unified screen basket part5, fixed all bottom sheets, couponset model fixes, overall fixes
Showing
23 changed files
with
449 additions
and
47 deletions
| ... | @@ -58,7 +58,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | ... | @@ -58,7 +58,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | 
| 58 | private TextView mTvEmptyUnifiedCoupons, mFontHeader, mTvInnerTitle, | 58 | private TextView mTvEmptyUnifiedCoupons, mFontHeader, mTvInnerTitle, | 
| 59 | mTvInnerSubtitle, mTvInnerClose, mTvUnifieCouponsTitle, mTvActiveUnifiedCouponsTitle, | 59 | mTvInnerSubtitle, mTvInnerClose, mTvUnifieCouponsTitle, mTvActiveUnifiedCouponsTitle, | 
| 60 | mTvChooseAll, mTvActivate; | 60 | mTvChooseAll, mTvActivate; | 
| 61 | - private boolean mUnifiedPressed = false, mActiveUnifiedPressed = false; | 61 | + private boolean mUnifiedPressed = false, mActiveUnifiedPressed = false, mIsActivatePressed = false; | 
| 62 | private ConstraintLayout mClInfoView, mClActiveCouponsHeader; | 62 | private ConstraintLayout mClInfoView, mClActiveCouponsHeader; | 
| 63 | private RelativeLayout mRlUnifiedCoupons, mRlActiveUnifiedCoupons; | 63 | private RelativeLayout mRlUnifiedCoupons, mRlActiveUnifiedCoupons; | 
| 64 | private ActiveCouponAdapter mAdapterCoupons; | 64 | private ActiveCouponAdapter mAdapterCoupons; | 
| ... | @@ -111,6 +111,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | ... | @@ -111,6 +111,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | 
| 111 | WarplyAnalyticsManager.logTrackersEvent(this, "screen", "ActiveUnifiedCouponsScreen"); | 111 | WarplyAnalyticsManager.logTrackersEvent(this, "screen", "ActiveUnifiedCouponsScreen"); | 
| 112 | mUnifiedPressed = false; | 112 | mUnifiedPressed = false; | 
| 113 | mActiveUnifiedPressed = false; | 113 | mActiveUnifiedPressed = false; | 
| 114 | + mIsActivatePressed = false; | ||
| 114 | filterItems(); | 115 | filterItems(); | 
| 115 | } | 116 | } | 
| 116 | 117 | ||
| ... | @@ -170,13 +171,17 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | ... | @@ -170,13 +171,17 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | 
| 170 | return; | 171 | return; | 
| 171 | } | 172 | } | 
| 172 | if (view.getId() == R.id.ll_activate_unified) { | 173 | if (view.getId() == R.id.ll_activate_unified) { | 
| 173 | - if (!mSelectedItems.isEmpty()) { | 174 | + if (!mIsActivatePressed) { | 
| 174 | - JSONArray tempArray = new JSONArray(); | 175 | + mIsActivatePressed = true; | 
| 175 | - for (Coupon selectedCoupon : mSelectedItems) { | 176 | + | 
| 176 | - tempArray.put(selectedCoupon.getCoupon()); | 177 | + if (!mSelectedItems.isEmpty()) { | 
| 177 | - } | 178 | + JSONArray tempArray = new JSONArray(); | 
| 179 | + for (Coupon selectedCoupon : mSelectedItems) { | ||
| 180 | + tempArray.put(selectedCoupon.getCoupon()); | ||
| 181 | + } | ||
| 178 | 182 | ||
| 179 | - WarplyManager.createUnifiedCoupon(tempArray, mCreateUnifiedCallback); | 183 | + WarplyManager.createUnifiedCoupon(tempArray, mCreateUnifiedCallback); | 
| 184 | + } | ||
| 180 | } | 185 | } | 
| 181 | } | 186 | } | 
| 182 | } | 187 | } | ... | ... | 
| ... | @@ -167,7 +167,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -167,7 +167,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener | 
| 167 | return; | 167 | return; | 
| 168 | } | 168 | } | 
| 169 | 169 | ||
| 170 | - final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 170 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 
| 171 | bottomSheetDialog.setContentView(R.layout.dl_share); | 171 | bottomSheetDialog.setContentView(R.layout.dl_share); | 
| 172 | TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value); | 172 | TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value); | 
| 173 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, tvHeader); | 173 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, tvHeader); | ... | ... | 
| 1 | package ly.warp.sdk.activities; | 1 | package ly.warp.sdk.activities; | 
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; | 
| 4 | +import android.content.Context; | ||
| 5 | +import android.content.DialogInterface; | ||
| 4 | import android.content.Intent; | 6 | import android.content.Intent; | 
| 5 | import android.graphics.Bitmap; | 7 | import android.graphics.Bitmap; | 
| 6 | import android.graphics.Color; | 8 | import android.graphics.Color; | 
| ... | @@ -8,11 +10,14 @@ import android.net.Uri; | ... | @@ -8,11 +10,14 @@ import android.net.Uri; | 
| 8 | import android.os.Bundle; | 10 | import android.os.Bundle; | 
| 9 | import android.text.TextUtils; | 11 | import android.text.TextUtils; | 
| 10 | import android.text.method.LinkMovementMethod; | 12 | import android.text.method.LinkMovementMethod; | 
| 13 | +import android.view.LayoutInflater; | ||
| 11 | import android.view.View; | 14 | import android.view.View; | 
| 15 | +import android.view.ViewGroup; | ||
| 12 | import android.widget.ImageView; | 16 | import android.widget.ImageView; | 
| 13 | import android.widget.LinearLayout; | 17 | import android.widget.LinearLayout; | 
| 14 | import android.widget.TextView; | 18 | import android.widget.TextView; | 
| 15 | 19 | ||
| 20 | +import androidx.constraintlayout.widget.ConstraintLayout; | ||
| 16 | import androidx.core.content.ContextCompat; | 21 | import androidx.core.content.ContextCompat; | 
| 17 | import androidx.core.text.HtmlCompat; | 22 | import androidx.core.text.HtmlCompat; | 
| 18 | import androidx.work.OneTimeWorkRequest; | 23 | import androidx.work.OneTimeWorkRequest; | 
| ... | @@ -22,16 +27,22 @@ import com.bumptech.glide.Glide; | ... | @@ -22,16 +27,22 @@ import com.bumptech.glide.Glide; | 
| 22 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 27 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 
| 23 | import com.google.android.gms.common.ConnectionResult; | 28 | import com.google.android.gms.common.ConnectionResult; | 
| 24 | import com.google.android.gms.common.GoogleApiAvailability; | 29 | import com.google.android.gms.common.GoogleApiAvailability; | 
| 30 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | ||
| 25 | import com.google.zxing.BarcodeFormat; | 31 | import com.google.zxing.BarcodeFormat; | 
| 26 | import com.google.zxing.common.BitMatrix; | 32 | import com.google.zxing.common.BitMatrix; | 
| 27 | import com.google.zxing.oned.EAN13Writer; | 33 | import com.google.zxing.oned.EAN13Writer; | 
| 28 | 34 | ||
| 35 | +import org.json.JSONArray; | ||
| 36 | +import org.json.JSONException; | ||
| 37 | +import org.json.JSONObject; | ||
| 38 | + | ||
| 29 | import java.text.ParseException; | 39 | import java.text.ParseException; | 
| 30 | import java.text.SimpleDateFormat; | 40 | import java.text.SimpleDateFormat; | 
| 31 | import java.util.Date; | 41 | import java.util.Date; | 
| 32 | 42 | ||
| 33 | import ly.warp.sdk.R; | 43 | import ly.warp.sdk.R; | 
| 34 | import ly.warp.sdk.io.models.Coupon; | 44 | import ly.warp.sdk.io.models.Coupon; | 
| 45 | +import ly.warp.sdk.io.models.Couponset; | ||
| 35 | import ly.warp.sdk.io.models.UnifiedCoupon; | 46 | import ly.warp.sdk.io.models.UnifiedCoupon; | 
| 36 | import ly.warp.sdk.services.EventCouponsService; | 47 | import ly.warp.sdk.services.EventCouponsService; | 
| 37 | import ly.warp.sdk.utils.WarpUtils; | 48 | import ly.warp.sdk.utils.WarpUtils; | 
| ... | @@ -83,6 +94,14 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -83,6 +94,14 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | 
| 83 | for (Coupon cpn : couponItem.getCoupons()) { | 94 | for (Coupon cpn : couponItem.getCoupons()) { | 
| 84 | if (cpn.getCoupon().equals(couponCode)) { | 95 | if (cpn.getCoupon().equals(couponCode)) { | 
| 85 | mCoupon = cpn; | 96 | mCoupon = cpn; | 
| 97 | + | ||
| 98 | + for (Couponset cpns : WarplyManagerHelper.getCouponsetsDeals()) { | ||
| 99 | + if (cpns.getUuid().equals(mCoupon.getCouponsetUuid())) { | ||
| 100 | + mCoupon.setCouponsetDetails(cpns); | ||
| 101 | + break; | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 86 | break; | 105 | break; | 
| 87 | } | 106 | } | 
| 88 | } | 107 | } | 
| ... | @@ -268,6 +287,9 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -268,6 +287,9 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | 
| 268 | if (view.getId() == R.id.ll_find_shops) { | 287 | if (view.getId() == R.id.ll_find_shops) { | 
| 269 | if (!mIsFindItPressed) { | 288 | if (!mIsFindItPressed) { | 
| 270 | mIsFindItPressed = true; | 289 | mIsFindItPressed = true; | 
| 290 | + | ||
| 291 | + //TODO: add check to open the sheet only if there are available merchants | ||
| 292 | + showChooseMerchantDialog(); | ||
| 271 | } | 293 | } | 
| 272 | } | 294 | } | 
| 273 | } | 295 | } | 
| ... | @@ -276,6 +298,46 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -276,6 +298,46 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | 
| 276 | // Methods | 298 | // Methods | 
| 277 | // =========================================================== | 299 | // =========================================================== | 
| 278 | 300 | ||
| 301 | + private void showChooseMerchantDialog() { | ||
| 302 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | ||
| 303 | + bottomSheetDialog.setContentView(R.layout.dl_bottom_sheet_merchants); | ||
| 304 | + bottomSheetDialog.setOnDismissListener(dialog -> { | ||
| 305 | + bottomSheetDialog.dismiss(); | ||
| 306 | + mIsFindItPressed = false; | ||
| 307 | + }); | ||
| 308 | + TextView sheetTitle = bottomSheetDialog.findViewById(R.id.tv_sm_sheet_title); | ||
| 309 | + TextView sheetSubtitle = bottomSheetDialog.findViewById(R.id.tv_sm_sheet_subtitle); | ||
| 310 | + WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, sheetTitle); | ||
| 311 | + WarpUtils.renderCustomFont(this, R.font.peridot_regular, sheetSubtitle); | ||
| 312 | + LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_sm_sheet_view_inner); | ||
| 313 | + | ||
| 314 | + ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sm_sheet_close); | ||
| 315 | + dialogClose.setOnClickListener(view -> { | ||
| 316 | + bottomSheetDialog.dismiss(); | ||
| 317 | + mIsFindItPressed = false; | ||
| 318 | + }); | ||
| 319 | + | ||
| 320 | + int tempLoop = 2; | ||
| 321 | + for (int i = 0; i < tempLoop; i++) { | ||
| 322 | + LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
| 323 | + LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_sheet_merchant, null); | ||
| 324 | + | ||
| 325 | + TextView textView = (TextView) v.findViewById(R.id.button_sm_buy_it); | ||
| 326 | + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, textView); | ||
| 327 | + ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); | ||
| 328 | + buyButton.setOnClickListener(view -> { | ||
| 329 | + //TODO: open webview with the specified url | ||
| 330 | + bottomSheetDialog.dismiss(); | ||
| 331 | + }); | ||
| 332 | + | ||
| 333 | + parent.addView(v, 0, new ViewGroup.LayoutParams( | ||
| 334 | + ViewGroup.LayoutParams.MATCH_PARENT, | ||
| 335 | + ViewGroup.LayoutParams.WRAP_CONTENT)); | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + bottomSheetDialog.show(); | ||
| 339 | + } | ||
| 340 | + | ||
| 279 | private void initViews() { | 341 | private void initViews() { | 
| 280 | if (mIsUnified) { | 342 | if (mIsUnified) { | 
| 281 | mTvCouponCodeTitle.setVisibility(View.GONE); | 343 | mTvCouponCodeTitle.setVisibility(View.GONE); | 
| ... | @@ -288,7 +350,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -288,7 +350,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | 
| 288 | 350 | ||
| 289 | if (mCoupon != null) { | 351 | if (mCoupon != null) { | 
| 290 | if (mIsUnified) { | 352 | if (mIsUnified) { | 
| 291 | - mTvCouponTitle.setText(HtmlCompat.fromHtml(mCoupon.getName(), HtmlCompat.FROM_HTML_MODE_COMPACT)); | 353 | +// mTvCouponTitle.setText(HtmlCompat.fromHtml(mCoupon.getName(), HtmlCompat.FROM_HTML_MODE_COMPACT)); | 
| 354 | + mTvCouponTitle.setText(mCoupon.getCouponsetDetails().getName()); | ||
| 292 | } else { | 355 | } else { | 
| 293 | mTvCouponCode.setText(mCoupon.getCoupon()); | 356 | mTvCouponCode.setText(mCoupon.getCoupon()); | 
| 294 | mTvCouponTitle.setText(mCoupon.getCouponsetDetails().getName()); | 357 | mTvCouponTitle.setText(mCoupon.getCouponsetDetails().getName()); | ... | ... | 
| ... | @@ -196,7 +196,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene | ... | @@ -196,7 +196,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene | 
| 196 | } | 196 | } | 
| 197 | 197 | ||
| 198 | private void showSharingDialog() { | 198 | private void showSharingDialog() { | 
| 199 | - final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 199 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 
| 200 | bottomSheetDialog.setContentView(R.layout.dl_share); | 200 | bottomSheetDialog.setContentView(R.layout.dl_share); | 
| 201 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); | 201 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); | 
| 202 | 202 | ... | ... | 
| ... | @@ -211,7 +211,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -211,7 +211,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | 
| 211 | for (Merchant merch : mMerchantList) { | 211 | for (Merchant merch : mMerchantList) { | 
| 212 | if (merch.getUuid().equals(marker.getSnippet())) { | 212 | if (merch.getUuid().equals(marker.getSnippet())) { | 
| 213 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShopsScreenMarker").concat(":").concat(marker.getSnippet())); | 213 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShopsScreenMarker").concat(":").concat(marker.getSnippet())); | 
| 214 | - final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 214 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 
| 215 | bottomSheetDialog.setContentView(R.layout.dl_map_pin); | 215 | bottomSheetDialog.setContentView(R.layout.dl_map_pin); | 
| 216 | 216 | ||
| 217 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close); | 217 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close); | ... | ... | 
| ... | @@ -212,7 +212,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -212,7 +212,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | 
| 212 | for (Merchant merch : mMerchantList) { | 212 | for (Merchant merch : mMerchantList) { | 
| 213 | if (merch.getUuid().equals(marker.getSnippet())) { | 213 | if (merch.getUuid().equals(marker.getSnippet())) { | 
| 214 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShopsScreenMarker").concat(":").concat(marker.getSnippet())); | 214 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShopsScreenMarker").concat(":").concat(marker.getSnippet())); | 
| 215 | - final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 215 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 
| 216 | bottomSheetDialog.setContentView(R.layout.dl_map_pin); | 216 | bottomSheetDialog.setContentView(R.layout.dl_map_pin); | 
| 217 | 217 | ||
| 218 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close); | 218 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_map_pin_close); | ... | ... | 
| ... | @@ -172,7 +172,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -172,7 +172,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | 
| 172 | } | 172 | } | 
| 173 | 173 | ||
| 174 | private void showActivationDialog() { | 174 | private void showActivationDialog() { | 
| 175 | - final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 175 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 
| 176 | bottomSheetDialog.setContentView(R.layout.dl_share); | 176 | bottomSheetDialog.setContentView(R.layout.dl_share); | 
| 177 | TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value); | 177 | TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value); | 
| 178 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, tvHeader); | 178 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, tvHeader); | ... | ... | 
| 1 | package ly.warp.sdk.activities; | 1 | 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.Intent; | 5 | import android.content.Intent; | 
| 5 | import android.graphics.Bitmap; | 6 | import android.graphics.Bitmap; | 
| 6 | import android.graphics.Color; | 7 | import android.graphics.Color; | 
| 7 | import android.os.Bundle; | 8 | import android.os.Bundle; | 
| 8 | import android.text.TextUtils; | 9 | import android.text.TextUtils; | 
| 10 | +import android.view.LayoutInflater; | ||
| 9 | import android.view.View; | 11 | import android.view.View; | 
| 12 | +import android.view.ViewGroup; | ||
| 10 | import android.widget.ImageView; | 13 | import android.widget.ImageView; | 
| 11 | import android.widget.LinearLayout; | 14 | import android.widget.LinearLayout; | 
| 12 | import android.widget.TextView; | 15 | import android.widget.TextView; | 
| 13 | 16 | ||
| 14 | import androidx.appcompat.app.AlertDialog; | 17 | import androidx.appcompat.app.AlertDialog; | 
| 18 | +import androidx.constraintlayout.widget.ConstraintLayout; | ||
| 15 | import androidx.core.content.ContextCompat; | 19 | import androidx.core.content.ContextCompat; | 
| 16 | import androidx.recyclerview.widget.LinearLayoutManager; | 20 | import androidx.recyclerview.widget.LinearLayoutManager; | 
| 17 | import androidx.recyclerview.widget.RecyclerView; | 21 | import androidx.recyclerview.widget.RecyclerView; | 
| 18 | 22 | ||
| 19 | import com.google.android.gms.common.ConnectionResult; | 23 | import com.google.android.gms.common.ConnectionResult; | 
| 20 | import com.google.android.gms.common.GoogleApiAvailability; | 24 | import com.google.android.gms.common.GoogleApiAvailability; | 
| 25 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | ||
| 21 | import com.google.zxing.BarcodeFormat; | 26 | import com.google.zxing.BarcodeFormat; | 
| 22 | import com.google.zxing.common.BitMatrix; | 27 | import com.google.zxing.common.BitMatrix; | 
| 23 | import com.google.zxing.oned.EAN13Writer; | 28 | import com.google.zxing.oned.EAN13Writer; | 
| ... | @@ -56,7 +61,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -56,7 +61,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | 
| 56 | private ImageView mIvBack, mIvBarcode, mIvMarketExpand; | 61 | private ImageView mIvBack, mIvBarcode, mIvMarketExpand; | 
| 57 | private TextView mTvTerms, mTvCouponCode, mTvCouponDate, mTvMarketExpand, mFontSMLabel, | 62 | private TextView mTvTerms, mTvCouponCode, mTvCouponDate, mTvMarketExpand, mFontSMLabel, | 
| 58 | mTvTermsValue, mTvFullBarcode, mTvActiveValue, mFontHeader, mFontCouponLabel, | 63 | mTvTermsValue, mTvFullBarcode, mTvActiveValue, mFontHeader, mFontCouponLabel, | 
| 59 | - mFontShopsLabel, mFontCancelLabel; | 64 | + mFontShopsLabel, mFontCancelLabel, mTvBarcodeTitle; | 
| 60 | private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand, | 65 | private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand, | 
| 61 | mLlCancelUnified; | 66 | mLlCancelUnified; | 
| 62 | private UnifiedCoupon mCoupon; | 67 | private UnifiedCoupon mCoupon; | 
| ... | @@ -108,11 +113,12 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -108,11 +113,12 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | 
| 108 | mFontCouponLabel = findViewById(R.id.textView15); | 113 | mFontCouponLabel = findViewById(R.id.textView15); | 
| 109 | mFontShopsLabel = findViewById(R.id.shops_label); | 114 | mFontShopsLabel = findViewById(R.id.shops_label); | 
| 110 | mFontCancelLabel = findViewById(R.id.cancel_label); | 115 | mFontCancelLabel = findViewById(R.id.cancel_label); | 
| 116 | + mTvBarcodeTitle = findViewById(R.id.tv_barcode_title); | ||
| 111 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mFontSMLabel); | 117 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mFontSMLabel); | 
| 112 | - WarpUtils.renderCustomFont(this, R.font.peridot_regular, mTvActiveValue, mTvCouponDate, | 118 | + WarpUtils.renderCustomFont(this, R.font.peridot_regular, mTvActiveValue, | 
| 113 | mTvTermsValue); | 119 | mTvTermsValue); | 
| 114 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontCouponLabel, mTvCouponCode, | 120 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontCouponLabel, mTvCouponCode, | 
| 115 | - mTvMarketExpand, mTvTerms); | 121 | + mTvMarketExpand, mTvTerms, mTvCouponDate, mTvBarcodeTitle); | 
| 116 | WarpUtils.renderCustomFont(this, R.font.pf_square_sans_pro_regular, mTvFullBarcode); | 122 | WarpUtils.renderCustomFont(this, R.font.pf_square_sans_pro_regular, mTvFullBarcode); | 
| 117 | WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mFontShopsLabel, mFontCancelLabel); | 123 | WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mFontShopsLabel, mFontCancelLabel); | 
| 118 | 124 | ||
| ... | @@ -137,19 +143,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -137,19 +143,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | 
| 137 | return; | 143 | return; | 
| 138 | } | 144 | } | 
| 139 | if (view.getId() == R.id.ll_shops) { | 145 | if (view.getId() == R.id.ll_shops) { | 
| 140 | - if (!mShopsPressed) { | 146 | + showChooseCategoryDialog(); | 
| 141 | - mShopsPressed = true; | ||
| 142 | - WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); | ||
| 143 | - if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) { | ||
| 144 | - Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class); | ||
| 145 | - startActivity(intent); | ||
| 146 | - return; | ||
| 147 | - } else { | ||
| 148 | - Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsHuaweiActivity.class); | ||
| 149 | - startActivity(intent); | ||
| 150 | - return; | ||
| 151 | - } | ||
| 152 | - } | ||
| 153 | } | 147 | } | 
| 154 | if (view.getId() == R.id.ll_terms_inner) { | 148 | if (view.getId() == R.id.ll_terms_inner) { | 
| 155 | if (mIsTermsShown) { | 149 | if (mIsTermsShown) { | 
| ... | @@ -188,6 +182,81 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -188,6 +182,81 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | 
| 188 | // Methods | 182 | // Methods | 
| 189 | // =========================================================== | 183 | // =========================================================== | 
| 190 | 184 | ||
| 185 | + private void showChooseCategoryDialog() { | ||
| 186 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | ||
| 187 | + bottomSheetDialog.setContentView(R.layout.dl_bottom_sheet_categories); | ||
| 188 | + bottomSheetDialog.setOnDismissListener(dialog -> bottomSheetDialog.dismiss()); | ||
| 189 | + ImageView dialogCLose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sm_sheet_category_close); | ||
| 190 | + dialogCLose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | ||
| 191 | + TextView sheetButtonShops = bottomSheetDialog.findViewById(R.id.shops_label); | ||
| 192 | + TextView sheetButtonEShops = bottomSheetDialog.findViewById(R.id.eshops_label); | ||
| 193 | + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, sheetButtonShops); | ||
| 194 | + WarpUtils.renderCustomFont(this, R.font.peridot_bold, sheetButtonEShops); | ||
| 195 | + | ||
| 196 | + LinearLayout buttonShops = bottomSheetDialog.findViewById(R.id.ll_unified_shops); | ||
| 197 | + LinearLayout buttonEshops = bottomSheetDialog.findViewById(R.id.ll_unified_eshops); | ||
| 198 | + | ||
| 199 | + buttonShops.setOnClickListener(view -> { | ||
| 200 | + if (!mShopsPressed) { | ||
| 201 | + mShopsPressed = true; | ||
| 202 | + bottomSheetDialog.dismiss(); | ||
| 203 | + WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); | ||
| 204 | + if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) { | ||
| 205 | + Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class); | ||
| 206 | + startActivity(intent); | ||
| 207 | + } else { | ||
| 208 | + Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsHuaweiActivity.class); | ||
| 209 | + startActivity(intent); | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | + }); | ||
| 213 | + | ||
| 214 | + buttonEshops.setOnClickListener(view -> { | ||
| 215 | + bottomSheetDialog.dismiss(); | ||
| 216 | + showChooseMerchantDialog(); | ||
| 217 | + }); | ||
| 218 | + | ||
| 219 | + bottomSheetDialog.show(); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + private void showChooseMerchantDialog() { | ||
| 223 | + final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | ||
| 224 | + bottomSheetDialog.setContentView(R.layout.dl_bottom_sheet_merchants); | ||
| 225 | + bottomSheetDialog.setOnDismissListener(dialog -> bottomSheetDialog.dismiss()); | ||
| 226 | + TextView sheetTitle = bottomSheetDialog.findViewById(R.id.tv_sm_sheet_title); | ||
| 227 | + sheetTitle.setText(R.string.cos_markets_eshop); | ||
| 228 | + TextView sheetSubtitle = bottomSheetDialog.findViewById(R.id.tv_sm_sheet_subtitle); | ||
| 229 | + WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, sheetTitle); | ||
| 230 | + WarpUtils.renderCustomFont(this, R.font.peridot_regular, sheetSubtitle); | ||
| 231 | + LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_sm_sheet_view_inner); | ||
| 232 | + | ||
| 233 | + ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sm_sheet_close); | ||
| 234 | + dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | ||
| 235 | + | ||
| 236 | + int tempLoop = 2; | ||
| 237 | + for (int i = 0; i < tempLoop; i++) { | ||
| 238 | + LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
| 239 | + LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_sheet_merchant, null); | ||
| 240 | + | ||
| 241 | + TextView textView = (TextView) v.findViewById(R.id.button_sm_buy_it); | ||
| 242 | + textView.setText(R.string.cos_markets_eshop_item); | ||
| 243 | + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, textView); | ||
| 244 | + ImageView buttonIcon = (ImageView) v.findViewById(R.id.iv_sheet_cart); | ||
| 245 | + buttonIcon.setVisibility(View.GONE); | ||
| 246 | + ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); | ||
| 247 | + buyButton.setOnClickListener(view -> { | ||
| 248 | + //TODO: open webview with the specified url | ||
| 249 | + bottomSheetDialog.dismiss(); | ||
| 250 | + }); | ||
| 251 | + | ||
| 252 | + parent.addView(v, 0, new ViewGroup.LayoutParams( | ||
| 253 | + ViewGroup.LayoutParams.MATCH_PARENT, | ||
| 254 | + ViewGroup.LayoutParams.WRAP_CONTENT)); | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + bottomSheetDialog.show(); | ||
| 258 | + } | ||
| 259 | + | ||
| 191 | private void initViews() { | 260 | private void initViews() { | 
| 192 | mTvCouponCode.setText(mCoupon.getBarcode()); | 261 | mTvCouponCode.setText(mCoupon.getBarcode()); | 
| 193 | 262 | ||
| ... | @@ -228,7 +297,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -228,7 +297,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | 
| 228 | e.printStackTrace(); | 297 | e.printStackTrace(); | 
| 229 | } | 298 | } | 
| 230 | simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); | 299 | simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); | 
| 231 | - mTvCouponDate.setText(String.format(getResources().getString(R.string.cos_mycoupon_date), simpleDateFormat.format(newDate != null ? newDate : ""))); | 300 | + mTvCouponDate.setText(String.format(getResources().getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : ""))); | 
| 232 | break; | 301 | break; | 
| 233 | } | 302 | } | 
| 234 | } | 303 | } | ... | ... | 
| ... | @@ -79,6 +79,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -79,6 +79,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 79 | private static final String INNER_TEXT = "inner_text"; | 79 | private static final String INNER_TEXT = "inner_text"; | 
| 80 | private static final String FINAL_PRICE = "final_price"; | 80 | private static final String FINAL_PRICE = "final_price"; | 
| 81 | private static final String DISCOUNT_TYPE = "discount_type"; | 81 | private static final String DISCOUNT_TYPE = "discount_type"; | 
| 82 | + private static final String EXTRA_FIELDS = "extra_fields"; | ||
| 82 | 83 | ||
| 83 | 84 | ||
| 84 | /* Member variables of the Campaign object */ | 85 | /* Member variables of the Campaign object */ | 
| ... | @@ -113,6 +114,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -113,6 +114,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 113 | private double final_price = 0.0d; | 114 | private double final_price = 0.0d; | 
| 114 | private Date endDate = new Date(); | 115 | private Date endDate = new Date(); | 
| 115 | private String couponsetType = ""; | 116 | private String couponsetType = ""; | 
| 117 | + private JSONObject extraFields = new JSONObject(); | ||
| 116 | 118 | ||
| 117 | public Couponset() { | 119 | public Couponset() { | 
| 118 | this.uuid = ""; | 120 | this.uuid = ""; | 
| ... | @@ -143,6 +145,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -143,6 +145,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 143 | this.innerText = ""; | 145 | this.innerText = ""; | 
| 144 | this.discount_type = ""; | 146 | this.discount_type = ""; | 
| 145 | this.final_price = 0.0d; | 147 | this.final_price = 0.0d; | 
| 148 | + this.extraFields = new JSONObject(); | ||
| 146 | } | 149 | } | 
| 147 | 150 | ||
| 148 | public Couponset(boolean isUniversal) { | 151 | public Couponset(boolean isUniversal) { | 
| ... | @@ -164,6 +167,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -164,6 +167,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 164 | this.img_preview = ""; | 167 | this.img_preview = ""; | 
| 165 | this.innerText = ""; | 168 | this.innerText = ""; | 
| 166 | this.final_price = 0.0d; | 169 | this.final_price = 0.0d; | 
| 170 | + this.extraFields = new JSONObject(); | ||
| 167 | } | 171 | } | 
| 168 | 172 | ||
| 169 | /** | 173 | /** | 
| ... | @@ -219,6 +223,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -219,6 +223,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 219 | this.innerText = json.optString(INNER_TEXT); | 223 | this.innerText = json.optString(INNER_TEXT); | 
| 220 | this.discount_type = json.isNull(DISCOUNT_TYPE) ? "" : json.optString(DISCOUNT_TYPE); | 224 | this.discount_type = json.isNull(DISCOUNT_TYPE) ? "" : json.optString(DISCOUNT_TYPE); | 
| 221 | this.final_price = json.isNull(FINAL_PRICE) ? 0.0d : json.optDouble(FINAL_PRICE); | 225 | this.final_price = json.isNull(FINAL_PRICE) ? 0.0d : json.optDouble(FINAL_PRICE); | 
| 226 | + this.extraFields = json.optJSONObject(EXTRA_FIELDS); | ||
| 222 | } | 227 | } | 
| 223 | } | 228 | } | 
| 224 | 229 | ||
| ... | @@ -241,6 +246,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -241,6 +246,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 241 | this.img_preview = json.optString(IMG_PREVIEW); | 246 | this.img_preview = json.optString(IMG_PREVIEW); | 
| 242 | this.innerText = json.optString(INNER_TEXT); | 247 | this.innerText = json.optString(INNER_TEXT); | 
| 243 | this.final_price = json.isNull(FINAL_PRICE) ? 0.0d : json.optDouble(FINAL_PRICE); | 248 | this.final_price = json.isNull(FINAL_PRICE) ? 0.0d : json.optDouble(FINAL_PRICE); | 
| 249 | + this.extraFields = json.optJSONObject(EXTRA_FIELDS); | ||
| 244 | // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 250 | // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 
| 245 | // Date newDate = new Date(); | 251 | // Date newDate = new Date(); | 
| 246 | // String tempRedeemDate = json.optString("end_date"); | 252 | // String tempRedeemDate = json.optString("end_date"); | 
| ... | @@ -371,6 +377,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -371,6 +377,7 @@ public class Couponset implements Parcelable, Serializable { | 
| 371 | jObj.putOpt(INNER_TEXT, this.innerText); | 377 | jObj.putOpt(INNER_TEXT, this.innerText); | 
| 372 | jObj.putOpt(DISCOUNT_TYPE, this.discount_type); | 378 | jObj.putOpt(DISCOUNT_TYPE, this.discount_type); | 
| 373 | jObj.putOpt(FINAL_PRICE, this.final_price); | 379 | jObj.putOpt(FINAL_PRICE, this.final_price); | 
| 380 | + jObj.putOpt(EXTRA_FIELDS, this.extraFields); | ||
| 374 | } catch (JSONException e) { | 381 | } catch (JSONException e) { | 
| 375 | if (WarpConstants.DEBUG) { | 382 | if (WarpConstants.DEBUG) { | 
| 376 | e.printStackTrace(); | 383 | e.printStackTrace(); | 
| ... | @@ -642,6 +649,26 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -642,6 +649,26 @@ public class Couponset implements Parcelable, Serializable { | 
| 642 | this.couponsetType = couponsetType; | 649 | this.couponsetType = couponsetType; | 
| 643 | } | 650 | } | 
| 644 | 651 | ||
| 652 | + public String getAdmin_name() { | ||
| 653 | + return admin_name; | ||
| 654 | + } | ||
| 655 | + | ||
| 656 | + public JSONObject getExtraFields() { | ||
| 657 | + return extraFields; | ||
| 658 | + } | ||
| 659 | + | ||
| 660 | + public void setExtraFields(JSONObject extraFields) { | ||
| 661 | + this.extraFields = extraFields; | ||
| 662 | + } | ||
| 663 | + | ||
| 664 | + public String getShort_description() { | ||
| 665 | + return short_description; | ||
| 666 | + } | ||
| 667 | + | ||
| 668 | + public String getImg_preview() { | ||
| 669 | + return img_preview; | ||
| 670 | + } | ||
| 671 | + | ||
| 645 | @Override | 672 | @Override | 
| 646 | public int describeContents() { | 673 | public int describeContents() { | 
| 647 | return 0; | 674 | return 0; | ... | ... | 
| ... | @@ -4252,7 +4252,7 @@ public class WarplyManager { | ... | @@ -4252,7 +4252,7 @@ public class WarplyManager { | 
| 4252 | Map<String, Object> jsonParams = new ArrayMap<>(); | 4252 | Map<String, Object> jsonParams = new ArrayMap<>(); | 
| 4253 | jsonParams.put("action", "retrieve_multilingual"); | 4253 | jsonParams.put("action", "retrieve_multilingual"); | 
| 4254 | jsonParams.put("active", true); | 4254 | jsonParams.put("active", true); | 
| 4255 | - jsonParams.put("visible", true); | 4255 | + jsonParams.put("visible", JSONObject.NULL); | 
| 4256 | jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext())); | 4256 | jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext())); | 
| 4257 | jsonParams.put("couponset_types", new JSONArray().put("supermarket")); | 4257 | jsonParams.put("couponset_types", new JSONArray().put("supermarket")); | 
| 4258 | 4258 | ... | ... | 
2.09 KB
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <item android:drawable="@drawable/shape_cos_green_tr2" android:state_pressed="true" /> | ||
| 4 | + <item android:drawable="@drawable/shape_cos_green2" android:state_pressed="false" /> | ||
| 5 | +</selector> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle"> | ||
| 4 | + <corners android:radius="12dp" /> | ||
| 5 | + | ||
| 6 | + <solid | ||
| 7 | + android:width="2dp" | ||
| 8 | + android:color="@color/cos_green12" /> | ||
| 9 | +</shape> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle"> | ||
| 4 | + <corners android:radius="12dp" /> | ||
| 5 | + | ||
| 6 | + <solid | ||
| 7 | + android:width="2dp" | ||
| 8 | + android:color="@color/cos_green6_tr" /> | ||
| 9 | +</shape> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle"> | ||
| 4 | + <corners android:radius="20dp" /> | ||
| 5 | + | ||
| 6 | + <solid android:color="@color/cos_light_grey3" /> | ||
| 7 | +</shape> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| ... | @@ -72,6 +72,20 @@ | ... | @@ -72,6 +72,20 @@ | 
| 72 | android:textSize="18sp" /> | 72 | android:textSize="18sp" /> | 
| 73 | 73 | ||
| 74 | <TextView | 74 | <TextView | 
| 75 | + android:id="@+id/textView17" | ||
| 76 | + android:layout_width="wrap_content" | ||
| 77 | + android:layout_height="wrap_content" | ||
| 78 | + android:layout_gravity="center" | ||
| 79 | + android:layout_marginTop="8dp" | ||
| 80 | + android:background="@drawable/shape_rounded_blue" | ||
| 81 | + android:includeFontPadding="false" | ||
| 82 | + android:paddingHorizontal="14dp" | ||
| 83 | + android:paddingVertical="3dp" | ||
| 84 | + android:textColor="@color/cos_blue6" | ||
| 85 | + android:textSize="14sp" | ||
| 86 | + tools:text="@string/cos_coupon_date" /> | ||
| 87 | + | ||
| 88 | + <TextView | ||
| 75 | android:id="@+id/textView14" | 89 | android:id="@+id/textView14" | 
| 76 | android:layout_width="match_parent" | 90 | android:layout_width="match_parent" | 
| 77 | android:layout_height="wrap_content" | 91 | android:layout_height="wrap_content" | 
| ... | @@ -122,18 +136,29 @@ | ... | @@ -122,18 +136,29 @@ | 
| 122 | android:orientation="vertical" | 136 | android:orientation="vertical" | 
| 123 | tools:visibility="visible"> | 137 | tools:visibility="visible"> | 
| 124 | 138 | ||
| 139 | + <TextView | ||
| 140 | + android:id="@+id/tv_barcode_title" | ||
| 141 | + android:layout_width="wrap_content" | ||
| 142 | + android:layout_height="wrap_content" | ||
| 143 | + android:layout_gravity="center" | ||
| 144 | + android:text="@string/cos_barcode_coupon_title" | ||
| 145 | + android:textColor="@color/cos_light_black" | ||
| 146 | + android:textSize="16sp" /> | ||
| 147 | + | ||
| 125 | <View | 148 | <View | 
| 126 | android:id="@+id/view5" | 149 | android:id="@+id/view5" | 
| 127 | android:layout_width="match_parent" | 150 | android:layout_width="match_parent" | 
| 128 | android:layout_height="0.8dp" | 151 | android:layout_height="0.8dp" | 
| 152 | + android:layout_marginTop="16dp" | ||
| 129 | android:layout_marginHorizontal="32dp" | 153 | android:layout_marginHorizontal="32dp" | 
| 130 | android:background="#E6E6E6" /> | 154 | android:background="#E6E6E6" /> | 
| 131 | 155 | ||
| 132 | <ImageView | 156 | <ImageView | 
| 133 | android:id="@+id/iv_barcode" | 157 | android:id="@+id/iv_barcode" | 
| 134 | - android:layout_width="284dp" | 158 | + android:layout_width="match_parent" | 
| 135 | android:layout_height="86dp" | 159 | android:layout_height="86dp" | 
| 136 | android:layout_marginTop="16dp" | 160 | android:layout_marginTop="16dp" | 
| 161 | + android:layout_marginHorizontal="48dp" | ||
| 137 | android:scaleType="fitXY" | 162 | android:scaleType="fitXY" | 
| 138 | tools:srcCompat="@tools:sample/avatars" /> | 163 | tools:srcCompat="@tools:sample/avatars" /> | 
| 139 | 164 | ||
| ... | @@ -152,21 +177,11 @@ | ... | @@ -152,21 +177,11 @@ | 
| 152 | android:layout_width="match_parent" | 177 | android:layout_width="match_parent" | 
| 153 | android:layout_height="0.8dp" | 178 | android:layout_height="0.8dp" | 
| 154 | android:layout_marginHorizontal="32dp" | 179 | android:layout_marginHorizontal="32dp" | 
| 155 | - android:layout_marginTop="20dp" | 180 | + android:layout_marginTop="16dp" | 
| 156 | android:background="#E6E6E6" /> | 181 | android:background="#E6E6E6" /> | 
| 157 | </LinearLayout> | 182 | </LinearLayout> | 
| 158 | </LinearLayout> | 183 | </LinearLayout> | 
| 159 | 184 | ||
| 160 | - <TextView | ||
| 161 | - android:id="@+id/textView17" | ||
| 162 | - android:layout_width="wrap_content" | ||
| 163 | - android:layout_height="wrap_content" | ||
| 164 | - android:layout_gravity="center" | ||
| 165 | - android:layout_marginTop="16dp" | ||
| 166 | - android:textColor="@color/cos_light_black" | ||
| 167 | - android:textSize="16sp" | ||
| 168 | - tools:text="@string/cos_coupon_date" /> | ||
| 169 | - | ||
| 170 | <LinearLayout | 185 | <LinearLayout | 
| 171 | android:id="@+id/ll_market_expand" | 186 | android:id="@+id/ll_market_expand" | 
| 172 | android:layout_width="wrap_content" | 187 | android:layout_width="wrap_content" | ... | ... | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:id="@+id/rl_sm_sheet_dialog_view" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:background="@drawable/shape_cos_white_rounded_top" | ||
| 7 | + android:orientation="vertical"> | ||
| 8 | + | ||
| 9 | + <RelativeLayout | ||
| 10 | + android:id="@+id/rl_sm_sheet" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="wrap_content" | ||
| 13 | + android:layout_marginBottom="24dp" | ||
| 14 | + android:paddingTop="16dp"> | ||
| 15 | + | ||
| 16 | + <ImageView | ||
| 17 | + android:id="@+id/iv_sm_sheet_category_close" | ||
| 18 | + android:layout_width="16dp" | ||
| 19 | + android:layout_height="16dp" | ||
| 20 | + android:layout_alignParentEnd="true" | ||
| 21 | + android:layout_marginEnd="24dp" | ||
| 22 | + android:src="@drawable/ic_close" /> | ||
| 23 | + </RelativeLayout> | ||
| 24 | + | ||
| 25 | + <LinearLayout | ||
| 26 | + android:id="@+id/ll_unified_shops" | ||
| 27 | + android:layout_width="312dp" | ||
| 28 | + android:layout_height="55dp" | ||
| 29 | + android:layout_gravity="center" | ||
| 30 | + android:background="@drawable/selector_button_green" | ||
| 31 | + android:gravity="center" | ||
| 32 | + android:orientation="horizontal" | ||
| 33 | + android:paddingVertical="8dp"> | ||
| 34 | + | ||
| 35 | + <TextView | ||
| 36 | + android:id="@+id/shops_label" | ||
| 37 | + android:layout_width="wrap_content" | ||
| 38 | + android:layout_height="wrap_content" | ||
| 39 | + android:gravity="center" | ||
| 40 | + android:includeFontPadding="false" | ||
| 41 | + android:text="@string/cos_markets_map" | ||
| 42 | + android:textColor="@color/white" | ||
| 43 | + android:textSize="16sp" /> | ||
| 44 | + </LinearLayout> | ||
| 45 | + | ||
| 46 | + <LinearLayout | ||
| 47 | + android:id="@+id/ll_unified_eshops" | ||
| 48 | + android:layout_width="312dp" | ||
| 49 | + android:layout_height="55dp" | ||
| 50 | + android:layout_gravity="center" | ||
| 51 | + android:layout_marginTop="20dp" | ||
| 52 | + android:layout_marginBottom="48dp" | ||
| 53 | + android:background="@drawable/selector_button_green_border" | ||
| 54 | + android:gravity="center" | ||
| 55 | + android:orientation="horizontal" | ||
| 56 | + android:paddingVertical="8dp"> | ||
| 57 | + | ||
| 58 | + <TextView | ||
| 59 | + android:id="@+id/eshops_label" | ||
| 60 | + android:layout_width="wrap_content" | ||
| 61 | + android:layout_height="wrap_content" | ||
| 62 | + android:gravity="center" | ||
| 63 | + android:includeFontPadding="false" | ||
| 64 | + android:text="@string/cos_markets_eshop" | ||
| 65 | + android:textColor="@color/cos_green12" | ||
| 66 | + android:textSize="16sp" /> | ||
| 67 | + </LinearLayout> | ||
| 68 | +</LinearLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:id="@+id/rl_sm_sheet_dialog_view" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:orientation="vertical" | ||
| 7 | + android:background="@drawable/shape_cos_white_rounded_top"> | ||
| 8 | + | ||
| 9 | + <RelativeLayout | ||
| 10 | + android:id="@+id/rl_sm_sheet" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="wrap_content" | ||
| 13 | + android:layout_marginBottom="24dp" | ||
| 14 | + android:paddingTop="16dp"> | ||
| 15 | + | ||
| 16 | + <TextView | ||
| 17 | + android:id="@+id/tv_sm_sheet_title" | ||
| 18 | + android:layout_width="wrap_content" | ||
| 19 | + android:layout_height="wrap_content" | ||
| 20 | + android:layout_alignParentStart="true" | ||
| 21 | + android:layout_marginStart="24dp" | ||
| 22 | + android:text="@string/cos_find_sm_product" | ||
| 23 | + android:textColor="@color/cos_light_black" | ||
| 24 | + android:textSize="17sp" /> | ||
| 25 | + | ||
| 26 | + <ImageView | ||
| 27 | + android:id="@+id/iv_sm_sheet_close" | ||
| 28 | + android:layout_width="16dp" | ||
| 29 | + android:layout_height="16dp" | ||
| 30 | + android:layout_alignParentEnd="true" | ||
| 31 | + android:layout_marginEnd="24dp" | ||
| 32 | + android:src="@drawable/ic_close" /> | ||
| 33 | + </RelativeLayout> | ||
| 34 | + | ||
| 35 | + <LinearLayout | ||
| 36 | + android:id="@+id/ll_sm_sheet_view_inner" | ||
| 37 | + android:layout_width="match_parent" | ||
| 38 | + android:layout_height="wrap_content" | ||
| 39 | + android:layout_marginHorizontal="24dp" | ||
| 40 | + android:layout_marginTop="48dp" | ||
| 41 | + android:orientation="vertical"> | ||
| 42 | + | ||
| 43 | + </LinearLayout> | ||
| 44 | + | ||
| 45 | + <TextView | ||
| 46 | + android:id="@+id/tv_sm_sheet_subtitle" | ||
| 47 | + android:layout_width="wrap_content" | ||
| 48 | + android:layout_height="wrap_content" | ||
| 49 | + android:layout_marginHorizontal="48dp" | ||
| 50 | + android:layout_marginVertical="32dp" | ||
| 51 | + android:text="@string/cos_sm_sheet_subtitle" | ||
| 52 | + android:textColor="@color/cos_light_black" | ||
| 53 | + android:layout_gravity="center" | ||
| 54 | + android:gravity="center" | ||
| 55 | + android:textSize="14sp" /> | ||
| 56 | +</LinearLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ | 
| 4 | android:id="@+id/rl_map_pin_view" | 4 | android:id="@+id/rl_map_pin_view" | 
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" | 
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" | 
| 7 | - android:background="@android:color/white" | 7 | + android:background="@drawable/shape_cos_white_rounded_top" | 
| 8 | android:orientation="vertical"> | 8 | android:orientation="vertical"> | 
| 9 | 9 | ||
| 10 | <RelativeLayout | 10 | <RelativeLayout | 
| ... | @@ -12,7 +12,6 @@ | ... | @@ -12,7 +12,6 @@ | 
| 12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" | 
| 13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" | 
| 14 | android:layout_marginBottom="24dp" | 14 | android:layout_marginBottom="24dp" | 
| 15 | - android:background="@drawable/shape_cos_white_rounded_top" | ||
| 16 | android:paddingHorizontal="24dp" | 15 | android:paddingHorizontal="24dp" | 
| 17 | android:paddingTop="16dp"> | 16 | android:paddingTop="16dp"> | 
| 18 | 17 | ... | ... | 
| ... | @@ -3,14 +3,14 @@ | ... | @@ -3,14 +3,14 @@ | 
| 3 | android:id="@+id/rl_share_dialog_view" | 3 | android:id="@+id/rl_share_dialog_view" | 
| 4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" | 
| 5 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" | 
| 6 | - android:orientation="vertical"> | 6 | + android:orientation="vertical" | 
| 7 | + android:background="@drawable/shape_cos_white_rounded_top"> | ||
| 7 | 8 | ||
| 8 | <RelativeLayout | 9 | <RelativeLayout | 
| 9 | android:id="@+id/rl_sender_list" | 10 | android:id="@+id/rl_sender_list" | 
| 10 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" | 
| 11 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" | 
| 12 | android:layout_marginBottom="24dp" | 13 | android:layout_marginBottom="24dp" | 
| 13 | - android:background="@drawable/shape_cos_white_rounded_top" | ||
| 14 | android:paddingTop="16dp"> | 14 | android:paddingTop="16dp"> | 
| 15 | 15 | ||
| 16 | <TextView | 16 | <TextView | ... | ... | 
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="wrap_content" | ||
| 6 | + android:background="@android:color/white"> | ||
| 7 | + | ||
| 8 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="56dp" | ||
| 11 | + android:layout_marginBottom="32dp" | ||
| 12 | + android:background="@drawable/shape_cos_sheet_item"> | ||
| 13 | + | ||
| 14 | + <ImageView | ||
| 15 | + android:layout_width="140dp" | ||
| 16 | + android:layout_height="36dp" | ||
| 17 | + android:layout_marginStart="24dp" | ||
| 18 | + android:background="@color/blue_dark" | ||
| 19 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 20 | + app:layout_constraintStart_toStartOf="parent" | ||
| 21 | + app:layout_constraintTop_toTopOf="parent" /> | ||
| 22 | + | ||
| 23 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
| 24 | + android:id="@+id/cl_button_sm_buy_it" | ||
| 25 | + android:layout_width="150dp" | ||
| 26 | + android:layout_height="36dp" | ||
| 27 | + android:layout_marginEnd="8dp" | ||
| 28 | + android:background="@drawable/selector_button_green2" | ||
| 29 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 30 | + app:layout_constraintEnd_toEndOf="parent" | ||
| 31 | + app:layout_constraintTop_toTopOf="parent"> | ||
| 32 | + | ||
| 33 | + <TextView | ||
| 34 | + android:id="@+id/button_sm_buy_it" | ||
| 35 | + android:layout_width="wrap_content" | ||
| 36 | + android:layout_height="wrap_content" | ||
| 37 | + android:includeFontPadding="false" | ||
| 38 | + android:text="@string/cos_sm_buy_it" | ||
| 39 | + android:textColor="@color/white" | ||
| 40 | + android:textSize="14sp" | ||
| 41 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 42 | + app:layout_constraintEnd_toEndOf="parent" | ||
| 43 | + app:layout_constraintStart_toStartOf="parent" | ||
| 44 | + app:layout_constraintTop_toTopOf="parent" /> | ||
| 45 | + | ||
| 46 | + <ImageView | ||
| 47 | + android:id="@+id/iv_sheet_cart" | ||
| 48 | + android:layout_width="16dp" | ||
| 49 | + android:layout_height="16dp" | ||
| 50 | + android:src="@drawable/ic_sm_cart" | ||
| 51 | + android:layout_marginEnd="8dp" | ||
| 52 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 53 | + app:layout_constraintEnd_toEndOf="parent" | ||
| 54 | + app:layout_constraintTop_toTopOf="parent" /> | ||
| 55 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
| 56 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
| 57 | +</LinearLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| ... | @@ -88,6 +88,7 @@ | ... | @@ -88,6 +88,7 @@ | 
| 88 | <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string> | 88 | <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string> | 
| 89 | <string name="cos_gift_it">Δώρισέ το</string> | 89 | <string name="cos_gift_it">Δώρισέ το</string> | 
| 90 | <string name="cos_sm_find_it">Βρες το στα supermarket</string> | 90 | <string name="cos_sm_find_it">Βρες το στα supermarket</string> | 
| 91 | + <string name="cos_sm_buy_it">Βρες το</string> | ||
| 91 | <string name="cos_activate_unified">Συνδύασε τις προσφορές σε ένα κουπόνι</string> | 92 | <string name="cos_activate_unified">Συνδύασε τις προσφορές σε ένα κουπόνι</string> | 
| 92 | <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string> | 93 | <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string> | 
| 93 | <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string> | 94 | <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string> | 
| ... | @@ -122,6 +123,8 @@ | ... | @@ -122,6 +123,8 @@ | 
| 122 | <string name="cos_coupon_gift">Δώρισέ το</string> | 123 | <string name="cos_coupon_gift">Δώρισέ το</string> | 
| 123 | <string name="cos_coupon_share_gift_title">Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο.</string> | 124 | <string name="cos_coupon_share_gift_title">Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο.</string> | 
| 124 | <string name="cos_coupon_share_sender">Αποστολέας</string> | 125 | <string name="cos_coupon_share_sender">Αποστολέας</string> | 
| 126 | + <string name="cos_find_sm_product">Βρες το προϊον στα supermarket</string> | ||
| 127 | + <string name="cos_sm_sheet_subtitle">Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία.</string> | ||
| 125 | <string name="cos_coupon_share_hint">Καταχώρηση τηλεφώνου</string> | 128 | <string name="cos_coupon_share_hint">Καταχώρηση τηλεφώνου</string> | 
| 126 | <string name="cos_coupon_share_button">Αποστολή με SMS</string> | 129 | <string name="cos_coupon_share_button">Αποστολή με SMS</string> | 
| 127 | <string name="cod_dlg_reject_title">Απόρριψη δώρου</string> | 130 | <string name="cod_dlg_reject_title">Απόρριψη δώρου</string> | 
| ... | @@ -188,6 +191,9 @@ | ... | @@ -188,6 +191,9 @@ | 
| 188 | <string name="cos_unified_subtitle">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας <![CDATA[<b>%1$s€</b>]]>.</string> | 191 | <string name="cos_unified_subtitle">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας <![CDATA[<b>%1$s€</b>]]>.</string> | 
| 189 | <string name="cos_unified_subtitle2">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών.</string> | 192 | <string name="cos_unified_subtitle2">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών.</string> | 
| 190 | <string name="cos_markets">Δες τα supermarket</string> | 193 | <string name="cos_markets">Δες τα supermarket</string> | 
| 194 | + <string name="cos_markets_map">Δες τα καταστήματα στο χάρτη</string> | ||
| 195 | + <string name="cos_markets_eshop">Δες τα eshop</string> | ||
| 196 | + <string name="cos_markets_eshop_item">Δες το eshop</string> | ||
| 191 | <string name="cos_show_market_coupons">Εμφάνιση προσφορών</string> | 197 | <string name="cos_show_market_coupons">Εμφάνιση προσφορών</string> | 
| 192 | <string name="cos_hide_market_coupons">Απόκρυψη προσφορών</string> | 198 | <string name="cos_hide_market_coupons">Απόκρυψη προσφορών</string> | 
| 193 | <string name="cos_market_terms">1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω.\n | 199 | <string name="cos_market_terms">1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω.\n | ... | ... | 
| ... | @@ -76,4 +76,11 @@ | ... | @@ -76,4 +76,11 @@ | 
| 76 | <item name="colorAccent">@color/cos_light_blue</item> | 76 | <item name="colorAccent">@color/cos_light_blue</item> | 
| 77 | </style> | 77 | </style> | 
| 78 | 78 | ||
| 79 | + <style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog"> | ||
| 80 | + <item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item> | ||
| 81 | + </style> | ||
| 82 | + | ||
| 83 | + <style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal"> | ||
| 84 | + <item name="android:background">@android:color/transparent</item> | ||
| 85 | + </style> | ||
| 79 | </resources> | 86 | </resources> | 
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
- 
Please register or login to post a comment