Skip to content

Commit df6fd85

Browse files
Merge pull request #30 from tim-littlefair/task28-google_play_accessibility
Task28 google play accessibility
2 parents 5a7d47e + 83ec6bc commit df6fd85

File tree

11 files changed

+30
-26
lines changed

11 files changed

+30
-26
lines changed

Diff for: android-app/build.gradle

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ android {
1919

2020
defaultConfig {
2121
applicationId "net.heretical_camelid.transit_emv_checker.android_app"
22-
minSdk 26
22+
minSdk 25
2323
targetSdk 34
2424

2525
// Version name and number are managed in the root build.gradle file
26+
2627
versionCode rootProject.ext.versionCode
28+
// For builds triggered under build_and_test_everything.sh
29+
// where the working directory exactly matches git HEAD,
30+
// the 7-hex-prefix of the current git HEAD hash will
31+
// be substituted for the $vname_suffix variable
32+
// in the line below.
33+
// For other builds, the variable will be the string 'dirty'.
2734
versionName rootProject.ext.versionName+"-$vname_suffix"
2835

2936
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Diff for: android-app/proguard-rules.pro

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
# Uncomment this to preserve the line number information for
1616
# debugging stack traces.
17-
#-keepattributes SourceFile,LineNumberTable
17+
-keepattributes SourceFile,LineNumberTable
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
-renamesourcefileattribute SourceFile

Diff for: android-app/src/androidTest/java/net/heretical_camelid/transit_emv_checker/android_app/TECTestSuiteBase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public class TECTestSuiteBase {
6464
static final Logger LOGGER = LoggerFactory.getLogger(TEC_UiTestSuite.class);
6565
private static final String TEC_ANDROID_APP_PACKAGE =
6666
"net.heretical_camelid.transit_emv_checker.android_app";
67-
private static final int _LAUNCH_TIMEOUT_SECONDS = 10;
67+
private static final int _LAUNCH_TIMEOUT_SECONDS = 15;
6868
// At any point where we are waiting for a UI element to
6969
// appear, we use this timeout
70-
private static final int _UI_APPEAR_TIMEOUT_SECONDS = 10;
70+
private static final int _UI_APPEAR_TIMEOUT_SECONDS = 15;
7171
// At any point where we are waiting for a UI element to change
7272
// state, we use this unconditional sleep
73-
protected static final int _UI_CHANGE_SLEEP_SECONDS = 1;
73+
protected static final int _UI_CHANGE_SLEEP_SECONDS = 3;
7474
protected UiDevice mDevice;
7575

7676
static Matcher<View> childAtPosition(

Diff for: android-app/src/main/java/net/heretical_camelid/transit_emv_checker/android_app/MainActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import androidx.annotation.NonNull;
1212
import androidx.appcompat.app.AlertDialog;
13+
import androidx.appcompat.app.AppCompatDelegate;
1314
import androidx.lifecycle.MutableLiveData;
1415
import androidx.appcompat.app.AppCompatActivity;
1516
import androidx.navigation.NavController;
@@ -105,6 +106,7 @@ TapConductor replayCapturedTap(String mediaAssetName, ITerminal terminal) {
105106
protected void onCreate(Bundle savedInstanceState) {
106107
super.onCreate(savedInstanceState);
107108

109+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
108110

109111
s_userHasAgreed = false;
110112
m_emvMediaAgent = new EMVMediaAgent(this);

Diff for: android-app/src/main/java/net/heretical_camelid/transit_emv_checker/android_app/ui/html/ObservableWebViewWrapper.java

+7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package net.heretical_camelid.transit_emv_checker.android_app.ui.html;
22

33
import android.annotation.SuppressLint;
4+
import android.content.res.Resources;
45
import android.os.Handler;
56
import android.os.Message;
67
import android.util.Base64;
78
import android.webkit.JavascriptInterface;
89
import android.webkit.WebResourceRequest;
10+
import android.webkit.WebSettings;
911
import android.webkit.WebView;
1012
import android.webkit.WebViewClient;
1113

@@ -25,12 +27,17 @@ public class ObservableWebViewWrapper extends WebViewClient implements Handler.C
2527
public ObservableWebViewWrapper(WebView webView, MainActivity activity) {
2628
m_mainActivity = activity;
2729
m_webView = webView;
30+
2831
// I have no reason to want Javascript enabled,
2932
// but running with it disabled triggers large
3033
// stack traces in logcat.
3134
// ref: https://stackoverflow.com/q/74198645
3235
m_webView.getSettings().setJavaScriptEnabled(true);
3336
m_webView.addJavascriptInterface(this,"observer");
37+
38+
// Pushing the text size up a little from the default
39+
m_webView.getSettings().setTextZoom(125);
40+
3441
m_webView.setWebViewClient(this);
3542
}
3643

Diff for: android-app/src/main/res/layout/fragment_html.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
android:layout_marginEnd="8dp"
1616
android:layout_marginBottom="8dp"
1717
android:textAlignment="center"
18-
android:textSize="20sp"
18+
android:textSize="30sp"
1919
app:layout_constraintBottom_toBottomOf="parent"
2020
app:layout_constraintEnd_toEndOf="parent"
2121
app:layout_constraintStart_toStartOf="parent"

Diff for: android-app/src/main/res/menu/bottom_nav_menu.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<item
55
android:id="@+id/navigation_home"
66
android:icon="@drawable/ic_home_black_24dp"
7-
android:title="@string/title_home"/>
7+
android:title="@string/title_home"
8+
android:contentDescription="Navigate to home tab"
9+
/>
810

911
<item
1012
android:id="@+id/navigation_transit"

Diff for: android-app/src/main/res/navigation/mobile_navigation.xml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:id="@+id/navigation_home"
1010
android:name="net.heretical_camelid.transit_emv_checker.android_app.ui.home.HomeFragment"
1111
android:label="@string/title_home"
12+
android:contentDescription="Navigate to home tab"
1213
tools:layout="@layout/fragment_home"/>
1314

1415
<fragment

Diff for: build.gradle

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.5.2' apply false
3+
id 'com.android.application' version '8.6.1' apply false
44
id 'com.google.gms.google-services' version '4.4.2' apply false
55
}
66

@@ -16,14 +16,6 @@ plugins {
1616
// 2 digits each for for major, minor, patch version number
1717
// 1 trailing digit starts at zero can be updated for successive
1818
// attempts within the same release number
19-
// For builds triggered under build_and_test_everything.sh
20-
// where the working directory exactly matches git HEAD,
21-
// the 7-hex-prefix of the current git HEAD hash will
22-
// be substituted for the $vname_suffix variable
23-
// in the line below.
24-
// For other builds, the variable may include an
25-
// additional 3-hex-digit suffix derived from the
26-
// hash of git HEAD, or may be the string 'dirty'.
27-
ext.versionCode=300002010
19+
ext.versionCode=300002013
2820

2921
ext.versionName="0.2.1"

Diff for: build_and_test_everything.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# if the diff is empty, the separator and the diff hash are omitted
88
generate_build_id() {
99
head_hash7=$(git rev-parse HEAD | cut -c1-7)
10-
diff_hash3=$(git diff | sha256sum - | cut -c1-3)
10+
diff_hash3=$(git diff HEAD | sha256sum - | cut -c1-3)
1111
if [ "$diff_hash3" = "e3b" ]
1212
then
1313
# If git diff returned an empty stream, $diff_hash3 will be 'e3b'

Diff for: pcsc-cli-app/src/main/java/net/heretical_camelid/transit_emv_checker/pcsc_cli_app/PCSCProvider.java

-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ public class PCSCProvider extends MyProviderBase {
2929
*/
3030
private final CardChannel channel;
3131

32-
33-
/**Source option 5 is no longer supported. Use 7 or later.
34-
* Constructor using field
35-
*
36-
* @param pChannel
37-
* card channel
38-
*/
3932
public PCSCProvider(Card card) {
4033
channel = card.getBasicChannel();
4134
}

0 commit comments

Comments
 (0)