Skip to content

Instantly share code, notes, and snippets.

View pedrovarela86's full-sized avatar
😀

Pedro Varela pedrovarela86

😀
View GitHub Profile
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.backbase.android.client.transactions.dto;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import androidx.annotation.NonNull;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.backbase.android.client.transactions.dto;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import androidx.annotation.VisibleForTesting;
companion object{
fun create(activity: FragmentActivity): ProductViewModel{
var productDetailViewModel = ViewModelProviders.of(activity).get(ProductViewModel::class.java)
return productDetailViewModel
}
}
@pedrovarela86
pedrovarela86 / onResume.kt
Created April 25, 2020 23:08
Llamada al método checkGooglePlayServices desde onResume() de la actividad
override fun onResume() {
super.onResume()
if (checkPlayServices()) {
startApp()
}
}
@pedrovarela86
pedrovarela86 / checkGooglePlayServices.kt
Last active April 25, 2020 23:06
Función para verificar la disponibiliadad de Google Play Services
private var errorDialog: Dialog? = null
private fun checkGooglePlayServices(): Boolean {
val googleApiAvailability: GoogleApiAvailability = GoogleApiAvailability.getInstance()
val resultCode: Int = googleApiAvailability.isGooglePlayServicesAvailable(this)
if (resultCode != ConnectionResult.SUCCESS) {
if (googleApiAvailability.isUserResolvableError(resultCode)) {
if (errorDialog == null) {
errorDialog = googleApiAvailability.getErrorDialog(this, resultCode, 2404)
errorDialog?.setCancelable(false)