From e85c5bc7b2589e05906fc111e7d36df4e9c5d76a Mon Sep 17 00:00:00 2001 From: MrSluffy Date: Thu, 23 Jan 2025 18:58:47 +0800 Subject: [PATCH] enh : make folder placeholder translatable --- lawnchair/res/values/strings.xml | 2 ++ .../src/app/lawnchair/data/folder/model/FolderViewModel.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lawnchair/res/values/strings.xml b/lawnchair/res/values/strings.xml index 460d8d84f02..9b8ca62fefb 100644 --- a/lawnchair/res/values/strings.xml +++ b/lawnchair/res/values/strings.xml @@ -107,6 +107,8 @@ Hide folder apps Apps assigned to folders are excluded from app lists + My folder + To lock your phone when performing a gesture, and to open Recents via gesture, Lawnchair requires accessibility access.\n\nLawnchair doesn\'t watch any user action, though the privilege to do so is required for all accessibility services. Lawnchair discards any event sent by the system.\n\nIn order to lock your phone, or to open Recents, Lawnchair uses the performGlobalAction Accessibility service. diff --git a/lawnchair/src/app/lawnchair/data/folder/model/FolderViewModel.kt b/lawnchair/src/app/lawnchair/data/folder/model/FolderViewModel.kt index 2803fa39f19..4bcea514c44 100644 --- a/lawnchair/src/app/lawnchair/data/folder/model/FolderViewModel.kt +++ b/lawnchair/src/app/lawnchair/data/folder/model/FolderViewModel.kt @@ -8,6 +8,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import app.lawnchair.data.folder.service.FolderService import app.lawnchair.ui.preferences.destinations.Action +import com.android.launcher3.R import com.android.launcher3.model.data.AppInfo import com.android.launcher3.model.data.FolderInfo import kotlinx.coroutines.flow.MutableStateFlow @@ -24,7 +25,7 @@ class FolderViewModel(context: Context) : ViewModel() { private val _folders = MutableStateFlow>(emptyList()) val folders: StateFlow> = _folders.asStateFlow() - private val _currentTitle = MutableStateFlow("My Folder") + private val _currentTitle = MutableStateFlow(context.resources.getString(R.string.my_folder_label)) val currentTitle: StateFlow = _currentTitle.asStateFlow() private val _action = MutableStateFlow(Action.DEFAULT)