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
import android.os.CountDownTimer | |
class CountdownTimerUtility { | |
var countdowntimer: CountDownTimer? = null | |
//start timer function | |
fun startTimer(duration: Long, countDownStep: Long, executeOnFinish: ()->Unit) { | |
countdowntimer = object : CountDownTimer(duration, countDownStep) { | |
override fun onTick(millisUntilFinished: Long) {} |
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
import android.view.View | |
// * for issue 1189: | |
// https://stackoverflow.com/questions/51060762/illegalargumentexception-navigation-destination-xxx-is-unknown-to-this-navcontr | |
class OnSingleClickListener : View.OnClickListener { | |
private val onClickListener: View.OnClickListener | |
constructor(listener: View.OnClickListener) { | |
onClickListener = listener |
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
import android.graphics.Color | |
import android.os.Build | |
import android.util.Log | |
import androidx.annotation.ColorInt | |
import it.diceworld.dicehome.utility.common.extensions.round | |
import kotlin.math.pow | |
class ColorConverter { | |
companion object { |
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
import android.os.Handler | |
import android.os.Looper | |
import java.util.concurrent.Executor | |
import java.util.concurrent.Executors | |
// Global executor pools. | |
class AppExecutors // singleton constructor | |
private constructor(private val diskIO: Executor, private val mainThread: Executor, | |
private val networkIO: Executor) { |
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 ArrayListStringToStringComma(arrayList: ArrayList<String>):String{ | |
var result = "" | |
for (i in arrayList.indices) { | |
if (i >= 1 && i <= arrayList.size-1) result += "," | |
result += arrayList[i] | |
} | |
return result | |
} |
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"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<com.google.android.material.card.MaterialCardView | |
style="@style/HomeCard.White" |
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"?> | |
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
style="@style/HomeCard.White" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="@dimen/_5ssp" | |
app:cardCornerRadius="12dp" | |
app:cardElevation="8dp"> |
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
/** | |
* --------------------------------------------------------------------------------------------- | |
* Animating camera to a target point | |
* @param lat | |
* @param lon | |
* --------------------------------------------------------------------------------------------- | |
*/ | |
private void animateCameraTo(double lat, double lon){ | |
final CameraPosition target = | |
new CameraPosition.Builder().target(new LatLng(lat, lon)) |
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
// giving a blink animation on TextView | |
txtLocationResult.setAlpha(0); | |
txtLocationResult.animate().alpha(1).setDuration(300); |