added dialpad button to choose between text and phone number soft keyboard
This commit is contained in:
@ -8,7 +8,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode = 29
|
||||
versionName = '3.1.2'
|
||||
versionName = '3.2.0'
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cFlags '-DHAVE_INTTYPES_H'
|
||||
|
||||
@ -22,6 +22,7 @@ import android.support.v4.content.LocalBroadcastManager
|
||||
import android.support.v7.view.menu.ActionMenuItemView
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.text.Editable
|
||||
import android.text.InputType
|
||||
import android.text.TextWatcher
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.*
|
||||
@ -46,6 +47,7 @@ class MainActivity : AppCompatActivity() {
|
||||
internal lateinit var contactsButton: ImageButton
|
||||
internal lateinit var messagesButton: ImageButton
|
||||
internal lateinit var callsButton: ImageButton
|
||||
internal lateinit var dialpadButton: ImageButton
|
||||
internal lateinit var dtmf: EditText
|
||||
internal lateinit var uaAdapter: UaSpinnerAdapter
|
||||
internal lateinit var aorSpinner: Spinner
|
||||
@ -86,6 +88,7 @@ class MainActivity : AppCompatActivity() {
|
||||
contactsButton = findViewById(R.id.contactsButton) as ImageButton
|
||||
messagesButton = findViewById(R.id.messagesButton) as ImageButton
|
||||
callsButton = findViewById(R.id.callsButton) as ImageButton
|
||||
dialpadButton = findViewById(R.id.dialpadButton) as ImageButton
|
||||
|
||||
am = getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
val rtUri = RingtoneManager.getActualDefaultRingtoneUri(applicationContext,
|
||||
@ -345,6 +348,20 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
dialpadButton.tag = "off"
|
||||
dialpadButton.setOnClickListener {
|
||||
if (dialpadButton.tag == "off") {
|
||||
callUri.inputType = InputType.TYPE_CLASS_PHONE
|
||||
dialpadButton.setImageResource(R.drawable.dialpad_on)
|
||||
dialpadButton.tag = "on"
|
||||
} else {
|
||||
callUri.inputType = InputType.TYPE_CLASS_TEXT +
|
||||
InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
|
||||
dialpadButton.setImageResource(R.drawable.dialpad_off)
|
||||
dialpadButton.tag = "off"
|
||||
}
|
||||
}
|
||||
|
||||
baresipService = Intent(this@MainActivity, BaresipService::class.java)
|
||||
if (!BaresipService.IS_SERVICE_RUNNING) {
|
||||
baresipService.setAction("Start")
|
||||
|
||||
5
app/src/main/res/drawable/dialpad_off.xml
Normal file
5
app/src/main/res/drawable/dialpad_off.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="40dp" android:tint="#00ACC1"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/dialpad_on.xml
Normal file
5
app/src/main/res/drawable/dialpad_on.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="40dp" android:tint="#04B404"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
|
||||
</vector>
|
||||
@ -94,7 +94,6 @@
|
||||
android:visibility="invisible" >
|
||||
</ImageButton>
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/answerButton"
|
||||
android:layout_width="wrap_content"
|
||||
@ -190,8 +189,20 @@
|
||||
android:padding="0dp"
|
||||
android:background="@null"
|
||||
android:src="@drawable/calls"
|
||||
android:layout_toStartOf="@id/dialpadButton"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_alignParentBottom="true" >
|
||||
</ImageButton>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/dialpadButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@drawable/dialpad_off"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_alignParentEnd="true" >
|
||||
</ImageButton>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user