From be6eaae5dfa0930d97801121dc544918eb1ad45d Mon Sep 17 00:00:00 2001 From: Kyle Agronick Date: Fri, 15 Dec 2023 15:40:34 -0500 Subject: [PATCH] feat: clean up --- app/src/main/AndroidManifest.xml | 11 +++++++---- app/src/main/java/com/agronick/launcher/App.kt | 3 ++- .../java/com/agronick/launcher/AppListProvider.kt | 2 +- .../main/java/com/agronick/launcher/Container.kt | 4 ---- .../java/com/agronick/launcher/MainActivity.kt | 4 +--- .../main/java/com/agronick/launcher/Reorderer.kt | 1 - .../java/com/agronick/launcher/StaticValues.kt | 1 - app/src/main/res/layout/activity_main.xml | 15 --------------- 8 files changed, 11 insertions(+), 30 deletions(-) delete mode 100644 app/src/main/res/layout/activity_main.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8096fcd..60c7e93 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,14 +1,17 @@ - + + android:taskAffinity="com.agronick.launcher" + android:exported="true"> - diff --git a/app/src/main/java/com/agronick/launcher/App.kt b/app/src/main/java/com/agronick/launcher/App.kt index 1777bb7..07392c4 100644 --- a/app/src/main/java/com/agronick/launcher/App.kt +++ b/app/src/main/java/com/agronick/launcher/App.kt @@ -11,7 +11,7 @@ class App(val pkgInfo: PInfo, var size: Int) { var left = 0.0f var top = 0.0f var hidden = false - public var assignedPos: Pair? = null + var assignedPos: Pair? = null private var lastCircle: Circle? = null fun copy(): App { @@ -84,6 +84,7 @@ class App(val pkgInfo: PInfo, var size: Int) { val F = R - kotlin.math.sqrt(R * R - lAB * lAB * 0.25f) Vector2(mAB.x - uAB.y * F, mAB.y + uAB.x * F) } + else -> null } } diff --git a/app/src/main/java/com/agronick/launcher/AppListProvider.kt b/app/src/main/java/com/agronick/launcher/AppListProvider.kt index 6310d60..a70ffab 100644 --- a/app/src/main/java/com/agronick/launcher/AppListProvider.kt +++ b/app/src/main/java/com/agronick/launcher/AppListProvider.kt @@ -11,7 +11,7 @@ import java.io.FileReader import java.io.FileWriter -class AppListProvider(val appList: List, context: Context) { +class AppListProvider(appList: List, context: Context) { val positions = HashMap>().withDefault { HashMap() } val filePath = "${context.dataDir}/appPositions.json" diff --git a/app/src/main/java/com/agronick/launcher/Container.kt b/app/src/main/java/com/agronick/launcher/Container.kt index 725d797..622cf95 100644 --- a/app/src/main/java/com/agronick/launcher/Container.kt +++ b/app/src/main/java/com/agronick/launcher/Container.kt @@ -22,10 +22,6 @@ class Container(val appList: AppListProvider, density: Float) { private var equalizerOffset = 1.1f - companion object { - private const val tag = "Container" - } - init { /* Tries to set up a rough circle shape diff --git a/app/src/main/java/com/agronick/launcher/MainActivity.kt b/app/src/main/java/com/agronick/launcher/MainActivity.kt index 87f52c9..36c4620 100644 --- a/app/src/main/java/com/agronick/launcher/MainActivity.kt +++ b/app/src/main/java/com/agronick/launcher/MainActivity.kt @@ -131,9 +131,7 @@ class MainActivity : Activity(), GestureDetector.OnGestureListener { } override fun onLongPress(e: MotionEvent) { - if (e != null) { - mainView.handleLongPress(e) - } + mainView.handleLongPress(e) } override fun onFling( diff --git a/app/src/main/java/com/agronick/launcher/Reorderer.kt b/app/src/main/java/com/agronick/launcher/Reorderer.kt index bcddcd2..1a8e4b2 100644 --- a/app/src/main/java/com/agronick/launcher/Reorderer.kt +++ b/app/src/main/java/com/agronick/launcher/Reorderer.kt @@ -3,7 +3,6 @@ package com.agronick.launcher import android.animation.AnimatorSet import android.animation.ValueAnimator import androidx.core.animation.doOnEnd -import kotlinx.coroutines.GlobalScope import util.geometry.Circle import util.geometry.Vector2 diff --git a/app/src/main/java/com/agronick/launcher/StaticValues.kt b/app/src/main/java/com/agronick/launcher/StaticValues.kt index f4769c3..31c3eb1 100644 --- a/app/src/main/java/com/agronick/launcher/StaticValues.kt +++ b/app/src/main/java/com/agronick/launcher/StaticValues.kt @@ -7,6 +7,5 @@ class StaticValues { val durationRise = 300L val durationSwap = 300L val durationOpen = 600L - val tag = "Flattery" } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 1b6b9b1..0000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file