Showing
8 changed files
with
279 additions
and
1 deletions
... | @@ -7,14 +7,19 @@ import android.os.Handler; | ... | @@ -7,14 +7,19 @@ import android.os.Handler; |
7 | import android.text.SpannableStringBuilder; | 7 | import android.text.SpannableStringBuilder; |
8 | import android.text.Spanned; | 8 | import android.text.Spanned; |
9 | import android.view.View; | 9 | import android.view.View; |
10 | +import android.view.accessibility.AccessibilityEvent; | ||
10 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
11 | import android.widget.LinearLayout; | 12 | import android.widget.LinearLayout; |
12 | import android.widget.RelativeLayout; | 13 | import android.widget.RelativeLayout; |
13 | import android.widget.TextView; | 14 | import android.widget.TextView; |
14 | 15 | ||
16 | +import androidx.annotation.NonNull; | ||
15 | import androidx.cardview.widget.CardView; | 17 | import androidx.cardview.widget.CardView; |
16 | import androidx.core.content.ContextCompat; | 18 | import androidx.core.content.ContextCompat; |
17 | import androidx.core.content.res.ResourcesCompat; | 19 | import androidx.core.content.res.ResourcesCompat; |
20 | +import androidx.core.view.AccessibilityDelegateCompat; | ||
21 | +import androidx.core.view.ViewCompat; | ||
22 | +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; | ||
18 | import androidx.recyclerview.widget.LinearLayoutManager; | 23 | import androidx.recyclerview.widget.LinearLayoutManager; |
19 | import androidx.recyclerview.widget.RecyclerView; | 24 | import androidx.recyclerview.widget.RecyclerView; |
20 | 25 | ||
... | @@ -98,6 +103,88 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -98,6 +103,88 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
98 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontExpiredMore, | 103 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontExpiredMore, |
99 | mFontSharedMore); | 104 | mFontSharedMore); |
100 | 105 | ||
106 | + //Accessibility | ||
107 | + ViewCompat.setAccessibilityDelegate(mFontHeader, new AccessibilityDelegateCompat() { | ||
108 | + @Override | ||
109 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
110 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
111 | + info.setClassName("android.widget.TextView"); | ||
112 | + info.setHeading(true); | ||
113 | + } | ||
114 | + }); | ||
115 | + mFontHeader.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
116 | + | ||
117 | + ViewCompat.setAccessibilityDelegate(mIvBack, new AccessibilityDelegateCompat() { | ||
118 | + @Override | ||
119 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
120 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
121 | + info.setClassName("android.widget.Button"); | ||
122 | + info.setContentDescription(getString(R.string.accessibility_back)); | ||
123 | + } | ||
124 | + }); | ||
125 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
126 | + mIvBack.postDelayed(() -> { | ||
127 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
128 | + }, 1000); | ||
129 | + | ||
130 | + ViewCompat.setAccessibilityDelegate(mLlExpiredTab, new AccessibilityDelegateCompat() { | ||
131 | + @Override | ||
132 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
133 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
134 | + info.setClassName("android.widget.Button"); | ||
135 | + info.setSelected(true); | ||
136 | + info.setContentDescription(getString(R.string.cos_redeemed_coupons_tab)); | ||
137 | + } | ||
138 | + }); | ||
139 | + | ||
140 | + ViewCompat.setAccessibilityDelegate(mLlSharedTab, new AccessibilityDelegateCompat() { | ||
141 | + @Override | ||
142 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
143 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
144 | + info.setClassName("android.widget.Button"); | ||
145 | + info.setSelected(false); | ||
146 | + info.setContentDescription(getString(R.string.cos_shared_gifts_tab)); | ||
147 | + } | ||
148 | + }); | ||
149 | + | ||
150 | + ViewCompat.setAccessibilityDelegate(mFontExpired, new AccessibilityDelegateCompat() { | ||
151 | + @Override | ||
152 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
153 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
154 | + info.setClassName("android.widget.TextView"); | ||
155 | + info.setHeading(true); | ||
156 | + } | ||
157 | + }); | ||
158 | + | ||
159 | + ViewCompat.setAccessibilityDelegate(mFontShared, new AccessibilityDelegateCompat() { | ||
160 | + @Override | ||
161 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
162 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
163 | + info.setClassName("android.widget.TextView"); | ||
164 | + info.setHeading(true); | ||
165 | + } | ||
166 | + }); | ||
167 | + | ||
168 | + ViewCompat.setAccessibilityDelegate(mLlShowMoreShared, new AccessibilityDelegateCompat() { | ||
169 | + @Override | ||
170 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
171 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
172 | + info.setClassName("android.widget.Button"); | ||
173 | + info.setContentDescription(getString(R.string.cos_see_more)); | ||
174 | + info.setStateDescription(getString(R.string.accessibility_collapse)); | ||
175 | + } | ||
176 | + }); | ||
177 | + | ||
178 | + ViewCompat.setAccessibilityDelegate(mLlShowMoreExpired, new AccessibilityDelegateCompat() { | ||
179 | + @Override | ||
180 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
181 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
182 | + info.setClassName("android.widget.Button"); | ||
183 | + info.setContentDescription(getString(R.string.cos_see_more)); | ||
184 | + info.setStateDescription(getString(R.string.accessibility_collapse)); | ||
185 | + } | ||
186 | + }); | ||
187 | + | ||
101 | initViews(); | 188 | initViews(); |
102 | } | 189 | } |
103 | 190 | ||
... | @@ -182,6 +269,26 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -182,6 +269,26 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
182 | 269 | ||
183 | mRlSharedView.setVisibility(View.GONE); | 270 | mRlSharedView.setVisibility(View.GONE); |
184 | mRlExpiredView.setVisibility(View.VISIBLE); | 271 | mRlExpiredView.setVisibility(View.VISIBLE); |
272 | + | ||
273 | + ViewCompat.setAccessibilityDelegate(mLlExpiredTab, new AccessibilityDelegateCompat() { | ||
274 | + @Override | ||
275 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
276 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
277 | + info.setClassName("android.widget.Button"); | ||
278 | + info.setSelected(true); | ||
279 | + info.setContentDescription(getString(R.string.cos_redeemed_coupons_tab)); | ||
280 | + } | ||
281 | + }); | ||
282 | + | ||
283 | + ViewCompat.setAccessibilityDelegate(mLlSharedTab, new AccessibilityDelegateCompat() { | ||
284 | + @Override | ||
285 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
286 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
287 | + info.setClassName("android.widget.Button"); | ||
288 | + info.setSelected(false); | ||
289 | + info.setContentDescription(getString(R.string.cos_shared_gifts_tab)); | ||
290 | + } | ||
291 | + }); | ||
185 | return; | 292 | return; |
186 | } | 293 | } |
187 | if (view.getId() == R.id.ll_tab_shared) { | 294 | if (view.getId() == R.id.ll_tab_shared) { |
... | @@ -215,6 +322,26 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -215,6 +322,26 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
215 | 322 | ||
216 | mRlExpiredView.setVisibility(View.GONE); | 323 | mRlExpiredView.setVisibility(View.GONE); |
217 | mRlSharedView.setVisibility(View.VISIBLE); | 324 | mRlSharedView.setVisibility(View.VISIBLE); |
325 | + | ||
326 | + ViewCompat.setAccessibilityDelegate(mLlExpiredTab, new AccessibilityDelegateCompat() { | ||
327 | + @Override | ||
328 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
329 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
330 | + info.setClassName("android.widget.Button"); | ||
331 | + info.setSelected(false); | ||
332 | + info.setContentDescription(getString(R.string.cos_redeemed_coupons_tab)); | ||
333 | + } | ||
334 | + }); | ||
335 | + | ||
336 | + ViewCompat.setAccessibilityDelegate(mLlSharedTab, new AccessibilityDelegateCompat() { | ||
337 | + @Override | ||
338 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
339 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
340 | + info.setClassName("android.widget.Button"); | ||
341 | + info.setSelected(true); | ||
342 | + info.setContentDescription(getString(R.string.cos_shared_gifts_tab)); | ||
343 | + } | ||
344 | + }); | ||
218 | return; | 345 | return; |
219 | } | 346 | } |
220 | if (view.getId() == R.id.ll_show_more_expired) { | 347 | if (view.getId() == R.id.ll_show_more_expired) { | ... | ... |
... | @@ -8,11 +8,16 @@ import android.os.Handler; | ... | @@ -8,11 +8,16 @@ import android.os.Handler; |
8 | import android.text.SpannableStringBuilder; | 8 | import android.text.SpannableStringBuilder; |
9 | import android.text.Spanned; | 9 | import android.text.Spanned; |
10 | import android.view.View; | 10 | import android.view.View; |
11 | +import android.view.accessibility.AccessibilityEvent; | ||
11 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
12 | import android.widget.RelativeLayout; | 13 | import android.widget.RelativeLayout; |
13 | import android.widget.TextView; | 14 | import android.widget.TextView; |
14 | 15 | ||
16 | +import androidx.annotation.NonNull; | ||
15 | import androidx.core.content.res.ResourcesCompat; | 17 | import androidx.core.content.res.ResourcesCompat; |
18 | +import androidx.core.view.AccessibilityDelegateCompat; | ||
19 | +import androidx.core.view.ViewCompat; | ||
20 | +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; | ||
16 | 21 | ||
17 | import org.greenrobot.eventbus.EventBus; | 22 | import org.greenrobot.eventbus.EventBus; |
18 | import org.greenrobot.eventbus.Subscribe; | 23 | import org.greenrobot.eventbus.Subscribe; |
... | @@ -84,6 +89,30 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -84,6 +89,30 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
84 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mTvDealsValue, mTvMarketValue, | 89 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mTvDealsValue, mTvMarketValue, |
85 | mTvGiftsValue, mTvBoxValue); | 90 | mTvGiftsValue, mTvBoxValue); |
86 | 91 | ||
92 | + //Accessibility | ||
93 | + ViewCompat.setAccessibilityDelegate(mFontHeader, new AccessibilityDelegateCompat() { | ||
94 | + @Override | ||
95 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
96 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
97 | + info.setClassName("android.widget.TextView"); | ||
98 | + info.setHeading(true); | ||
99 | + } | ||
100 | + }); | ||
101 | + mFontHeader.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
102 | + | ||
103 | + ViewCompat.setAccessibilityDelegate(mIvBack, new AccessibilityDelegateCompat() { | ||
104 | + @Override | ||
105 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
106 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
107 | + info.setClassName("android.widget.Button"); | ||
108 | + info.setContentDescription(getString(R.string.accessibility_back)); | ||
109 | + } | ||
110 | + }); | ||
111 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
112 | + mIvBack.postDelayed(() -> { | ||
113 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
114 | + }, 1000); | ||
115 | + | ||
87 | initViews(); | 116 | initViews(); |
88 | } | 117 | } |
89 | 118 | ||
... | @@ -250,6 +279,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -250,6 +279,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
250 | sBuilder.setSpan(typefaceBoldSpanFirst, 24, 24 + badgeValueFirst.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 279 | sBuilder.setSpan(typefaceBoldSpanFirst, 24, 24 + badgeValueFirst.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
251 | mTvDealsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); | 280 | mTvDealsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); |
252 | mFavValue += WarplyManagerHelper.getDealsCouponsSum(); | 281 | mFavValue += WarplyManagerHelper.getDealsCouponsSum(); |
282 | + | ||
283 | + ViewCompat.setAccessibilityDelegate(mRlDealsBanner, new AccessibilityDelegateCompat() { | ||
284 | + @Override | ||
285 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
286 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
287 | + info.setClassName("android.widget.Button"); | ||
288 | + info.setContentDescription(getString(R.string.accessibility_market_dfy) + ", " + mTvDealsValueAll.getText().toString()); | ||
289 | + } | ||
290 | + }); | ||
253 | /** First Banner */ | 291 | /** First Banner */ |
254 | 292 | ||
255 | /** Second Expandable Banner */ | 293 | /** Second Expandable Banner */ |
... | @@ -287,6 +325,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -287,6 +325,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
287 | 325 | ||
288 | sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 326 | sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
289 | mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); | 327 | mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); |
328 | + | ||
329 | + ViewCompat.setAccessibilityDelegate(mRlUnifiedBanner, new AccessibilityDelegateCompat() { | ||
330 | + @Override | ||
331 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
332 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
333 | + info.setClassName("android.widget.Button"); | ||
334 | + info.setContentDescription(getString(R.string.accessibility_market_sm) + ", " + mTvMarketAll.getText().toString()); | ||
335 | + } | ||
336 | + }); | ||
290 | } else { | 337 | } else { |
291 | String badgeValue = String.format(Locale.GERMAN, "%.02f", 0.0f); | 338 | String badgeValue = String.format(Locale.GERMAN, "%.02f", 0.0f); |
292 | mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); | 339 | mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); |
... | @@ -298,6 +345,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -298,6 +345,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
298 | 345 | ||
299 | sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 346 | sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
300 | mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); | 347 | mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); |
348 | + | ||
349 | + ViewCompat.setAccessibilityDelegate(mRlUnifiedBanner, new AccessibilityDelegateCompat() { | ||
350 | + @Override | ||
351 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
352 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
353 | + info.setClassName("android.widget.Button"); | ||
354 | + info.setContentDescription(getString(R.string.accessibility_market_sm) + ", " + mTvMarketAll.getText().toString()); | ||
355 | + } | ||
356 | + }); | ||
301 | } | 357 | } |
302 | /** Second Expandable Banner */ | 358 | /** Second Expandable Banner */ |
303 | 359 | ||
... | @@ -319,6 +375,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -319,6 +375,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
319 | sBuilderSecond.setSpan(typefaceBoldSpanSecond, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 375 | sBuilderSecond.setSpan(typefaceBoldSpanSecond, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
320 | mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE); | 376 | mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE); |
321 | mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue(); | 377 | mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue(); |
378 | + | ||
379 | + ViewCompat.setAccessibilityDelegate(mRlGiftsBanner, new AccessibilityDelegateCompat() { | ||
380 | + @Override | ||
381 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
382 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
383 | + info.setClassName("android.widget.Button"); | ||
384 | + info.setContentDescription(getString(R.string.accessibility_market_free_coupons) + ", " + mTvGiftsValueAll.getText().toString()); | ||
385 | + } | ||
386 | + }); | ||
322 | } | 387 | } |
323 | /** Third Banner */ | 388 | /** Third Banner */ |
324 | 389 | ||
... | @@ -339,6 +404,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList | ... | @@ -339,6 +404,15 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList |
339 | sBuilderFourth.setSpan(typefaceBoldSpanFourth, 24, 24 + badgeValueFourth.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 404 | sBuilderFourth.setSpan(typefaceBoldSpanFourth, 24, 24 + badgeValueFourth.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
340 | mTvBoxValueAll.setText(sBuilderFourth, TextView.BufferType.SPANNABLE); | 405 | mTvBoxValueAll.setText(sBuilderFourth, TextView.BufferType.SPANNABLE); |
341 | mFavValue += WarplyManagerHelper.getBoxCouponsSum(); | 406 | mFavValue += WarplyManagerHelper.getBoxCouponsSum(); |
407 | + | ||
408 | + ViewCompat.setAccessibilityDelegate(mRlBoxBanner, new AccessibilityDelegateCompat() { | ||
409 | + @Override | ||
410 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
411 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
412 | + info.setClassName("android.widget.Button"); | ||
413 | + info.setContentDescription(getString(R.string.accessibility_market_box) + ", " + mTvBoxValueAll.getText().toString()); | ||
414 | + } | ||
415 | + }); | ||
342 | /** Fourth Banner */ | 416 | /** Fourth Banner */ |
343 | 417 | ||
344 | /** Sum Banner */ | 418 | /** Sum Banner */ | ... | ... |
... | @@ -8,14 +8,19 @@ import android.os.Looper; | ... | @@ -8,14 +8,19 @@ import android.os.Looper; |
8 | import android.text.SpannableStringBuilder; | 8 | import android.text.SpannableStringBuilder; |
9 | import android.text.Spanned; | 9 | import android.text.Spanned; |
10 | import android.view.View; | 10 | import android.view.View; |
11 | +import android.view.accessibility.AccessibilityEvent; | ||
11 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
12 | import android.widget.LinearLayout; | 13 | import android.widget.LinearLayout; |
13 | import android.widget.RelativeLayout; | 14 | import android.widget.RelativeLayout; |
14 | import android.widget.TextView; | 15 | import android.widget.TextView; |
15 | 16 | ||
17 | +import androidx.annotation.NonNull; | ||
16 | import androidx.cardview.widget.CardView; | 18 | import androidx.cardview.widget.CardView; |
17 | import androidx.core.content.ContextCompat; | 19 | import androidx.core.content.ContextCompat; |
18 | import androidx.core.content.res.ResourcesCompat; | 20 | import androidx.core.content.res.ResourcesCompat; |
21 | +import androidx.core.view.AccessibilityDelegateCompat; | ||
22 | +import androidx.core.view.ViewCompat; | ||
23 | +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; | ||
19 | import androidx.recyclerview.widget.LinearLayoutManager; | 24 | import androidx.recyclerview.widget.LinearLayoutManager; |
20 | import androidx.recyclerview.widget.RecyclerView; | 25 | import androidx.recyclerview.widget.RecyclerView; |
21 | 26 | ||
... | @@ -98,6 +103,57 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -98,6 +103,57 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl |
98 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontExpiredMore, | 103 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mFontExpiredMore, |
99 | mFontSharedMore); | 104 | mFontSharedMore); |
100 | 105 | ||
106 | + //Accessibility | ||
107 | + ViewCompat.setAccessibilityDelegate(mFontHeader, new AccessibilityDelegateCompat() { | ||
108 | + @Override | ||
109 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
110 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
111 | + info.setClassName("android.widget.TextView"); | ||
112 | + info.setHeading(true); | ||
113 | + } | ||
114 | + }); | ||
115 | + mFontHeader.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); | ||
116 | + | ||
117 | + ViewCompat.setAccessibilityDelegate(mIvBack, new AccessibilityDelegateCompat() { | ||
118 | + @Override | ||
119 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
120 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
121 | + info.setClassName("android.widget.Button"); | ||
122 | + info.setContentDescription(getString(R.string.accessibility_back)); | ||
123 | + } | ||
124 | + }); | ||
125 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); | ||
126 | + mIvBack.postDelayed(() -> { | ||
127 | + mIvBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
128 | + }, 1000); | ||
129 | + | ||
130 | + ViewCompat.setAccessibilityDelegate(mFontExpired, new AccessibilityDelegateCompat() { | ||
131 | + @Override | ||
132 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
133 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
134 | + info.setClassName("android.widget.TextView"); | ||
135 | + info.setHeading(true); | ||
136 | + } | ||
137 | + }); | ||
138 | + | ||
139 | + ViewCompat.setAccessibilityDelegate(mFontShared, new AccessibilityDelegateCompat() { | ||
140 | + @Override | ||
141 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
142 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
143 | + info.setClassName("android.widget.TextView"); | ||
144 | + info.setHeading(true); | ||
145 | + } | ||
146 | + }); | ||
147 | + | ||
148 | + ViewCompat.setAccessibilityDelegate(mLlShowMoreExpired, new AccessibilityDelegateCompat() { | ||
149 | + @Override | ||
150 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
151 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
152 | + info.setClassName("android.widget.Button"); | ||
153 | + info.setContentDescription(getString(R.string.cos_see_more)); | ||
154 | + info.setStateDescription(getString(R.string.accessibility_collapse)); | ||
155 | + } | ||
156 | + }); | ||
101 | 157 | ||
102 | if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) { | 158 | if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) { |
103 | final ExecutorService executor = Executors.newFixedThreadPool(1); | 159 | final ExecutorService executor = Executors.newFixedThreadPool(1); | ... | ... |
... | @@ -28,7 +28,7 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList | ... | @@ -28,7 +28,7 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList |
28 | // Fields | 28 | // Fields |
29 | // =========================================================== | 29 | // =========================================================== |
30 | 30 | ||
31 | - private ImageView mIvBack; | 31 | + private ImageView mIvBack, mIvGenericImage; |
32 | private TextView mFontHeader, mTvPassInfoHeader, mTvBasketTitle, mTvBasketSubtitle, | 32 | private TextView mFontHeader, mTvPassInfoHeader, mTvBasketTitle, mTvBasketSubtitle, |
33 | mTvEshopTitle, mTvEshopSubtitle, mTvAbTitle, mTvAbSubtitle, mTvPassBack; | 33 | mTvEshopTitle, mTvEshopSubtitle, mTvAbTitle, mTvAbSubtitle, mTvPassBack; |
34 | private LinearLayout mLlPassReturn; | 34 | private LinearLayout mLlPassReturn; |
... | @@ -53,6 +53,7 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList | ... | @@ -53,6 +53,7 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList |
53 | mTvAbSubtitle = findViewById(R.id.tv_pass_info_ab_subtitle); | 53 | mTvAbSubtitle = findViewById(R.id.tv_pass_info_ab_subtitle); |
54 | mTvPassBack = findViewById(R.id.tv_button_back); | 54 | mTvPassBack = findViewById(R.id.tv_button_back); |
55 | mLlPassReturn = findViewById(R.id.ll_return_back); | 55 | mLlPassReturn = findViewById(R.id.ll_return_back); |
56 | + mIvGenericImage = findViewById(R.id.iv_pass_info_logo); | ||
56 | 57 | ||
57 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mTvPassInfoHeader); | 58 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mTvPassInfoHeader); |
58 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mTvBasketTitle, mTvEshopTitle, | 59 | WarpUtils.renderCustomFont(this, R.font.peridot_bold, mTvBasketTitle, mTvEshopTitle, |
... | @@ -93,6 +94,16 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList | ... | @@ -93,6 +94,16 @@ public class MarketPassInfoActivity extends Activity implements View.OnClickList |
93 | } | 94 | } |
94 | }); | 95 | }); |
95 | 96 | ||
97 | + mIvGenericImage.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); | ||
98 | + ViewCompat.setAccessibilityDelegate(mIvGenericImage, new AccessibilityDelegateCompat() { | ||
99 | + @Override | ||
100 | + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) { | ||
101 | + super.onInitializeAccessibilityNodeInfo(host, info); | ||
102 | + info.setClassName("android.widget.ImageView"); | ||
103 | + info.setContentDescription(getString(R.string.cos_market_Pass_info_title)); | ||
104 | + } | ||
105 | + }); | ||
106 | + | ||
96 | initViews(); | 107 | initViews(); |
97 | } | 108 | } |
98 | 109 | ... | ... |
... | @@ -18,6 +18,7 @@ | ... | @@ -18,6 +18,7 @@ |
18 | android:layout_width="48dp" | 18 | android:layout_width="48dp" |
19 | android:layout_height="48dp" | 19 | android:layout_height="48dp" |
20 | android:layout_marginStart="16dp" | 20 | android:layout_marginStart="16dp" |
21 | + android:contentDescription="@string/accessibility_back" | ||
21 | android:scaleType="centerInside" | 22 | android:scaleType="centerInside" |
22 | android:src="@drawable/ic_back" | 23 | android:src="@drawable/ic_back" |
23 | app:layout_constraintBottom_toBottomOf="parent" | 24 | app:layout_constraintBottom_toBottomOf="parent" |
... | @@ -28,6 +29,7 @@ | ... | @@ -28,6 +29,7 @@ |
28 | android:id="@+id/textView3" | 29 | android:id="@+id/textView3" |
29 | android:layout_width="wrap_content" | 30 | android:layout_width="wrap_content" |
30 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
32 | + android:contentDescription="@string/cos_analysis" | ||
31 | android:text="@string/cos_analysis" | 33 | android:text="@string/cos_analysis" |
32 | android:textColor="@color/cos_light_black" | 34 | android:textColor="@color/cos_light_black" |
33 | android:textSize="19sp" | 35 | android:textSize="19sp" | ... | ... |
... | @@ -20,6 +20,7 @@ | ... | @@ -20,6 +20,7 @@ |
20 | android:layout_marginStart="16dp" | 20 | android:layout_marginStart="16dp" |
21 | android:scaleType="centerInside" | 21 | android:scaleType="centerInside" |
22 | android:src="@drawable/ic_close" | 22 | android:src="@drawable/ic_close" |
23 | + android:contentDescription="@string/accessibility_close" | ||
23 | app:layout_constraintBottom_toBottomOf="parent" | 24 | app:layout_constraintBottom_toBottomOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 26 | app:layout_constraintTop_toTopOf="parent" /> |
... | @@ -29,6 +30,7 @@ | ... | @@ -29,6 +30,7 @@ |
29 | android:layout_width="wrap_content" | 30 | android:layout_width="wrap_content" |
30 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
31 | android:text="@string/cos_loyalty_history" | 32 | android:text="@string/cos_loyalty_history" |
33 | + android:contentDescription="@string/cos_loyalty_history" | ||
32 | android:textColor="@color/cos_light_black" | 34 | android:textColor="@color/cos_light_black" |
33 | android:textSize="19sp" | 35 | android:textSize="19sp" |
34 | app:layout_constraintBottom_toBottomOf="parent" | 36 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... |
... | @@ -19,6 +19,7 @@ | ... | @@ -19,6 +19,7 @@ |
19 | android:layout_height="48dp" | 19 | android:layout_height="48dp" |
20 | android:layout_marginStart="16dp" | 20 | android:layout_marginStart="16dp" |
21 | android:scaleType="centerInside" | 21 | android:scaleType="centerInside" |
22 | + android:contentDescription="@string/accessibility_back" | ||
22 | android:src="@drawable/ic_back" | 23 | android:src="@drawable/ic_back" |
23 | app:layout_constraintBottom_toBottomOf="parent" | 24 | app:layout_constraintBottom_toBottomOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
... | @@ -29,6 +30,7 @@ | ... | @@ -29,6 +30,7 @@ |
29 | android:layout_width="wrap_content" | 30 | android:layout_width="wrap_content" |
30 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
31 | android:text="@string/cos_analysis" | 32 | android:text="@string/cos_analysis" |
33 | + android:contentDescription="@string/cos_analysis" | ||
32 | android:textColor="@color/cos_light_black" | 34 | android:textColor="@color/cos_light_black" |
33 | android:textSize="19sp" | 35 | android:textSize="19sp" |
34 | app:layout_constraintBottom_toBottomOf="parent" | 36 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... |
... | @@ -277,6 +277,10 @@ | ... | @@ -277,6 +277,10 @@ |
277 | <string name="accessibility_market_pass_info">Πληροφορίες</string> | 277 | <string name="accessibility_market_pass_info">Πληροφορίες</string> |
278 | <string name="accessibility_market_pass_barcode_value">Αριθμός barcode</string> | 278 | <string name="accessibility_market_pass_barcode_value">Αριθμός barcode</string> |
279 | <string name="accessibility_market_pass_barcode">Barcode</string> | 279 | <string name="accessibility_market_pass_barcode">Barcode</string> |
280 | + <string name="accessibility_market_dfy">Deals for you</string> | ||
281 | + <string name="accessibility_market_sm">Supermarket deals</string> | ||
282 | + <string name="accessibility_market_free_coupons">Free coupons</string> | ||
283 | + <string name="accessibility_market_box">Box</string> | ||
280 | 284 | ||
281 | <string-array name="coupons_array"> | 285 | <string-array name="coupons_array"> |
282 | <item>Κουπόνια</item> | 286 | <item>Κουπόνια</item> | ... | ... |
-
Please register or login to post a comment