mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Remove unnecessary leftover code
zombiecode, toasts and the old apps list
This commit is contained in:
parent
4c131e4aed
commit
9fa009bf99
4 changed files with 0 additions and 25 deletions
|
@ -66,15 +66,11 @@ class ChooseActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
}*/
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == REQUEST_UNINSTALL) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
Toast.makeText(this, getString(R.string.choose_removed_toast), Toast.LENGTH_LONG).show()
|
||||
updateAppList(packageManager)
|
||||
finish()
|
||||
} else if (resultCode == Activity.RESULT_FIRST_USER) {
|
||||
Toast.makeText(this, getString(R.string.choose_not_removed_toast), Toast.LENGTH_LONG).show()
|
||||
|
|
|
@ -32,7 +32,6 @@ class MainActivity : AppCompatActivity(),
|
|||
// timers
|
||||
private var clockTimer = Timer()
|
||||
private var tooltipTimer = Timer()
|
||||
private var loadAppsTimer = Timer()
|
||||
|
||||
private var settingsIconShown = false
|
||||
|
||||
|
@ -125,18 +124,11 @@ class MainActivity : AppCompatActivity(),
|
|||
activity_main_date_view.text = d
|
||||
}
|
||||
}
|
||||
|
||||
val pm = packageManager
|
||||
|
||||
loadAppsTimer = fixedRateTimer("loadAppsTimer", true, 0L, 30000) {
|
||||
AsyncTask.execute { updateAppList(pm) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
clockTimer.cancel()
|
||||
loadAppsTimer.cancel()
|
||||
}
|
||||
|
||||
private fun openSettings(){
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.finnmglas.launcher.R
|
||||
import com.finnmglas.launcher.extern.*
|
||||
|
@ -36,8 +35,6 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
|
|||
val launchIntent: Intent = context.packageManager
|
||||
.getLaunchIntentForPackage(appPackageName)!!
|
||||
context.startActivity(launchIntent)
|
||||
Toast.makeText(v.context, appsList[pos].label.toString(), Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
"pick" -> {
|
||||
val returnIntent = Intent()
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.content.DialogInterface
|
|||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ResolveInfo
|
||||
import android.graphics.*
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
|
@ -30,8 +29,6 @@ var volumeDownApp = ""
|
|||
var calendarApp = ""
|
||||
var clockApp = ""
|
||||
|
||||
var appsList : MutableList<ResolveInfo> = mutableListOf()
|
||||
|
||||
var background : Bitmap? = null
|
||||
|
||||
var dominantColor = 0
|
||||
|
@ -126,13 +123,6 @@ fun isInstalled(uri: String, context: Context): Boolean {
|
|||
return false
|
||||
}
|
||||
|
||||
fun updateAppList(pm : PackageManager) {
|
||||
val intent = Intent(Intent.ACTION_MAIN)
|
||||
.addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
appsList = pm.queryIntentActivities(intent, 0)
|
||||
appsList.sortBy { it.activityInfo.loadLabel(pm).toString() }
|
||||
}
|
||||
|
||||
private fun getIntent(packageName: String, context: Context): Intent? {
|
||||
val intent: Intent? = context.packageManager.getLaunchIntentForPackage(packageName)
|
||||
intent?.addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
|
|
Loading…
Add table
Reference in a new issue