Compare commits

..

3 commits

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

View file

@ -74,8 +74,4 @@ class AppAction(val app: AppInfo) : Action {
// check if app is installed // check if app is installed
return DetailedAppInfo.fromAppInfo(app, context) != null 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.string.settings_gesture_description_double_right,
R.array.default_double_right, R.array.default_double_right,
R.anim.left_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 { enum class Edge {

View file

@ -13,7 +13,6 @@ import android.os.UserManager
import android.provider.Settings import android.provider.Settings
import android.view.KeyEvent import android.view.KeyEvent
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.widget.AppCompatDrawableManager
import de.jrpie.android.launcher.Application import de.jrpie.android.launcher.Application
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.apps.AppFilter import de.jrpie.android.launcher.apps.AppFilter
@ -41,29 +40,25 @@ enum class LauncherAction(
val label: Int, val label: Int,
val icon: Int, val icon: Int,
val launch: (Context) -> Unit, val launch: (Context) -> Unit,
private val canReachSettings: Boolean = false, val available: (Context) -> Boolean = { true }
val available: (Context) -> Boolean = { true },
) : Action { ) : Action {
SETTINGS( SETTINGS(
"settings", "settings",
R.string.list_other_settings, R.string.list_other_settings,
R.drawable.baseline_settings_24, R.drawable.baseline_settings_24,
::openSettings, ::openSettings
true
), ),
CHOOSE( CHOOSE(
"choose", "choose",
R.string.list_other_list, R.string.list_other_list,
R.drawable.baseline_menu_24, R.drawable.baseline_menu_24,
::openAppsList, ::openAppsList
true
), ),
CHOOSE_FROM_FAVORITES( CHOOSE_FROM_FAVORITES(
"choose_from_favorites", "choose_from_favorites",
R.string.list_other_list_favorites, R.string.list_other_list_favorites,
R.drawable.baseline_favorite_24, R.drawable.baseline_favorite_24,
{ context -> openAppsList(context, true) }, { context -> openAppsList(context, true) }
true
), ),
TOGGLE_PRIVATE_SPACE_LOCK( TOGGLE_PRIVATE_SPACE_LOCK(
"toggle_private_space_lock", "toggle_private_space_lock",
@ -132,11 +127,7 @@ enum class LauncherAction(
} }
override fun isAvailable(context: Context): Boolean { override fun isAvailable(context: Context): Boolean {
return this.available(context) return true
}
override fun canReachSettings(): Boolean {
return this.canReachSettings
} }
companion object { 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.AppInfo
import de.jrpie.android.launcher.apps.DetailedAppInfo import de.jrpie.android.launcher.apps.DetailedAppInfo
import de.jrpie.android.launcher.preferences.legacy.migratePreferencesFromVersion1 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.preferences.legacy.migratePreferencesFromVersionUnknown
import de.jrpie.android.launcher.ui.HomeActivity 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 * Increase when breaking changes are introduced and write an appropriate case in
* `migratePreferencesToNewVersion` * `migratePreferencesToNewVersion`
*/ */
const val PREFERENCE_VERSION = 3 const val PREFERENCE_VERSION = 2
const val UNKNOWN_PREFERENCE_VERSION = -1 const val UNKNOWN_PREFERENCE_VERSION = -1
private const val TAG = "Launcher - Preferences" private const val TAG = "Launcher - Preferences"
@ -33,16 +32,13 @@ fun migratePreferencesToNewVersion(context: Context) {
UNKNOWN_PREFERENCE_VERSION -> { /* still using the old preferences file */ UNKNOWN_PREFERENCE_VERSION -> { /* still using the old preferences file */
migratePreferencesFromVersionUnknown(context) migratePreferencesFromVersionUnknown(context)
Log.i(TAG, "migration of preferences complete (${UNKNOWN_PREFERENCE_VERSION} -> ${PREFERENCE_VERSION}).")
Log.i(TAG, "migration of preferences complete.")
} }
1 -> { 1 -> {
migratePreferencesFromVersion1() migratePreferencesFromVersion1()
Log.i(TAG, "migration of preferences complete (1 -> ${PREFERENCE_VERSION}).") Log.i(TAG, "migration of preferences complete.")
}
2 -> {
migratePreferencesFromVersion2()
Log.i(TAG, "migration of preferences complete (2 -> ${PREFERENCE_VERSION}).")
} }
else -> { else -> {

View file

@ -117,12 +117,11 @@ private fun migrateAction(key: String) {
* (see [PREFERENCE_VERSION]) * (see [PREFERENCE_VERSION])
*/ */
fun migratePreferencesFromVersion1() { fun migratePreferencesFromVersion1() {
assert(PREFERENCE_VERSION == 2)
assert(LauncherPreferences.internal().versionCode() == 1) assert(LauncherPreferences.internal().versionCode() == 1)
Gesture.entries.forEach { g -> migrateAction(g.id) } Gesture.entries.forEach { g -> migrateAction(g.id) }
migrateAppInfoSet(LauncherPreferences.apps().keys().hidden()) migrateAppInfoSet(LauncherPreferences.apps().keys().hidden())
migrateAppInfoSet(LauncherPreferences.apps().keys().favorites()) migrateAppInfoSet(LauncherPreferences.apps().keys().favorites())
migrateAppInfoStringMap(LauncherPreferences.apps().keys().customNames()) migrateAppInfoStringMap(LauncherPreferences.apps().keys().customNames())
LauncherPreferences.internal().versionCode(2) 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. * and a different file was used.
*/ */
fun migratePreferencesFromVersionUnknown(context: Context) { fun migratePreferencesFromVersionUnknown(context: Context) {
assert(PREFERENCE_VERSION == 2)
Log.i( Log.i(
TAG, TAG,

View file

@ -9,7 +9,6 @@ import android.util.DisplayMetrics
import android.view.GestureDetector import android.view.GestureDetector
import android.view.KeyEvent import android.view.KeyEvent
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration import android.view.ViewConfiguration
import android.window.OnBackInvokedDispatcher import android.window.OnBackInvokedDispatcher
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -55,10 +54,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
) { ) {
recreate() recreate()
} }
if (prefKey?.startsWith("action.") == true) {
updateSettingsFallbackButtonVisibility()
}
} }
private var edgeWidth = 0.15f private var edgeWidth = 0.15f
@ -85,10 +80,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
handleBack() 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() { private fun initClock() {
val locale = Locale.getDefault() val locale = Locale.getDefault()
val dateVisible = LauncherPreferences.clock().dateVisible() val dateVisible = LauncherPreferences.clock().dateVisible()
@ -175,7 +152,6 @@ class HomeActivity : UIObject, AppCompatActivity(),
edgeWidth = LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f edgeWidth = LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f
initClock() initClock()
updateSettingsFallbackButtonVisibility()
} }
override fun onDestroy() { override fun onDestroy() {
@ -323,7 +299,7 @@ class HomeActivity : UIObject, AppCompatActivity(),
private fun handleBack() { private fun handleBack() {
Gesture.BACK(this) LauncherAction.CHOOSE.launch(this)
} }
override fun isHomeScreen(): Boolean { override fun isHomeScreen(): Boolean {

View file

@ -34,18 +34,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="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> </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">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_setup_text_2">Puoi anche cambiare la tua selezione in seguito.</string>
<string name="tutorial_finish_title">Iniziamo!</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="tutorial_finish_button">Inizia</string>
<string name="settings">Impostazioni</string> <string name="settings">Impostazioni</string>
<string name="ic_menu_alt">Altre opzioni</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_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_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="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> </resources>

View file

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

View file

@ -25,8 +25,6 @@
- Settings : Apps - 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_up">Up</string>
<string name="settings_gesture_description_up">Swipe up</string> <string name="settings_gesture_description_up">Swipe up</string>
<string name="settings_gesture_double_up">Double Up</string> <string name="settings_gesture_double_up">Double Up</string>