1
0
mirror of https://github.com/danog/termux-api.git synced 2025-01-22 13:21:10 +01:00

DialogAPI Improvements / Enhancements (#172)

* DialogAPI Improvements / Enhancements
    * New Widgets: Date, Time, Spinner, Text-To-Speech, Confirmation
    * Results are returned as JSON including code of button pressed

* Fix typo

* Add BottomSheet InputMethod type
    * Change DialogActivity to AppCompatActivity
    * Add support library dependency to gradle
    * Change theme to be compatible with AppCompatActivity
    * Refactor getSpinnerItems to getInputValues so BottomSheet can use
    as well

* Add Radio InputMethod

* Better touch outside dialog cancellation behavior
    * Prevent speech InputMethod from being cancelled on touch outside

* Add Counter InputMethod

* Add CheckBox InputMethod
    * Change FrameLayout to be NestedScrollView to handle scrolling
    large dialogs as necessary

* Add custom range for CounterInputMethod

* Set text for ConfirmInputMethod

* Add numeric option / other minor tweaks
    * change password type to a boolean option instead of string
    * allow multiline password (text only not numeric)

* Allow text hint to be set for SpeechInputMethod
This commit is contained in:
David Kramer 2018-06-21 16:25:47 -06:00 committed by Fredrik Fornwall
parent a96abbbe14
commit c4fbbf1bf2
6 changed files with 1044 additions and 69 deletions

View File

@ -18,3 +18,7 @@ android {
}
}
}
dependencies {
implementation 'com.android.support:design:27.1.1'
}

View File

@ -50,7 +50,7 @@
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.Light" >
<receiver android:name="com.termux.api.TermuxApiReceiver"/>
<activity android:name="com.termux.api.DialogActivity" android:theme="@android:style/Theme.Material.Light.Dialog.Alert" android:noHistory="true" android:excludeFromRecents="true" android:exported="false"/>
<activity android:name="com.termux.api.DialogActivity" android:theme="@style/DialogTheme" android:noHistory="true" android:excludeFromRecents="true" android:exported="false"/>
<activity android:name=".FingerprintAPI$FingerprintActivity" android:theme="@android:style/Theme.NoDisplay"
android:noHistory="true"
android:excludeFromRecents="true"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/incrementButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp"
android:text="▲"
android:textSize="28sp" />
<TextView
android:id="@+id/counterTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="0"
android:textAlignment="center"
android:textSize="24sp"
android:textStyle="bold" />
<Button
android:id="@+id/decrementButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp"
android:text="▼"
android:textSize="28sp" />
</LinearLayout>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:padding="8dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:ellipsize="marquee"
android:textAlignment="inherit"/>

View File

@ -13,6 +13,10 @@
<item name="android:background">@color/black_overlay</item>
</style>
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="windowNoTitle">true</item>
</style>
<style name="ButtonBar">
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingTop">5dp</item>