Skip to content

Instantly share code, notes, and snippets.

kishansinh parmar kishansinhparmar

Block or report user

Report or block kishansinhparmar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SingleLiveEvent
class SingleLiveEvent<T> : MutableLiveData<T>() {
private val mPending = AtomicBoolean(false)
override fun observe(owner: LifecycleOwner, observer: Observer<in T>) {
if (hasActiveObservers()) {
Log.w(TAG, "Multiple observers registered but only one will be notified of changes.");
View recyclerviewadapter
class $CLASS_NAME$Adapter(private var list: MutableList<$DT$>) :
RecyclerView.Adapter<$CLASS_NAME$Adapter.$CLASS_NAME$ViewHolder>() {
override fun getItemCount() = list.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): $CLASS_NAME$ViewHolder {
return $CLASS_NAME$ViewHolder(
kishansinhparmar / vminflate.kt
Created Jul 19, 2019
This template will inflate and initialize common code.
View vminflate.kt
binding = DataBindingUtil.inflate(inflater, R.layout.$layout_file$, container, false)
val vm by lazy {
ViewModelProviders.of(this, $VIEWMODEL_CLASS$Factory(repo))
binding.lifecycleOwner = this
kishansinhparmar / vmfactory.kt
Created Jul 19, 2019
View model with repository
View vmfactory.kt
class $viewModelName$Factory(val repo: RepoModel) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T = $viewModelName$(repo) as T
kishansinhparmar / vmclass.kt
Last active Jul 19, 2019
This will create a VM class with repo param.
View vmclass.kt
class $CLASS_NAME$VM(private var repo: RepoModel) : ViewModel() {
kishansinhparmar / main.dart
Last active Apr 28, 2018
Flutter Hello World!
View main.dart
//material package to use material widgets
import 'package:flutter/material.dart';
//Main method to run app
void main() => runApp(new MyApp());
//MyApp class
class MyApp extends StatelessWidget {
Intent sendIntent = new Intent();
"Performance app:"
+ ".packageid");
You can’t perform that action at this time.