add Settings activity content

This commit is contained in:
tibbi 2016-12-09 20:49:53 +01:00
parent 7dd27f51b9
commit 4bc87a5065
1 changed files with 19 additions and 0 deletions

View File

@ -1,9 +1,28 @@
package com.simplemobiletools.thankyou.activities
import android.os.Bundle
import android.support.v4.app.TaskStackBuilder
import com.simplemobiletools.thankyou.R
import kotlinx.android.synthetic.main.activity_settings.*
class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
setupDarkTheme()
}
private fun setupDarkTheme() {
settings_dark_theme.isChecked = mConfig.isDarkTheme
settings_dark_theme_holder.setOnClickListener {
settings_dark_theme.toggle()
mConfig.isDarkTheme = settings_dark_theme.isChecked
restartActivity()
}
}
private fun restartActivity() {
TaskStackBuilder.create(applicationContext).addNextIntentWithParentStack(intent).startActivities()
}
}