diff --git a/app/src/main/java/be/scri/fragments/AboutFragment.kt b/app/src/main/java/be/scri/fragments/AboutFragment.kt index 06e03cc7..96889d0f 100644 --- a/app/src/main/java/be/scri/fragments/AboutFragment.kt +++ b/app/src/main/java/be/scri/fragments/AboutFragment.kt @@ -21,7 +21,7 @@ class AboutFragment : Fragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?, - ): View? { + ): View { binding = FragmentAboutBinding.inflate(inflater, container, false) val callback = requireActivity().onBackPressedDispatcher.addCallback(this) { diff --git a/app/src/main/java/be/scri/fragments/MainFragment.kt b/app/src/main/java/be/scri/fragments/MainFragment.kt index 980f3206..543e1ee3 100644 --- a/app/src/main/java/be/scri/fragments/MainFragment.kt +++ b/app/src/main/java/be/scri/fragments/MainFragment.kt @@ -1,7 +1,6 @@ package be.scri.fragments import android.content.Context -import android.content.Context.INPUT_METHOD_SERVICE import android.content.Intent import android.content.res.Configuration import android.os.Bundle @@ -10,14 +9,12 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.view.inputmethod.InputMethodManager import androidx.activity.addCallback import androidx.appcompat.app.AppCompatDelegate import androidx.fragment.app.Fragment import be.scri.R import be.scri.activities.MainActivity import be.scri.databinding.FragmentMainBinding -import be.scri.dialogs.ConfirmationAdvancedDialog class MainFragment : Fragment() { private var _binding: FragmentMainBinding? = null @@ -38,23 +35,6 @@ class MainFragment : Fragment() { (requireActivity() as MainActivity).unsetActionBarLayoutMargin() applyUserDarkModePreference() - if (!isKeyboardEnabled()) { - ConfirmationAdvancedDialog( - requireActivity(), - messageId = R.string.redirection_note, - positive = R.string.ok, - negative = 0, - ) { success -> - if (success) { - Intent(Settings.ACTION_INPUT_METHOD_SETTINGS).apply { - addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - startActivity(this) - } - } else { - requireActivity().finish() - } - } - } val callback = requireActivity().onBackPressedDispatcher.addCallback(this) { getParentFragmentManager().popBackStack() @@ -92,27 +72,6 @@ class MainFragment : Fragment() { } } - override fun onResume() { - super.onResume() - if (!isKeyboardEnabled()) { - ConfirmationAdvancedDialog( - requireActivity(), - messageId = R.string.redirection_note, - positive = R.string.ok, - negative = 0, - ) { success -> - if (success) { - Intent(Settings.ACTION_INPUT_METHOD_SETTINGS).apply { - addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - startActivity(this) - } - } else { - requireActivity().finish() - } - } - } - } - private fun openKeyboardSettings() { Intent(Settings.ACTION_INPUT_METHOD_SETTINGS).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) @@ -120,14 +79,6 @@ class MainFragment : Fragment() { } } - private fun isKeyboardEnabled(): Boolean { - val inputMethodManager = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - val enabledKeyboards = inputMethodManager.enabledInputMethodList - return enabledKeyboards.any { - it.packageName == requireContext().packageName - } - } - override fun onDestroyView() { super.onDestroyView() _binding = null diff --git a/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt b/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt index 74a9eba4..08813a99 100644 --- a/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt @@ -13,7 +13,6 @@ import be.scri.databinding.KeyboardViewCommandOptionsBinding import be.scri.databinding.KeyboardViewKeyboardBinding import be.scri.helpers.MyKeyboard import be.scri.helpers.MyKeyboard.Companion.KEYCODE_ENTER -import be.scri.services.ItalianKeyboardIME.ScribeState import be.scri.views.MyKeyboardView class EnglishKeyboardIME : SimpleKeyboardIME() { diff --git a/app/src/main/java/be/scri/views/MyKeyboardView.kt b/app/src/main/java/be/scri/views/MyKeyboardView.kt index fc8b2c63..3d1dbbe7 100644 --- a/app/src/main/java/be/scri/views/MyKeyboardView.kt +++ b/app/src/main/java/be/scri/views/MyKeyboardView.kt @@ -387,7 +387,7 @@ class MyKeyboardView val wasDarkened = mBackgroundColor != mBackgroundColor.darkenColor() mToolbarHolder?.apply { - keyboardBinding?.apply { + keyboardBinding.apply { topKeyboardDivider.beGoneIf(wasDarkened) topKeyboardDivider.background = ColorDrawable(strokeColor) diff --git a/app/src/main/res/drawable/rounded_button.xml b/app/src/main/res/drawable/rounded_button.xml new file mode 100644 index 00000000..c0c02405 --- /dev/null +++ b/app/src/main/res/drawable/rounded_button.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index a640bd52..fe5080ae 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -1,8 +1,6 @@