Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2026-03-16 18:14:53 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
daf11762d4471a47b2e7a25f5f016c5a209ca431
daf11762
1 parent
5fce6aa1
map marker view part1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
260 additions
and
67 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ShopsActivity.java
warply_android_sdk/src/main/res/drawable-xhdpi/demo_close.png
warply_android_sdk/src/main/res/drawable/shape_rectangle_rounded_corners_grey.xml
warply_android_sdk/src/main/res/layout/demo_marker_view.xml
warply_android_sdk/src/main/res/values/colors.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/src/main/res/values/styles.xml
warply_android_sdk/build.gradle
View file @
daf1176
...
...
@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.6deh
5
'
PUBLISH_VERSION
=
'4.5.5.6deh
6
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ShopsActivity.java
View file @
daf1176
...
...
@@ -12,7 +12,6 @@ import android.graphics.drawable.Drawable;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
...
...
@@ -50,10 +49,7 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.Merchant
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.WarplyProperty
;
import
ly.warp.sdk.utils.constants.WarpConstants
;
import
ly.warp.sdk.utils.managers.WarplyAnalyticsManager
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
public
class
ShopsActivity
extends
FragmentActivity
implements
View
.
OnClickListener
,
...
...
@@ -168,8 +164,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
//// mMap.setOnMarkerClickListener(/*mClusterManager*/this);
// }
if
(!
TextUtils
.
isEmpty
(
mMerchantUuid
))
{
WarplyManager
.
getStores
(
"86eba6980cf746cbbcca5c6446700121"
,
mStoresCallback
);
if
(!
TextUtils
.
isEmpty
(
mMerchantUuid
))
{
// "86eba6980cf746cbbcca5c6446700121" test merchant for pins
WarplyManager
.
getStores
(
mMerchantUuid
,
mStoresCallback
);
}
}
...
...
@@ -188,59 +184,69 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
@Override
public
boolean
onMarkerClick
(
@NonNull
Marker
marker
)
{
// for (Merchant merch : mMerchantList) {
// if (merch.getUuid().equals(marker.getSnippet())) {
// Merchant merch = (Merchant) marker.getTag();
// if (merch == null) return false;
//
// final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog);
// bottomSheetDialog.setContentView(R.layout.dl_map_pin);
// ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close);
// dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss());
// TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_bold, pinTitle);
// if (mMerchantParentList != null && mMerchantParentList.size() > 0) {
// for (Merchant parentMerch : mMerchantParentList) {
// if (parentMerch.getUuid().equals(merch.getParent())) {
// pinTitle.setText(parentMerch.getAdminName());
// break;
// }
// }
// }
// ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo);
// if (!TextUtils.isEmpty(merch.getImgPreview())) {
// bottomSheetDialog.setContentView(R.layout.demo_marker_view);
//
// ImageView dialogClose = bottomSheetDialog.findViewById(R.id.iv_map_pin_close);
// if (dialogClose != null) dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss());
//
// ImageView pinLogo = bottomSheetDialog.findViewById(R.id.iv_pin_logo);
// if (pinLogo != null && !TextUtils.isEmpty(merch.getImgPreview())) {
// Glide.with(this)
//// .setDefaultRequestOptions(
//// RequestOptions
//// .placeholderOf(R.drawable.ic_default_contact_photo)
//// .error(R.drawable.ic_default_contact_photo))
// .load(merch.getImgPreview())
// .diskCacheStrategy(DiskCacheStrategy.DATA)
// .into(pinLogo);
// }
// TextView pinName = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_name);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_medium, pinName);
// pinName.setText(merch.getName());
// TextView pinDays = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_days);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_regular, pinDays);
// pinDays.setText(merch.getSnippet()); //TODO: wrong getter
// TextView pinTel = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_tel);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_medium, pinTel);
// pinTel.setText(merch.getTelephone());
// TextView pinAddress = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_address);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_medium, pinAddress);
// pinAddress.setText(merch.getAddress());
// TextView pinDirectionsText = (TextView) bottomSheetDialog.findViewById(R.id.tv_directions);
// WarpUtils.renderCustomFont(ShopsActivity.this, R.font.pf_square_sans_pro_medium, pinDirectionsText);
// LinearLayout pinDirections = (LinearLayout) bottomSheetDialog.findViewById(R.id.ll_directions);
//
// TextView pinTitle = bottomSheetDialog.findViewById(R.id.tv_pin_title);
// if (pinTitle != null) {
// WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, pinTitle);
// pinTitle.setText(!TextUtils.isEmpty(merch.getAdminName()) ? merch.getAdminName() : merch.getName());
// }
//
// TextView pinName = bottomSheetDialog.findViewById(R.id.tv_pin_name);
// if (pinName != null) {
// WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, pinName);
// pinName.setText(!TextUtils.isEmpty(merch.getName()) ? merch.getName() : "");
// }
//
// TextView pinAddress = bottomSheetDialog.findViewById(R.id.tv_pin_address);
// if (pinAddress != null) {
// WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, pinAddress);
// pinAddress.setText(!TextUtils.isEmpty(merch.getAddress()) ? merch.getAddress() : "");
// }
//
// TextView pinTel = bottomSheetDialog.findViewById(R.id.tv_pin_tel);
// if (pinTel != null) {
// WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, pinTel);
// pinTel.setText(!TextUtils.isEmpty(merch.getTelephone()) ? merch.getTelephone() : "");
// }
//
// TextView pinDirectionsText = bottomSheetDialog.findViewById(R.id.tv_directions);
// if (pinDirectionsText != null) {
// WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, pinDirectionsText);
// }
//
// LinearLayout pinDirections = bottomSheetDialog.findViewById(R.id.ll_directions);
// if (pinDirections != null) {
// pinDirections.setOnClickListener(view -> {
//
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + merch.getLatitude() + "," + merch.getLongitude()/* + "&mode=w"*/
);
//
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + merch.getLatitude() + "," + merch.getLongitude()
);
// Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
// mapIntent.setPackage("com.google.android.apps.maps");
// try {
// startActivity(mapIntent);
// }
);
//
bottomSheetDialog.show(
);
//
return false
;
// }
catch (ActivityNotFoundException e) {
//
Uri browserUri = Uri.parse("https://maps.google.com/?q=" + merch.getLatitude() + "," + merch.getLongitude()
);
//
startActivity(new Intent(Intent.ACTION_VIEW, browserUri))
;
// }
// });
// }
return
false
;
//
// bottomSheetDialog.show();
return
true
;
}
// ===========================================================
...
...
@@ -321,6 +327,10 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
.
into
(
new
CustomTarget
<
Bitmap
>()
{
@Override
public
void
onResourceReady
(
@NonNull
Bitmap
staticImage
,
@Nullable
Transition
<?
super
Bitmap
>
transition
)
{
Bitmap
scaledPin
=
Bitmap
.
createScaledBitmap
(
staticImage
,
(
int
)
(
staticImage
.
getWidth
()
*
0.75f
),
(
int
)
(
staticImage
.
getHeight
()
*
0.75f
),
true
);
if
(!
TextUtils
.
isEmpty
(
merch
.
getImgPreview
()))
{
Glide
.
with
(
ShopsActivity
.
this
)
.
asBitmap
()
...
...
@@ -329,45 +339,45 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
.
into
(
new
CustomTarget
<
Bitmap
>()
{
@Override
public
void
onResourceReady
(
@NonNull
Bitmap
poiImage
,
@Nullable
Transition
<?
super
Bitmap
>
transition
)
{
Bitmap
combinedBitmap
=
overlayBitmaps
(
s
taticImage
,
poiImage
,
48
,
48
,
0
);
Bitmap
combinedBitmap
=
overlayBitmaps
(
s
caledPin
,
poiImage
,
48
,
48
,
0
);
if
(
mMap
!=
null
)
{
mMap
.
addMarker
(
new
MarkerOptions
()
Marker
m
=
mMap
.
addMarker
(
new
MarkerOptions
()
.
position
(
new
LatLng
(
merch
.
getLatitude
(),
merch
.
getLongitude
()))
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
combinedBitmap
))
.
anchor
(
0.5f
,
1.0f
)
.
snippet
(
merch
.
getUuid
())
);
.
anchor
(
0.5f
,
1.0f
)
);
if
(
m
!=
null
)
m
.
setTag
(
merch
);
}
}
@Override
public
void
onLoadCleared
(
@Nullable
Drawable
placeholder
)
{
if
(
mMap
!=
null
)
{
mMap
.
addMarker
(
new
MarkerOptions
()
Marker
m
=
mMap
.
addMarker
(
new
MarkerOptions
()
.
position
(
new
LatLng
(
merch
.
getLatitude
(),
merch
.
getLongitude
()))
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
taticImage
))
.
anchor
(
0.5f
,
1.0f
)
.
snippet
(
merch
.
getUuid
())
);
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
caledPin
))
.
anchor
(
0.5f
,
1.0f
)
);
if
(
m
!=
null
)
m
.
setTag
(
merch
);
}
}
@Override
public
void
onLoadFailed
(
@Nullable
Drawable
errorDrawable
)
{
if
(
mMap
!=
null
)
{
mMap
.
addMarker
(
new
MarkerOptions
()
Marker
m
=
mMap
.
addMarker
(
new
MarkerOptions
()
.
position
(
new
LatLng
(
merch
.
getLatitude
(),
merch
.
getLongitude
()))
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
taticImage
))
.
anchor
(
0.5f
,
1.0f
)
.
snippet
(
merch
.
getUuid
())
);
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
caledPin
))
.
anchor
(
0.5f
,
1.0f
)
);
if
(
m
!=
null
)
m
.
setTag
(
merch
);
}
}
});
}
else
{
if
(
mMap
!=
null
)
{
mMap
.
addMarker
(
new
MarkerOptions
()
Marker
m
=
mMap
.
addMarker
(
new
MarkerOptions
()
.
position
(
new
LatLng
(
merch
.
getLatitude
(),
merch
.
getLongitude
()))
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
taticImage
))
.
anchor
(
0.5f
,
1.0f
)
.
snippet
(
merch
.
getUuid
())
);
.
icon
(
BitmapDescriptorFactory
.
fromBitmap
(
s
caledPin
))
.
anchor
(
0.5f
,
1.0f
)
);
if
(
m
!=
null
)
m
.
setTag
(
merch
);
}
}
}
...
...
@@ -375,10 +385,10 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
@Override
public
void
onLoadCleared
(
@Nullable
Drawable
placeholder
)
{
if
(
mMap
!=
null
)
{
mMap
.
addMarker
(
new
MarkerOptions
()
Marker
m
=
mMap
.
addMarker
(
new
MarkerOptions
()
.
position
(
new
LatLng
(
merch
.
getLatitude
(),
merch
.
getLongitude
()))
.
anchor
(
0.5f
,
1.0f
)
.
snippet
(
merch
.
getUuid
())
);
.
anchor
(
0.5f
,
1.0f
)
);
if
(
m
!=
null
)
m
.
setTag
(
merch
);
}
}
});
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/demo_close.png
0 → 100644
View file @
daf1176
1.27 KB
warply_android_sdk/src/main/res/drawable/shape_rectangle_rounded_corners_grey.xml
0 → 100644
View file @
daf1176
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"2.5dp"
/>
<solid
android:width=
"0dp"
android:color=
"@color/custom_grey10"
/>
</shape>
\ No newline at end of file
warply_android_sdk/src/main/res/layout/demo_marker_view.xml
0 → 100644
View file @
daf1176
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@color/white"
android:paddingHorizontal=
"24dp"
android:paddingVertical=
"8dp"
>
<View
android:id=
"@+id/sheet_view"
android:layout_width=
"48dp"
android:layout_height=
"5dp"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/shape_rectangle_rounded_corners_grey"
/>
<ImageView
android:id=
"@+id/iv_map_pin_close"
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:background=
"@drawable/shape_rectangle_rounded_grey"
android:padding=
"12dp"
android:src=
"@drawable/demo_close"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/iv_map_pin_close"
>
<ImageView
android:id=
"@+id/iv_pin_logo"
android:layout_width=
"102dp"
android:layout_height=
"102dp"
android:scaleType=
"centerCrop"
android:background=
"@drawable/shape_rectangle_rounded_grey"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <RelativeLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_toEndOf="@id/iv_pin_logo"-->
<!-- android:layout_toStartOf="@id/iv_map_pin_close"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:orientation="vertical"-->
<!-- android:paddingStart="12dp"-->
<!-- android:paddingEnd="8dp">-->
<!-- <TextView-->
<!-- android:id="@+id/tv_pin_title"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:includeFontPadding="false"-->
<!-- android:textColor="@color/custom_black6"-->
<!-- android:textSize="16sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_pin_name"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="2dp"-->
<!-- android:includeFontPadding="false"-->
<!-- android:textColor="@color/custom_grey3"-->
<!-- android:textSize="13sp" />-->
<!-- </LinearLayout>-->
<!-- </RelativeLayout>-->
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:layout_marginBottom="16dp"-->
<!-- android:background="@color/custom_grey4" />-->
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center_vertical"-->
<!-- android:orientation="horizontal">-->
<!-- <ImageView-->
<!-- android:layout_width="16dp"-->
<!-- android:layout_height="16dp"-->
<!-- android:src="@android:drawable/ic_dialog_map"-->
<!-- android:tint="@color/custom_grey3" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_pin_address"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="8dp"-->
<!-- android:layout_weight="1"-->
<!-- android:includeFontPadding="false"-->
<!-- android:textColor="@color/custom_grey3"-->
<!-- android:textSize="13sp" />-->
<!-- </LinearLayout>-->
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="8dp"-->
<!-- android:gravity="center_vertical"-->
<!-- android:orientation="horizontal">-->
<!-- <ImageView-->
<!-- android:layout_width="16dp"-->
<!-- android:layout_height="16dp"-->
<!-- android:src="@android:drawable/ic_menu_call"-->
<!-- android:tint="@color/custom_grey3" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_pin_tel"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="8dp"-->
<!-- android:layout_weight="1"-->
<!-- android:includeFontPadding="false"-->
<!-- android:textColor="@color/custom_grey3"-->
<!-- android:textSize="13sp" />-->
<!-- </LinearLayout>-->
<!-- <LinearLayout-->
<!-- android:id="@+id/ll_directions"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="48dp"-->
<!-- android:layout_marginTop="20dp"-->
<!-- android:background="@drawable/shape_rectangle_rounded_black2"-->
<!-- android:gravity="center"-->
<!-- android:orientation="horizontal">-->
<!-- <TextView-->
<!-- android:id="@+id/tv_directions"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:includeFontPadding="false"-->
<!-- android:text="@string/lbl_directions"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="14sp" />-->
<!-- </LinearLayout>-->
</RelativeLayout>
warply_android_sdk/src/main/res/values/colors.xml
View file @
daf1176
...
...
@@ -41,4 +41,5 @@
<color
name=
"custom_yellow2"
>
#FFEABA
</color>
<color
name=
"custom_gold"
>
#573300
</color>
<color
name=
"custom_grey9"
>
#ADB3B8
</color>
<color
name=
"custom_grey10"
>
#ECEDEF
</color>
</resources>
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
daf1176
...
...
@@ -41,4 +41,5 @@
<string
name=
"demo_coupon_expired"
>
Expired
</string>
<string
name=
"demo_partners_title"
>
Partner businesses
</string>
<string
name=
"demo_search_title"
>
Αναζήτηση
</string>
<string
name=
"lbl_directions"
>
Οδηγίες
</string>
</resources>
...
...
warply_android_sdk/src/main/res/values/styles.xml
View file @
daf1176
...
...
@@ -30,4 +30,21 @@
<style
name=
"progressBarBlue"
parent=
"@style/Theme.AppCompat"
>
<item
name=
"colorAccent"
>
@color/custom_light_blue
</item>
</style>
<style
name=
"BottomSheetDialog"
parent=
"Theme.MaterialComponents.Light.BottomSheetDialog"
>
<item
name=
"android:windowIsFloating"
>
false
</item>
<item
name=
"bottomSheetStyle"
>
@style/BottomSheetStyle
</item>
</style>
<style
name=
"BottomSheetStyle"
parent=
"Widget.MaterialComponents.BottomSheet.Modal"
>
<item
name=
"shapeAppearanceOverlay"
>
@style/BottomSheetShapeAppearance
</item>
</style>
<style
name=
"BottomSheetShapeAppearance"
parent=
""
>
<item
name=
"cornerFamily"
>
rounded
</item>
<item
name=
"cornerSizeTopLeft"
>
16dp
</item>
<item
name=
"cornerSizeTopRight"
>
16dp
</item>
<item
name=
"cornerSizeBottomLeft"
>
0dp
</item>
<item
name=
"cornerSizeBottomRight"
>
0dp
</item>
</style>
</resources>
...
...
Please
register
or
login
to post a comment