Skip to content

Instantly share code, notes, and snippets.

@IkhwanSI13
Created May 10, 2020 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IkhwanSI13/fa5b17e91183979e4f653ca7549ddc34 to your computer and use it in GitHub Desktop.
Save IkhwanSI13/fa5b17e91183979e4f653ca7549ddc34 to your computer and use it in GitHub Desktop.
Activity template with MVP pattern
package ${escapeKotlinIdentifiers(packageName)}
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class ${mvpClass}Activity : AppCompatActivity(), ${mvpClass}Contract.View {
lateinit var presenter: ${mvpClass}Presenter
companion object {
fun startThisActivity(context: Context) {
val intent = Intent(context, ${mvpClass}Activity::class.java)
context.startActivity(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.${layoutName})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment