show extra buttons on long pressing a top letter

This commit is contained in:
tibbi 2022-01-13 12:28:29 +01:00
parent 52d6f86277
commit 2596891d4c
5 changed files with 47 additions and 11 deletions

View File

@ -435,7 +435,12 @@ class MyKeyboard {
row.defaultHorizontalGap = mDefaultHorizontalGap row.defaultHorizontalGap = mDefaultHorizontalGap
row.verticalGap = mDefaultVerticalGap row.verticalGap = mDefaultVerticalGap
row.rowEdgeFlags = EDGE_TOP or EDGE_BOTTOM row.rowEdgeFlags = EDGE_TOP or EDGE_BOTTOM
val maxColumns = if (columns == -1) Int.MAX_VALUE else columns val maxColumns = if (columns == -1) {
Int.MAX_VALUE
} else {
columns
}
for (element in characters) { for (element in characters) {
val c = element val c = element
if (column >= maxColumns || x + mDefaultWidth + horizontalPadding > mDisplayWidth) { if (column >= maxColumns || x + mDefaultWidth + horizontalPadding > mDisplayWidth) {

View File

@ -6,6 +6,7 @@
<com.simplemobiletools.keyboard.views.MyKeyboardView <com.simplemobiletools.keyboard.views.MyKeyboardView
android:id="@+id/keyboardView" android:id="@+id/keyboardView"
style="@style/Widget.KeyboardViewPopup"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />

View File

@ -19,4 +19,8 @@
<item name="shadowColor">#BB000000</item> <item name="shadowColor">#BB000000</item>
<item name="shadowRadius">2.75</item> <item name="shadowRadius">2.75</item>
</style> </style>
<style name="Widget.KeyboardViewPopup" parent="Widget.KeyboardView">
<item name="keyTextSize">26sp</item>
</style>
</resources> </resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:app="http://schemas.android.com/apk/res-auto"
app:horizontalGap="0px"
app:keyHeight="60dp"
app:keyWidth="10%p"
app:verticalGap="0px" />

View File

@ -9,35 +9,55 @@
<Key <Key
app:codes="113" app:codes="113"
app:keyEdgeFlags="left" app:keyEdgeFlags="left"
app:keyLabel="q" /> app:keyLabel="q"
app:popupCharacters="1"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="119" app:codes="119"
app:keyLabel="w" /> app:keyLabel="w"
app:popupCharacters="2"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="101" app:codes="101"
app:keyLabel="e" /> app:keyLabel="e"
app:popupCharacters="3"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="114" app:codes="114"
app:keyLabel="r" /> app:keyLabel="r"
app:popupCharacters="4"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="116" app:codes="116"
app:keyLabel="t" /> app:keyLabel="t"
app:popupCharacters="5"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="121" app:codes="121"
app:keyLabel="y" /> app:keyLabel="y"
app:popupCharacters="6"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="117" app:codes="117"
app:keyLabel="u" /> app:keyLabel="u"
app:popupCharacters="7"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="105" app:codes="105"
app:keyLabel="i" /> app:keyLabel="i"
app:popupCharacters="8"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="111" app:codes="111"
app:keyLabel="o" /> app:keyLabel="o"
app:popupCharacters="9"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key <Key
app:codes="112" app:codes="112"
app:keyEdgeFlags="right" app:keyEdgeFlags="right"
app:keyLabel="p" /> app:keyLabel="p"
app:popupCharacters="0"
app:popupKeyboard="@xml/keyboard_popup_template" />
</Row> </Row>
<Row> <Row>
<Key <Key