I hereby claim:
- I am gorrotowi on github.
- I am gorrotowi (https://keybase.io/gorrotowi) on keybase.
- I have a public key ASDLdGLEHxY9unTMiueFG7WU0M331hjgX4vMUFcxw5KXdwo
To claim this, I am signing this object:
import android.app.Application | |
import androidx.lifecycle.AndroidViewModel | |
import androidx.lifecycle.viewModelScope | |
import com.flux.mobile.utils.loge | |
import kotlinx.coroutines.CoroutineExceptionHandler | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.launch |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
import com.gorrotowi.firebaseworkshop.R | |
import com.gorrotowi.firebaseworkshop.entities.FirebaseProduct | |
import kotlinx.android.synthetic.main.item_product.view.* | |
import kotlin.properties.Delegates | |
class AdapterProducts : RecyclerView.Adapter<AdapterProducts.ProducsViewHolder>() { |
I hereby claim:
To claim this, I am signing this object:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (requestCode == AUTOCOMPLETE_REQUEST_CODE) { | |
when (resultCode) { | |
Activity.RESULT_OK -> { | |
val place = data?.let { Autocomplete.getPlaceFromIntent(it) } | |
Log.e("PlaceResult", "${place?.toString()}") | |
} | |
Activity.RESULT_CANCELED -> { | |
Log.e("PlaceCanceled", "No Place selected") |
val name:String? = null | |
var length:Int | |
if(name != null){ | |
length = name.length | |
} else{ | |
length = -1 | |
} | |
print(length) // -1 |
val name:String? = null | |
val l:Int = name?.length ?: -1 | |
print(l) // -1 |
val name:String? = null | |
val l:Int = if(name != null) name.length else -1 | |
print(l) // -1 |
import kotlin.math.roundToInt | |
fun main(args: Array<String>) { | |
println("#2c79a5".alphaColor(0.5F)) | |
println(getColorIntWithAlpha("#2c79a5",0.5F)) | |
} | |
fun getColorIntWithAlpha(hexColor: String, alpha: Float): Int = | |
Color.parseColor(hexColor.alphaColor(alpha)) |
import java.io.File | |
import java.io.InputStream | |
import kotlin.math.sqrt | |
fun main(args: Array<String>) { | |
val inputStream: InputStream = File("src/test_case.txt").inputStream() | |
val lineList = mutableListOf<String>() | |
inputStream.bufferedReader().useLines { lines -> |
data class Galleta(val sabor: String, val chispas: String) |