mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-16 20:00:36 +01:00
Make clipboard item wrap_content instead of fill up parent
This commit is contained in:
parent
f1b4896a86
commit
937bedb3eb
@ -1632,11 +1632,18 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
} else {
|
||||
mToolbarHolder?.autofill_suggestions_holder?.addView(it)
|
||||
}
|
||||
|
||||
// make room on suggestion toolbar for inline views
|
||||
mToolbarHolder?.suggestions_items_holder?.gravity = Gravity.NO_GRAVITY
|
||||
mToolbarHolder?.clipboard_value?.maxWidth = resources.getDimensionPixelSize(R.dimen.suggestion_max_width)
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.R)
|
||||
fun clearClipboardViews() {
|
||||
mToolbarHolder?.autofill_suggestions_holder?.removeAllViews()
|
||||
// restore original clipboard toolbar appearance
|
||||
mToolbarHolder?.suggestions_items_holder?.gravity = Gravity.CENTER_HORIZONTAL
|
||||
mToolbarHolder?.clipboard_value?.maxWidth = Integer.MAX_VALUE
|
||||
}
|
||||
}
|
||||
|
@ -43,18 +43,18 @@
|
||||
android:id="@+id/suggestions_items_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/clipboard_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="none"
|
||||
android:background="@drawable/clipboard_background"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:maxWidth="@dimen/suggestion_max_width"
|
||||
android:minWidth="@dimen/suggestion_min_width"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/small_margin"
|
||||
|
Loading…
x
Reference in New Issue
Block a user