add a Customize Colors settings button

This commit is contained in:
tibbi 2017-01-07 21:28:50 +01:00
parent c399167c12
commit a7356e315e
2 changed files with 17 additions and 18 deletions

View file

@ -2,10 +2,10 @@ package com.simplemobiletools.musicplayer.activities
import android.content.Intent
import android.os.Bundle
import android.support.v4.app.TaskStackBuilder
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.helpers.EQUALIZER
import com.simplemobiletools.musicplayer.helpers.SET_EQUALIZER
@ -16,9 +16,21 @@ class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
}
override fun onResume() {
super.onResume()
setupCustomizeColors()
setupNumericProgress()
setupEqualizer()
updateTextColors(settings_scrollview)
}
private fun setupCustomizeColors() {
settings_customize_colors_holder.setOnClickListener {
startCustomizationActivity()
}
}
private fun setupNumericProgress() {
@ -58,8 +70,4 @@ class SettingsActivity : SimpleActivity() {
}
}
}
private fun restartActivity() {
TaskStackBuilder.create(applicationContext).addNextIntentWithParentStack(intent).startActivities()
}
}

View file

@ -12,30 +12,21 @@
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_dark_theme_holder"
android:id="@+id/settings_customize_colors_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<TextView
android:id="@+id/settings_dark_theme_label"
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/dark_theme"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/settings_dark_theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="@null"
android:clickable="false"/>
android:text="@string/customize_colors"/>
</RelativeLayout>