forked from davidmigloz/number-keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when unsetting key background (by setting it to 0). Allow setting the layout for the keyboard view itself in xml as attribute "layout". Add getters for keyboard and popupwindow instances to NumberKeyboardPopup Sample: Update sample to include AOSP style keyboard via "layout" attribute.
- Loading branch information
1 parent
68c00d7
commit 36a355e
Showing
6 changed files
with
290 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
266 changes: 266 additions & 0 deletions
266
sample/src/main/res/layout/number_keyboard_4rows_aosp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,266 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<merge | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key1Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key4Container" | ||
app:layout_constraintEnd_toStartOf="@+id/key2Container" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
<TextView | ||
android:id="@+id/key1" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/one"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key2Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key5Container" | ||
app:layout_constraintEnd_toStartOf="@+id/key3Container" | ||
app:layout_constraintStart_toEndOf="@+id/key1Container" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
<TextView | ||
android:id="@+id/key2" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/two"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key3Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key6Container" | ||
app:layout_constraintEnd_toStartOf="@+id/modifier1Container" | ||
app:layout_constraintStart_toEndOf="@+id/key2Container" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
<TextView | ||
android:id="@+id/key3" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/three"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/modifier1Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key6Container" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/key3Container" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
<TextView | ||
android:id="@+id/keyModifier1" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/minus"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key4Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key7Container" | ||
app:layout_constraintEnd_toStartOf="@+id/key5Container" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/key1Container"> | ||
|
||
<TextView | ||
android:id="@+id/key4" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/four"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key5Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key8Container" | ||
app:layout_constraintEnd_toStartOf="@+id/key6Container" | ||
app:layout_constraintStart_toEndOf="@+id/key4Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key2Container"> | ||
|
||
<TextView | ||
android:id="@+id/key5" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/five"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key6Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key9Container" | ||
app:layout_constraintEnd_toStartOf="@+id/modifier2Container" | ||
app:layout_constraintStart_toEndOf="@+id/key5Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key3Container"> | ||
|
||
<TextView | ||
android:id="@+id/key6" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/six"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/modifier2Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key9Container" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/key6Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key3Container"> | ||
|
||
<TextView | ||
android:id="@+id/keyModifier2" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/comma"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key7Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/leftAuxBtnContainer" | ||
app:layout_constraintEnd_toStartOf="@+id/key8Container" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/key4Container"> | ||
|
||
<TextView | ||
android:id="@+id/key7" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/seven"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key8Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/key0Container" | ||
app:layout_constraintEnd_toStartOf="@+id/key9Container" | ||
app:layout_constraintStart_toEndOf="@+id/key7Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key5Container"> | ||
|
||
<TextView | ||
android:id="@+id/key8" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/eight"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key9Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/rightAuxBtnContainer" | ||
app:layout_constraintEnd_toStartOf="@+id/modifier3Container" | ||
app:layout_constraintStart_toEndOf="@+id/key8Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key6Container"> | ||
|
||
<TextView | ||
android:id="@+id/key9" | ||
style="@style/keyNoBg" | ||
android:padding="0dp" | ||
android:text="@string/nine"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/modifier3Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toTopOf="@+id/rightAuxBtnContainer" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/key9Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key6Container"> | ||
|
||
<ImageView | ||
android:id="@+id/buttonModifier3" | ||
style="@style/keyNoBg" | ||
android:scaleType="center" | ||
app:srcCompat="@drawable/ic_backspace"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/leftAuxBtnContainer" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toStartOf="@+id/key0Container" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/key7Container"> | ||
|
||
<ImageView | ||
android:id="@+id/leftAuxBtn" | ||
style="@style/keyNoBg" | ||
android:scaleType="center" | ||
app:srcCompat="@drawable/ic_fingerprint"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/key0Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toStartOf="@+id/rightAuxBtnContainer" | ||
app:layout_constraintStart_toEndOf="@+id/leftAuxBtnContainer" | ||
app:layout_constraintTop_toBottomOf="@+id/key8Container"> | ||
|
||
<TextView | ||
android:id="@+id/key0" | ||
style="@style/keyNoBg" | ||
android:text="@string/zero"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/rightAuxBtnContainer" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toStartOf="@+id/modifier4Container" | ||
app:layout_constraintStart_toEndOf="@+id/key0Container" | ||
app:layout_constraintTop_toBottomOf="@+id/key9Container"> | ||
|
||
<ImageView | ||
android:id="@+id/rightAuxBtn" | ||
style="@style/keyNoBg" | ||
android:scaleType="center" | ||
app:srcCompat="@drawable/ic_backspace"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
|
||
<com.davidmiguel.numberkeyboard.SquareFrameLayout | ||
android:id="@+id/modifier4Container" | ||
style="@style/keyContainer" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/rightAuxBtnContainer" | ||
app:layout_constraintTop_toBottomOf="@+id/key9Container"> | ||
|
||
<ImageView | ||
android:id="@+id/buttonModifier4" | ||
style="@style/keyNoBg" | ||
android:scaleType="center" | ||
app:srcCompat="@drawable/ic_check_circle"/> | ||
|
||
</com.davidmiguel.numberkeyboard.SquareFrameLayout> | ||
</merge> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters