Skip to content

Commit d91ed5f

Browse files
Add ripple to close button in WebActivity, fix tint color not being applied to the ProgressBar. Remove unnecessary null checks.
1 parent 13ee6d2 commit d91ed5f

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

OpenScienceJournal/whistlepunk_library/src/main/java/com/google/android/apps/forscience/whistlepunk/signin/WebActivity.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,24 @@ protected void onCreate(Bundle savedInstanceState) {
8787
@Override
8888
protected void onDestroy() {
8989
super.onDestroy();
90-
if (mWebView != null) {
91-
mWebView.destroy();
92-
}
90+
mWebView.destroy();
9391
}
9492

9593
@Override
9694
protected void onPause() {
9795
super.onPause();
98-
if (mWebView != null) {
99-
mWebView.onPause();
100-
}
96+
mWebView.onPause();
10197
}
10298

10399
@Override
104100
protected void onResume() {
105101
super.onResume();
106-
if (mWebView != null) {
107-
mWebView.onResume();
108-
}
102+
mWebView.onResume();
109103
}
110104

111105
@Override
112106
public void onBackPressed() {
113-
if (mWebView != null && mWebView.canGoBack()) {
107+
if (mWebView.canGoBack()) {
114108
mWebView.goBack();
115109
} else {
116110
super.onBackPressed();

OpenScienceJournal/whistlepunk_library/src/main/res/layout/activity_arduino_auth_web.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
android:layout_width="40dp"
2121
android:layout_height="40dp"
2222
android:layout_marginStart="18dp"
23-
android:background="@null"
23+
android:background="?selectableItemBackgroundBorderless"
24+
android:clickable="true"
2425
android:contentDescription="@null"
26+
android:focusable="true"
2527
android:scaleType="centerInside"
2628
android:src="@drawable/ic_arduino_auth_close"
2729
app:layout_constraintBottom_toBottomOf="parent"
@@ -65,9 +67,9 @@
6567
android:layout_width="0dp"
6668
android:layout_height="4dp"
6769
android:elevation="0dp"
68-
android:foregroundTint="@color/arduino_carrot"
6970
android:indeterminate="false"
7071
android:max="100"
72+
android:progressTint="@color/arduino_carrot"
7173
android:visibility="gone"
7274
app:layout_constraintBottom_toBottomOf="parent"
7375
app:layout_constraintEnd_toEndOf="parent"

0 commit comments

Comments
 (0)