aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'sample/src/main/kotlin')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt47
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity2.kt10
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt2
3 files changed, 1 insertions, 58 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 2e4106f..e97c530 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
@@ -1,57 +1,10 @@
package ca.allanwang.kau.sample
-import android.os.Bundle
-import android.os.Handler
import ca.allanwang.kau.about.AboutActivityBase
-import ca.allanwang.kau.about.MainItem
-import ca.allanwang.kau.adapters.SectionAdapter
-import ca.allanwang.kau.logging.KL
-import ca.allanwang.kau.utils.string
/**
* Created by Allan Wang on 2017-06-27.
*/
class AboutActivity : AboutActivityBase(R.string::class.java) {
- val mainHeader = SectionAdapter<MainItem>()
-
- override fun onCreateSections(): List<Pair<String, SectionAdapter<*>>> = listOf(
- // libSection,
- String.format(string(R.string.kau_about_x), "KAU") to mainHeader
- )
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- sectionsChain.baseAdapter.withPositionBasedStateManagement(false)
- }
-
- override fun onPostCreate() {
- Handler().postDelayed({
- mainHeader.add(MainItem {
- title = string(R.string.app_name)
- author = "Allan Wang"
- version = BuildConfig.VERSION_NAME
- })
- mainHeader.add(MainItem {
- title = string(R.string.app_name)
- author = "Allan Wang"
- version = BuildConfig.VERSION_NAME
- })
- mainHeader.add(MainItem { })
- mainHeader.add(MainItem { })
- KL.e(R.layout.kau_about_item_library.toString())
- KL.e(R.layout.kau_about_item_main.toString())
- KL.e(R.id.kau_item_about_library.toString())
- KL.e(R.id.kau_item_about_main.toString())
-// KL.e(sectionsChain.baseAdapter.getItemViewType(0).toString())
-// KL.e(sectionsChain.baseAdapter.getItemViewType(6).toString())
- with(sectionsChain.baseAdapter) {
- KL.e(mainHeader.adapterItemCount.toString())
- KL.e(getAdapter(1)?.getGlobalPosition(0)?.toString() ?: "")
- KL.e((getItem(0) is MainItem).toString())
- KL.e((getItem(6) is MainItem).toString())
-// KL.e((getItem(6) is MainItem).toString())
- }
- }, 2000)
- }
} \ No newline at end of file
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity2.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity2.kt
deleted file mode 100644
index 0e2a3fb..0000000
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity2.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package ca.allanwang.kau.sample
-
-import ca.allanwang.kau.about.AboutActivityBase
-
-/**
- * Created by Allan Wang on 2017-06-27.
- */
-class AboutActivity2 : AboutActivityBase(R.string::class.java) {
-
-} \ No newline at end of file
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 46c5968..53fa68e 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -149,7 +149,7 @@ class MainActivity : KPrefActivity() {
plainText(R.string.kau_lorem_ipsum) {
onClick = {
_, _, _ ->
- startActivity(AboutActivity2::class.java, transition = true)
+ startActivity(AboutActivity::class.java, transition = true)
false
}
}