mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-07 15:41:38 +01:00
50 lines
1.5 KiB
Plaintext
50 lines
1.5 KiB
Plaintext
|
package ${escapeKotlinIdentifiers(packageName)}
|
||
|
|
||
|
import android.content.Context
|
||
|
import android.content.Intent
|
||
|
import androidx.appcompat.widget.Toolbar
|
||
|
import im.vector.riotx.R
|
||
|
import im.vector.riotx.core.extensions.addFragment
|
||
|
import im.vector.riotx.core.platform.ToolbarConfigurable
|
||
|
import im.vector.riotx.core.platform.VectorBaseActivity
|
||
|
|
||
|
//TODO: add this activity to manifest
|
||
|
class ${activityClass} : VectorBaseActivity(), ToolbarConfigurable {
|
||
|
|
||
|
companion object {
|
||
|
|
||
|
<#if createFragmentArgs>
|
||
|
private const val EXTRA_FRAGMENT_ARGS = "EXTRA_FRAGMENT_ARGS"
|
||
|
|
||
|
fun newIntent(context: Context, args: ${fragmentArgsClass}): Intent {
|
||
|
return Intent(context, ${activityClass}::class.java).apply {
|
||
|
putExtra(EXTRA_FRAGMENT_ARGS, args)
|
||
|
}
|
||
|
}
|
||
|
<#else>
|
||
|
fun newIntent(context: Context): Intent {
|
||
|
return Intent(context, ${activityClass}::class.java)
|
||
|
}
|
||
|
</#if>
|
||
|
}
|
||
|
|
||
|
override fun getLayoutRes() = R.layout.activity_simple
|
||
|
|
||
|
override fun initUiAndData() {
|
||
|
if (isFirstCreation()) {
|
||
|
<#if createFragmentArgs>
|
||
|
val fragmentArgs: ${fragmentArgsClass} = intent?.extras?.getParcelable(EXTRA_FRAGMENT_ARGS)
|
||
|
?: return
|
||
|
addFragment(R.id.simpleFragmentContainer, ${fragmentClass}::class.java, fragmentArgs)
|
||
|
<#else>
|
||
|
addFragment(R.id.simpleFragmentContainer, ${fragmentClass}::class.java)
|
||
|
</#if>
|
||
|
}
|
||
|
}
|
||
|
|
||
|
override fun configure(toolbar: Toolbar) {
|
||
|
configureToolbar(toolbar)
|
||
|
}
|
||
|
|
||
|
}
|