add some customization menu items
This commit is contained in:
parent
46cce1e41d
commit
31c8fd3bda
7 changed files with 44 additions and 0 deletions
|
@ -2,6 +2,8 @@ package com.simplemobiletools.commons.activities
|
|||
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.extensions.getContrastColor
|
||||
|
@ -23,6 +25,34 @@ class CustomizationActivity : BaseSimpleActivity() {
|
|||
customization_primary_color_holder.setOnClickListener { pickPrimaryColor() }
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_customization, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return when (item.itemId) {
|
||||
R.id.undo -> {
|
||||
undoChanges()
|
||||
true
|
||||
}
|
||||
R.id.save -> {
|
||||
saveChanges()
|
||||
true
|
||||
}
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
private fun saveChanges() {
|
||||
|
||||
}
|
||||
|
||||
private fun undoChanges() {
|
||||
|
||||
}
|
||||
|
||||
private fun setupColorsPickers() {
|
||||
customization_text_color.setBackgroundColor(baseConfig.textColor)
|
||||
customization_primary_color.setBackgroundColor(baseConfig.primaryColor)
|
||||
|
|
BIN
library/src/main/res/drawable-hdpi/ic_cross.png
Normal file
BIN
library/src/main/res/drawable-hdpi/ic_cross.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 416 B |
BIN
library/src/main/res/drawable-mdpi/ic_cross.png
Normal file
BIN
library/src/main/res/drawable-mdpi/ic_cross.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 255 B |
BIN
library/src/main/res/drawable-xhdpi/ic_cross.png
Normal file
BIN
library/src/main/res/drawable-xhdpi/ic_cross.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 396 B |
BIN
library/src/main/res/drawable-xxhdpi/ic_cross.png
Normal file
BIN
library/src/main/res/drawable-xxhdpi/ic_cross.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 778 B |
BIN
library/src/main/res/drawable-xxxhdpi/ic_cross.png
Normal file
BIN
library/src/main/res/drawable-xxxhdpi/ic_cross.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 579 B |
14
library/src/main/res/menu/menu_customization.xml
Normal file
14
library/src/main/res/menu/menu_customization.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?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/undo"
|
||||
android:icon="@drawable/ic_cross"
|
||||
android:title="@string/undo_changes"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/save"
|
||||
android:icon="@drawable/ic_check"
|
||||
android:title="@string/save"
|
||||
app:showAsAction="ifRoom"/>
|
||||
</menu>
|
Loading…
Reference in a new issue