Created
May 10, 2020 09:46
-
-
Save IkhwanSI13/fa5b17e91183979e4f653ca7549ddc34 to your computer and use it in GitHub Desktop.
Activity template with MVP pattern
This file contains hidden or 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 ${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