Display a toast after restoring a backup. Seems like useful feedback. (#1531)

This commit is contained in:
Eran Leshem 2025-05-14 17:23:39 +03:00 committed by GitHub
parent 95d4bfe97c
commit c4386df186
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,8 @@ package helium314.keyboard.settings.preferences
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Looper
import android.widget.Toast
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@ -151,6 +153,9 @@ fun BackupRestorePreference(setting: Setting) {
} }
} }
} }
Looper.prepare()
Toast.makeText(ctx, ctx.getString(R.string.backup_restored), Toast.LENGTH_LONG).show()
} catch (t: Throwable) { } catch (t: Throwable) {
error = "r" + t.message error = "r" + t.message
Log.w("AdvancedScreen", "error during restore", t) Log.w("AdvancedScreen", "error during restore", t)

View file

@ -196,6 +196,8 @@
<string name="button_backup">Backup</string> <string name="button_backup">Backup</string>
<!-- restore button --> <!-- restore button -->
<string name="button_restore">Restore</string> <string name="button_restore">Restore</string>
<!-- Message when backup is restored successfully -->
<string name="backup_restored">Backup restored</string>
<!-- Preferences item for format for timestamp keycode --> <!-- Preferences item for format for timestamp keycode -->
<string name="timestamp_format_title">Format for timestamp key</string> <string name="timestamp_format_title">Format for timestamp key</string>
<!-- Preferences item for choosing secondary language --> <!-- Preferences item for choosing secondary language -->