keyboard changes

hh
Laurent 6 years ago
parent 529a7cc21e
commit 39709e3e97
  1. 3
      app/src/main/AndroidManifest.xml
  2. 10
      app/src/main/java/net/pokeranalytics/android/ui/adapter/HandHistoryAdapter.kt
  3. 1
      app/src/main/java/net/pokeranalytics/android/ui/extensions/UIExtensions.kt
  4. 1
      app/src/main/java/net/pokeranalytics/android/ui/fragment/HandHistoryFragment.kt
  5. 2
      app/src/main/res/layout/view_hand_keyboard_amount.xml

@ -74,7 +74,8 @@
<activity
android:name="net.pokeranalytics.android.ui.activity.HandHistoryActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden"/>
<activity
android:name="net.pokeranalytics.android.ui.activity.BankrollDetailsActivity"

@ -1,14 +1,12 @@
package net.pokeranalytics.android.ui.adapter
import android.app.Activity
import android.content.Context
import android.content.res.ColorStateList
import android.text.InputType
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.Button
import android.widget.EditText
import androidx.recyclerview.widget.RecyclerView
@ -224,11 +222,13 @@ class HandHistoryAdapter(
}
private fun requestFocusAndShowKeyboard(editText: EditText) {
editText.requestFocus()
if (editText.requestFocus()) {
val imm = itemView.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0)
// val imm = itemView.context.getSystemService(InputMethodManager::class.java)
// imm.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY)
// val imm = itemView.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
// imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0)
// imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
}

@ -210,7 +210,6 @@ fun Bitmap.toByteArray() : ByteArray {
fun Activity.hideKeyboard() {
this.currentFocus?.let {
val imm = getSystemService(InputMethodManager::class.java)
// imm.showSoftInput()
imm.hideSoftInputFromWindow(it.windowToken, 0)
}
}

@ -240,7 +240,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDataSource, RowRepr
override fun amountKeyTyped(key: NumericKey) {
this.model.amountKeyTyped(key)
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
// Table refresh

@ -55,7 +55,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_height="240dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

Loading…
Cancel
Save