Showing
3 changed files
with
41 additions
and
11 deletions
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4.6rc69' | 5 | + PUBLISH_VERSION = '4.5.4.6rc70' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -71,6 +71,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -71,6 +71,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
71 | private MerchantList mMerchantList = new MerchantList(); | 71 | private MerchantList mMerchantList = new MerchantList(); |
72 | private AlertDialog mAlertDialogNoShopsAvailable; | 72 | private AlertDialog mAlertDialogNoShopsAvailable; |
73 | private Merchant mMerchant, mMerchantParent; | 73 | private Merchant mMerchant, mMerchantParent; |
74 | + private ArrayList<Merchant> mMerchantParentList = new ArrayList<>(); | ||
74 | 75 | ||
75 | // =========================================================== | 76 | // =========================================================== |
76 | // Methods for/from SuperClass/Interfaces | 77 | // Methods for/from SuperClass/Interfaces |
... | @@ -214,7 +215,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -214,7 +215,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
214 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | 215 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); |
215 | 216 | ||
216 | TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title); | 217 | TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title); |
217 | - pinTitle.setText(mMerchantParent != null ? mMerchantParent.getAdminName() : merch.getAdminName()); | 218 | + if (mMerchantParentList != null && mMerchantParentList.size() > 0) { |
219 | + for (Merchant parentMerch : mMerchantParentList) { | ||
220 | + if (parentMerch.getUuid().equals(merch.getParent())) { | ||
221 | + pinTitle.setText(parentMerch.getAdminName()); | ||
222 | + break; | ||
223 | + } | ||
224 | + } | ||
225 | + } | ||
218 | 226 | ||
219 | ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo); | 227 | ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo); |
220 | if (!TextUtils.isEmpty(merch.getImgPreview())) { | 228 | if (!TextUtils.isEmpty(merch.getImgPreview())) { |
... | @@ -319,7 +327,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -319,7 +327,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
319 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { | 327 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { |
320 | nonNullCoords++; | 328 | nonNullCoords++; |
321 | } else { | 329 | } else { |
322 | - mMerchantParent = merchCoords; | 330 | +// mMerchantParent = merchCoords; |
331 | + mMerchantParentList.add(merchCoords); | ||
323 | } | 332 | } |
324 | } | 333 | } |
325 | 334 | ||
... | @@ -368,7 +377,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -368,7 +377,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
368 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { | 377 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { |
369 | nonNullCoords++; | 378 | nonNullCoords++; |
370 | } else { | 379 | } else { |
371 | - mMerchantParent = merchCoords; | 380 | +// mMerchantParent = merchCoords; |
381 | + mMerchantParentList.add(merchCoords); | ||
372 | } | 382 | } |
373 | } | 383 | } |
374 | 384 | ||
... | @@ -377,9 +387,12 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -377,9 +387,12 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
377 | return; | 387 | return; |
378 | } | 388 | } |
379 | 389 | ||
380 | - if (mMerchantParent != null) { | 390 | +// if (mMerchantParent != null) { |
391 | + if (mMerchantParentList != null && mMerchantParentList.size() > 0) { | ||
392 | + for (Merchant parentMerch : mMerchantParentList) { | ||
381 | for (Merchant merch : result) { | 393 | for (Merchant merch : result) { |
382 | - merch.setImg_preview(mMerchantParent.getImgPreview()); | 394 | + if (parentMerch.getUuid().equals(merch.getParent())) { |
395 | + merch.setImg_preview(parentMerch.getImgPreview()); | ||
383 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | 396 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { |
384 | mMap.addMarker(new MarkerOptions() | 397 | mMap.addMarker(new MarkerOptions() |
385 | .position(new LatLng(merch.getLatitude(), merch.getLongitude())) | 398 | .position(new LatLng(merch.getLatitude(), merch.getLongitude())) |
... | @@ -388,6 +401,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -388,6 +401,8 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
388 | .snippet(merch.getUuid())); | 401 | .snippet(merch.getUuid())); |
389 | } | 402 | } |
390 | } | 403 | } |
404 | + } | ||
405 | + } | ||
391 | } else { | 406 | } else { |
392 | for (Merchant merch : result) { | 407 | for (Merchant merch : result) { |
393 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | 408 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | ... | ... |
... | @@ -69,6 +69,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -69,6 +69,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
69 | private MerchantList mMerchantList = new MerchantList(); | 69 | private MerchantList mMerchantList = new MerchantList(); |
70 | private AlertDialog mAlertDialogNoShopsAvailable; | 70 | private AlertDialog mAlertDialogNoShopsAvailable; |
71 | private Merchant mMerchant, mMerchantParent; | 71 | private Merchant mMerchant, mMerchantParent; |
72 | + private ArrayList<Merchant> mMerchantParentList = new ArrayList<>(); | ||
72 | 73 | ||
73 | // =========================================================== | 74 | // =========================================================== |
74 | // Methods for/from SuperClass/Interfaces | 75 | // Methods for/from SuperClass/Interfaces |
... | @@ -215,7 +216,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -215,7 +216,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
215 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | 216 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); |
216 | 217 | ||
217 | TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title); | 218 | TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title); |
218 | - pinTitle.setText(mMerchantParent != null ? mMerchantParent.getAdminName() : merch.getAdminName()); | 219 | + if (mMerchantParentList != null && mMerchantParentList.size() > 0) { |
220 | + for (Merchant parentMerch : mMerchantParentList) { | ||
221 | + if (parentMerch.getUuid().equals(merch.getParent())) { | ||
222 | + pinTitle.setText(parentMerch.getAdminName()); | ||
223 | + break; | ||
224 | + } | ||
225 | + } | ||
226 | + } | ||
219 | 227 | ||
220 | ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo); | 228 | ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo); |
221 | if (!TextUtils.isEmpty(merch.getImgPreview())) { | 229 | if (!TextUtils.isEmpty(merch.getImgPreview())) { |
... | @@ -336,7 +344,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -336,7 +344,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
336 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { | 344 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { |
337 | nonNullCoords++; | 345 | nonNullCoords++; |
338 | } else { | 346 | } else { |
339 | - mMerchantParent = merchCoords; | 347 | +// mMerchantParent = merchCoords; |
348 | + mMerchantParentList.add(merchCoords); | ||
340 | } | 349 | } |
341 | } | 350 | } |
342 | 351 | ||
... | @@ -386,7 +395,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -386,7 +395,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
386 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { | 395 | if (merchCoords.getLatitude() != 0.0 && merchCoords.getLongitude() != 0.0) { |
387 | nonNullCoords++; | 396 | nonNullCoords++; |
388 | } else { | 397 | } else { |
389 | - mMerchantParent = merchCoords; | 398 | +// mMerchantParent = merchCoords; |
399 | + mMerchantParentList.add(merchCoords); | ||
390 | } | 400 | } |
391 | } | 401 | } |
392 | 402 | ||
... | @@ -395,9 +405,12 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -395,9 +405,12 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
395 | return; | 405 | return; |
396 | } | 406 | } |
397 | 407 | ||
398 | - if (mMerchantParent != null) { | 408 | +// if (mMerchantParent != null) { |
409 | + if (mMerchantParentList != null && mMerchantParentList.size() > 0) { | ||
410 | + for (Merchant parentMerch : mMerchantParentList) { | ||
399 | for (Merchant merch : result) { | 411 | for (Merchant merch : result) { |
400 | - merch.setImg_preview(mMerchantParent.getImgPreview()); | 412 | + if (parentMerch.getUuid().equals(merch.getParent())) { |
413 | + merch.setImg_preview(parentMerch.getImgPreview()); | ||
401 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | 414 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { |
402 | mMap.addMarker(new MarkerOptions() | 415 | mMap.addMarker(new MarkerOptions() |
403 | .position(new LatLng(merch.getLatitude(), merch.getLongitude())) | 416 | .position(new LatLng(merch.getLatitude(), merch.getLongitude())) |
... | @@ -407,6 +420,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -407,6 +420,8 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
407 | .clusterable(true)); | 420 | .clusterable(true)); |
408 | } | 421 | } |
409 | } | 422 | } |
423 | + } | ||
424 | + } | ||
410 | } else { | 425 | } else { |
411 | for (Merchant merch : result) { | 426 | for (Merchant merch : result) { |
412 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | 427 | if (merch.getLatitude() != 0.0 && merch.getLongitude() != 0.0) { | ... | ... |
-
Please register or login to post a comment