mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
parent
faf50c9e09
commit
9f9a223d6e
8 changed files with 35 additions and 16 deletions
|
@ -25,7 +25,6 @@ import android.widget.Button
|
|||
import android.widget.ImageView
|
||||
import android.widget.Switch
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.finnmglas.launcher.list.ListActivity
|
||||
import com.finnmglas.launcher.list.apps.AppInfo
|
||||
import com.finnmglas.launcher.list.apps.AppsRecyclerAdapter
|
||||
|
@ -54,8 +53,8 @@ const val ACTION_VOL_DOWN = "action_volumeDownApp"
|
|||
const val ACTION_DOUBLE_CLICK = "action_doubleClickApp"
|
||||
const val ACTION_LONG_CLICK = "action_longClickApp"
|
||||
|
||||
const val ACTION_CALENDAR = "action_calendarApp"
|
||||
const val ACTION_CLOCK = "action_clockApp"
|
||||
const val ACTION_DATE = "action_dateApp"
|
||||
const val ACTION_TIME = "action_timeApp"
|
||||
|
||||
val ACTIONS = listOf(
|
||||
ACTION_UP, ACTION_DOUBLE_UP,
|
||||
|
@ -63,7 +62,7 @@ val ACTIONS = listOf(
|
|||
ACTION_RIGHT, ACTION_LEFT,
|
||||
ACTION_VOL_UP, ACTION_VOL_DOWN,
|
||||
ACTION_DOUBLE_CLICK, ACTION_LONG_CLICK,
|
||||
ACTION_CALENDAR, ACTION_CLOCK
|
||||
ACTION_DATE, ACTION_TIME
|
||||
)
|
||||
|
||||
const val PREF_DOMINANT = "custom_dominant"
|
||||
|
@ -105,8 +104,8 @@ var volumeDownApp = ""
|
|||
var doubleClickApp = ""
|
||||
var longClickApp = ""
|
||||
|
||||
var calendarApp = ""
|
||||
var clockApp = ""
|
||||
var timeApp = ""
|
||||
var dateApp = ""
|
||||
|
||||
var background : Bitmap? = null
|
||||
|
||||
|
@ -440,8 +439,8 @@ fun loadSettings() {
|
|||
doubleClickApp = launcherPreferences.getString(ACTION_DOUBLE_CLICK, "")!!
|
||||
longClickApp = launcherPreferences.getString(ACTION_LONG_CLICK, "")!!
|
||||
|
||||
calendarApp = launcherPreferences.getString(ACTION_CALENDAR, "")!!
|
||||
clockApp = launcherPreferences.getString(ACTION_CLOCK, "")!!
|
||||
dateApp = launcherPreferences.getString(ACTION_DATE, "")!!
|
||||
timeApp = launcherPreferences.getString(ACTION_TIME, "")!!
|
||||
|
||||
dominantColor = launcherPreferences.getInt(PREF_DOMINANT, 0)
|
||||
vibrantColor = launcherPreferences.getInt(PREF_VIBRANT, 0)
|
||||
|
@ -509,8 +508,8 @@ fun pickDefaultApp(action: String, context: Context) : String {
|
|||
ACTION_VOL_DOWN -> R.array.default_volume_down
|
||||
ACTION_DOUBLE_CLICK -> R.array.default_double_click
|
||||
ACTION_LONG_CLICK -> R.array.default_long_click
|
||||
ACTION_CLOCK -> R.array.default_clock
|
||||
ACTION_CALENDAR -> R.array.default_left
|
||||
ACTION_TIME -> R.array.default_time
|
||||
ACTION_DATE -> R.array.default_date
|
||||
|
||||
else -> return "" // just prevent crashing on unknown input
|
||||
}
|
||||
|
|
|
@ -262,15 +262,15 @@ class HomeActivity: UIObject, AppCompatActivity(),
|
|||
|
||||
home_upper_view.setOnClickListener() {
|
||||
when (launcherPreferences.getInt(PREF_DATE_FORMAT, 0)) {
|
||||
0 -> launch(calendarApp, this)
|
||||
else -> launch(clockApp,this)
|
||||
0 -> launch(dateApp, this)
|
||||
else -> launch(timeApp,this)
|
||||
}
|
||||
}
|
||||
|
||||
home_lower_view.setOnClickListener() {
|
||||
when (launcherPreferences.getInt(PREF_DATE_FORMAT, 0)) {
|
||||
0 -> launch(clockApp, this)
|
||||
else -> launch(calendarApp,this)
|
||||
0 -> launch(timeApp, this)
|
||||
else -> launch(dateApp,this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,6 +181,12 @@ class ActionsRecyclerAdapter(val activity: Activity):
|
|||
actionsList.add(ActionInfo(activity.getString(R.string.settings_apps_long_click), "longClickApp",
|
||||
longClickApp
|
||||
))
|
||||
actionsList.add(ActionInfo(activity.getString(R.string.settings_apps_time), "timeApp",
|
||||
timeApp
|
||||
))
|
||||
actionsList.add(ActionInfo(activity.getString(R.string.settings_apps_date), "dateApp",
|
||||
dateApp
|
||||
))
|
||||
}
|
||||
|
||||
/* */
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
<string name="settings_apps_vol_down">Lautstärke -</string>
|
||||
<string name="settings_apps_double_click">Doppelklick</string>
|
||||
<string name="settings_apps_long_click">Langer Klick</string>
|
||||
<string name="settings_apps_date">Datum antippen</string>
|
||||
<string name="settings_apps_time">Uhr antippen</string>
|
||||
|
||||
<string name="settings_apps_choose">App wählen</string>
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
<string name="settings_apps_vol_down">Bajar Volumen</string>
|
||||
<string name="settings_apps_double_click">Doble Click</string>
|
||||
<string name="settings_apps_long_click">Click Largo</string>
|
||||
<string name="settings_apps_date">Toca la fecha</string>
|
||||
<string name="settings_apps_time">Toca el reloj</string>
|
||||
|
||||
<string name="settings_apps_choose">Elegir Aplicación</string>
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
<string name="settings_apps_vol_down">Baisser volume</string>
|
||||
<string name="settings_apps_double_click">Double clic</string>
|
||||
<string name="settings_apps_long_click">Clic long</string>
|
||||
<string name="settings_apps_date">Touchez date</string>
|
||||
<string name="settings_apps_time">Touchez horloge</string>
|
||||
|
||||
<string name="settings_apps_choose">Choisir App</string>
|
||||
|
||||
|
|
|
@ -81,9 +81,15 @@
|
|||
<item>launcher:settings</item> <!-- Launcher Settings -->
|
||||
</string-array>
|
||||
|
||||
<!-- Clock -->
|
||||
<string-array name="default_clock">
|
||||
<!-- Time / Clock -->
|
||||
<string-array name="default_time">
|
||||
<item>com.sec.android.app.clockpackage</item> <!-- Android Clock -->
|
||||
</string-array>
|
||||
|
||||
<!-- Date / Calendar (same as left app currently) -->
|
||||
<string-array name="default_date">
|
||||
<item>com.google.android.calendar</item> <!-- Google Calendar -->
|
||||
<item>com.samsung.android.calendar</item> <!-- Samsung Calendar -->
|
||||
</string-array>
|
||||
|
||||
</resources>
|
|
@ -45,6 +45,8 @@
|
|||
<string name="settings_apps_vol_down">Volume Down</string>
|
||||
<string name="settings_apps_double_click">Double Click</string>
|
||||
<string name="settings_apps_long_click">Long Click</string>
|
||||
<string name="settings_apps_date">Click on Date</string>
|
||||
<string name="settings_apps_time">Click on Time</string>
|
||||
|
||||
<string name="settings_apps_choose">Choose App</string>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue