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
if (ContextCompat.checkSelfPermission(this, $PERMISSION$) | |
!= PackageManager.PERMISSION_GRANTED) { | |
// Permission is not granted | |
// Should we show an explanation? | |
if (ActivityCompat.shouldShowRequestPermissionRationale(this, | |
$PERMISSION$)) { | |
TODO("Show Explainantion if needed") | |
} else { | |
// No explanation needed, we can request the permission. | |
ActivityCompat.requestPermissions(this, |
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
fun launch$POSTFIX$(context: Context, $PARAM1$: $DATATYPE1$, $PARAM2$: $DATATYPE2$) { | |
Intent(context, $TARGETINTENT$::class.java) | |
intent.`package` = context.packageName | |
intent.putExtra($KEY1$, $PARAM1$) | |
intent.putExtra($KEY2$, $PARAM2$) | |
context.startActivity(intent) | |
} |
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
fun get$PREFIX$Intent(context: Context, $PARAM1$: $DATATYPE1$, $PARAM2$: $DATATYPE2$): Intent { | |
Intent(context, $ACTIVITY$::class.java) | |
intent.`package` = context.packageName | |
intent.putExtra($NAME1$, $PARAM1$) | |
intent.putExtra($NAME2$, $PARAM2$) | |
return intent | |
} |
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
class ${NAME}(val list: List<$DataType>) : RecyclerView.Adapter<${NAME}.$Viewholder>() { | |
override fun onCreateViewHolder(container: ViewGroup, viewType: Int): $Viewholder { |
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "") package ${PACKAGE_NAME} #end | |
import android.arch.lifecycle.ViewModel | |
class ${NAME} : ViewModel() { | |
} |
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
<LinearLayout | |
android:layout_width="match_parent" | |
android:id="@+id/$id$" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
</LinearLayout> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:id="@+id/${layoutId}" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
</LinearLayout> | |
<!--${SUBSTITTE}--> it allows to assign value to the required params |