From 4cf46887fb2c308e5da97a43e242857577bf45b5 Mon Sep 17 00:00:00 2001 From: ottoptj Date: Fri, 4 Oct 2024 21:40:49 +0300 Subject: [PATCH] Moved all text to resource files. Not yet organized --- .../eu/ottop/yamlauncher/AppActionMenu.kt | 8 +- .../eu/ottop/yamlauncher/AppMenuAdapter.kt | 4 +- .../eu/ottop/yamlauncher/ContactsAdapter.kt | 2 +- .../java/eu/ottop/yamlauncher/MainActivity.kt | 16 +-- .../yamlauncher/settings/AboutFragment.kt | 2 +- .../settings/AppMenuSettingsFragment.kt | 2 +- .../settings/GestureAppsFragment.kt | 10 +- .../settings/HiddenAppsFragment.kt | 10 +- .../settings/HomeSettingsFragment.kt | 2 +- .../yamlauncher/settings/LocationFragment.kt | 18 +-- .../yamlauncher/settings/SettingsActivity.kt | 16 +-- .../yamlauncher/settings/SettingsFragment.kt | 2 +- .../settings/SharedPreferenceManager.kt | 5 +- .../settings/UISettingsFragment.kt | 2 +- .../eu/ottop/yamlauncher/utils/AppUtils.kt | 3 +- .../ottop/yamlauncher/utils/GestureUtils.kt | 9 +- .../ottop/yamlauncher/utils/WeatherSystem.kt | 3 +- app/src/main/res/values/strings.xml | 121 +++++++++++++++++- app/src/main/res/xml/app_menu_preferences.xml | 24 ++-- app/src/main/res/xml/home_preferences.xml | 62 ++++----- app/src/main/res/xml/root_preferences.xml | 42 +++--- app/src/main/res/xml/ui_preferences.xml | 20 +-- 22 files changed, 250 insertions(+), 133 deletions(-) diff --git a/app/src/main/java/eu/ottop/yamlauncher/AppActionMenu.kt b/app/src/main/java/eu/ottop/yamlauncher/AppActionMenu.kt index ecb4b21..ddb3f48 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/AppActionMenu.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/AppActionMenu.kt @@ -39,7 +39,7 @@ class AppActionMenu(private val activity: MainActivity, private val binding: Act ){ - ViewCompat.addAccessibilityAction(textView, "App info") { _, _ -> + ViewCompat.addAccessibilityAction(textView, activity.getString(R.string.accessibility_info)) { _, _ -> appInfo(appActivity, userHandle) true } @@ -50,7 +50,7 @@ class AppActionMenu(private val activity: MainActivity, private val binding: Act textView.visibility = View.VISIBLE } - ViewCompat.addAccessibilityAction(textView, "Uninstall app") { _, _ -> + ViewCompat.addAccessibilityAction(textView, activity.getString(R.string.accessibility_uninstall)) { _, _ -> uninstallApp(appInfo, userHandle) true } @@ -61,7 +61,7 @@ class AppActionMenu(private val activity: MainActivity, private val binding: Act textView.visibility = View.VISIBLE } - ViewCompat.addAccessibilityAction(textView, "Rename app") { _, _ -> + ViewCompat.addAccessibilityAction(textView, activity.getString(R.string.accessibility_rename)) { _, _ -> renameApp(textView, editLayout, actionMenu, appActivity, appInfo, userHandle, workProfile) true } @@ -70,7 +70,7 @@ class AppActionMenu(private val activity: MainActivity, private val binding: Act renameApp(textView, editLayout, actionMenu, appActivity, appInfo, userHandle, workProfile) } - ViewCompat.addAccessibilityAction(textView, "Hide app") { _, _ -> + ViewCompat.addAccessibilityAction(textView, activity.getString(R.string.accessibility_hide)) { _, _ -> hideApp(editLayout, textView, actionMenu, appInfo, workProfile) true } diff --git a/app/src/main/java/eu/ottop/yamlauncher/AppMenuAdapter.kt b/app/src/main/java/eu/ottop/yamlauncher/AppMenuAdapter.kt index 7f6076d..562e359 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/AppMenuAdapter.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/AppMenuAdapter.kt @@ -136,7 +136,7 @@ class AppMenuAdapter( ) // Set app name on the menu. If the app has been uninstalled, replace it with "Removing" until the app menu updates. - val appLabel: CharSequence = appInfo?.let { activity.packageManager.getApplicationLabel(it) } ?: "Removing..." + val appLabel: CharSequence = appInfo?.let { activity.packageManager.getApplicationLabel(it) } ?: activity.getString(R.string.removing) if (appInfo != null) { holder.textView.text = sharedPreferenceManager.getAppName( @@ -174,7 +174,7 @@ class AppMenuAdapter( appActivity ) } - ViewCompat.addAccessibilityAction(holder.textView, "Close App Menu") { _, _ -> + ViewCompat.addAccessibilityAction(holder.textView, activity.getString(R.string.close_app_menu)) { _, _ -> activity.backToHome() true } diff --git a/app/src/main/java/eu/ottop/yamlauncher/ContactsAdapter.kt b/app/src/main/java/eu/ottop/yamlauncher/ContactsAdapter.kt index 8a075ce..76559e4 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/ContactsAdapter.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/ContactsAdapter.kt @@ -64,7 +64,7 @@ class ContactsAdapter( holder.textView.visibility = View.VISIBLE - ViewCompat.addAccessibilityAction(holder.textView, "Close App Menu") { _, _ -> + ViewCompat.addAccessibilityAction(holder.textView, activity.getString(R.string.close_app_menu)) { _, _ -> activity.backToHome() true } diff --git a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt index c991d57..8805267 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt @@ -233,7 +233,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh super.onTouchEvent(event) } - ViewCompat.addAccessibilityAction(textView, "Set Shortcut App") { _, _ -> + ViewCompat.addAccessibilityAction(textView, getString(R.string.accessibility_set_shortcut)) { _, _ -> uiUtils.setMenuTitleAlignment(binding.menuTitle) uiUtils.setMenuTitleSize(binding.menuTitle) binding.menuTitle.visibility = View.VISIBLE @@ -243,12 +243,12 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh true } - ViewCompat.addAccessibilityAction(textView, "Launcher Settings") { _, _ -> + ViewCompat.addAccessibilityAction(textView, getString(R.string.settings_title)) { _, _ -> startActivity(Intent(this@MainActivity, SettingsActivity::class.java)) true } - ViewCompat.addAccessibilityAction(textView, "Open App Menu") { _, _ -> + ViewCompat.addAccessibilityAction(textView, getString(R.string.open_app_menu)) { _, _ -> openAppMenu() true } @@ -296,7 +296,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh private fun unsetShortcutListeners(textView: TextView) { textView.setOnClickListener { if (canLaunchShortcut) { - Toast.makeText(this, "Long click to select an app", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.shortcut_default_click), Toast.LENGTH_SHORT).show() } } } @@ -417,12 +417,12 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh true } - ViewCompat.addAccessibilityAction(binding.homeView, "Launcher Settings") { _, _ -> + ViewCompat.addAccessibilityAction(binding.homeView, getString(R.string.settings_title)) { _, _ -> startActivity(Intent(this@MainActivity, SettingsActivity::class.java)) true } - ViewCompat.addAccessibilityAction(binding.homeView, "Open App Menu") { _, _ -> + ViewCompat.addAccessibilityAction(binding.homeView, getString(R.string.open_app_menu)) { _, _ -> openAppMenu() true } @@ -1042,7 +1042,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh canLaunchShortcut = false launcherApps.startMainActivity(leftSwipeActivity.first!!.componentName, launcherApps.profiles[leftSwipeActivity.second!!], null, null) } else { - Toast.makeText(this@MainActivity, "Cannot launch app", Toast.LENGTH_SHORT).show() + Toast.makeText(this@MainActivity, getString(R.string.launch_error), Toast.LENGTH_SHORT).show() } } @@ -1053,7 +1053,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh canLaunchShortcut = false launcherApps.startMainActivity(rightSwipeActivity.first!!.componentName, launcherApps.profiles[rightSwipeActivity.second!!], null, null) } else { - Toast.makeText(this@MainActivity, "Cannot launch app", Toast.LENGTH_SHORT).show() + Toast.makeText(this@MainActivity, getString(R.string.launch_error), Toast.LENGTH_SHORT).show() } } } diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/AboutFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/AboutFragment.kt index b5b7fee..c596233 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/AboutFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/AboutFragment.kt @@ -47,6 +47,6 @@ class AboutFragment : Fragment(), TitleProvider { } override fun getTitle(): String { - return "About YAM Launcher" + return getString(R.string.about_title) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/AppMenuSettingsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/AppMenuSettingsFragment.kt index a84974d..7f0d01a 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/AppMenuSettingsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/AppMenuSettingsFragment.kt @@ -27,7 +27,7 @@ class AppMenuSettingsFragment : PreferenceFragmentCompat(), TitleProvider { } override fun getTitle(): String { - return "App Menu Settings" + return getString(R.string.app_settings_title) } fun setContactPreference(isEnabled: Boolean) { diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/GestureAppsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/GestureAppsFragment.kt index d84c81e..7e31329 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/GestureAppsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/GestureAppsFragment.kt @@ -135,14 +135,14 @@ class GestureAppsFragment(private val direction: String) : Fragment(), private fun showConfirmationDialog(appInfo: LauncherActivityInfo, appName: String, profile: Int) { AlertDialog.Builder(requireContext()).apply { - setTitle("Confirmation") - setMessage("Are you sure you want to choose $appName?") + setTitle(getString(R.string.confirm_title)) + setMessage("${getString(R.string.app_confirm_text)} $appName?") - setPositiveButton("Yes") { _, _ -> + setPositiveButton(getString(R.string.confirm_yes)) { _, _ -> performConfirmedAction(appInfo, appName, profile) } - setNegativeButton("Cancel") { _, _ -> + setNegativeButton(getString(R.string.confirm_no)) { _, _ -> } }.create().show() @@ -165,7 +165,7 @@ class GestureAppsFragment(private val direction: String) : Fragment(), } override fun getTitle(): String { - return "Select an App" + return getString(R.string.select_an_app) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/HiddenAppsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/HiddenAppsFragment.kt index 12841e6..4d83fea 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/HiddenAppsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/HiddenAppsFragment.kt @@ -135,15 +135,15 @@ class HiddenAppsFragment : Fragment(), HiddenAppsAdapter.OnItemClickListener, Ti private fun showConfirmationDialog(appInfo: LauncherActivityInfo, appName: String, profile: Int) { AlertDialog.Builder(requireContext()).apply { - setTitle("Confirmation") - setMessage("Are you sure you want to unhide $appName?") - setPositiveButton("Yes") { _, _ -> + setTitle(getString(R.string.confirm_title)) + setMessage("${getString(R.string.hidden_confirm_text)} $appName?") + setPositiveButton(getString(R.string.confirm_yes)) { _, _ -> lifecycleScope.launch { performConfirmedAction(appInfo, profile) } } - setNegativeButton("Cancel") { _, _ -> + setNegativeButton(getString(R.string.confirm_no)) { _, _ -> } }.create().show() } @@ -162,7 +162,7 @@ class HiddenAppsFragment : Fragment(), HiddenAppsAdapter.OnItemClickListener, Ti } override fun getTitle(): String { - return "Hidden Apps" + return getString(R.string.hidden_apps_title) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/HomeSettingsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/HomeSettingsFragment.kt index 9f2e672..f06c5ea 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/HomeSettingsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/HomeSettingsFragment.kt @@ -84,6 +84,6 @@ class HomeSettingsFragment : PreferenceFragmentCompat(), TitleProvider { } override fun getTitle(): String { - return "Home Screen Settings" + return getString(R.string.home_settings_title) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/LocationFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/LocationFragment.kt index 0d8d914..cf8674f 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/LocationFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/LocationFragment.kt @@ -105,22 +105,22 @@ class LocationFragment : Fragment(), LocationListAdapter.OnItemClickListener, Ti } } - private fun showConfirmationDialog(appName: String?, latitude: String?, longitude: String?) { + private fun showConfirmationDialog(locationName: String?, latitude: String?, longitude: String?) { AlertDialog.Builder(requireContext()).apply { - setTitle("Confirmation") - setMessage("Are you sure you want to select $appName?") - setPositiveButton("Yes") { _, _ -> - performConfirmedAction(appName, latitude, longitude) + setTitle(getString(R.string.confirm_title)) + setMessage("${getString(R.string.app_confirm_text)} $locationName?") + setPositiveButton(getString(R.string.confirm_yes)) { _, _ -> + performConfirmedAction(locationName, latitude, longitude) } - setNegativeButton("Cancel") { _, _ -> + setNegativeButton(R.string.confirm_no) { _, _ -> } }.create().show() } - private fun performConfirmedAction(appName: String?, latitude: String?, longitude: String?) { - sharedPreferenceManager.setWeatherLocation("latitude=${latitude}&longitude=${longitude}", appName) + private fun performConfirmedAction(locationName: String?, latitude: String?, longitude: String?) { + sharedPreferenceManager.setWeatherLocation("latitude=${latitude}&longitude=${longitude}", locationName) requireActivity().supportFragmentManager.popBackStack() } @@ -130,7 +130,7 @@ class LocationFragment : Fragment(), LocationListAdapter.OnItemClickListener, Ti } override fun getTitle(): String { - return "Search for Your City" + return getString(R.string.find_your_city) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsActivity.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsActivity.kt index e3c7e41..b2d8285 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsActivity.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsActivity.kt @@ -40,7 +40,7 @@ class SettingsActivity : AppCompatActivity() { setContentView(binding.root) supportActionBar?.setDisplayHomeAsUpEnabled(true) - supportActionBar?.title = "Launcher Settings" + supportActionBar?.title = getString(R.string.settings_title) supportActionBar?.setDisplayShowTitleEnabled(true) if (supportFragmentManager.backStackEntryCount == 0) { @@ -123,9 +123,9 @@ class SettingsActivity : AppCompatActivity() { contentResolver.openOutputStream(uri)?.use { outputStream -> outputStream.write(sharedPreferencesText.toByteArray()) } - Toast.makeText(this, "Backup successful :)", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.backup_success), Toast.LENGTH_SHORT).show() } catch (e: Exception) { - Toast.makeText(this, "Backup failed :(", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.backup_fail), Toast.LENGTH_SHORT).show() } } @@ -143,7 +143,7 @@ class SettingsActivity : AppCompatActivity() { try { val backupData = JSONObject(jsonData) if (backupData.getString("app_id") != application.packageName) { - throw IllegalArgumentException("Not a YAM Launcher backup") + throw IllegalArgumentException(getString(R.string.restore_wrong_app)) } val data = backupData.getJSONObject("data") @@ -168,14 +168,14 @@ class SettingsActivity : AppCompatActivity() { editor.apply() - Toast.makeText(this, "Restore successful :)", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.restore_success), Toast.LENGTH_SHORT).show() } catch(e: IllegalArgumentException) { Toast.makeText(this, e.message, Toast.LENGTH_SHORT).show() } catch (e: Exception) { - Toast.makeText(this, "Restore failed :( (corrupt file?)", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.restore_fail), Toast.LENGTH_SHORT).show() } } else { - Toast.makeText(this, "Failed to read file", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.restore_error), Toast.LENGTH_SHORT).show() } } @@ -221,7 +221,7 @@ class SettingsActivity : AppCompatActivity() { if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) { fragment.setContactPreference(true) } else { - Toast.makeText(this, "Permission Denied", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.permission_denied), Toast.LENGTH_SHORT).show() fragment.setContactPreference(false) } } diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsFragment.kt index ba44221..3fd538b 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/SettingsFragment.kt @@ -90,7 +90,7 @@ class SettingsFragment : PreferenceFragmentCompat(), TitleProvider { } override fun getTitle(): String { - return "Launcher Settings" + return getString(R.string.settings_title) } diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/SharedPreferenceManager.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/SharedPreferenceManager.kt index 72d825a..815180a 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/SharedPreferenceManager.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/SharedPreferenceManager.kt @@ -6,6 +6,7 @@ import android.graphics.Color import android.util.TypedValue import android.widget.TextView import androidx.preference.PreferenceManager +import eu.ottop.yamlauncher.R class SharedPreferenceManager (private val context: Context) { @@ -258,8 +259,8 @@ class SharedPreferenceManager (private val context: Context) { fun resetAllPreferences() { AlertDialog.Builder(context).apply { - setTitle("Confirmation") - setMessage("You will lose ALL changes that you have made to the launcher settings, shortcuts, hidden apps, etc.\n\nAre you sure?") + setTitle(context.getString(R.string.confirm_title)) + setMessage(context.getString(R.string.reset_confirm_text)) setPositiveButton("Yes") { _, _ -> performReset() } diff --git a/app/src/main/java/eu/ottop/yamlauncher/settings/UISettingsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/settings/UISettingsFragment.kt index c6743c2..0455a0a 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/settings/UISettingsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/settings/UISettingsFragment.kt @@ -11,6 +11,6 @@ class UISettingsFragment : PreferenceFragmentCompat(), TitleProvider { } override fun getTitle(): String { - return "General UI Settings" + return getString(R.string.ui_settings_title) } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/utils/AppUtils.kt b/app/src/main/java/eu/ottop/yamlauncher/utils/AppUtils.kt index ba8e5a1..341f090 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/utils/AppUtils.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/utils/AppUtils.kt @@ -6,6 +6,7 @@ import android.content.pm.LauncherActivityInfo import android.content.pm.LauncherApps import android.os.UserHandle import android.widget.Toast +import eu.ottop.yamlauncher.R import eu.ottop.yamlauncher.settings.SharedPreferenceManager import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -84,7 +85,7 @@ class AppUtils(private val context: Context, private val launcherApps: LauncherA if (mainActivity != null) { launcherApps.startMainActivity(mainActivity.componentName, userHandle, null, null) } else { - Toast.makeText(context, "Cannot launch app", Toast.LENGTH_SHORT).show() + Toast.makeText(context, context.getString(R.string.launch_error), Toast.LENGTH_SHORT).show() } } } \ No newline at end of file diff --git a/app/src/main/java/eu/ottop/yamlauncher/utils/GestureUtils.kt b/app/src/main/java/eu/ottop/yamlauncher/utils/GestureUtils.kt index 3ebb455..69f9050 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/utils/GestureUtils.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/utils/GestureUtils.kt @@ -11,6 +11,7 @@ import android.content.pm.ServiceInfo import android.provider.Settings import android.view.accessibility.AccessibilityManager import androidx.appcompat.app.AppCompatActivity.ACCESSIBILITY_SERVICE +import eu.ottop.yamlauncher.R import eu.ottop.yamlauncher.settings.SharedPreferenceManager class GestureUtils(private val context: Context) { @@ -50,15 +51,15 @@ class GestureUtils(private val context: Context) { fun promptEnableAccessibility() { AlertDialog.Builder(context).apply { - setTitle("Confirmation") - setMessage("To lock with double tap, enable YAM Launcher in accessibility settings.") - setPositiveButton("Yes") { _, _ -> + setTitle(context.getString(R.string.confirm_title)) + setMessage(context.getString(R.string.screenlock_confirmation)) + setPositiveButton(context.getString(R.string.confirm_yes)) { _, _ -> // Perform action on confirmation val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK context.startActivity(intent) } - setNegativeButton("Cancel") { _, _ -> + setNegativeButton(context.getString(R.string.confirm_no)) { _, _ -> } diff --git a/app/src/main/java/eu/ottop/yamlauncher/utils/WeatherSystem.kt b/app/src/main/java/eu/ottop/yamlauncher/utils/WeatherSystem.kt index 0a3f231..4b4ac6a 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/utils/WeatherSystem.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/utils/WeatherSystem.kt @@ -8,6 +8,7 @@ import android.location.LocationManager import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import eu.ottop.yamlauncher.MainActivity +import eu.ottop.yamlauncher.R import eu.ottop.yamlauncher.settings.SharedPreferenceManager import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -43,7 +44,7 @@ class WeatherSystem(private val context: Context) { CoroutineScope(Dispatchers.IO).launch { val latitude = location.latitude val longitude = location.longitude - sharedPreferenceManager.setWeatherLocation("latitude=${latitude}&longitude=${longitude}", "Latest GPS location") + sharedPreferenceManager.setWeatherLocation("latitude=${latitude}&longitude=${longitude}", context.getString(R.string.latest_location)) activity.updateWeatherText() } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3e6b22e..3bcccbd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,25 +5,84 @@ App - + Long click to select an app + + Set Shortcut App + + Select an app - Unhide an app - Find your city + "Search for Your City" Search… Switch to Contacts Switch to Apps + Confirmation + Are you sure you want to choose + Yes + Cancel + Are you sure you want to unhide + + Removing... + + Close App Menu + Open App Menu + + Cannot launch app + - Reset Info Uninstall Rename Hide Close + App info + Uninstall app + Rename app + Hide app + + + Launcher Settings + + Set Default Home + + Customization + + General UI Settings + General UI + Configure the overall look + Appearance + + Home Screen Settings + Home Screen + Configure the home screen + App Menu Settings + App Menu + Configure the application menu + Hidden Apps + Manage Hidden Apps + Unhide Apps + About + Reset + Restart YAM Launcher + Reset All Settings + You will lose ALL changes that you have made to the launcher settings, shortcuts, hidden apps, etc.\n\nAre you sure? + Backup and Restore + Backup + Backup your settings + Restore + Restore a backup + Backup successful :) + Backup failed :( + Restore successful :) + Restore failed :( (corrupt file?) + Not a YAM Launcher backup + Failed to read file + Permission Denied + About YAM Launcher App Icon By Otto Petäjä Source Code @@ -46,5 +105,59 @@ Open-Meteo.com (CC BY 4.0)]]> %1$s%2$s + Latest GPS location + + To lock with double tap, enable YAM Launcher in accessibility settings. The permission is required for double tap to work for locking the screen.\n\nIt is only needed if you want to use the double tap to lock screen feature in YAM Launcher. + Background Color + Text Color + Text Font + Text Style + Animation Speed + Swipe Threshold + Operation + Swipe Velocity Threshold + Show Status Bar + Apps + App Alignment + App Size + App Spacing + Contacts Menu + Search + Enable Search + Search Alignment + Search Size + Automatically Open Keyboard + Automatic App Opening + Automatically launch an app when it\'s the last search result + Clock + Show Clock + Clock Alignment + Clock Size + Clicking Time Opens Clock + Custom Clock + Set Clock App + Date + Show Date + Date Size + Battery Indicator + Clicking Date Opens Calendar + Custom Calendar + Set Calendar App + Weather + GPS Location + Set Manual Location + Units + Shortcuts + Number of Shortcuts + Horizontal Alignment + Vertical Alignment + Shortcut Size + Shortcut Spacing + Gestures + Swipe Left + Left Swipe App + Swipe Right + Right Swipe App + Double Tap to Lock Screen \ No newline at end of file diff --git a/app/src/main/res/xml/app_menu_preferences.xml b/app/src/main/res/xml/app_menu_preferences.xml index 90c16c5..f88b5ca 100644 --- a/app/src/main/res/xml/app_menu_preferences.xml +++ b/app/src/main/res/xml/app_menu_preferences.xml @@ -4,7 +4,7 @@ + app:title="@string/apps"> + app:title="@string/search_text"> + app:summary="@string/auto_launch_summary" /> diff --git a/app/src/main/res/xml/home_preferences.xml b/app/src/main/res/xml/home_preferences.xml index 6c162bd..79b8041 100644 --- a/app/src/main/res/xml/home_preferences.xml +++ b/app/src/main/res/xml/home_preferences.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -11,7 +11,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="true" - android:title="Show Clock" + android:title="@string/show_clock" app:key="clockEnabled" /> + app:title="@string/set_clock_app" /> @@ -62,7 +62,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:defaultValue="true" - android:title="Show Date" + android:title="@string/show_date" app:key="dateEnabled" /> + app:title="@string/set_calendar_app" /> + app:title="@string/weather"> + app:title="@string/set_manual_location" /> + app:title="@string/shortcuts"> + app:title="@string/gestures"> + app:title="@string/left_swipe_app" /> + app:title="@string/right_swipe_app" /> diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index f40ab01..1707f35 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -7,97 +7,97 @@ android:layout_height="wrap_content" app:key="defaultHome" app:selectable="true" - app:title="Set Default Home" /> + app:title="@string/default_home" /> + app:title="@string/customization" > + app:summary="@string/ui_settings_summary" + app:title="@string/ui_settings_text" /> + app:summary="@string/home_settings_summary" + app:title="@string/home_settings_text" /> + app:summary="@string/app_settings_summary" + app:title="@string/app_settings_text" /> + app:title="@string/hidden_apps_title"> + app:summary="@string/hidden_apps_summary" + app:title="@string/hidden_apps_text" /> + app:title="@string/backup_restore"> + app:summary="@string/backup_summary" + app:title="@string/backup" /> + app:summary="@string/restore_summary" + app:title="@string/restore" /> + app:title="@string/about"> + app:title="@string/about_title" /> + app:title="@string/reset"> + app:title="@string/restart_text" /> + app:title="@string/reset_text" /> \ No newline at end of file diff --git a/app/src/main/res/xml/ui_preferences.xml b/app/src/main/res/xml/ui_preferences.xml index 5d39326..4a81f59 100644 --- a/app/src/main/res/xml/ui_preferences.xml +++ b/app/src/main/res/xml/ui_preferences.xml @@ -4,7 +4,7 @@