This file contains 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
from dataclasses import dataclass, field | |
from typing import Optional | |
@dataclass | |
class MerchantAccount: | |
identifier: str = "" # 26/51 / 00 | |
merchant_id: str = "" # 26/51 / 02 | |
merchant_pan: str = "" # 26/51 / 01 | |
merchant_criteria: str = "" # 26/51 / 03 |
This file contains 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
map.setOnCameraIdleListener { | |
val newPosition = map.cameraPosition.target | |
if (newPosition != oldPosition) { | |
// drag ended | |
icon_marker.animate().translationY(0f).start() | |
icon_marker_shadow.animate().withStartAction { | |
icon_marker_shadow.setPadding(0) | |
}.start() | |
getLocation(newPosition) { item -> |
This file contains 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
private fun getLocation(latLng: LatLng, done: (Item) -> Unit) { | |
val at = "${latLng.latitude},${latLng.longitude}" | |
if (!hasFetch) { | |
animateMarker = false | |
progress_circular.visibility = View.VISIBLE | |
GlobalScope.launch { | |
try { | |
val places = retrofitInstance.getLocation(at).items | |
runOnUiThread { | |
if (places.isNotEmpty()) { |
This file contains 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
interface RetrofitInstance { | |
@GET("/v1/revgeocode") | |
suspend fun getLocation( | |
@Query("at") at: String, | |
@Query("apiKey") apiKey: String = Constant.apiKey | |
): Places | |
companion object { | |
fun create(): RetrofitInstance { |
This file contains 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
data class Places ( | |
val items: List<Item> | |
) | |
data class Item ( | |
val title: String, | |
val id: String, | |
val resultType: String, | |
val address: Address, | |
val position: Position, |
This file contains 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
(map_view as SupportMapFragment).getMapAsync { map -> | |
map.moveCamera(CameraUpdateFactory.newLatLngZoom(jakartaLatLng, 18f)) | |
val oldPosition = map.cameraPosition.target | |
map.setOnCameraMoveStartedListener { | |
// drag started | |
// start animation | |
icon_marker.animate().translationY(-50f).start() |
This file contains 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.coordinatorlayout.widget.CoordinatorLayout 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="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" |
This file contains 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" | |
android:id="@+id/bottom_sheet" | |
android:layout_width="match_parent" | |
android:layout_height="100dp" | |
android:background="@android:color/white" | |
android:padding="12dp" | |
app:behavior_hideable="true" | |
app:behavior_peekHeight="100dp" |
This file contains 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"?> | |
<shape | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="oval"> | |
<size | |
android:width="120dp" | |
android:height="30dp"/> | |
<solid android:color="#000000"/> | |
</shape> |
This file contains 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"?> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="24dp" | |
android:height="24dp" | |
android:viewportWidth="24" | |
android:viewportHeight="24"> | |
<path | |
android:pathData="M0 0h24v24H0z" /> | |
<path |
NewerOlder