mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-25 11:22:20 +00:00
fix issues with restoring old settings
This commit is contained in:
parent
0fa8f58750
commit
56c7748dff
3 changed files with 7 additions and 3 deletions
|
@ -252,6 +252,7 @@ fun checkVersionUpgrade(context: Context) {
|
||||||
if (oldVersion <= 2303) {
|
if (oldVersion <= 2303) {
|
||||||
File(DeviceProtectedUtils.getFilesDir(context), "layouts").listFiles()?.forEach { file ->
|
File(DeviceProtectedUtils.getFilesDir(context), "layouts").listFiles()?.forEach { file ->
|
||||||
val folder = DeviceProtectedUtils.getFilesDir(context)
|
val folder = DeviceProtectedUtils.getFilesDir(context)
|
||||||
|
if (file.isDirectory) return@forEach
|
||||||
when (file.name) {
|
when (file.name) {
|
||||||
"custom.symbols." -> {
|
"custom.symbols." -> {
|
||||||
val dir = File(folder, LayoutType.SYMBOLS.folder)
|
val dir = File(folder, LayoutType.SYMBOLS.folder)
|
||||||
|
|
|
@ -134,8 +134,11 @@ fun BackupRestorePreference(setting: Setting) {
|
||||||
ctx.getActivity()?.contentResolver?.openInputStream(uri)?.use { inputStream ->
|
ctx.getActivity()?.contentResolver?.openInputStream(uri)?.use { inputStream ->
|
||||||
ZipInputStream(inputStream).use { zip ->
|
ZipInputStream(inputStream).use { zip ->
|
||||||
var entry: ZipEntry? = zip.nextEntry
|
var entry: ZipEntry? = zip.nextEntry
|
||||||
val filesDir = ctx.filesDir?.path ?: return@execute
|
val filesDir = ctx.filesDir ?: return@execute
|
||||||
val deviceProtectedFilesDir = DeviceProtectedUtils.getFilesDir(ctx).path
|
val deviceProtectedFilesDir = DeviceProtectedUtils.getFilesDir(ctx)
|
||||||
|
filesDir.deleteRecursively()
|
||||||
|
deviceProtectedFilesDir.deleteRecursively()
|
||||||
|
LayoutUtilsCustom.onLayoutFileChanged()
|
||||||
Settings.getInstance().stopListener()
|
Settings.getInstance().stopListener()
|
||||||
while (entry != null) {
|
while (entry != null) {
|
||||||
if (entry.name.startsWith("unprotected${File.separator}")) {
|
if (entry.name.startsWith("unprotected${File.separator}")) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ import helium314.keyboard.settings.dialogs.LayoutPickerDialog
|
||||||
import helium314.keyboard.settings.preferences.Preference
|
import helium314.keyboard.settings.preferences.Preference
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LayoutScreen(
|
fun SecondaryLayoutScreen(
|
||||||
onClickBack: () -> Unit,
|
onClickBack: () -> Unit,
|
||||||
) {
|
) {
|
||||||
// todo: enable main layouts
|
// todo: enable main layouts
|
Loading…
Add table
Add a link
Reference in a new issue