Add a few fallback applications to launch

This commit is contained in:
Finn M Glas 2020-05-14 22:31:30 +02:00
parent a41ab50ed8
commit 9040056c67

View file

@ -54,16 +54,22 @@ class MainActivity : AppCompatActivity() {
fun launchWhatsapp(v: View){ launchApp("com.whatsapp") } fun launchWhatsapp(v: View){ launchApp("com.whatsapp") }
fun launchFinder(v: View){ launchApp("com.samsung.android.app.galaxyfinder") } fun launchFinder(v: View){ launchApp("com.samsung.android.app.galaxyfinder") }
fun launchMail(v: View){ launchApp("com.samsung.android.email.provider") } fun launchMail(v: View){ launchApp("com.samsung.android.email.provider", "com.google.android.gm") }
fun launchCalendar(v: View){ launchApp("com.google.android.calendar") } fun launchCalendar(v: View){ launchApp("com.google.android.calendar", "com.samsung.android.calendar") }
fun launchClock(v: View){ launchApp("com.sec.android.app.clockpackage") } fun launchClock(v: View){ launchApp("com.sec.android.app.clockpackage") }
fun launchBrowser(v: View){ launchApp("org.mozilla.firefox") } fun launchBrowser(v: View){ launchApp("org.mozilla.firefox", "com.sec.android.app.sbrowser") }
fun launchUpApp() { launchBrowser(container) } fun launchUpApp() { launchBrowser(container) }
fun launchDownApp() { launchFinder(container) } fun launchDownApp() { launchFinder(container) }
fun lauchLeftApp() { launchCalendar(container) } fun lauchLeftApp() { launchCalendar(container) }
fun lauchRightApp() { launchMail(container) } fun lauchRightApp() { launchMail(container) }
fun lauchVolumeUpApp() { }
fun lauchVolumeDownApp() {
val intent = Intent(this, ChooseActivity::class.java);
startActivity(intent)
}
// Overrides // Overrides
var touchX : Float = 0F var touchX : Float = 0F
@ -123,16 +129,9 @@ class MainActivity : AppCompatActivity() {
} }
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK) { if (keyCode == KeyEvent.KEYCODE_BACK) { return true }
else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) lauchVolumeUpApp()
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) lauchVolumeDownApp()
else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
}
else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
val intent = Intent(this, ChooseActivity::class.java);
startActivity(intent)
}
return true return true
} }