Showing
22 changed files
with
500 additions
and
63 deletions
... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { |
36 | public void onWarplyReady() { | 36 | public void onWarplyReady() { |
37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { | 37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { |
38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
39 | - .setGuid("7000001406"), //6012049321, 6012049322, 6012049323 | 39 | + .setGuid("7000000832"), //6012049321, 6012049322, 6012049323 |
40 | mLoginReceiver); | 40 | mLoginReceiver); |
41 | } else { | 41 | } else { |
42 | startNextActivity(); | 42 | startNextActivity(); | ... | ... |
... | @@ -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-cosbeta51' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta52' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -2,7 +2,6 @@ package ly.warp.sdk.activities; | ... | @@ -2,7 +2,6 @@ package ly.warp.sdk.activities; |
2 | 2 | ||
3 | import android.app.Activity; | 3 | import android.app.Activity; |
4 | import android.content.Context; | 4 | import android.content.Context; |
5 | -import android.content.Intent; | ||
6 | import android.os.Bundle; | 5 | import android.os.Bundle; |
7 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
8 | import android.util.Log; | 7 | import android.util.Log; |
... | @@ -25,16 +24,15 @@ import org.json.JSONArray; | ... | @@ -25,16 +24,15 @@ import org.json.JSONArray; |
25 | import org.json.JSONException; | 24 | import org.json.JSONException; |
26 | import org.json.JSONObject; | 25 | import org.json.JSONObject; |
27 | 26 | ||
28 | -import java.util.ArrayList; | ||
29 | - | ||
30 | import io.github.inflationx.viewpump.ViewPumpContextWrapper; | 27 | import io.github.inflationx.viewpump.ViewPumpContextWrapper; |
31 | import ly.warp.sdk.R; | 28 | import ly.warp.sdk.R; |
32 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 29 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
33 | import ly.warp.sdk.io.models.Consumer; | 30 | import ly.warp.sdk.io.models.Consumer; |
34 | import ly.warp.sdk.io.models.Coupon; | 31 | import ly.warp.sdk.io.models.Coupon; |
32 | +import ly.warp.sdk.io.models.CouponList; | ||
35 | import ly.warp.sdk.io.request.CosmoteCouponSharingRequest; | 33 | import ly.warp.sdk.io.request.CosmoteCouponSharingRequest; |
36 | -import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; | ||
37 | import ly.warp.sdk.io.request.WarplyConsumerRequest; | 34 | import ly.warp.sdk.io.request.WarplyConsumerRequest; |
35 | +import ly.warp.sdk.io.request.WarplyUserCouponsRequest; | ||
38 | import ly.warp.sdk.utils.managers.WarplyManager; | 36 | import ly.warp.sdk.utils.managers.WarplyManager; |
39 | 37 | ||
40 | 38 | ||
... | @@ -265,6 +263,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene | ... | @@ -265,6 +263,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene |
265 | public void onSuccess(JSONObject result) { | 263 | public void onSuccess(JSONObject result) { |
266 | int status = result.optInt("status", 2); | 264 | int status = result.optInt("status", 2); |
267 | String message = result.optString("msg", ""); | 265 | String message = result.optString("msg", ""); |
266 | + WarplyManager.getUserCouponsWithCouponsets(new WarplyUserCouponsRequest(), mUserCouponsReceiver); | ||
268 | runOnUiThread(() -> { | 267 | runOnUiThread(() -> { |
269 | if (status == 1) | 268 | if (status == 1) |
270 | acceptSharingDialog(); | 269 | acceptSharingDialog(); |
... | @@ -282,6 +281,18 @@ public class CouponShareActivity extends Activity implements View.OnClickListene | ... | @@ -282,6 +281,18 @@ public class CouponShareActivity extends Activity implements View.OnClickListene |
282 | } | 281 | } |
283 | }; | 282 | }; |
284 | 283 | ||
284 | + private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() { | ||
285 | + @Override | ||
286 | + public void onSuccess(CouponList result) { | ||
287 | + | ||
288 | + } | ||
289 | + | ||
290 | + @Override | ||
291 | + public void onFailure(int errorCode) { | ||
292 | + | ||
293 | + } | ||
294 | + }; | ||
295 | + | ||
285 | // =========================================================== | 296 | // =========================================================== |
286 | // Inner and Anonymous Classes | 297 | // Inner and Anonymous Classes |
287 | // =========================================================== | 298 | // =========================================================== | ... | ... |
... | @@ -264,7 +264,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -264,7 +264,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
264 | 264 | ||
265 | private void nonTelcoDialog() { | 265 | private void nonTelcoDialog() { |
266 | mAlertDialogNonTelco = new AlertDialog.Builder(this) | 266 | mAlertDialogNonTelco = new AlertDialog.Builder(this) |
267 | - .setTitle(R.string.cos_dlg_non_telco) | 267 | + .setMessage(R.string.cos_dlg_non_telco) |
268 | .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { | 268 | .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { |
269 | dialogPositive.dismiss(); | 269 | dialogPositive.dismiss(); |
270 | onBackPressed(); | 270 | onBackPressed(); | ... | ... |
... | @@ -43,7 +43,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -43,7 +43,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
43 | // =========================================================== | 43 | // =========================================================== |
44 | 44 | ||
45 | private ImageView mIvBack; | 45 | private ImageView mIvBack; |
46 | - private TextView mTvCouponsValueAll; | 46 | + private TextView mTvCouponsValueAll, mTvSharedEmpty, mTvExpiredEmpty; |
47 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; | 47 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; |
48 | private ExpiredCouponAdapter mAdapterExpiredCoupons; | 48 | private ExpiredCouponAdapter mAdapterExpiredCoupons; |
49 | private SharedCouponAdapter mAdapterSharedCoupons; | 49 | private SharedCouponAdapter mAdapterSharedCoupons; |
... | @@ -68,6 +68,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -68,6 +68,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
68 | mRlExpiredView = findViewById(R.id.rl_expired_view); | 68 | mRlExpiredView = findViewById(R.id.rl_expired_view); |
69 | mRlSharedView = findViewById(R.id.rl_shared_view); | 69 | mRlSharedView = findViewById(R.id.rl_shared_view); |
70 | mRvSharedCoupons = findViewById(R.id.rv_shared_coupons); | 70 | mRvSharedCoupons = findViewById(R.id.rv_shared_coupons); |
71 | + mTvSharedEmpty = findViewById(R.id.tv_shared_empty); | ||
72 | + mTvExpiredEmpty = findViewById(R.id.tv_expired_empty); | ||
71 | 73 | ||
72 | initViews(); | 74 | initViews(); |
73 | } | 75 | } |
... | @@ -205,6 +207,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -205,6 +207,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
205 | // .doOnError(error -> { | 207 | // .doOnError(error -> { |
206 | // }) | 208 | // }) |
207 | // .subscribe(); | 209 | // .subscribe(); |
210 | + } else { | ||
211 | + mTvExpiredEmpty.setVisibility(View.VISIBLE); | ||
208 | } | 212 | } |
209 | } | 213 | } |
210 | 214 | ||
... | @@ -232,9 +236,13 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -232,9 +236,13 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
232 | } | 236 | } |
233 | 237 | ||
234 | runOnUiThread(() -> { | 238 | runOnUiThread(() -> { |
239 | + if (mSharedCoupons != null && mSharedCoupons.size() > 0) { | ||
235 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 240 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); |
236 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons); | 241 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons); |
237 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 242 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); |
243 | + } else { | ||
244 | + mTvSharedEmpty.setVisibility(View.VISIBLE); | ||
245 | + } | ||
238 | }); | 246 | }); |
239 | } | 247 | } |
240 | 248 | ... | ... |
... | @@ -11,6 +11,7 @@ import android.view.View; | ... | @@ -11,6 +11,7 @@ import android.view.View; |
11 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
12 | import android.widget.LinearLayout; | 12 | import android.widget.LinearLayout; |
13 | import android.widget.TextView; | 13 | import android.widget.TextView; |
14 | +import android.widget.Toast; | ||
14 | 15 | ||
15 | import androidx.appcompat.app.AlertDialog; | 16 | import androidx.appcompat.app.AlertDialog; |
16 | import androidx.constraintlayout.widget.ConstraintLayout; | 17 | import androidx.constraintlayout.widget.ConstraintLayout; |
... | @@ -24,8 +25,12 @@ import org.greenrobot.eventbus.EventBus; | ... | @@ -24,8 +25,12 @@ import org.greenrobot.eventbus.EventBus; |
24 | import org.json.JSONObject; | 25 | import org.json.JSONObject; |
25 | 26 | ||
26 | import java.io.Serializable; | 27 | import java.io.Serializable; |
28 | +import java.text.ParseException; | ||
29 | +import java.text.SimpleDateFormat; | ||
27 | import java.util.Collections; | 30 | import java.util.Collections; |
28 | import java.util.Comparator; | 31 | import java.util.Comparator; |
32 | +import java.util.Date; | ||
33 | +import java.util.concurrent.TimeUnit; | ||
29 | 34 | ||
30 | import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan; | 35 | import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan; |
31 | import io.github.inflationx.calligraphy3.TypefaceUtils; | 36 | import io.github.inflationx.calligraphy3.TypefaceUtils; |
... | @@ -84,7 +89,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -84,7 +89,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
84 | mTvDealsValue = findViewById(R.id.tv_deals_value); | 89 | mTvDealsValue = findViewById(R.id.tv_deals_value); |
85 | mTvDealsValueAll = findViewById(R.id.tv_deals_value_all); | 90 | mTvDealsValueAll = findViewById(R.id.tv_deals_value_all); |
86 | mTvActiveCode = findViewById(R.id.tv_active_deals_text); | 91 | mTvActiveCode = findViewById(R.id.tv_active_deals_text); |
87 | -// mTvActiveDate = findViewById(R.id.tv_active_deals_date_text); | 92 | + mTvActiveDate = findViewById(R.id.tv_active_deals_date_text); |
88 | mIvDealsLogo = findViewById(R.id.dfy_logo); | 93 | mIvDealsLogo = findViewById(R.id.dfy_logo); |
89 | mClDealsView = findViewById(R.id.cl_mygifts); | 94 | mClDealsView = findViewById(R.id.cl_mygifts); |
90 | mIvProfilePhoto = findViewById(R.id.iv_profile_photo); | 95 | mIvProfilePhoto = findViewById(R.id.iv_profile_photo); |
... | @@ -131,6 +136,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -131,6 +136,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
131 | return; | 136 | return; |
132 | } | 137 | } |
133 | if (view.getId() == R.id.cl_deals_cos) { | 138 | if (view.getId() == R.id.cl_deals_cos) { |
139 | + //TODO: remove | ||
140 | + WarpUtils.log("DFY coupon banner pressed!"); | ||
141 | + Toast.makeText(this, "TODO:Remove:DFY banner clicked", Toast.LENGTH_SHORT).show(); | ||
142 | + //TODO: remove | ||
134 | WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel(); | 143 | WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel(); |
135 | warplyDealsAnalysisEventModel.setPressed(true); | 144 | warplyDealsAnalysisEventModel.setPressed(true); |
136 | EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel)); | 145 | EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel)); |
... | @@ -174,9 +183,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -174,9 +183,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
174 | // =========================================================== | 183 | // =========================================================== |
175 | 184 | ||
176 | private void initViews() { | 185 | private void initViews() { |
177 | - if(WarplyManagerHelper.getConsumerInternal() != null) { | 186 | + if (WarplyManagerHelper.getConsumerInternal() != null) { |
178 | JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata()); | 187 | JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata()); |
179 | - if(profMetadata != null) { | 188 | + if (profMetadata != null) { |
180 | if (profMetadata.has("nonTelco") && profMetadata.optBoolean("nonTelco")) { | 189 | if (profMetadata.has("nonTelco") && profMetadata.optBoolean("nonTelco")) { |
181 | nonTelcoDialog(); | 190 | nonTelcoDialog(); |
182 | } | 191 | } |
... | @@ -255,6 +264,20 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -255,6 +264,20 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
255 | if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) { | 264 | if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) { |
256 | codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode(); | 265 | codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode(); |
257 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1))); | 266 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1))); |
267 | + | ||
268 | + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | ||
269 | + String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate(); | ||
270 | + String date2 = dateFormat.format(new Date()); | ||
271 | + | ||
272 | + try { | ||
273 | + Date toDate = dateFormat.parse(date2); | ||
274 | + Date fromDate = dateFormat.parse(date1); | ||
275 | + long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()); | ||
276 | + mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff))); | ||
277 | + mTvActiveDate.setVisibility(View.VISIBLE); | ||
278 | + } catch (ParseException e) { | ||
279 | + e.printStackTrace(); | ||
280 | + } | ||
258 | } else { | 281 | } else { |
259 | for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) { | 282 | for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) { |
260 | codes = codes + coupon.getCode() + ","; | 283 | codes = codes + coupon.getCode() + ","; |
... | @@ -264,19 +287,6 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -264,19 +287,6 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
264 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()))); | 287 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()))); |
265 | } | 288 | } |
266 | mTvActiveCode.setText(codes); | 289 | mTvActiveCode.setText(codes); |
267 | - | ||
268 | -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | ||
269 | -// String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate(); | ||
270 | -// String date2 = dateFormat.format(new Date()); | ||
271 | -// | ||
272 | -// try { | ||
273 | -// Date toDate = dateFormat.parse(date2); | ||
274 | -// Date fromDate = dateFormat.parse(date1); | ||
275 | -// long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()); | ||
276 | -// mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff))); | ||
277 | -// } catch (ParseException e) { | ||
278 | -// e.printStackTrace(); | ||
279 | -// } | ||
280 | } else { | 290 | } else { |
281 | mIvDealsLogo.setVisibility(View.GONE); | 291 | mIvDealsLogo.setVisibility(View.GONE); |
282 | mClDealsView.setVisibility(View.GONE); | 292 | mClDealsView.setVisibility(View.GONE); |
... | @@ -322,7 +332,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -322,7 +332,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
322 | 332 | ||
323 | private void nonTelcoDialog() { | 333 | private void nonTelcoDialog() { |
324 | mAlertDialogNonTelco = new AlertDialog.Builder(this) | 334 | mAlertDialogNonTelco = new AlertDialog.Builder(this) |
325 | - .setTitle(R.string.cos_dlg_non_telco) | 335 | + .setMessage(R.string.cos_dlg_non_telco) |
326 | .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { | 336 | .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { |
327 | dialogPositive.dismiss(); | 337 | dialogPositive.dismiss(); |
328 | onBackPressed(); | 338 | onBackPressed(); | ... | ... |
1 | package ly.warp.sdk.activities; | 1 | package ly.warp.sdk.activities; |
2 | 2 | ||
3 | import android.Manifest; | 3 | import android.Manifest; |
4 | +import android.content.Context; | ||
5 | +import android.content.Intent; | ||
4 | import android.content.pm.PackageManager; | 6 | import android.content.pm.PackageManager; |
7 | +import android.net.Uri; | ||
5 | import android.os.Bundle; | 8 | import android.os.Bundle; |
6 | import android.os.Handler; | 9 | import android.os.Handler; |
7 | import android.os.Looper; | 10 | import android.os.Looper; |
11 | +import android.text.TextUtils; | ||
8 | import android.util.Log; | 12 | import android.util.Log; |
9 | import android.view.View; | 13 | import android.view.View; |
10 | import android.widget.ImageView; | 14 | import android.widget.ImageView; |
15 | +import android.widget.LinearLayout; | ||
16 | +import android.widget.TextView; | ||
11 | 17 | ||
12 | import androidx.annotation.NonNull; | 18 | import androidx.annotation.NonNull; |
13 | import androidx.core.app.ActivityCompat; | 19 | import androidx.core.app.ActivityCompat; |
14 | import androidx.core.content.ContextCompat; | 20 | import androidx.core.content.ContextCompat; |
15 | import androidx.fragment.app.FragmentActivity; | 21 | import androidx.fragment.app.FragmentActivity; |
16 | 22 | ||
23 | +import com.bumptech.glide.Glide; | ||
24 | +import com.bumptech.glide.load.engine.DiskCacheStrategy; | ||
17 | import com.google.android.gms.maps.CameraUpdate; | 25 | import com.google.android.gms.maps.CameraUpdate; |
18 | import com.google.android.gms.maps.CameraUpdateFactory; | 26 | import com.google.android.gms.maps.CameraUpdateFactory; |
19 | import com.google.android.gms.maps.GoogleMap; | 27 | import com.google.android.gms.maps.GoogleMap; |
20 | import com.google.android.gms.maps.OnMapReadyCallback; | 28 | import com.google.android.gms.maps.OnMapReadyCallback; |
21 | import com.google.android.gms.maps.SupportMapFragment; | 29 | import com.google.android.gms.maps.SupportMapFragment; |
30 | +import com.google.android.gms.maps.model.LatLng; | ||
31 | +import com.google.android.gms.maps.model.Marker; | ||
32 | +import com.google.android.gms.maps.model.MarkerOptions; | ||
33 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | ||
22 | import com.google.maps.android.clustering.Cluster; | 34 | import com.google.maps.android.clustering.Cluster; |
23 | import com.google.maps.android.clustering.ClusterManager; | 35 | import com.google.maps.android.clustering.ClusterManager; |
24 | 36 | ||
25 | import java.util.ArrayList; | 37 | import java.util.ArrayList; |
26 | 38 | ||
39 | +import io.github.inflationx.viewpump.ViewPumpContextWrapper; | ||
27 | import ly.warp.sdk.R; | 40 | import ly.warp.sdk.R; |
28 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 41 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
29 | import ly.warp.sdk.io.models.Couponset; | 42 | import ly.warp.sdk.io.models.Couponset; |
... | @@ -35,7 +48,8 @@ import ly.warp.sdk.utils.managers.WarplyManager; | ... | @@ -35,7 +48,8 @@ import ly.warp.sdk.utils.managers.WarplyManager; |
35 | 48 | ||
36 | 49 | ||
37 | public class ShopsActivity extends FragmentActivity implements View.OnClickListener, | 50 | public class ShopsActivity extends FragmentActivity implements View.OnClickListener, |
38 | - OnMapReadyCallback, GoogleMap.OnMapLoadedCallback, ClusterManager.OnClusterClickListener<Merchant> { | 51 | + OnMapReadyCallback, GoogleMap.OnMapLoadedCallback, ClusterManager.OnClusterClickListener<Merchant>, |
52 | + GoogleMap.OnMarkerClickListener { | ||
39 | 53 | ||
40 | // =========================================================== | 54 | // =========================================================== |
41 | // Constants | 55 | // Constants |
... | @@ -52,6 +66,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -52,6 +66,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
52 | private GoogleMap mMap; | 66 | private GoogleMap mMap; |
53 | private ClusterManager<Merchant> mClusterManager; | 67 | private ClusterManager<Merchant> mClusterManager; |
54 | SupportMapFragment mMapView; | 68 | SupportMapFragment mMapView; |
69 | + private MerchantList mMerchantList = new MerchantList(); | ||
55 | 70 | ||
56 | // =========================================================== | 71 | // =========================================================== |
57 | // Methods for/from SuperClass/Interfaces | 72 | // Methods for/from SuperClass/Interfaces |
... | @@ -83,6 +98,11 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -83,6 +98,11 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
83 | } | 98 | } |
84 | 99 | ||
85 | @Override | 100 | @Override |
101 | + protected void attachBaseContext(Context newBase) { | ||
102 | + super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase)); | ||
103 | + } | ||
104 | + | ||
105 | + @Override | ||
86 | public void onMapReady(@NonNull GoogleMap googleMap) { | 106 | public void onMapReady(@NonNull GoogleMap googleMap) { |
87 | mMap = googleMap; | 107 | mMap = googleMap; |
88 | 108 | ||
... | @@ -108,6 +128,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -108,6 +128,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
108 | mMap.getUiSettings().setTiltGesturesEnabled(false); | 128 | mMap.getUiSettings().setTiltGesturesEnabled(false); |
109 | mMap.getUiSettings().setRotateGesturesEnabled(false); | 129 | mMap.getUiSettings().setRotateGesturesEnabled(false); |
110 | mMap.setOnMapLoadedCallback(this); | 130 | mMap.setOnMapLoadedCallback(this); |
131 | + mMap.setOnMarkerClickListener(/*mClusterManager*/this); | ||
111 | } | 132 | } |
112 | 133 | ||
113 | @Override | 134 | @Override |
... | @@ -118,11 +139,11 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -118,11 +139,11 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
118 | mMap.animateCamera(camUpdate); | 139 | mMap.animateCamera(camUpdate); |
119 | } | 140 | } |
120 | 141 | ||
121 | - if (mClusterManager == null) { | 142 | +// if (mClusterManager == null) { |
122 | - mClusterManager = new ClusterManager<>(this, mMap); | 143 | +// mClusterManager = new ClusterManager<>(this, mMap); |
123 | - mClusterManager.setOnClusterClickListener(this); | 144 | +// mClusterManager.setOnClusterClickListener(this); |
124 | - mMap.setOnMarkerClickListener(mClusterManager); | 145 | +//// mMap.setOnMarkerClickListener(/*mClusterManager*/this); |
125 | - } | 146 | +// } |
126 | 147 | ||
127 | if (mCouponset != null) { | 148 | if (mCouponset != null) { |
128 | ArrayList<String> uuids = new ArrayList<>(); | 149 | ArrayList<String> uuids = new ArrayList<>(); |
... | @@ -153,6 +174,59 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -153,6 +174,59 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
153 | return true; | 174 | return true; |
154 | } | 175 | } |
155 | 176 | ||
177 | + @Override | ||
178 | + public boolean onMarkerClick(@NonNull Marker marker) { | ||
179 | + for (Merchant merch : mMerchantList) { | ||
180 | + if (merch.getUuid().equals(marker.getSnippet())) { | ||
181 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | ||
182 | + bottomSheetDialog.setContentView(R.layout.dl_map_pin); | ||
183 | + | ||
184 | + ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close); | ||
185 | + dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | ||
186 | + | ||
187 | + TextView pinTitle = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_title); | ||
188 | + pinTitle.setText(merch.getAdminName()); | ||
189 | + | ||
190 | + ImageView pinLogo = (ImageView) bottomSheetDialog.findViewById(R.id.iv_pin_logo); | ||
191 | + if (!TextUtils.isEmpty(merch.getImgPreview())) { | ||
192 | + Glide.with(this) | ||
193 | +// .setDefaultRequestOptions( | ||
194 | +// RequestOptions | ||
195 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
196 | +// .error(R.drawable.ic_default_contact_photo)) | ||
197 | + .load(merch.getImgPreview()) | ||
198 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
199 | + .into(pinLogo); | ||
200 | + } | ||
201 | + | ||
202 | + TextView pinName = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_name); | ||
203 | + pinName.setText(merch.getName()); | ||
204 | + | ||
205 | + TextView pinDays = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_days); | ||
206 | + pinDays.setText(merch.getSnippet()); | ||
207 | + | ||
208 | + TextView pinTel = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_tel); | ||
209 | + pinTel.setText(merch.getTelephone()); | ||
210 | + | ||
211 | + TextView pinAddress = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_address); | ||
212 | + pinAddress.setText(merch.getAddress()); | ||
213 | + | ||
214 | + LinearLayout pinDirections = (LinearLayout) bottomSheetDialog.findViewById(R.id.ll_directions); | ||
215 | + pinDirections.setOnClickListener(view -> { | ||
216 | + Uri gmmIntentUri = Uri.parse("google.navigation:q=" + merch.getLatitude() + "," + merch.getLongitude()/* + "&mode=w"*/); | ||
217 | + Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); | ||
218 | + mapIntent.setPackage("com.google.android.apps.maps"); | ||
219 | + startActivity(mapIntent); | ||
220 | + }); | ||
221 | + | ||
222 | + bottomSheetDialog.show(); | ||
223 | + | ||
224 | + return false; | ||
225 | + } | ||
226 | + } | ||
227 | + | ||
228 | + return false; | ||
229 | + } | ||
156 | 230 | ||
157 | // =========================================================== | 231 | // =========================================================== |
158 | // Methods | 232 | // Methods |
... | @@ -161,14 +235,24 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -161,14 +235,24 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
161 | private final CallbackReceiver<MerchantList> mMerchantsCallback = new CallbackReceiver<MerchantList>() { | 235 | private final CallbackReceiver<MerchantList> mMerchantsCallback = new CallbackReceiver<MerchantList>() { |
162 | @Override | 236 | @Override |
163 | public void onSuccess(MerchantList result) { | 237 | public void onSuccess(MerchantList result) { |
238 | + mMerchantList.clear(); | ||
239 | + mMerchantList.addAll(result); | ||
164 | new Handler(Looper.getMainLooper()).post(() -> { | 240 | new Handler(Looper.getMainLooper()).post(() -> { |
165 | - if (mClusterManager != null) { | 241 | +// if (mClusterManager != null) { |
166 | - mMap.clear(); | 242 | +// mMap.clear(); |
167 | - mClusterManager.clearItems(); | 243 | +// mClusterManager.clearItems(); |
168 | - if (result != null) { | 244 | +// if (result != null) { |
169 | - mClusterManager.addItems(result); | 245 | +// mClusterManager.addItems(result); |
170 | - } | 246 | +// } |
171 | - mClusterManager.cluster(); | 247 | +// mClusterManager.cluster(); |
248 | +// } | ||
249 | + | ||
250 | + for (Merchant merch : result) { | ||
251 | + mMap.addMarker(new MarkerOptions() | ||
252 | + .position(new LatLng(merch.getLatitude(), merch.getLongitude())) | ||
253 | + .anchor(0.5f, 0.5f) | ||
254 | + .title(merch.getTitle()) | ||
255 | + .snippet(merch.getUuid())); | ||
172 | } | 256 | } |
173 | }); | 257 | }); |
174 | } | 258 | } | ... | ... |
... | @@ -52,6 +52,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -52,6 +52,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
52 | private static final String DATE = "date"; | 52 | private static final String DATE = "date"; |
53 | private static final String COUPONSET_UUID = "couponset_uuid"; | 53 | private static final String COUPONSET_UUID = "couponset_uuid"; |
54 | private static final String NAME = "name"; | 54 | private static final String NAME = "name"; |
55 | + private static final String MERCHANT_UUID = "merchant_uuid"; | ||
55 | 56 | ||
56 | /* Member variables of the Campaign object */ | 57 | /* Member variables of the Campaign object */ |
57 | 58 | ||
... | @@ -61,6 +62,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -61,6 +62,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
61 | private String date = ""; | 62 | private String date = ""; |
62 | private String couponsetUuid = ""; | 63 | private String couponsetUuid = ""; |
63 | private String name = ""; | 64 | private String name = ""; |
65 | + private String merchantUuid = ""; | ||
64 | 66 | ||
65 | /** | 67 | /** |
66 | * Basic constructor used to create an object from a String, representing a | 68 | * Basic constructor used to create an object from a String, representing a |
... | @@ -95,6 +97,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -95,6 +97,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
95 | this.sharingType = json.optString(SHARING_TYPE); | 97 | this.sharingType = json.optString(SHARING_TYPE); |
96 | this.transactionMetadata = json.optString(TRANSACTION_METADATA); | 98 | this.transactionMetadata = json.optString(TRANSACTION_METADATA); |
97 | this.name = json.optString(NAME); | 99 | this.name = json.optString(NAME); |
100 | + this.merchantUuid = json.optString(MERCHANT_UUID); | ||
98 | } | 101 | } |
99 | } | 102 | } |
100 | 103 | ||
... | @@ -105,6 +108,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -105,6 +108,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
105 | this.sharingType = source.readString(); | 108 | this.sharingType = source.readString(); |
106 | this.transactionMetadata = source.readString(); | 109 | this.transactionMetadata = source.readString(); |
107 | this.name = source.readString(); | 110 | this.name = source.readString(); |
111 | + this.merchantUuid = source.readString(); | ||
108 | } | 112 | } |
109 | 113 | ||
110 | @Override | 114 | @Override |
... | @@ -115,6 +119,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -115,6 +119,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
115 | dest.writeString(this.sharingType); | 119 | dest.writeString(this.sharingType); |
116 | dest.writeString(this.transactionMetadata); | 120 | dest.writeString(this.transactionMetadata); |
117 | dest.writeString(this.name); | 121 | dest.writeString(this.name); |
122 | + dest.writeString(this.merchantUuid); | ||
118 | } | 123 | } |
119 | 124 | ||
120 | /** | 125 | /** |
... | @@ -131,6 +136,7 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -131,6 +136,7 @@ public class SharingCoupon implements Parcelable, Serializable { |
131 | jObj.putOpt(SHARING_TYPE, this.sharingType); | 136 | jObj.putOpt(SHARING_TYPE, this.sharingType); |
132 | jObj.putOpt(TRANSACTION_METADATA, this.transactionMetadata); | 137 | jObj.putOpt(TRANSACTION_METADATA, this.transactionMetadata); |
133 | jObj.putOpt(NAME, this.name); | 138 | jObj.putOpt(NAME, this.name); |
139 | + jObj.putOpt(MERCHANT_UUID, this.merchantUuid); | ||
134 | } catch (JSONException e) { | 140 | } catch (JSONException e) { |
135 | if (WarpConstants.DEBUG) { | 141 | if (WarpConstants.DEBUG) { |
136 | e.printStackTrace(); | 142 | e.printStackTrace(); |
... | @@ -218,6 +224,14 @@ public class SharingCoupon implements Parcelable, Serializable { | ... | @@ -218,6 +224,14 @@ public class SharingCoupon implements Parcelable, Serializable { |
218 | this.name = name; | 224 | this.name = name; |
219 | } | 225 | } |
220 | 226 | ||
227 | + public String getMerchantUuid() { | ||
228 | + return merchantUuid; | ||
229 | + } | ||
230 | + | ||
231 | + public void setMerchantUuid(String merchantUuid) { | ||
232 | + this.merchantUuid = merchantUuid; | ||
233 | + } | ||
234 | + | ||
221 | @Override | 235 | @Override |
222 | public int describeContents() { | 236 | public int describeContents() { |
223 | return 0; | 237 | return 0; | ... | ... |
... | @@ -136,13 +136,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -136,13 +136,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
136 | } | 136 | } |
137 | } | 137 | } |
138 | } else { | 138 | } else { |
139 | - if (!TextUtils.isEmpty(merchant.getImage())) { | 139 | + if (!TextUtils.isEmpty(merchant.getImgPreview())) { |
140 | Glide.with(mContext) | 140 | Glide.with(mContext) |
141 | // .setDefaultRequestOptions( | 141 | // .setDefaultRequestOptions( |
142 | // RequestOptions | 142 | // RequestOptions |
143 | // .placeholderOf(R.drawable.ic_default_contact_photo) | 143 | // .placeholderOf(R.drawable.ic_default_contact_photo) |
144 | // .error(R.drawable.ic_default_contact_photo)) | 144 | // .error(R.drawable.ic_default_contact_photo)) |
145 | - .load(merchant.getImage()) | 145 | + .load(merchant.getImgPreview()) |
146 | .diskCacheStrategy(DiskCacheStrategy.DATA) | 146 | .diskCacheStrategy(DiskCacheStrategy.DATA) |
147 | .into(holder.ivCouponLogo); | 147 | .into(holder.ivCouponLogo); |
148 | } else { | 148 | } else { | ... | ... |
1 | package ly.warp.sdk.views.adapters; | 1 | package ly.warp.sdk.views.adapters; |
2 | 2 | ||
3 | import android.content.Context; | 3 | import android.content.Context; |
4 | +import android.text.TextUtils; | ||
4 | import android.view.LayoutInflater; | 5 | import android.view.LayoutInflater; |
5 | import android.view.View; | 6 | import android.view.View; |
6 | import android.view.ViewGroup; | 7 | import android.view.ViewGroup; |
... | @@ -9,6 +10,9 @@ import android.widget.TextView; | ... | @@ -9,6 +10,9 @@ import android.widget.TextView; |
9 | 10 | ||
10 | import androidx.recyclerview.widget.RecyclerView; | 11 | import androidx.recyclerview.widget.RecyclerView; |
11 | 12 | ||
13 | +import com.bumptech.glide.Glide; | ||
14 | +import com.bumptech.glide.load.engine.DiskCacheStrategy; | ||
15 | + | ||
12 | import java.text.ParseException; | 16 | import java.text.ParseException; |
13 | import java.text.SimpleDateFormat; | 17 | import java.text.SimpleDateFormat; |
14 | import java.util.Date; | 18 | import java.util.Date; |
... | @@ -19,6 +23,8 @@ import io.reactivex.subjects.PublishSubject; | ... | @@ -19,6 +23,8 @@ import io.reactivex.subjects.PublishSubject; |
19 | import ly.warp.sdk.R; | 23 | import ly.warp.sdk.R; |
20 | import ly.warp.sdk.io.models.Coupon; | 24 | import ly.warp.sdk.io.models.Coupon; |
21 | import ly.warp.sdk.io.models.CouponList; | 25 | import ly.warp.sdk.io.models.CouponList; |
26 | +import ly.warp.sdk.io.models.Merchant; | ||
27 | +import ly.warp.sdk.utils.WarplyManagerHelper; | ||
22 | 28 | ||
23 | public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdapter.ExpiredCouponViewHolder> { | 29 | public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdapter.ExpiredCouponViewHolder> { |
24 | 30 | ||
... | @@ -33,12 +39,14 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -33,12 +39,14 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
33 | 39 | ||
34 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { | 40 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { |
35 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; | 41 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; |
42 | + private ImageView ivCouponLogo; | ||
36 | 43 | ||
37 | public ExpiredCouponViewHolder(View view) { | 44 | public ExpiredCouponViewHolder(View view) { |
38 | super(view); | 45 | super(view); |
39 | tvCouponTitle = view.findViewById(R.id.tv_expired_coupons_title); | 46 | tvCouponTitle = view.findViewById(R.id.tv_expired_coupons_title); |
40 | tvCouponValue = view.findViewById(R.id.tv_expired_coupons_value); | 47 | tvCouponValue = view.findViewById(R.id.tv_expired_coupons_value); |
41 | tvCouponDate = view.findViewById(R.id.tv_expired_coupons_date); | 48 | tvCouponDate = view.findViewById(R.id.tv_expired_coupons_date); |
49 | + ivCouponLogo = view.findViewById(R.id.iv_expired_logo); | ||
42 | } | 50 | } |
43 | } | 51 | } |
44 | 52 | ||
... | @@ -72,9 +80,33 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -72,9 +80,33 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
72 | @Override | 80 | @Override |
73 | public void onBindViewHolder(final ExpiredCouponViewHolder holder, int position) { | 81 | public void onBindViewHolder(final ExpiredCouponViewHolder holder, int position) { |
74 | Coupon couponItem = mCoupons.get(position); | 82 | Coupon couponItem = mCoupons.get(position); |
83 | + Merchant merchant = new Merchant(); | ||
75 | 84 | ||
76 | if (couponItem != null) { | 85 | if (couponItem != null) { |
86 | + if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { | ||
87 | + for (Merchant mer : WarplyManagerHelper.getMerchantList()) { | ||
88 | + if (mer.getUuid().equals(couponItem.getMerchantUuid())) { | ||
89 | + merchant = mer; | ||
90 | + break; | ||
91 | + } | ||
92 | + } | ||
93 | + } | ||
94 | + | ||
95 | + if (merchant == null) { | ||
77 | holder.tvCouponTitle.setText(couponItem.getName()); | 96 | holder.tvCouponTitle.setText(couponItem.getName()); |
97 | + } else { | ||
98 | + holder.tvCouponTitle.setText(merchant.getAdminName()); | ||
99 | + if (!TextUtils.isEmpty(merchant.getImgPreview())) { | ||
100 | + Glide.with(mContext) | ||
101 | +// .setDefaultRequestOptions( | ||
102 | +// RequestOptions | ||
103 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
104 | +// .error(R.drawable.ic_default_contact_photo)) | ||
105 | + .load(merchant.getImgPreview()) | ||
106 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
107 | + .into(holder.ivCouponLogo); | ||
108 | + } | ||
109 | + } | ||
78 | 110 | ||
79 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 111 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); |
80 | Date newDate = new Date(); | 112 | Date newDate = new Date(); | ... | ... |
1 | package ly.warp.sdk.views.adapters; | 1 | package ly.warp.sdk.views.adapters; |
2 | 2 | ||
3 | import android.content.Context; | 3 | import android.content.Context; |
4 | +import android.text.TextUtils; | ||
4 | import android.view.LayoutInflater; | 5 | import android.view.LayoutInflater; |
5 | import android.view.View; | 6 | import android.view.View; |
6 | import android.view.ViewGroup; | 7 | import android.view.ViewGroup; |
8 | +import android.widget.ImageView; | ||
7 | import android.widget.TextView; | 9 | import android.widget.TextView; |
8 | 10 | ||
9 | import androidx.recyclerview.widget.RecyclerView; | 11 | import androidx.recyclerview.widget.RecyclerView; |
10 | 12 | ||
13 | +import com.bumptech.glide.Glide; | ||
14 | +import com.bumptech.glide.load.engine.DiskCacheStrategy; | ||
15 | + | ||
11 | import org.json.JSONObject; | 16 | import org.json.JSONObject; |
12 | 17 | ||
13 | import java.text.ParseException; | 18 | import java.text.ParseException; |
... | @@ -18,9 +23,11 @@ import java.util.concurrent.TimeUnit; | ... | @@ -18,9 +23,11 @@ import java.util.concurrent.TimeUnit; |
18 | import io.reactivex.Observable; | 23 | import io.reactivex.Observable; |
19 | import io.reactivex.subjects.PublishSubject; | 24 | import io.reactivex.subjects.PublishSubject; |
20 | import ly.warp.sdk.R; | 25 | import ly.warp.sdk.R; |
26 | +import ly.warp.sdk.io.models.Merchant; | ||
21 | import ly.warp.sdk.io.models.SharingCoupon; | 27 | import ly.warp.sdk.io.models.SharingCoupon; |
22 | import ly.warp.sdk.io.models.SharingList; | 28 | import ly.warp.sdk.io.models.SharingList; |
23 | import ly.warp.sdk.utils.WarpJSONParser; | 29 | import ly.warp.sdk.utils.WarpJSONParser; |
30 | +import ly.warp.sdk.utils.WarplyManagerHelper; | ||
24 | 31 | ||
25 | public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapter.SharedCouponViewHolder> { | 32 | public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapter.SharedCouponViewHolder> { |
26 | 33 | ||
... | @@ -35,6 +42,7 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte | ... | @@ -35,6 +42,7 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte |
35 | 42 | ||
36 | public class SharedCouponViewHolder extends RecyclerView.ViewHolder { | 43 | public class SharedCouponViewHolder extends RecyclerView.ViewHolder { |
37 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponLabel, tvCouponPhone; | 44 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponLabel, tvCouponPhone; |
45 | + private ImageView ivCouponLogo; | ||
38 | 46 | ||
39 | public SharedCouponViewHolder(View view) { | 47 | public SharedCouponViewHolder(View view) { |
40 | super(view); | 48 | super(view); |
... | @@ -43,6 +51,7 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte | ... | @@ -43,6 +51,7 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte |
43 | tvCouponDate = view.findViewById(R.id.tv_shared_coupons_date); | 51 | tvCouponDate = view.findViewById(R.id.tv_shared_coupons_date); |
44 | tvCouponLabel = view.findViewById(R.id.tv_shared_coupons_label); | 52 | tvCouponLabel = view.findViewById(R.id.tv_shared_coupons_label); |
45 | tvCouponPhone = view.findViewById(R.id.tv_shared_coupons_phone); | 53 | tvCouponPhone = view.findViewById(R.id.tv_shared_coupons_phone); |
54 | + ivCouponLogo = view.findViewById(R.id.iv_shared_logo); | ||
46 | } | 55 | } |
47 | } | 56 | } |
48 | 57 | ||
... | @@ -76,11 +85,35 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte | ... | @@ -76,11 +85,35 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte |
76 | @Override | 85 | @Override |
77 | public void onBindViewHolder(final SharedCouponViewHolder holder, int position) { | 86 | public void onBindViewHolder(final SharedCouponViewHolder holder, int position) { |
78 | SharingCoupon couponItem = mCoupons.get(position); | 87 | SharingCoupon couponItem = mCoupons.get(position); |
88 | + Merchant merchant = new Merchant(); | ||
79 | 89 | ||
80 | if (couponItem != null) { | 90 | if (couponItem != null) { |
81 | - JSONObject extraFields = WarpJSONParser.getJSONFromString(couponItem.getTransactionMetadata()); | 91 | + if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { |
92 | + for (Merchant mer : WarplyManagerHelper.getMerchantList()) { | ||
93 | + if (mer.getUuid().equals(couponItem.getMerchantUuid())) { | ||
94 | + merchant = mer; | ||
95 | + break; | ||
96 | + } | ||
97 | + } | ||
98 | + } | ||
82 | 99 | ||
100 | + if (merchant == null) { | ||
83 | holder.tvCouponTitle.setText(couponItem.getName()); | 101 | holder.tvCouponTitle.setText(couponItem.getName()); |
102 | + } else { | ||
103 | + holder.tvCouponTitle.setText(merchant.getAdminName()); | ||
104 | + if (!TextUtils.isEmpty(merchant.getImgPreview())) { | ||
105 | + Glide.with(mContext) | ||
106 | +// .setDefaultRequestOptions( | ||
107 | +// RequestOptions | ||
108 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
109 | +// .error(R.drawable.ic_default_contact_photo)) | ||
110 | + .load(merchant.getImgPreview()) | ||
111 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
112 | + .into(holder.ivCouponLogo); | ||
113 | + } | ||
114 | + } | ||
115 | + | ||
116 | + JSONObject extraFields = WarpJSONParser.getJSONFromString(couponItem.getTransactionMetadata()); | ||
84 | 117 | ||
85 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 118 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); |
86 | Date newDate = new Date(); | 119 | Date newDate = new Date(); | ... | ... |
997 Bytes
757 Bytes
657 Bytes
... | @@ -100,6 +100,19 @@ | ... | @@ -100,6 +100,19 @@ |
100 | android:layout_marginHorizontal="8dp" | 100 | android:layout_marginHorizontal="8dp" |
101 | android:layout_marginTop="24dp" | 101 | android:layout_marginTop="24dp" |
102 | android:orientation="vertical" /> | 102 | android:orientation="vertical" /> |
103 | + | ||
104 | + <TextView | ||
105 | + android:id="@+id/tv_expired_empty" | ||
106 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
107 | + android:layout_width="wrap_content" | ||
108 | + android:layout_height="wrap_content" | ||
109 | + android:layout_centerHorizontal="true" | ||
110 | + android:layout_marginTop="56dp" | ||
111 | + android:layout_below="@+id/tv_expired_title" | ||
112 | + android:text="@string/cos_empty_expired_coupons" | ||
113 | + android:textColor="@color/cos_light_grey2" | ||
114 | + android:textSize="16sp" | ||
115 | + android:visibility="gone"/> | ||
103 | </RelativeLayout> | 116 | </RelativeLayout> |
104 | 117 | ||
105 | <RelativeLayout | 118 | <RelativeLayout |
... | @@ -128,5 +141,18 @@ | ... | @@ -128,5 +141,18 @@ |
128 | android:layout_marginHorizontal="8dp" | 141 | android:layout_marginHorizontal="8dp" |
129 | android:layout_marginTop="24dp" | 142 | android:layout_marginTop="24dp" |
130 | android:orientation="vertical" /> | 143 | android:orientation="vertical" /> |
144 | + | ||
145 | + <TextView | ||
146 | + android:id="@+id/tv_shared_empty" | ||
147 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
148 | + android:layout_width="wrap_content" | ||
149 | + android:layout_height="wrap_content" | ||
150 | + android:layout_centerHorizontal="true" | ||
151 | + android:layout_marginTop="56dp" | ||
152 | + android:layout_below="@+id/tv_shared_title" | ||
153 | + android:text="@string/cos_empty_shared_coupons" | ||
154 | + android:textColor="@color/cos_light_grey2" | ||
155 | + android:textSize="16sp" | ||
156 | + android:visibility="gone"/> | ||
131 | </RelativeLayout> | 157 | </RelativeLayout> |
132 | </RelativeLayout> | 158 | </RelativeLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -368,12 +368,13 @@ | ... | @@ -368,12 +368,13 @@ |
368 | android:textSize="18sp" | 368 | android:textSize="18sp" |
369 | tools:text="961544809" /> | 369 | tools:text="961544809" /> |
370 | 370 | ||
371 | - <!-- <TextView--> | 371 | + <TextView |
372 | - <!-- android:id="@+id/tv_active_deals_date_text"--> | 372 | + android:id="@+id/tv_active_deals_date_text" |
373 | - <!-- android:layout_width="wrap_content"--> | 373 | + android:layout_width="wrap_content" |
374 | - <!-- android:layout_height="wrap_content"--> | 374 | + android:layout_height="wrap_content" |
375 | - <!-- tools:text="@string/cos_active_coupon_date"--> | 375 | + android:textColor="@color/blue_dark" |
376 | - <!-- android:textColor="@color/blue_dark" />--> | 376 | + android:visibility="gone" |
377 | + tools:text="@string/cos_active_coupon_date" /> | ||
377 | </LinearLayout> | 378 | </LinearLayout> |
378 | 379 | ||
379 | <ImageView | 380 | <ImageView | ... | ... |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:id="@+id/rl_map_pin_view" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + android:background="@android:color/white" | ||
8 | + android:orientation="vertical"> | ||
9 | + | ||
10 | + <RelativeLayout | ||
11 | + android:id="@+id/rl_map_pin" | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + android:layout_marginBottom="24dp" | ||
15 | + android:background="@drawable/shape_cos_white_rounded_top" | ||
16 | + android:paddingHorizontal="24dp" | ||
17 | + android:paddingTop="16dp"> | ||
18 | + | ||
19 | + <TextView | ||
20 | + android:id="@+id/tv_pin_title" | ||
21 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
22 | + android:layout_width="wrap_content" | ||
23 | + android:layout_height="wrap_content" | ||
24 | + android:layout_alignParentStart="true" | ||
25 | + android:textColor="@color/cos_grey9" | ||
26 | + android:textSize="16sp" | ||
27 | + tools:text="ΓΕΡΜΑΝΟΣ" /> | ||
28 | + | ||
29 | + <ImageView | ||
30 | + android:id="@+id/iv_map_pin_close" | ||
31 | + android:layout_width="16dp" | ||
32 | + android:layout_height="16dp" | ||
33 | + android:layout_alignParentEnd="true" | ||
34 | + android:src="@drawable/ic_close" /> | ||
35 | + </RelativeLayout> | ||
36 | + | ||
37 | + <LinearLayout | ||
38 | + android:layout_width="match_parent" | ||
39 | + android:layout_height="wrap_content" | ||
40 | + android:gravity="center_vertical" | ||
41 | + android:paddingHorizontal="24dp"> | ||
42 | + | ||
43 | + <ImageView | ||
44 | + android:id="@+id/iv_pin_logo" | ||
45 | + android:layout_width="36dp" | ||
46 | + android:layout_height="36dp" | ||
47 | + tools:src="@drawable/ic_deals_circle" /> | ||
48 | + | ||
49 | + <LinearLayout | ||
50 | + android:id="@+id/ll_pin_title_view" | ||
51 | + android:layout_width="wrap_content" | ||
52 | + android:layout_height="wrap_content" | ||
53 | + android:layout_marginStart="8dp" | ||
54 | + android:layout_toEndOf="@+id/iv_pin_logo" | ||
55 | + android:orientation="vertical"> | ||
56 | + | ||
57 | + <TextView | ||
58 | + android:id="@+id/tv_pin_name" | ||
59 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
60 | + android:layout_width="wrap_content" | ||
61 | + android:layout_height="wrap_content" | ||
62 | + android:textColor="@color/grey" | ||
63 | + android:textSize="14sp" | ||
64 | + tools:text="Γερμανός Χαλανδρίου" /> | ||
65 | + | ||
66 | + <TextView | ||
67 | + android:id="@+id/tv_pin_days" | ||
68 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
69 | + android:layout_width="wrap_content" | ||
70 | + android:layout_height="wrap_content" | ||
71 | + android:textColor="@color/cos_grey8" | ||
72 | + android:textSize="14sp" | ||
73 | + tools:text="Δευτέρα-Τετάρτη" /> | ||
74 | + </LinearLayout> | ||
75 | + </LinearLayout> | ||
76 | + | ||
77 | + <View | ||
78 | + android:layout_width="match_parent" | ||
79 | + android:layout_height="1dp" | ||
80 | + android:layout_marginHorizontal="12dp" | ||
81 | + android:layout_marginVertical="12dp" | ||
82 | + android:background="@drawable/divider2" /> | ||
83 | + | ||
84 | + <LinearLayout | ||
85 | + android:layout_width="match_parent" | ||
86 | + android:layout_height="36dp" | ||
87 | + android:gravity="center_vertical" | ||
88 | + android:orientation="horizontal" | ||
89 | + android:paddingHorizontal="24dp"> | ||
90 | + | ||
91 | + <ImageView | ||
92 | + android:layout_width="14dp" | ||
93 | + android:layout_height="14dp" | ||
94 | + android:src="@drawable/ic_pin_tel" /> | ||
95 | + | ||
96 | + <TextView | ||
97 | + android:id="@+id/tv_pin_tel" | ||
98 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
99 | + android:layout_width="wrap_content" | ||
100 | + android:layout_height="wrap_content" | ||
101 | + android:layout_marginStart="12dp" | ||
102 | + android:textColor="@color/grey" | ||
103 | + android:textSize="14sp" | ||
104 | + tools:text="210-6230543" /> | ||
105 | + </LinearLayout> | ||
106 | + | ||
107 | + <View | ||
108 | + android:layout_width="match_parent" | ||
109 | + android:layout_height="1dp" | ||
110 | + android:layout_marginHorizontal="12dp" | ||
111 | + android:layout_marginVertical="12dp" | ||
112 | + android:background="@drawable/divider2" /> | ||
113 | + | ||
114 | + <RelativeLayout | ||
115 | + android:layout_width="match_parent" | ||
116 | + android:layout_height="wrap_content" | ||
117 | + android:layout_marginBottom="16dp" | ||
118 | + android:paddingHorizontal="24dp"> | ||
119 | + | ||
120 | + <LinearLayout | ||
121 | + android:id="@+id/ll_pin_address" | ||
122 | + android:layout_width="match_parent" | ||
123 | + android:layout_height="36dp" | ||
124 | + android:gravity="center_vertical" | ||
125 | + android:orientation="horizontal"> | ||
126 | + | ||
127 | + <ImageView | ||
128 | + android:layout_width="14dp" | ||
129 | + android:layout_height="14dp" | ||
130 | + android:src="@drawable/ic_pin_location" /> | ||
131 | + | ||
132 | + <TextView | ||
133 | + android:id="@+id/tv_pin_address" | ||
134 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
135 | + android:layout_width="184dp" | ||
136 | + android:layout_height="wrap_content" | ||
137 | + android:layout_marginStart="12dp" | ||
138 | + android:maxLines="2" | ||
139 | + android:textColor="@color/grey" | ||
140 | + android:textSize="14sp" | ||
141 | + tools:text="ΕΘΝΙΚΗΣ ΑΝΤΙΣΤΑΣΕΩΣ 4 41" /> | ||
142 | + </LinearLayout> | ||
143 | + | ||
144 | + <LinearLayout | ||
145 | + android:id="@+id/ll_directions" | ||
146 | + android:layout_width="wrap_content" | ||
147 | + android:layout_height="wrap_content" | ||
148 | + android:layout_alignParentEnd="true" | ||
149 | + android:layout_centerVertical="true" | ||
150 | + android:background="@drawable/selector_button_green" | ||
151 | + android:gravity="center" | ||
152 | + android:orientation="horizontal" | ||
153 | + android:paddingHorizontal="20dp" | ||
154 | + android:paddingVertical="8dp"> | ||
155 | + | ||
156 | + <ImageView | ||
157 | + android:layout_width="14dp" | ||
158 | + android:layout_height="14dp" | ||
159 | + android:src="@drawable/ic_pin_compass" /> | ||
160 | + | ||
161 | + <TextView | ||
162 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
163 | + android:layout_width="wrap_content" | ||
164 | + android:layout_height="wrap_content" | ||
165 | + android:layout_marginStart="8dp" | ||
166 | + android:gravity="center" | ||
167 | + android:text="@string/cos_directions" | ||
168 | + android:textColor="@color/white" | ||
169 | + android:textSize="14dp" /> | ||
170 | + </LinearLayout> | ||
171 | + </RelativeLayout> | ||
172 | + | ||
173 | +</LinearLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -7,52 +7,71 @@ | ... | @@ -7,52 +7,71 @@ |
7 | 7 | ||
8 | <TextView | 8 | <TextView |
9 | android:id="@+id/tv_expired_coupons_date" | 9 | android:id="@+id/tv_expired_coupons_date" |
10 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
10 | android:layout_width="wrap_content" | 11 | android:layout_width="wrap_content" |
11 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
12 | android:textColor="@color/cos_blue_dark2" | 13 | android:textColor="@color/cos_blue_dark2" |
13 | android:textSize="13sp" | 14 | android:textSize="13sp" |
14 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
15 | tools:text="05/05/2022" /> | 15 | tools:text="05/05/2022" /> |
16 | 16 | ||
17 | <LinearLayout | 17 | <LinearLayout |
18 | - android:id="@+id/ll_expired_info_view" | ||
19 | android:layout_width="match_parent" | 18 | android:layout_width="match_parent" |
20 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
21 | android:layout_below="@+id/tv_expired_coupons_date" | 20 | android:layout_below="@+id/tv_expired_coupons_date" |
22 | android:layout_marginTop="8dp" | 21 | android:layout_marginTop="8dp" |
22 | + android:orientation="horizontal"> | ||
23 | + | ||
24 | + <ImageView | ||
25 | + android:id="@+id/iv_expired_logo" | ||
26 | + android:layout_width="28dp" | ||
27 | + android:layout_height="28dp" | ||
28 | + tools:src="@drawable/ic_deals_circle" /> | ||
29 | + | ||
30 | + <LinearLayout | ||
31 | + android:layout_width="match_parent" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:layout_marginStart="6dp" | ||
34 | + android:orientation="vertical"> | ||
35 | + | ||
36 | + <LinearLayout | ||
37 | + android:id="@+id/ll_expired_info_view" | ||
38 | + android:layout_width="match_parent" | ||
39 | + android:layout_height="wrap_content" | ||
23 | android:orientation="horizontal" | 40 | android:orientation="horizontal" |
24 | android:weightSum="1"> | 41 | android:weightSum="1"> |
25 | 42 | ||
26 | <TextView | 43 | <TextView |
27 | android:id="@+id/tv_expired_coupons_title" | 44 | android:id="@+id/tv_expired_coupons_title" |
28 | - android:layout_width="0dp" | 45 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" |
46 | + android:layout_width="wrap_content" | ||
29 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
30 | android:layout_weight="0.5" | 48 | android:layout_weight="0.5" |
31 | android:maxLines="2" | 49 | android:maxLines="2" |
32 | android:textColor="@color/cos_blue_dark2" | 50 | android:textColor="@color/cos_blue_dark2" |
33 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
34 | android:textSize="16sp" | 51 | android:textSize="16sp" |
35 | tools:text="Box" /> | 52 | tools:text="Box" /> |
36 | 53 | ||
37 | <TextView | 54 | <TextView |
38 | android:id="@+id/tv_expired_coupons_value" | 55 | android:id="@+id/tv_expired_coupons_value" |
56 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
39 | android:layout_width="wrap_content" | 57 | android:layout_width="wrap_content" |
40 | android:layout_height="wrap_content" | 58 | android:layout_height="wrap_content" |
41 | android:layout_weight="0.5" | 59 | android:layout_weight="0.5" |
42 | android:gravity="end" | 60 | android:gravity="end" |
43 | android:textColor="@color/cos_blue_dark2" | 61 | android:textColor="@color/cos_blue_dark2" |
44 | android:textSize="16sp" | 62 | android:textSize="16sp" |
45 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
46 | tools:text="4$" /> | 63 | tools:text="4$" /> |
47 | </LinearLayout> | 64 | </LinearLayout> |
48 | 65 | ||
49 | <TextView | 66 | <TextView |
50 | android:id="@+id/tv_expired_coupons_label" | 67 | android:id="@+id/tv_expired_coupons_label" |
68 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
51 | android:layout_width="wrap_content" | 69 | android:layout_width="wrap_content" |
52 | android:layout_height="wrap_content" | 70 | android:layout_height="wrap_content" |
53 | android:layout_below="@+id/ll_expired_info_view" | 71 | android:layout_below="@+id/ll_expired_info_view" |
54 | android:text="@string/cos_expired_coupon_label" | 72 | android:text="@string/cos_expired_coupon_label" |
55 | - fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
56 | android:textColor="@color/cos_light_grey2" | 73 | android:textColor="@color/cos_light_grey2" |
57 | android:textSize="16sp" /> | 74 | android:textSize="16sp" /> |
75 | + </LinearLayout> | ||
76 | + </LinearLayout> | ||
58 | </RelativeLayout> | 77 | </RelativeLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -7,62 +7,79 @@ | ... | @@ -7,62 +7,79 @@ |
7 | 7 | ||
8 | <TextView | 8 | <TextView |
9 | android:id="@+id/tv_shared_coupons_date" | 9 | android:id="@+id/tv_shared_coupons_date" |
10 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
10 | android:layout_width="wrap_content" | 11 | android:layout_width="wrap_content" |
11 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
12 | android:textColor="@color/cos_blue_dark2" | 13 | android:textColor="@color/cos_blue_dark2" |
13 | android:textSize="13sp" | 14 | android:textSize="13sp" |
14 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
15 | tools:text="05/05/2022" /> | 15 | tools:text="05/05/2022" /> |
16 | 16 | ||
17 | <LinearLayout | 17 | <LinearLayout |
18 | - android:id="@+id/ll_expired_info_view" | ||
19 | android:layout_width="match_parent" | 18 | android:layout_width="match_parent" |
20 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
21 | android:layout_below="@+id/tv_shared_coupons_date" | 20 | android:layout_below="@+id/tv_shared_coupons_date" |
22 | android:layout_marginTop="8dp" | 21 | android:layout_marginTop="8dp" |
22 | + android:orientation="horizontal"> | ||
23 | + | ||
24 | + <ImageView | ||
25 | + android:id="@+id/iv_shared_logo" | ||
26 | + android:layout_width="28dp" | ||
27 | + android:layout_height="28dp" | ||
28 | + tools:src="@drawable/ic_deals_circle" /> | ||
29 | + | ||
30 | + <LinearLayout | ||
31 | + android:layout_width="match_parent" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:layout_marginStart="6dp" | ||
34 | + android:orientation="vertical"> | ||
35 | + | ||
36 | + <LinearLayout | ||
37 | + android:id="@+id/ll_expired_info_view" | ||
38 | + android:layout_width="match_parent" | ||
39 | + android:layout_height="wrap_content" | ||
23 | android:orientation="horizontal" | 40 | android:orientation="horizontal" |
24 | android:weightSum="1"> | 41 | android:weightSum="1"> |
25 | 42 | ||
26 | <TextView | 43 | <TextView |
27 | android:id="@+id/tv_shared_coupons_title" | 44 | android:id="@+id/tv_shared_coupons_title" |
28 | - android:layout_width="0dp" | 45 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" |
46 | + android:layout_width="wrap_content" | ||
29 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
30 | android:layout_weight="0.5" | 48 | android:layout_weight="0.5" |
31 | android:maxLines="2" | 49 | android:maxLines="2" |
32 | android:textColor="@color/cos_blue_dark2" | 50 | android:textColor="@color/cos_blue_dark2" |
33 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
34 | android:textSize="16sp" | 51 | android:textSize="16sp" |
35 | tools:text="Box" /> | 52 | tools:text="Box" /> |
36 | 53 | ||
37 | <TextView | 54 | <TextView |
38 | android:id="@+id/tv_shared_coupons_value" | 55 | android:id="@+id/tv_shared_coupons_value" |
56 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
39 | android:layout_width="wrap_content" | 57 | android:layout_width="wrap_content" |
40 | android:layout_height="wrap_content" | 58 | android:layout_height="wrap_content" |
41 | android:layout_weight="0.5" | 59 | android:layout_weight="0.5" |
42 | android:gravity="end" | 60 | android:gravity="end" |
43 | android:textColor="@color/cos_blue_dark2" | 61 | android:textColor="@color/cos_blue_dark2" |
44 | android:textSize="16sp" | 62 | android:textSize="16sp" |
45 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
46 | tools:text="4$" /> | 63 | tools:text="4$" /> |
47 | </LinearLayout> | 64 | </LinearLayout> |
48 | 65 | ||
49 | <TextView | 66 | <TextView |
50 | android:id="@+id/tv_shared_coupons_label" | 67 | android:id="@+id/tv_shared_coupons_label" |
68 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
51 | android:layout_width="wrap_content" | 69 | android:layout_width="wrap_content" |
52 | android:layout_height="wrap_content" | 70 | android:layout_height="wrap_content" |
53 | - android:layout_below="@+id/ll_expired_info_view" | ||
54 | android:textColor="@color/cos_light_grey2" | 71 | android:textColor="@color/cos_light_grey2" |
55 | android:textSize="16sp" | 72 | android:textSize="16sp" |
56 | - fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
57 | tools:text="@string/cos_expired_coupon_label" /> | 73 | tools:text="@string/cos_expired_coupon_label" /> |
58 | 74 | ||
59 | <TextView | 75 | <TextView |
60 | android:id="@+id/tv_shared_coupons_phone" | 76 | android:id="@+id/tv_shared_coupons_phone" |
77 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
61 | android:layout_width="wrap_content" | 78 | android:layout_width="wrap_content" |
62 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
63 | - fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
64 | - android:layout_below="@+id/tv_shared_coupons_label" | ||
65 | android:textColor="@color/cos_light_grey2" | 80 | android:textColor="@color/cos_light_grey2" |
66 | android:textSize="16sp" | 81 | android:textSize="16sp" |
67 | tools:text="@string/cos_expired_coupon_label" /> | 82 | tools:text="@string/cos_expired_coupon_label" /> |
83 | + </LinearLayout> | ||
84 | + </LinearLayout> | ||
68 | </RelativeLayout> | 85 | </RelativeLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -60,4 +60,5 @@ | ... | @@ -60,4 +60,5 @@ |
60 | <color name="cos_blue4">#07A2D1</color> | 60 | <color name="cos_blue4">#07A2D1</color> |
61 | <color name="cos_green10">#73CA34</color> | 61 | <color name="cos_green10">#73CA34</color> |
62 | <color name="cos_blue5">#0D81B8</color> | 62 | <color name="cos_blue5">#0D81B8</color> |
63 | + <color name="cos_grey9">#757575</color> | ||
63 | </resources> | 64 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -114,7 +114,7 @@ | ... | @@ -114,7 +114,7 @@ |
114 | <string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string> | 114 | <string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string> |
115 | <string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string> | 115 | <string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string> |
116 | <string name="cos_steps_for_good_notification_title">Steps for Good</string> | 116 | <string name="cos_steps_for_good_notification_title">Steps for Good</string> |
117 | - <string name="cos_empty_wallet">Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For YOU και βρες αποκλειστικές προσφορές!</string> | 117 | + <string name="cos_empty_wallet">Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!</string> |
118 | <string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει </string> | 118 | <string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει </string> |
119 | <string name="cos_wallet_text2"> με το DEALS for YOU!</string> | 119 | <string name="cos_wallet_text2"> με το DEALS for YOU!</string> |
120 | <string name="cos_wallet_text3">Μέχρι τώρα έχεις κερδίσει </string> | 120 | <string name="cos_wallet_text3">Μέχρι τώρα έχεις κερδίσει </string> |
... | @@ -128,6 +128,9 @@ | ... | @@ -128,6 +128,9 @@ |
128 | <string name="cos_dlg_error_used">Το δώρο έχει ήδη χρησιμοποιηθεί</string> | 128 | <string name="cos_dlg_error_used">Το δώρο έχει ήδη χρησιμοποιηθεί</string> |
129 | <string name="cos_see_more2">Δες Περισσότερα</string> | 129 | <string name="cos_see_more2">Δες Περισσότερα</string> |
130 | <string name="cos_dlg_non_telco">Παρακαλούμε πολύ πρόσθεσε τις συνδέσεις σου στην COSMOTE για να έχεις πρόσβαση στα προνόμια του νέου Loyalty προγράμματος της COSMOTE!</string> | 130 | <string name="cos_dlg_non_telco">Παρακαλούμε πολύ πρόσθεσε τις συνδέσεις σου στην COSMOTE για να έχεις πρόσβαση στα προνόμια του νέου Loyalty προγράμματος της COSMOTE!</string> |
131 | + <string name="cos_directions">Οδηγίες</string> | ||
132 | + <string name="cos_empty_shared_coupons">Δεν έχεις μοιραστεί ακόμη κουπόνια</string> | ||
133 | + <string name="cos_empty_expired_coupons">Δεν έχεις εξαργυρώσει ακόμη κουπόνια</string> | ||
131 | 134 | ||
132 | <string-array name="coupons_array"> | 135 | <string-array name="coupons_array"> |
133 | <item>Κουπόνια</item> | 136 | <item>Κουπόνια</item> | ... | ... |
-
Please register or login to post a comment