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 | |
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')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt | 2 | ||||
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt | 1 | ||||
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 24 | ||||
-rw-r--r-- | sample/src/main/res/menu/menu_main.xml | 16 | ||||
-rw-r--r-- | sample/src/main/res/xml/kau_changelog.xml | 13 | ||||
-rw-r--r-- | sample/src/main/res/xml/kau_faq.xml | 14 |
6 files changed, 53 insertions, 17 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) diff --git a/sample/src/main/res/menu/menu_main.xml b/sample/src/main/res/menu/menu_main.xml index 039c2c9..f8933f3 100644 --- a/sample/src/main/res/menu/menu_main.xml +++ b/sample/src/main/res/menu/menu_main.xml @@ -1,13 +1,19 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" - tools:context="com.pitchedapps.myapplication.MainActivity"> + tools:context="ca.allanwang.kau.sample.MainActivity"> <item android:id="@+id/action_search" android:orderInCategory="90" android:title="@string/kau_search" - app:showAsAction="always|collapseActionView" /> + app:showAsAction="always" /> + + <item + android:id="@+id/action_changelog" + android:orderInCategory="95" + android:title="@string/kau_changelog" + app:showAsAction="never" /> <item android:id="@+id/action_settings" @@ -21,11 +27,5 @@ android:title="@string/kau_send_feedback" app:showAsAction="never" /> - <item - android:id="@+id/test" - android:orderInCategory="300" - android:title="Test" - app:showAsAction="never" /> - </menu> diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index db6a504..df6ec2b 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,14 +6,17 @@ <item text="" /> --> - <version title="v3.2.2"/> - <item text=":core: Add simple KauBaseActivity so that activities extending AppCompatActivity can have some default kau helpers implemented" /> - <item text=":core: The permission manager will now notify you if you try to request a permission that isn\'t added to your manifest" /> + <version title="v3.2.3"/> + <item text=":about: Modularize everything" /> + <item text=":about: Create faq panel" /> <item text=":core: Create faq parser" /> + <item text=":core: Create collapsible view delegate" /> <item text=":mediapicker: Allow for prefetching by default for videos" /> + + <version title="v3.2.2"/> + <item text=":core: Add simple KauBaseActivity so that activities extending AppCompatActivity can have some default kau helpers implemented" /> + <item text=":core: The permission manager will now notify you if you try to request a permission that isn\'t added to your manifest" /> <item text="Begin writing android tests" /> - <item text="" /> - <item text="" /> <version title="v3.2.1"/> <item text=":core: Remove requestLayout call from setMargin and setPadding" /> diff --git a/sample/src/main/res/xml/kau_faq.xml b/sample/src/main/res/xml/kau_faq.xml new file mode 100644 index 0000000..5230a31 --- /dev/null +++ b/sample/src/main/res/xml/kau_faq.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <question>This is a FAQ question</question> + <answer>This is a FAQ answer</answer> + <question><![CDATA[Supports <b>HTML</b> <i>tags</i>]]></question> + <answer><![CDATA[Both <u>questions</u> and <u>answers</u> are automatically parsed with <b>HTML</b>]]></answer> + <question>Links</question> + <answer><![CDATA[<ul> + <li><a href="https://github.com/AllanWang/KAU">Github</a><li> + <li><a href="https://allanwang.github.io/KAU">Page</a><li> + <li><a href="https://play.google.com/store/apps/details?id=ca.allanwang.kau.sample&utm_source=sample">Play Store</a><li> + </ul>]]></answer> +</resources>
\ No newline at end of file |