Panagiotis Triantafyllou

map fixes fixes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc69'
PUBLISH_VERSION = '4.5.4.6rc70'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -71,6 +71,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
private MerchantList mMerchantList = new MerchantList();
private AlertDialog mAlertDialogNoShopsAvailable;
private Merchant mMerchant, mMerchantParent;
private ArrayList<Merchant> mMerchantParentList = new ArrayList<>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -214,7 +215,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss());
TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title);
pinTitle.setText(mMerchantParent != null ? mMerchantParent.getAdminName() : merch.getAdminName());
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())) {
......@@ -319,7 +327,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) {
nonNullCoords++;
} else {
mMerchantParent = merchCoords;
// mMerchantParent = merchCoords;
mMerchantParentList.add(merchCoords);
}
}
......@@ -368,7 +377,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) {
nonNullCoords++;
} else {
mMerchantParent = merchCoords;
// mMerchantParent = merchCoords;
mMerchantParentList.add(merchCoords);
}
}
......@@ -377,9 +387,12 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
return;
}
if (mMerchantParent != null) {
// if (mMerchantParent != null) {
if (mMerchantParentList != null && mMerchantParentList.size() > 0) {
for (Merchant parentMerch : mMerchantParentList) {
for (Merchant merch : result) {
merch.setImg_preview(mMerchantParent.getImgPreview());
if (parentMerch.getUuid().equals(merch.getParent())) {
merch.setImg_preview(parentMerch.getImgPreview());
if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) {
mMap.addMarker(new MarkerOptions()
.position(new LatLng(merch.getLatitude(), merch.getLongitude()))
......@@ -388,6 +401,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
.snippet(merch.getUuid()));
}
}
}
}
} else {
for (Merchant merch : result) {
if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) {
......
......@@ -69,6 +69,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
private MerchantList mMerchantList = new MerchantList();
private AlertDialog mAlertDialogNoShopsAvailable;
private Merchant mMerchant, mMerchantParent;
private ArrayList<Merchant> mMerchantParentList = new ArrayList<>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -215,7 +216,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss());
TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title);
pinTitle.setText(mMerchantParent != null ? mMerchantParent.getAdminName() : merch.getAdminName());
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())) {
......@@ -336,7 +344,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) {
nonNullCoords++;
} else {
mMerchantParent = merchCoords;
// mMerchantParent = merchCoords;
mMerchantParentList.add(merchCoords);
}
}
......@@ -386,7 +395,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) {
nonNullCoords++;
} else {
mMerchantParent = merchCoords;
// mMerchantParent = merchCoords;
mMerchantParentList.add(merchCoords);
}
}
......@@ -395,9 +405,12 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
return;
}
if (mMerchantParent != null) {
// if (mMerchantParent != null) {
if (mMerchantParentList != null && mMerchantParentList.size() > 0) {
for (Merchant parentMerch : mMerchantParentList) {
for (Merchant merch : result) {
merch.setImg_preview(mMerchantParent.getImgPreview());
if (parentMerch.getUuid().equals(merch.getParent())) {
merch.setImg_preview(parentMerch.getImgPreview());
if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) {
mMap.addMarker(new MarkerOptions()
.position(new LatLng(merch.getLatitude(), merch.getLongitude()))
......@@ -407,6 +420,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
.clusterable(true));
}
}
}
}
} else {
for (Merchant merch : result) {
if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) {
......