mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
removed old logging
This commit is contained in:
parent
f788a11489
commit
9a3957be36
5 changed files with 7 additions and 13 deletions
|
@ -230,7 +230,6 @@ fun uninstallApp(packageName: String, user: Int?, activity: Activity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun launchApp(packageName: String, user: Int?, context: Context, rect: Rect? = null) {
|
fun launchApp(packageName: String, user: Int?, context: Context, rect: Rect? = null) {
|
||||||
Log.i("Launcher", "Starting: " + packageName + " (user " +user.toString()+ ")")
|
|
||||||
if (user != null && user != INVALID_USER) {
|
if (user != null && user != INVALID_USER) {
|
||||||
val launcherApps = context.getSystemService(Service.LAUNCHER_APPS_SERVICE) as LauncherApps
|
val launcherApps = context.getSystemService(Service.LAUNCHER_APPS_SERVICE) as LauncherApps
|
||||||
getLauncherActivityInfo(packageName,user,context)?.let {
|
getLauncherActivityInfo(packageName,user,context)?.let {
|
||||||
|
|
|
@ -2,7 +2,6 @@ package de.jrpie.android.launcher
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,7 +143,6 @@ enum class Gesture (val id: String, private val labelResource: Int,
|
||||||
|
|
||||||
operator fun invoke(activity: Activity) {
|
operator fun invoke(activity: Activity) {
|
||||||
val app = this.getApp(activity)
|
val app = this.getApp(activity)
|
||||||
Log.d("LAUNCHER", "Launching ${app.first} (user: ${app.second}) ${this.toString()}")
|
|
||||||
launch(app.first, app.second, activity, this.animationIn, this.animationOut)
|
launch(app.first, app.second, activity, this.animationIn, this.animationOut)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Intent
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.os.AsyncTask
|
import android.os.AsyncTask
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import android.view.GestureDetector
|
import android.view.GestureDetector
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
|
@ -163,8 +162,6 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
||||||
val width = displayMetrics!!.widthPixels
|
val width = displayMetrics!!.widthPixels
|
||||||
val height = displayMetrics!!.heightPixels
|
val height = displayMetrics!!.heightPixels
|
||||||
|
|
||||||
Log.i("LAUNCHER", "width: $width, height: $height, ${e1.x}, ${e1.y}, ${e2.x}, ${e2.y}")
|
|
||||||
|
|
||||||
val diffX = e1.x - e2.x
|
val diffX = e1.x - e2.x
|
||||||
val diffY = e1.y - e2.y
|
val diffY = e1.y - e2.y
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import de.jrpie.android.launcher.preferences.theme.ColorTheme
|
||||||
*/
|
*/
|
||||||
const val PREFERENCE_VERSION = 1
|
const val PREFERENCE_VERSION = 1
|
||||||
const val UNKNOWN_PREFERENCE_VERSION = -1
|
const val UNKNOWN_PREFERENCE_VERSION = -1
|
||||||
|
private const val TAG = "Launcher - Preferences"
|
||||||
|
|
||||||
|
|
||||||
private fun migrateStringPreference(oldPrefs: SharedPreferences, newPreferences: SharedPreferences.Editor, oldKey: String, newKey: String, default: String) {
|
private fun migrateStringPreference(oldPrefs: SharedPreferences, newPreferences: SharedPreferences.Editor, oldKey: String, newKey: String, default: String) {
|
||||||
|
@ -34,7 +35,7 @@ fun migratePreferencesToNewVersion(context: Context) {
|
||||||
// Check versions, make sure transitions between versions go well
|
// Check versions, make sure transitions between versions go well
|
||||||
PREFERENCE_VERSION -> { /* the version installed and used previously are the same */ }
|
PREFERENCE_VERSION -> { /* the version installed and used previously are the same */ }
|
||||||
UNKNOWN_PREFERENCE_VERSION -> { /* still using the old preferences file */
|
UNKNOWN_PREFERENCE_VERSION -> { /* still using the old preferences file */
|
||||||
Log.i("Launcher", "Unknown preference version, trying to restore preferences from old version.")
|
Log.i(TAG, "Unknown preference version, trying to restore preferences from old version.")
|
||||||
|
|
||||||
|
|
||||||
val oldPrefs = context.getSharedPreferences(
|
val oldPrefs = context.getSharedPreferences(
|
||||||
|
@ -42,7 +43,7 @@ fun migratePreferencesToNewVersion(context: Context) {
|
||||||
Context.MODE_PRIVATE
|
Context.MODE_PRIVATE
|
||||||
)
|
)
|
||||||
if(!oldPrefs.contains("startedBefore")) {
|
if(!oldPrefs.contains("startedBefore")) {
|
||||||
Log.i("Launcher", "No old preferences found.")
|
Log.i(TAG, "No old preferences found.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val newPrefs = LauncherPreferences.getSharedPreferences().edit()
|
val newPrefs = LauncherPreferences.getSharedPreferences().edit()
|
||||||
|
@ -121,7 +122,7 @@ fun migratePreferencesToNewVersion(context: Context) {
|
||||||
|
|
||||||
|
|
||||||
LauncherPreferences.internal().versionCode(PREFERENCE_VERSION)
|
LauncherPreferences.internal().versionCode(PREFERENCE_VERSION)
|
||||||
Log.i("Launcher", "migration of preferences complete.")
|
Log.i(TAG, "migration of preferences complete.")
|
||||||
|
|
||||||
// show the new tutorial
|
// show the new tutorial
|
||||||
// context.startActivity(Intent(context, TutorialActivity::class.java))
|
// context.startActivity(Intent(context, TutorialActivity::class.java))
|
||||||
|
@ -131,11 +132,11 @@ fun migratePreferencesToNewVersion(context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resetPreferences(context: Context) {
|
fun resetPreferences(context: Context) {
|
||||||
Log.i("Launcher", "resetting preferences")
|
Log.i(TAG, "resetting preferences")
|
||||||
LauncherPreferences.clear()
|
LauncherPreferences.clear()
|
||||||
LauncherPreferences.internal().versionCode(PREFERENCE_VERSION)
|
LauncherPreferences.internal().versionCode(PREFERENCE_VERSION)
|
||||||
val editor = LauncherPreferences.getSharedPreferences().edit()
|
val editor = LauncherPreferences.getSharedPreferences().edit()
|
||||||
Gesture.values().forEach { editor.putString(it.id + ".app", it.pickDefaultApp(context)) }
|
Gesture.values().forEach { editor.putString(it.id + ".app", it.pickDefaultApp(context)) }
|
||||||
Gesture.values().forEach { editor.putInt(it.id + ".user", -1) }
|
Gesture.values().forEach { editor.putInt(it.id + ".user", -1) }
|
||||||
editor.apply()
|
editor.apply()
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import de.jrpie.android.launcher.list.ListActivity
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.util.Log
|
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
@ -162,4 +161,4 @@ class ActionsRecyclerAdapter(val activity: Activity):
|
||||||
REQUEST_CHOOSE_APP
|
REQUEST_CHOOSE_APP
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue