adding some dialpad numbers and symbols

This commit is contained in:
tibbi 2018-09-22 23:35:34 +02:00
parent 872a7f19d4
commit 9ab4f3ea7f
5 changed files with 184 additions and 1 deletions

View File

@ -1,11 +1,30 @@
package com.simplemobiletools.contacts.activities
import android.os.Bundle
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.contacts.R
import kotlinx.android.synthetic.main.activity_dialpad.*
class DialpadActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_dialpad)
dialpad_0.setOnClickListener { }
dialpad_1.setOnClickListener { }
dialpad_2.setOnClickListener { }
dialpad_3.setOnClickListener { }
dialpad_4.setOnClickListener { }
dialpad_5.setOnClickListener { }
dialpad_6.setOnClickListener { }
dialpad_7.setOnClickListener { }
dialpad_8.setOnClickListener { }
dialpad_9.setOnClickListener { }
dialpad_asterisk.setOnClickListener { }
dialpad_hashtag.setOnClickListener { }
}
override fun onResume() {
super.onResume()
updateTextColors(dialpad_wrapper)
}
}

View File

@ -1,8 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialpad_holder"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dialpad_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/dialpad_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginLeft="@dimen/activity_margin"
android:layout_marginRight="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_1"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="1"
app:layout_constraintBottom_toTopOf="@+id/dialpad_4"
app:layout_constraintEnd_toStartOf="@+id/dialpad_2"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_2"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="2"
app:layout_constraintBottom_toTopOf="@+id/dialpad_5"
app:layout_constraintEnd_toStartOf="@+id/dialpad_3"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_1"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_3"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="3"
app:layout_constraintBottom_toTopOf="@+id/dialpad_6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_2"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_4"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="4"
app:layout_constraintBottom_toTopOf="@+id/dialpad_7"
app:layout_constraintEnd_toStartOf="@+id/dialpad_5"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_5"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="5"
app:layout_constraintBottom_toTopOf="@+id/dialpad_8"
app:layout_constraintEnd_toStartOf="@+id/dialpad_6"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_4"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_6"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="6"
app:layout_constraintBottom_toTopOf="@+id/dialpad_9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_5"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_7"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="7"
app:layout_constraintBottom_toTopOf="@+id/dialpad_asterisk"
app:layout_constraintEnd_toStartOf="@+id/dialpad_8"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_8"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="8"
app:layout_constraintBottom_toTopOf="@+id/dialpad_0"
app:layout_constraintEnd_toStartOf="@+id/dialpad_9"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_7"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_9"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="9"
app:layout_constraintBottom_toTopOf="@+id/dialpad_hashtag"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_8"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_asterisk"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="*"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/dialpad_0"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="0dp"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_0"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/dialpad_hashtag"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_asterisk"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialpad_hashtag"
style="@style/DialpadNumberStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/dialpad_0"/>
</android.support.constraint.ConstraintLayout>
</RelativeLayout>

View File

@ -0,0 +1,7 @@
<resources>
<style name="DialpadNumberStyle" parent="DialpadNumberStyle.Base">
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
</style>
</resources>

View File

@ -5,4 +5,5 @@
<dimen name="contact_icons_size">40dp</dimen>
<dimen name="contact_item_height">52dp</dimen>
<dimen name="dialpad_button_size">60dp</dimen>
<dimen name="dialpad_text_size">44sp</dimen>
</resources>

View File

@ -2,4 +2,15 @@
<style name="AppTheme" parent="AppTheme.Base"/>
<style name="DialpadNumberStyle.Base">
<item name="android:gravity">center</item>
<item name="android:paddingBottom">@dimen/activity_margin</item>
<item name="android:paddingTop">@dimen/activity_margin</item>
<item name="android:textSize">@dimen/dialpad_text_size</item>
</style>
<style name="DialpadNumberStyle" parent="DialpadNumberStyle.Base">
<item name="android:background">?attr/selectableItemBackground</item>
</style>
</resources>