add some customization menu items

This commit is contained in:
tibbi 2016-12-15 19:11:49 +01:00
parent 46cce1e41d
commit 31c8fd3bda
7 changed files with 44 additions and 0 deletions

View file

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

View 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>