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.Manifest; | |
import android.content.DialogInterface; | |
import android.content.pm.PackageManager; | |
import android.location.Location; | |
import android.location.LocationListener; | |
import android.os.Build; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.app.FragmentActivity; | |
import android.os.Bundle; | |
import android.support.v4.content.ContextCompat; |
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
// set position by long press | |
mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() { | |
@Override | |
public void onMapLongClick(LatLng latLng) { | |
// First check if myMarker is null | |
if (myManualPositionMarker == null) { | |
// Marker was not set yet. Add marker: | |
myManualPositionMarker = mMap.addMarker(new MarkerOptions() | |
.position(latLng) | |
.title("My positions") |
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); |
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
<?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
<?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
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
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
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 { |