Compare commits

..

4 commits

Author SHA1 Message Date
Too Late (bot)
e8a3993abb
Merge da33327502 into fa2f1c4127 2025-02-06 00:07:21 +00:00
Vossa Excelencia
da33327502 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (218 of 218 strings)

Translation: jrpie-Launcher/Launcher
Translate-URL: https://toolate.othing.xyz/projects/jrpie-launcher/launcher/pt_BR/
2025-02-06 00:07:17 +00:00
Xanadul
30fc2ce9c1 Translated using Weblate (German)
Currently translated at 13.3% (2 of 15 strings)

Translation: jrpie-Launcher/metadata
Translate-URL: https://toolate.othing.xyz/projects/jrpie-launcher/metadata/de/
2025-02-06 00:07:17 +00:00
Nicola Bortoletto
3788ff805a Translated using Weblate (Italian)
Currently translated at 98.1% (214 of 218 strings)

Translation: jrpie-Launcher/Launcher
Translate-URL: https://toolate.othing.xyz/projects/jrpie-launcher/launcher/it/
2025-02-06 00:07:17 +00:00
13 changed files with 14 additions and 110 deletions

View file

@ -21,9 +21,6 @@ sealed interface Action {
fun getIcon(context: Context): Drawable?
fun isAvailable(context: Context): Boolean
// Can the action be used to reach µLauncher settings?
fun canReachSettings(): Boolean
fun bindToGesture(prefEditor: Editor, id: String) {
prefEditor.putString(id, Json.encodeToString(this))
@ -53,10 +50,7 @@ sealed interface Action {
.map { Pair(it, Json.decodeFromString<Action>(it)) }
.firstOrNull { it.second.isAvailable(context) }
?.apply {
// allow to bind CHOOSE to multiple gestures
if (second != LauncherAction.CHOOSE) {
boundActions.add(first)
}
boundActions.add(first)
second.bindToGesture(editor, gesture.id)
}
}

View file

@ -74,8 +74,4 @@ class AppAction(val app: AppInfo) : Action {
// check if app is installed
return DetailedAppInfo.fromAppInfo(app, context) != null
}
override fun canReachSettings(): Boolean {
return false
}
}

View file

@ -168,12 +168,6 @@ enum class Gesture(
R.string.settings_gesture_description_double_right,
R.array.default_double_right,
R.anim.left_right
),
BACK(
"action.back",
R.string.settings_gesture_back,
R.string.settings_gesture_description_back,
R.array.default_up
);
enum class Edge {

View file

@ -13,7 +13,6 @@ import android.os.UserManager
import android.provider.Settings
import android.view.KeyEvent
import android.widget.Toast
import androidx.appcompat.widget.AppCompatDrawableManager
import de.jrpie.android.launcher.Application
import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.apps.AppFilter
@ -41,29 +40,25 @@ enum class LauncherAction(
val label: Int,
val icon: Int,
val launch: (Context) -> Unit,
private val canReachSettings: Boolean = false,
val available: (Context) -> Boolean = { true },
val available: (Context) -> Boolean = { true }
) : Action {
SETTINGS(
"settings",
R.string.list_other_settings,
R.drawable.baseline_settings_24,
::openSettings,
true
::openSettings
),
CHOOSE(
"choose",
R.string.list_other_list,
R.drawable.baseline_menu_24,
::openAppsList,
true
::openAppsList
),
CHOOSE_FROM_FAVORITES(
"choose_from_favorites",
R.string.list_other_list_favorites,
R.drawable.baseline_favorite_24,
{ context -> openAppsList(context, true) },
true
{ context -> openAppsList(context, true) }
),
TOGGLE_PRIVATE_SPACE_LOCK(
"toggle_private_space_lock",
@ -132,11 +127,7 @@ enum class LauncherAction(
}
override fun isAvailable(context: Context): Boolean {
return this.available(context)
}
override fun canReachSettings(): Boolean {
return this.canReachSettings
return true
}
companion object {

View file

@ -7,7 +7,6 @@ import de.jrpie.android.launcher.actions.Action
import de.jrpie.android.launcher.apps.AppInfo
import de.jrpie.android.launcher.apps.DetailedAppInfo
import de.jrpie.android.launcher.preferences.legacy.migratePreferencesFromVersion1
import de.jrpie.android.launcher.preferences.legacy.migratePreferencesFromVersion2
import de.jrpie.android.launcher.preferences.legacy.migratePreferencesFromVersionUnknown
import de.jrpie.android.launcher.ui.HomeActivity
@ -15,7 +14,7 @@ import de.jrpie.android.launcher.ui.HomeActivity
* Increase when breaking changes are introduced and write an appropriate case in
* `migratePreferencesToNewVersion`
*/
const val PREFERENCE_VERSION = 3
const val PREFERENCE_VERSION = 2
const val UNKNOWN_PREFERENCE_VERSION = -1
private const val TAG = "Launcher - Preferences"
@ -33,16 +32,13 @@ fun migratePreferencesToNewVersion(context: Context) {
UNKNOWN_PREFERENCE_VERSION -> { /* still using the old preferences file */
migratePreferencesFromVersionUnknown(context)
Log.i(TAG, "migration of preferences complete (${UNKNOWN_PREFERENCE_VERSION} -> ${PREFERENCE_VERSION}).")
Log.i(TAG, "migration of preferences complete.")
}
1 -> {
migratePreferencesFromVersion1()
Log.i(TAG, "migration of preferences complete (1 -> ${PREFERENCE_VERSION}).")
}
2 -> {
migratePreferencesFromVersion2()
Log.i(TAG, "migration of preferences complete (2 -> ${PREFERENCE_VERSION}).")
Log.i(TAG, "migration of preferences complete.")
}
else -> {

View file

@ -117,12 +117,11 @@ private fun migrateAction(key: String) {
* (see [PREFERENCE_VERSION])
*/
fun migratePreferencesFromVersion1() {
assert(PREFERENCE_VERSION == 2)
assert(LauncherPreferences.internal().versionCode() == 1)
Gesture.entries.forEach { g -> migrateAction(g.id) }
migrateAppInfoSet(LauncherPreferences.apps().keys().hidden())
migrateAppInfoSet(LauncherPreferences.apps().keys().favorites())
migrateAppInfoStringMap(LauncherPreferences.apps().keys().customNames())
LauncherPreferences.internal().versionCode(2)
migratePreferencesFromVersion2()
}

View file

@ -1,20 +0,0 @@
package de.jrpie.android.launcher.preferences.legacy
import de.jrpie.android.launcher.actions.Action
import de.jrpie.android.launcher.actions.Gesture
import de.jrpie.android.launcher.actions.LauncherAction
import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.preferences.PREFERENCE_VERSION
/**
* Migrate preferences from version 2 (used until version 0.0.21) to the current format
* (see [PREFERENCE_VERSION])
*/
fun migratePreferencesFromVersion2() {
assert(PREFERENCE_VERSION == 3)
assert(LauncherPreferences.internal().versionCode() == 2)
// previously there was no setting for this
Action.setActionForGesture(Gesture.BACK, LauncherAction.CHOOSE)
LauncherPreferences.internal().versionCode(3)
}

View file

@ -50,6 +50,7 @@ private const val TAG = "Preferences ? -> 1"
* and a different file was used.
*/
fun migratePreferencesFromVersionUnknown(context: Context) {
assert(PREFERENCE_VERSION == 2)
Log.i(
TAG,

View file

@ -9,7 +9,6 @@ import android.util.DisplayMetrics
import android.view.GestureDetector
import android.view.KeyEvent
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import android.window.OnBackInvokedDispatcher
import androidx.appcompat.app.AppCompatActivity
@ -55,10 +54,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
) {
recreate()
}
if (prefKey?.startsWith("action.") == true) {
updateSettingsFallbackButtonVisibility()
}
}
private var edgeWidth = 0.15f
@ -85,10 +80,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
handleBack()
}
}
binding.buttonFallbackSettings.setOnClickListener {
LauncherAction.SETTINGS.invoke(this)
}
}
@ -105,20 +96,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
}
private fun updateSettingsFallbackButtonVisibility() {
// If µLauncher settings can not be reached from any action bound to an enabled gesture,
// show the fallback button.
binding.buttonFallbackSettings.visibility = if (
!Gesture.entries.any { g ->
g.isEnabled() && Action.forGesture(g)?.canReachSettings() == true
}
) {
View.VISIBLE
} else {
View.GONE
}
}
private fun initClock() {
val locale = Locale.getDefault()
val dateVisible = LauncherPreferences.clock().dateVisible()
@ -175,7 +152,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
edgeWidth = LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f
initClock()
updateSettingsFallbackButtonVisibility()
}
override fun onDestroy() {
@ -323,7 +299,7 @@ class HomeActivity : UIObject, AppCompatActivity(),
private fun handleBack() {
Gesture.BACK(this)
LauncherAction.CHOOSE.launch(this)
}
override fun isHomeScreen(): Boolean {

View file

@ -34,18 +34,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- only shown when µLauncher settings can't be reached by a gesture -->
<ImageView
android:id="@+id/button_fallback_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/settings"
android:visibility="gone"
tools:visibility="visible"
android:padding="20dp"
android:alpha="0.4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/baseline_settings_24"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -125,7 +125,7 @@
<string name="tutorial_setup_text">Abbiamo impostato alcune app predefinite per te. Puoi modificarle ora se lo desideri:</string>
<string name="tutorial_setup_text_2">Puoi anche cambiare la tua selezione in seguito.</string>
<string name="tutorial_finish_title">Iniziamo!</string>
<string name="tutorial_finish_text">Sei pronto per iniziare! Spero questa applicazione ti risulti preziosa! - Finn (che ha ideato il launcher)\n \te Josia (che ha aggiunto qualche miglioramento e mantiene il fork μLauncher)</string>
<string name="tutorial_finish_text">Sei pronto per iniziare! Spero questa applicazione ti risulti preziosa! - Finn (che ha ideato il launcher) \te Josia (che ha aggiunto qualche miglioramento e mantiene il fork μLauncher)</string>
<string name="tutorial_finish_button">Inizia</string>
<string name="settings">Impostazioni</string>
<string name="ic_menu_alt">Altre opzioni</string>
@ -236,5 +236,4 @@
<string name="toast_private_space_default_home_screen">µLauncher deve essere la schermata iniziale predefinita per accedere allo spazio privato.</string>
<string name="toast_activity_not_found_browser">Impossibile aprire l\'URL: nessun browser trovato.</string>
<string name="toast_activity_not_found_search_web">Non è stata trovata un\'applicazione per gestire la ricerca.</string>
<string name="dialog_consent_accessibility_text"><![CDATA[Stai per arrivare il servizio di accessibilità. Questo garantirà <strong>privilegi più ampi</strong> a µLauncher.<br/>µLauncher utilizzerà questi privilegi <strong>solo per bloccare lo schermo</strong>. µLauncher <strong>non raccoglierà mai alcun dato</strong>. In particolare, µLauncher non usa il servizio di accessibilità per raccogliere nessun dato.]]></string>
</resources>

View file

@ -3,12 +3,6 @@
<resources>
<!-- Default Apps for different actions (button-press, swipes ...) -->
<!-- Back - Apps list -->
<string-array name="default_back">
<item>{\"type\": \"action:launcher\", \"value\": \"choose\"}</item> <!-- All Apps -->
</string-array>
<!-- Swipe up - Apps list -->
<string-array name="default_up">
<item>{\"type\": \"action:launcher\", \"value\": \"choose\"}</item> <!-- All Apps -->

View file

@ -25,8 +25,6 @@
- Settings : Apps
-
-->
<string name="settings_gesture_back">Back</string>
<string name="settings_gesture_description_back">Back button / back gesture</string>
<string name="settings_gesture_up">Up</string>
<string name="settings_gesture_description_up">Swipe up</string>
<string name="settings_gesture_double_up">Double Up</string>