diff options
Diffstat (limited to 'sample/src/main/kotlin/ca')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt | 34 | ||||
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 9 |
2 files changed, 42 insertions, 1 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 new file mode 100644 index 0000000..574922d --- /dev/null +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt @@ -0,0 +1,34 @@ +package ca.allanwang.kau.sample + +import android.os.Bundle +import android.os.PersistableBundle +import ca.allanwang.kau.about.AboutActivityBase +import ca.allanwang.kau.about.MainItem +import ca.allanwang.kau.utils.string +import com.mikepenz.fastadapter.adapters.HeaderAdapter + +/** + * Created by Allan Wang on 2017-06-27. + */ +class AboutActivity : AboutActivityBase(R.string::class.java) { + + val mainHeader = HeaderAdapter<MainItem>() + +// override fun onCreateSections(): List<Pair<String, HeaderAdapter<*>>> = listOf( +// String.format(string(R.string.kau_about_x), "KAU") to mainHeader +// ) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) +// mainHeader.add(MainItem { +// title = string(R.string.app_name) +// author = "Allan Wang" +// version = BuildConfig.VERSION_NAME +// }) + } + + override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { + super.onPostCreate(savedInstanceState, persistentState) + recycler.adapter.notifyDataSetChanged() + } +}
\ 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 3cd714e..d8e7e33 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -3,6 +3,7 @@ package ca.allanwang.kau.sample import android.os.Bundle import android.view.Menu import android.view.MenuItem +import ca.allanwang.kau.about.AboutActivityBase import ca.allanwang.kau.email.sendEmail import ca.allanwang.kau.kpref.CoreAttributeContract import ca.allanwang.kau.kpref.KPrefActivity @@ -146,7 +147,13 @@ class MainActivity : KPrefActivity() { descRes = R.string.sub_item_desc } - plainText(R.string.kau_lorem_ipsum) + plainText(R.string.kau_lorem_ipsum) { + onClick = { + _, _, _ -> + startActivity(AboutActivity::class.java) + false + } + } } |