Skip to content

Commit

Permalink
fix: fix build error of missing resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Bambooin committed Jul 8, 2023
1 parent cd98833 commit 998d923
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions app/src/main/java/com/osfans/trime/ime/text/TextInputManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.text.InputType
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.appcompat.R.style.Theme_AppCompat_DayNight_Dialog_Alert
import androidx.appcompat.app.AlertDialog
import androidx.lifecycle.lifecycleScope
import com.osfans.trime.R
Expand Down Expand Up @@ -400,24 +401,24 @@ class TextInputManager private constructor() :
trime.lifecycleScope.launch {
when (event.option) {
"theme" -> trime.showDialogAboveInputView(
trime.themePicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert),
trime.themePicker(Theme_AppCompat_DayNight_Dialog_Alert),
)
"color" -> trime.showDialogAboveInputView(
trime.colorPicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert),
trime.colorPicker(Theme_AppCompat_DayNight_Dialog_Alert),
)
"schema" -> trime.showDialogAboveInputView(
trime.schemaPicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert),
trime.schemaPicker(Theme_AppCompat_DayNight_Dialog_Alert),
)
"sound" -> trime.showDialogAboveInputView(
trime.soundPicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert),
trime.soundPicker(Theme_AppCompat_DayNight_Dialog_Alert),
)
else -> ShortcutUtils.launchMainActivity(trime)
}
}
}
KeyEvent.KEYCODE_PROG_RED -> trime.lifecycleScope.launch {
trime.showDialogAboveInputView(
trime.colorPicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert),
trime.colorPicker(Theme_AppCompat_DayNight_Dialog_Alert),
)
}
KeyEvent.KEYCODE_MENU -> showOptionsDialog()
Expand Down Expand Up @@ -549,9 +550,9 @@ class TextInputManager private constructor() :
}

private fun showOptionsDialog() {
val builder = AlertDialog.Builder(trime, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
val builder = AlertDialog.Builder(trime, Theme_AppCompat_DayNight_Dialog_Alert)
builder
.setTitle(R.string.trime_app_name)
.setTitle(R.string.app_name_release)
.setIcon(R.mipmap.ic_app_icon)
.setNegativeButton(R.string.other_ime) { dialog, _ ->
dialog.dismiss()
Expand All @@ -573,7 +574,7 @@ class TextInputManager private constructor() :
R.string.pref_select_schemas,
) { dialog, _ ->
dialog.dismiss()
trime.showDialogAboveInputView(trime.schemaPicker(R.style.Theme_AppCompat_DayNight_Dialog_Alert))
trime.showDialogAboveInputView(trime.schemaPicker(Theme_AppCompat_DayNight_Dialog_Alert))
}
.setSingleChoiceItems(
schemaNameList,
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/osfans/trime/util/DialogUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.ViewGroup.MarginLayoutParams
import android.widget.LinearLayout
import android.widget.ProgressBar
import androidx.annotation.StringRes
import androidx.appcompat.R.style.Theme_AppCompat_DayNight_Dialog_Alert
import androidx.appcompat.app.AlertDialog
import androidx.lifecycle.LifecycleCoroutineScope
import com.blankj.utilcode.util.ToastUtils
Expand All @@ -20,7 +21,7 @@ import kotlinx.coroutines.withContext
// Adapted from https://github.com/fcitx5-android/fcitx5-android/blob/e37f5513239bab279a9e58cf0c9b163e0dbf5efb/app/src/main/java/org/fcitx/fcitx5/android/ui/common/Preset.kt#L60
@Suppress("FunctionName")
fun Context.ProgressBarDialogIndeterminate(@StringRes titleId: Int): AlertDialog.Builder {
return AlertDialog.Builder(this, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
return AlertDialog.Builder(this, Theme_AppCompat_DayNight_Dialog_Alert)
.setTitle(titleId)
.setView(
LinearLayout(this).apply {
Expand Down

0 comments on commit 998d923

Please sign in to comment.