Build phone number picker

This commit is contained in:
moezbhatti
2019-11-07 02:44:19 -05:00
committed by Moez Bhatti
parent 058d12d3bb
commit bb816209ba
21 changed files with 531 additions and 28 deletions
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.moez.QKSMS.common.widget.RadioPreferenceView
android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:summary="Mobile"
tools:title="(123) 456-7890" />
</FrameLayout>
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
android:orientation="vertical">
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginTop="16dp"
android:layout_marginRight="24dp"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:textSize="dialog"
tools:text="Choose a phone number"
tools:visibility="visible" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginTop="2dp"
android:layout_marginRight="24dp"
android:textColor="?android:attr/textColorPrimary"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/title"
app:textSize="primary"
tools:text="Moez Bhatti"
tools:visibility="visible" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/subtitle"
tools:itemCount="2"
tools:listitem="@layout/phone_number_list_item"
tools:visibility="visible" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/positiveButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackground"
android:padding="16dp"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/list"
app:layout_goneMarginRight="8dp"
app:textSize="secondary"
tools:text="Always"
tools:visibility="visible" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/negativeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="?attr/selectableItemBackground"
android:padding="16dp"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@id/positiveButton"
app:layout_constraintTop_toBottomOf="@id/list"
app:textSize="secondary"
tools:text="Just once"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -98,6 +98,10 @@
<item>Delete</item>
</string-array>
<string name="compose_number_picker_title">Choose a phone number</string>
<string name="compose_number_picker_default">%s ∙ Default</string>
<string name="compose_number_picker_once">Just once</string>
<string name="compose_number_picker_always">Always</string>
<string name="compose_title_selected">%d selected</string>
<string name="compose_subtitle_results">%1$d of %2$d results</string>
<string name="compose_send_group_title">Send as group message</string>