diff options
author | Allan Wang <me@allanwang.ca> | 2017-08-03 15:18:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 15:18:20 -0700 |
commit | bafc1996d803862d30a2c7d0c402d30c79c4f647 (patch) | |
tree | 5456960a330d7890ac43e1193a80f1db670a8b06 /sample/src/main/kotlin/ca/allanwang/kau | |
parent | 84b9d3b40e342dc7715c5af13d102bb98529b0fb (diff) | |
download | kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.gz kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.tar.bz2 kau-bafc1996d803862d30a2c7d0c402d30c79c4f647.zip |
3.2.2 - Create faq parser and update sample (#19)3.2.3
* Test emulator
* Update readme
* Update fastadapter and about listing
* Make faq parser asynchronous
* Modularize about panels
* Add basis for faq
* Test and finalize the faq panel
* Update readme
* Update changelog
* Remove emulator for now
* Update sample
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang/kau')
3 files changed, 23 insertions, 4 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt index 983544d..78f31ae 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt @@ -14,6 +14,8 @@ class AboutActivity : AboutActivityBase(R.string::class.java, { backgroundColor = 0xfffafafa.toInt() accentColor = 0xff00838F.toInt() cutoutForeground = 0xff18FFFF.toInt() + faqXmlRes = R.xml.kau_faq + faqParseNewLine = false }) { override fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) { diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt index fc4277f..9adabed 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt @@ -8,6 +8,7 @@ import ca.allanwang.kau.kpref.kpref * Created by Allan Wang on 2017-06-07. */ object KPrefSample : KPref() { + var version: Int by kpref("version", -1) var textColor: Int by kpref("TEXT_COLOR", Color.WHITE) var accentColor: Int by kpref("ACCENT_COLOR", 0xffff8900.toInt()) var bgColor: Int by kpref("BG_COLOR", 0xff303030.toInt()) diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt index 4c9107c..62ca8a3 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -6,12 +6,11 @@ import android.view.Menu import android.view.MenuItem import ca.allanwang.kau.about.kauLaunchAbout import ca.allanwang.kau.email.sendEmail - -import ca.allanwang.kau.mediapicker.kauLaunchMediaPicker -import ca.allanwang.kau.mediapicker.kauOnMediaPickerResult import ca.allanwang.kau.kpref.activity.CoreAttributeContract import ca.allanwang.kau.kpref.activity.KPrefActivity import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder +import ca.allanwang.kau.mediapicker.kauLaunchMediaPicker +import ca.allanwang.kau.mediapicker.kauOnMediaPickerResult import ca.allanwang.kau.searchview.SearchItem import ca.allanwang.kau.searchview.SearchView import ca.allanwang.kau.searchview.bindSearchView @@ -20,6 +19,7 @@ import ca.allanwang.kau.utils.materialDialog import ca.allanwang.kau.utils.navigationBarColor import ca.allanwang.kau.utils.startActivity import ca.allanwang.kau.utils.toast +import ca.allanwang.kau.xml.showChangelog import com.mikepenz.google_material_typeface_library.GoogleMaterial @@ -206,7 +206,18 @@ class MainActivity : KPrefActivity() { bgCanvas.set(KPrefSample.bgColor) toolbarCanvas.set(KPrefSample.accentColor) this.navigationBarColor = KPrefSample.accentColor - + if (KPrefSample.version < BuildConfig.VERSION_CODE) { + KPrefSample.version = BuildConfig.VERSION_CODE + showChangelog(R.xml.kau_changelog, KPrefSample.textColor) { + titleColor(KPrefSample.textColor) + backgroundColor(KPrefSample.bgColor) + positiveColor(KPrefSample.accentColor) + } + } + supportActionBar?.apply { + setDisplayHomeAsUpEnabled(false) + setDisplayShowHomeEnabled(false) + } } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -237,6 +248,11 @@ class MainActivity : KPrefActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { + R.id.action_changelog -> showChangelog(R.xml.kau_changelog, KPrefSample.textColor) { + titleColor(KPrefSample.textColor) + backgroundColor(KPrefSample.bgColor) + positiveColor(KPrefSample.accentColor) + } R.id.action_settings -> startActivity(AnimActivity::class.java) R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject) else -> return super.onOptionsItemSelected(item) |