mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
use icons for profile edit appbar
to use same design as for conversation info editing Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
260452234b
commit
0b5f38f232
@ -40,6 +40,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toFile
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -203,8 +204,10 @@ class ProfileActivity : BaseActivity() {
|
||||
menu.findItem(R.id.edit).isVisible = editableFields.size > 0
|
||||
if (edit) {
|
||||
menu.findItem(R.id.edit).setTitle(R.string.save)
|
||||
menu.findItem(R.id.edit).icon = ContextCompat.getDrawable(this, R.drawable.ic_check)
|
||||
} else {
|
||||
menu.findItem(R.id.edit).setTitle(R.string.edit)
|
||||
menu.findItem(R.id.edit).icon = ContextCompat.getDrawable(this, R.drawable.ic_edit)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@ -217,6 +220,7 @@ class ProfileActivity : BaseActivity() {
|
||||
edit = !edit
|
||||
if (edit) {
|
||||
item.setTitle(R.string.save)
|
||||
item.icon = ContextCompat.getDrawable(this, R.drawable.ic_check)
|
||||
binding.emptyList.root.visibility = View.GONE
|
||||
binding.userinfoList.visibility = View.VISIBLE
|
||||
if (CapabilitiesUtilNew.isAvatarEndpointAvailable(currentUser!!)) {
|
||||
@ -250,6 +254,8 @@ class ProfileActivity : BaseActivity() {
|
||||
})
|
||||
} else {
|
||||
item.setTitle(R.string.edit)
|
||||
item.icon = ContextCompat.getDrawable(this, R.drawable.ic_edit)
|
||||
|
||||
binding.avatarButtons.visibility = View.INVISIBLE
|
||||
if (adapter!!.filteredDisplayList.isEmpty()) {
|
||||
binding.emptyList.root.visibility = View.VISIBLE
|
||||
|
@ -21,8 +21,11 @@
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/edit"
|
||||
android:icon="@drawable/ic_edit"
|
||||
android:title="@string/edit"
|
||||
app:showAsAction="ifRoom" />
|
||||
app:showAsAction="ifRoom"
|
||||
app:iconTint="@color/high_emphasis_text"/>
|
||||
</menu>
|
||||
|
Loading…
Reference in New Issue
Block a user