Showing
4 changed files
with
111 additions
and
75 deletions
... | @@ -256,6 +256,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene | ... | @@ -256,6 +256,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene |
256 | }); | 256 | }); |
257 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); | 257 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); |
258 | TextView header = bottomSheetDialog.findViewById(R.id.tv_sender_value); | 258 | TextView header = bottomSheetDialog.findViewById(R.id.tv_sender_value); |
259 | + WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, header); | ||
259 | 260 | ||
260 | RelativeLayout dialogClose = (RelativeLayout) bottomSheetDialog.findViewById(R.id.rl_sender_list_close); | 261 | RelativeLayout dialogClose = (RelativeLayout) bottomSheetDialog.findViewById(R.id.rl_sender_list_close); |
261 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | 262 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | ... | ... |
... | @@ -9,13 +9,18 @@ import android.util.Log; | ... | @@ -9,13 +9,18 @@ import android.util.Log; |
9 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
10 | import android.view.View; | 10 | import android.view.View; |
11 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
12 | +import android.view.accessibility.AccessibilityEvent; | ||
12 | import android.widget.ImageView; | 13 | import android.widget.ImageView; |
13 | import android.widget.LinearLayout; | 14 | import android.widget.LinearLayout; |
14 | import android.widget.RelativeLayout; | 15 | import android.widget.RelativeLayout; |
15 | import android.widget.TextView; | 16 | import android.widget.TextView; |
16 | 17 | ||
18 | +import androidx.annotation.NonNull; | ||
17 | import androidx.appcompat.app.AlertDialog; | 19 | import androidx.appcompat.app.AlertDialog; |
18 | import androidx.core.content.ContextCompat; | 20 | import androidx.core.content.ContextCompat; |
21 | +import androidx.core.view.AccessibilityDelegateCompat; | ||
22 | +import androidx.core.view.ViewCompat; | ||
23 | +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; | ||
19 | 24 | ||
20 | import com.bumptech.glide.Glide; | 25 | import com.bumptech.glide.Glide; |
21 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 26 | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
... | @@ -103,6 +108,51 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -103,6 +108,51 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
103 | mTvCampaignTitle, mTvSeeMoreValue); | 108 | mTvCampaignTitle, mTvSeeMoreValue); |
104 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontButtonSeeMore); | 109 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontButtonSeeMore); |
105 | 110 | ||
111 | + //Accessibility | ||
112 | + ViewCompat.setAccessibilityDelegate(mTvTelcoHeaderTitle, new AccessibilityDelegateCompat() { | ||
113 | + @Override | ||
114 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
115 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
116 | + info.setClassName("android.widget.TextView"); | ||
117 | + info.setContentDescription(mCCMS != null ? mCCMS.getTitleOffer() : ""); | ||
118 | + info.setHeading(true); | ||
119 | + } | ||
120 | + }); | ||
121 | + mTvTelcoHeaderTitle.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
122 | + | ||
123 | + ViewCompat.setAccessibilityDelegate(mIvBack, new AccessibilityDelegateCompat() { | ||
124 | + @Override | ||
125 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
126 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
127 | + info.setClassName("android.widget.Button"); | ||
128 | + info.setContentDescription(getString(R.string.accessibility_back)); | ||
129 | + } | ||
130 | + }); | ||
131 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
132 | + mIvBack.postDelayed(() -> { | ||
133 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
134 | + }, 1000); | ||
135 | + | ||
136 | + ViewCompat.setAccessibilityDelegate(mLlActivateOffer, new AccessibilityDelegateCompat() { | ||
137 | + @Override | ||
138 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
139 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
140 | + info.setClassName("android.widget.Button"); | ||
141 | + info.setContentDescription(getString(R.string.cos_dlg_positive_button)); | ||
142 | + } | ||
143 | + }); | ||
144 | + | ||
145 | + mTvSeeMoreValue.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
146 | + ViewCompat.setAccessibilityDelegate(mLlSeeMore, new AccessibilityDelegateCompat() { | ||
147 | + @Override | ||
148 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
149 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
150 | + info.setClassName("android.widget.Button"); | ||
151 | + info.setContentDescription(getString(R.string.cos_see_more2)); | ||
152 | + info.setStateDescription(getString(R.string.accessibility_collapse)); | ||
153 | + } | ||
154 | + }); | ||
155 | + | ||
106 | initViews(); | 156 | initViews(); |
107 | } | 157 | } |
108 | 158 | ||
... | @@ -136,12 +186,37 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -136,12 +186,37 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
136 | } | 186 | } |
137 | if (view.getId() == R.id.ll_see_more) { | 187 | if (view.getId() == R.id.ll_see_more) { |
138 | if (mIsSeeMoreShown) { | 188 | if (mIsSeeMoreShown) { |
189 | + mTvSeeMoreValue.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
190 | + ViewCompat.setAccessibilityDelegate(mLlSeeMore, new AccessibilityDelegateCompat() { | ||
191 | + @Override | ||
192 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
193 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
194 | + info.setClassName("android.widget.Button"); | ||
195 | + info.setContentDescription(getString(R.string.cos_see_more2)); | ||
196 | + info.setStateDescription(getString(R.string.accessibility_collapse)); | ||
197 | + } | ||
198 | + }); | ||
199 | + | ||
139 | mTvSeeMoreValue.setVisibility(View.GONE); | 200 | mTvSeeMoreValue.setVisibility(View.GONE); |
140 | ImageView seeMoreButtonArrow = mLlSeeMore.findViewById(R.id.iv_see_more_arrow); | 201 | ImageView seeMoreButtonArrow = mLlSeeMore.findViewById(R.id.iv_see_more_arrow); |
141 | seeMoreButtonArrow.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_down_dark_new)); | 202 | seeMoreButtonArrow.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_down_dark_new)); |
142 | mIsSeeMoreShown = false; | 203 | mIsSeeMoreShown = false; |
143 | } else { | 204 | } else { |
205 | + ViewCompat.setAccessibilityDelegate(mLlSeeMore, new AccessibilityDelegateCompat() { | ||
206 | + @Override | ||
207 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
208 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
209 | + info.setClassName("android.widget.Button"); | ||
210 | + info.setContentDescription(getString(R.string.cos_see_more2)); | ||
211 | + info.setStateDescription(getString(R.string.accessibility_expand)); | ||
212 | + } | ||
213 | + }); | ||
214 | + | ||
144 | mTvSeeMoreValue.setVisibility(View.VISIBLE); | 215 | mTvSeeMoreValue.setVisibility(View.VISIBLE); |
216 | + | ||
217 | + mTvSeeMoreValue.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
218 | + mTvSeeMoreValue.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
219 | + | ||
145 | ImageView seeMoreButtonArrow = mLlSeeMore.findViewById(R.id.iv_see_more_arrow); | 220 | ImageView seeMoreButtonArrow = mLlSeeMore.findViewById(R.id.iv_see_more_arrow); |
146 | seeMoreButtonArrow.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_up_dark_new)); | 221 | seeMoreButtonArrow.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_up_dark_new)); |
147 | mIsSeeMoreShown = true; | 222 | mIsSeeMoreShown = true; |
... | @@ -154,6 +229,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -154,6 +229,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
154 | // =========================================================== | 229 | // =========================================================== |
155 | 230 | ||
156 | private void initViews() { | 231 | private void initViews() { |
232 | + if (mCCMS != null) { | ||
157 | mTvTelcoHeaderTitle.setText(mCCMS.getTitleOffer()); | 233 | mTvTelcoHeaderTitle.setText(mCCMS.getTitleOffer()); |
158 | mTvCampaignTitle.setText(mCCMS.getDescription()); | 234 | mTvCampaignTitle.setText(mCCMS.getDescription()); |
159 | mTvTelcoGiftValue.setText(mCCMS.getGiftValue()); | 235 | mTvTelcoGiftValue.setText(mCCMS.getGiftValue()); |
... | @@ -175,6 +251,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -175,6 +251,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
175 | .load(R.drawable.ic_cosmote_logo_horizontal_grey) | 251 | .load(R.drawable.ic_cosmote_logo_horizontal_grey) |
176 | .into(mIvCampaignPhoto); | 252 | .into(mIvCampaignPhoto); |
177 | } | 253 | } |
254 | + } | ||
178 | mIvBack.setOnClickListener(this); | 255 | mIvBack.setOnClickListener(this); |
179 | mLlActivateOffer.setOnClickListener(this); | 256 | mLlActivateOffer.setOnClickListener(this); |
180 | mLlSeeMore.setOnClickListener(this); | 257 | mLlSeeMore.setOnClickListener(this); |
... | @@ -198,7 +275,27 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -198,7 +275,27 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
198 | bottomSheetDialog.dismiss(); | 275 | bottomSheetDialog.dismiss(); |
199 | }); | 276 | }); |
200 | 277 | ||
201 | - if (mCCMS.getEligibleAssets() != null && mCCMS.getEligibleAssets().size() > 0) { | 278 | + ViewCompat.setAccessibilityDelegate(tvHeader, new AccessibilityDelegateCompat() { |
279 | + @Override | ||
280 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
281 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
282 | + info.setClassName("android.widget.TextView"); | ||
283 | + info.setContentDescription(getString(R.string.cos_coupon_share_telco)); | ||
284 | + info.setHeading(true); | ||
285 | + } | ||
286 | + }); | ||
287 | + tvHeader.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
288 | + | ||
289 | + ViewCompat.setAccessibilityDelegate(dialogClose, new AccessibilityDelegateCompat() { | ||
290 | + @Override | ||
291 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
292 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
293 | + info.setClassName("android.widget.Button"); | ||
294 | + info.setContentDescription(getString(R.string.accessibility_close)); | ||
295 | + } | ||
296 | + }); | ||
297 | + | ||
298 | + if (mCCMS != null && mCCMS.getEligibleAssets() != null && mCCMS.getEligibleAssets().size() > 0) { | ||
202 | for (int i = 0; i < mCCMS.getEligibleAssets().size(); i++) { | 299 | for (int i = 0; i < mCCMS.getEligibleAssets().size(); i++) { |
203 | LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | 300 | LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
204 | LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_share, null); | 301 | LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_share, null); |
... | @@ -211,6 +308,16 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -211,6 +308,16 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
211 | bottomSheetDialog.dismiss(); | 308 | bottomSheetDialog.dismiss(); |
212 | askActivateDialog(); | 309 | askActivateDialog(); |
213 | }); | 310 | }); |
311 | + | ||
312 | + ViewCompat.setAccessibilityDelegate(textView, new AccessibilityDelegateCompat() { | ||
313 | + @Override | ||
314 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
315 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
316 | + info.setClassName("android.widget.TextView"); | ||
317 | + info.setContentDescription(WarplyManagerHelper.formatPhoneNumber(textView.getText().toString())); | ||
318 | + } | ||
319 | + }); | ||
320 | + | ||
214 | parent.addView(v, 0, new ViewGroup.LayoutParams( | 321 | parent.addView(v, 0, new ViewGroup.LayoutParams( |
215 | ViewGroup.LayoutParams.MATCH_PARENT, | 322 | ViewGroup.LayoutParams.MATCH_PARENT, |
216 | ViewGroup.LayoutParams.WRAP_CONTENT)); | 323 | ViewGroup.LayoutParams.WRAP_CONTENT)); | ... | ... |
... | @@ -375,42 +375,6 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -375,42 +375,6 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
375 | } | 375 | } |
376 | return; | 376 | return; |
377 | } | 377 | } |
378 | - /** Active Unified Banner */ | ||
379 | -// if (view.getId() == R.id.rv_sm_count) { | ||
380 | -// if (!mUnifiedCountPressed) { | ||
381 | -// mUnifiedCountPressed = true; | ||
382 | -// WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen") | ||
383 | -// .concat(":") | ||
384 | -// .concat("ActiveMarketBanner")); | ||
385 | -// | ||
386 | -// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | ||
387 | -// analyticsEvent.setEventName("did_tap_market_active_badge"); | ||
388 | -// analyticsEvent.setParameter("screen", "Loyalty Wallet"); | ||
389 | -// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | ||
390 | -// | ||
391 | -// Intent intent = new Intent(getContext(), ActiveUnifiedCouponsActivity.class); | ||
392 | -// startActivity(intent); | ||
393 | -// } | ||
394 | -// return; | ||
395 | -// } | ||
396 | - /** Active Coupons Banner */ | ||
397 | -// if (view.getId() == R.id.rv_gifts_count) { | ||
398 | -// if (!mGiftsCountPressed) { | ||
399 | -// mGiftsCountPressed = true; | ||
400 | -// WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen") | ||
401 | -// .concat(":") | ||
402 | -// .concat("ActiveLoyaltyBanner")); | ||
403 | -// | ||
404 | -// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | ||
405 | -// analyticsEvent.setEventName("did_tap_gifts_for_you_active_badge"); | ||
406 | -// analyticsEvent.setParameter("screen", "Loyalty Wallet"); | ||
407 | -// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | ||
408 | -// | ||
409 | -// Intent intent = new Intent(getContext(), ActiveCouponsActivity.class); | ||
410 | -// startActivity(intent); | ||
411 | -// } | ||
412 | -// return; | ||
413 | -// } | ||
414 | /** Coupons History */ | 378 | /** Coupons History */ |
415 | if (view.getId() == R.id.cl_deals_win_inner) { | 379 | if (view.getId() == R.id.cl_deals_win_inner) { |
416 | if (!mHistoryPressed) { | 380 | if (!mHistoryPressed) { |
... | @@ -429,25 +393,6 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -429,25 +393,6 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
429 | } | 393 | } |
430 | return; | 394 | return; |
431 | } | 395 | } |
432 | - /** Active Box Banner */ | ||
433 | -// if (view.getId() == R.id.rv_box_count) { | ||
434 | -// if (!mBoxCountPressed) { | ||
435 | -// mBoxCountPressed = true; | ||
436 | -// WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen") | ||
437 | -// .concat(":") | ||
438 | -// .concat("ActiveBoxBanner")); | ||
439 | -// | ||
440 | -// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | ||
441 | -// analyticsEvent.setEventName("did_tap_box_active_badge"); | ||
442 | -// analyticsEvent.setParameter("screen", "Loyalty Wallet"); | ||
443 | -// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | ||
444 | -// | ||
445 | -// ActiveBoxCouponEventModel activeBoxEventModel = new ActiveBoxCouponEventModel(); | ||
446 | -// activeBoxEventModel.setPressed(true); | ||
447 | -// EventBus.getDefault().post(new WarplyEventBusManager(activeBoxEventModel)); | ||
448 | -// } | ||
449 | -// return; | ||
450 | -// } | ||
451 | /** Unified History */ | 396 | /** Unified History */ |
452 | if (view.getId() == R.id.cl_market_inner) { | 397 | if (view.getId() == R.id.cl_market_inner) { |
453 | if (!mHistoryMarketPressed) { | 398 | if (!mHistoryMarketPressed) { |
... | @@ -496,26 +441,7 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -496,26 +441,7 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
496 | 441 | ||
497 | VouchersActivityEventModel vouchersActivity = new VouchersActivityEventModel(); | 442 | VouchersActivityEventModel vouchersActivity = new VouchersActivityEventModel(); |
498 | EventBus.getDefault().post(new WarplyEventBusManager(vouchersActivity)); | 443 | EventBus.getDefault().post(new WarplyEventBusManager(vouchersActivity)); |
499 | - return; | ||
500 | } | 444 | } |
501 | - /** Active Deals Banner */ | ||
502 | -// if (view.getId() == R.id.rv_deals_count) { | ||
503 | -// if (!mDfyPressed) { | ||
504 | -// mDfyPressed = true; | ||
505 | -// WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen") | ||
506 | -// .concat(":") | ||
507 | -// .concat("ActiveDealsBanner")); | ||
508 | -// | ||
509 | -// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | ||
510 | -// analyticsEvent.setEventName("did_tap_deals_for_you_active_badge"); | ||
511 | -// analyticsEvent.setParameter("screen", "Loyalty Wallet"); | ||
512 | -// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | ||
513 | -// | ||
514 | -// ActiveDFYCouponEventModel activeCouponEventModel = new ActiveDFYCouponEventModel(); | ||
515 | -// activeCouponEventModel.setPressed(true); | ||
516 | -// EventBus.getDefault().post(new WarplyEventBusManager(activeCouponEventModel)); | ||
517 | -// } | ||
518 | -// } | ||
519 | } | 445 | } |
520 | 446 | ||
521 | @Override | 447 | @Override | ... | ... |
... | @@ -18,6 +18,7 @@ | ... | @@ -18,6 +18,7 @@ |
18 | android:layout_marginStart="16dp" | 18 | android:layout_marginStart="16dp" |
19 | android:scaleType="centerInside" | 19 | android:scaleType="centerInside" |
20 | android:src="@drawable/ic_close" | 20 | android:src="@drawable/ic_close" |
21 | + android:contentDescription="@string/accessibility_close" | ||
21 | app:layout_constraintBottom_toBottomOf="parent" | 22 | app:layout_constraintBottom_toBottomOf="parent" |
22 | app:layout_constraintStart_toStartOf="parent" | 23 | app:layout_constraintStart_toStartOf="parent" |
23 | app:layout_constraintTop_toTopOf="parent" /> | 24 | app:layout_constraintTop_toTopOf="parent" /> |
... | @@ -65,6 +66,7 @@ | ... | @@ -65,6 +66,7 @@ |
65 | android:layout_height="222dp" | 66 | android:layout_height="222dp" |
66 | android:layout_centerHorizontal="true" | 67 | android:layout_centerHorizontal="true" |
67 | android:scaleType="centerCrop" | 68 | android:scaleType="centerCrop" |
69 | + android:contentDescription="@string/accessibility_coupon_image" | ||
68 | tools:src="@drawable/carousel_banner" /> | 70 | tools:src="@drawable/carousel_banner" /> |
69 | 71 | ||
70 | <LinearLayout | 72 | <LinearLayout | ... | ... |
-
Please register or login to post a comment