From bf3b9c374e1e68b1244da392666b571ab37e51fb Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 6 Jul 2024 22:16:37 +0200 Subject: Clipboard pane (#681) This adds the clipboard pane, which allows to save an arbitrary number of clipboards and to paste them later. The key can be disabled in settings. Checking the "Recently copied text" checkbox will cause the keyboard to keep a temporary history of copied text. This history can only contain 3 elements which expire after 5 minutes. If this is unchecked, no history is collected. History entries can be pinned into the persisted list of pins. --- srcs/juloo.keyboard2/NonScrollListView.java | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 srcs/juloo.keyboard2/NonScrollListView.java (limited to 'srcs/juloo.keyboard2/NonScrollListView.java') diff --git a/srcs/juloo.keyboard2/NonScrollListView.java b/srcs/juloo.keyboard2/NonScrollListView.java new file mode 100644 index 0000000..32ef744 --- /dev/null +++ b/srcs/juloo.keyboard2/NonScrollListView.java @@ -0,0 +1,38 @@ +package juloo.keyboard2; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View.MeasureSpec; +import android.view.ViewGroup; +import android.widget.ListView; + +/** A non-scrollable list view that can be embedded in a bigger ScrollView. + Credits to Dedaniya HirenKumar in + https://stackoverflow.com/questions/18813296/non-scrollable-listview-inside-scrollview */ +public class NonScrollListView extends ListView +{ + public NonScrollListView(Context context) + { + super(context); + } + + public NonScrollListView(Context context, AttributeSet attrs) + { + super(context, attrs); + } + + public NonScrollListView(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + } + + @Override + public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) + { + int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec( + Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); + super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom); + ViewGroup.LayoutParams params = getLayoutParams(); + params.height = getMeasuredHeight(); + } +} -- cgit v1.2.3