Skip to content

Commit

Permalink
Potential workaround for #1555
Browse files Browse the repository at this point in the history
  • Loading branch information
mtotschnig committed Sep 7, 2024
1 parent f29808b commit 3bb633e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.totschnig.myexpenses.delegate

import android.database.Cursor
import android.os.Build
import android.os.Bundle
import android.text.Editable
import android.text.SpannableStringBuilder
Expand All @@ -10,7 +11,9 @@ import android.view.Menu
import android.view.View
import android.widget.AdapterView
import android.widget.FilterQueryProvider
import android.widget.ListPopupWindow
import android.widget.SimpleCursorAdapter
import androidx.appcompat.widget.ListPopupWindow.INPUT_METHOD_NOT_NEEDED
import androidx.appcompat.widget.PopupMenu
import androidx.core.text.bold
import androidx.core.view.isVisible
Expand Down Expand Up @@ -40,6 +43,8 @@ import org.totschnig.myexpenses.provider.TransactionProvider
import org.totschnig.myexpenses.ui.MyTextWatcher
import org.totschnig.myexpenses.util.TextUtils.withAmountColor
import org.totschnig.myexpenses.util.Utils
import org.totschnig.myexpenses.util.config.Configurator.Configuration.AUTO_COMPLETE_DROPDOWN_SET_INPUT_METHOD_NEEDED
import org.totschnig.myexpenses.util.config.get
import org.totschnig.myexpenses.util.ui.configurePopupAnchor
import org.totschnig.myexpenses.util.crashreporting.CrashHandler
import org.totschnig.myexpenses.util.formatMoney
Expand Down Expand Up @@ -174,6 +179,9 @@ abstract class MainDelegate<T : ITransaction>(
intArrayOf(android.R.id.text1),
0
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && configurator[AUTO_COMPLETE_DROPDOWN_SET_INPUT_METHOD_NEEDED, true]) {
viewBinding.Payee.inputMethodMode = ListPopupWindow.INPUT_METHOD_NEEDED
}
viewBinding.Payee.setAdapter(payeeAdapter)
payeeAdapter.filterQueryProvider = FilterQueryProvider { constraint: CharSequence? ->
if (constraint != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import org.totschnig.myexpenses.util.ICurrencyFormatter
import org.totschnig.myexpenses.util.PermissionHelper
import org.totschnig.myexpenses.util.TextUtils.appendCurrencyDescription
import org.totschnig.myexpenses.util.TextUtils.appendCurrencySymbol
import org.totschnig.myexpenses.util.config.Configurator
import org.totschnig.myexpenses.util.epoch2ZonedDateTime
import org.totschnig.myexpenses.util.ui.UiUtils
import org.totschnig.myexpenses.util.ui.addChipsBulk
Expand Down Expand Up @@ -91,6 +92,9 @@ abstract class TransactionDelegate<T : ITransaction>(
@Inject
lateinit var currencyContext: CurrencyContext

@Inject
lateinit var configurator: Configurator

val homeCurrency by lazy {
currencyContext.homeCurrencyUnit
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Configurator {

enum class Configuration {
USE_SET_DECOR_PADDING_WORKAROUND,
AUTO_COMPLETE_DROPDOWN_SET_INPUT_METHOD_NEEDED,
ad_handling_waterfall;
}

Expand Down

0 comments on commit 3bb633e

Please sign in to comment.