Last active
May 29, 2020 07:54
-
-
Save ktvipin27/24f1c27d807cf1f7f7ea319879c45ec3 to your computer and use it in GitHub Desktop.
Demo files created using Android studio template engine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout 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"> | |
<data> | |
<variable | |
name="viewModel" | |
type="com.ktvipin.templatedemo.demo.DemoViewModel" /> | |
</data> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.ktvipin.templatedemo.demo.DemoActivity"> | |
</androidx.constraintlayout.widget.ConstraintLayout> | |
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ktvipin.templatedemo.demo | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Bundle | |
import com.ktvipin.templatedemo.R | |
import com.ktvipin.templatedemo.core.BaseActivity | |
import com.ktvipin.templatedemo.databinding.ActivityDemoBinding | |
class DemoActivity : BaseActivity<ActivityDemoBinding, DemoViewModel>() { | |
override val layoutId: Int | |
get() = R.layout.activity_demo | |
override val viewModelClass: Class<DemoViewModel> | |
get() = DemoViewModel::class.java | |
override fun onCreated(savedInstanceState: Bundle?, extras: Bundle?) { | |
super.onCreated(savedInstanceState, extras) | |
} | |
companion object { | |
fun start(context: Context) { | |
context.startActivity((Intent(context, DemoActivity::class.java))) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ktvipin.templatedemo.demo | |
import android.os.Bundle | |
import com.ktvipin.templatedemo.core.BaseViewModel | |
class DemoViewModel : BaseViewModel() { | |
override fun onActivityCreated(extras: Bundle?) { | |
super.onActivityCreated(extras) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment