replaced account menu with save (check) icon
This commit is contained in:
@@ -116,14 +116,14 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
super.onCreateOptionsMenu(menu)
|
super.onCreateOptionsMenu(menu)
|
||||||
val inflater = menuInflater
|
val inflater = menuInflater
|
||||||
inflater.inflate(R.menu.edit_menu, menu)
|
inflater.inflate(R.menu.check_icon, menu)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
val intent = Intent(this, MainActivity::class.java)
|
|
||||||
when (item.itemId) {
|
if (item.itemId == R.id.checkIcon) {
|
||||||
R.id.save -> {
|
|
||||||
val dn = displayName.text.toString().trim()
|
val dn = displayName.text.toString().trim()
|
||||||
if (dn != acc.displayName) {
|
if (dn != acc.displayName) {
|
||||||
if (checkDisplayName(dn)) {
|
if (checkDisplayName(dn)) {
|
||||||
@@ -218,7 +218,7 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
val ac = ArrayList(LinkedHashSet<String>(newCodecs.filter{it != ""} as ArrayList<String>))
|
val ac = ArrayList(LinkedHashSet<String>(newCodecs.filter { it != "" } as ArrayList<String>))
|
||||||
if (ac != acc.audioCodec) {
|
if (ac != acc.audioCodec) {
|
||||||
Log.d("Baresip", "New codecs ${newCodecs.filter { it != "" }}")
|
Log.d("Baresip", "New codecs ${newCodecs.filter { it != "" }}")
|
||||||
val acParam = ";audio_codecs=" + Utils.implode(ac, ",")
|
val acParam = ";audio_codecs=" + Utils.implode(ac, ",")
|
||||||
@@ -260,19 +260,9 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
setResult(RESULT_OK, intent)
|
setResult(RESULT_OK, intent)
|
||||||
finish()
|
finish()
|
||||||
return true
|
return true
|
||||||
}
|
|
||||||
R.id.cancel, android.R.id.home -> {
|
} else
|
||||||
intent.putExtra("action", "cancel")
|
return super.onOptionsItemSelected(item)
|
||||||
if (acc.regint > 0) {
|
|
||||||
Log.d("Baresip", "Registering ${acc.aor}")
|
|
||||||
UserAgent.ua_register(Account.findUA(acc.aor)!!.uap)
|
|
||||||
}
|
|
||||||
setResult(RESULT_OK, intent)
|
|
||||||
finish()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkDisplayName(dn: String): Boolean {
|
private fun checkDisplayName(dn: String): Boolean {
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 294 B |
Binary file not shown.
|
After Width: | Height: | Size: 154 B |
Binary file not shown.
|
After Width: | Height: | Size: 238 B |
Binary file not shown.
|
After Width: | Height: | Size: 444 B |
Binary file not shown.
|
After Width: | Height: | Size: 374 B |
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/checkIcon"
|
||||||
|
android:title=""
|
||||||
|
app:showAsAction="always"
|
||||||
|
android:icon="@drawable/ic_action_check"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</menu>
|
||||||
Reference in New Issue
Block a user