Skip to content

Commit 38731c2

Browse files
committed
Add security overlay with authentication button
Introduced a security overlay layout with a retry authentication button to both activity_main.xml and drawer_main_content.xml. Updated the loading text and added a new string resource for the authentication button.
1 parent 89c54e9 commit 38731c2

File tree

3 files changed

+64
-25
lines changed

3 files changed

+64
-25
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,17 @@
2222
android:layout_alignParentLeft="true"
2323
android:layout_alignParentStart="true"
2424
tools:ignore="RtlHardcoded">
25-
<ImageView
26-
android:id="@+id/msw_logo"
27-
android:layout_width="275dip"
28-
android:layout_height="100dip"
29-
android:src="@raw/front_splash"
30-
android:gravity="center_vertical|center_horizontal|center"
31-
android:contentDescription="@string/image_view"
32-
android:layout_gravity="top"
33-
android:layout_centerVertical="true"
34-
android:layout_centerHorizontal="true" />
3525

36-
<TextView
37-
android:id="@+id/msw_loading_text"
38-
android:layout_height="wrap_content"
39-
android:gravity="center_vertical|center_horizontal|center"
40-
android:layout_width="match_parent"
41-
tools:ignore="NotSibling"
42-
android:text="@string/loading_app"
43-
android:textSize="21sp"
44-
android:textStyle="bold"
45-
android:textColor="@color/cardview_light_background"
46-
android:layout_marginTop="32dp"
47-
android:layout_below="@+id/msw_logo"
48-
android:layout_alignParentLeft="true"
49-
android:layout_alignParentStart="true" />
26+
<TextView
27+
android:id="@+id/msw_loading_text"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:gravity="center_vertical|center_horizontal|center"
31+
android:text="@string/loading_app"
32+
android:textColor="@color/cardview_light_background"
33+
android:textSize="21sp"
34+
android:textStyle="bold"
35+
tools:ignore="NotSibling" />
5036

5137
</RelativeLayout>
5238
<WebView
@@ -77,5 +63,29 @@
7763
android:layout_alignParentBottom="true"
7864
android:layout_alignParentStart="true"
7965
android:visibility="visible" />
66+
67+
<RelativeLayout
68+
android:id="@+id/security_overlay"
69+
android:layout_width="match_parent"
70+
android:layout_height="match_parent"
71+
android:background="@color/colorPrimary"
72+
android:clickable="true"
73+
android:focusable="true"
74+
android:gravity="bottom|center_horizontal"
75+
android:paddingBottom="100sp"
76+
android:visibility="gone">
77+
78+
<Button
79+
android:id="@+id/retry_auth_button"
80+
android:layout_width="wrap_content"
81+
android:layout_height="wrap_content"
82+
android:layout_centerInParent="true"
83+
android:backgroundTint="@color/colorPrimaryDark"
84+
android:padding="21dp"
85+
android:text="@string/authenticate"
86+
android:textColor="@color/white"
87+
android:textSize="16sp" />
88+
89+
</RelativeLayout>
8090
</RelativeLayout>
8191
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

app/src/main/res/layout/drawer_main_content.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,32 @@
1717
tools:ignore="MissingConstraints"
1818
tools:layout_editor_absoluteY="50dp" />
1919

20+
<RelativeLayout
21+
android:id="@+id/security_overlay"
22+
android:layout_width="0dp"
23+
android:layout_height="0dp"
24+
app:layout_constraintTop_toTopOf="parent"
25+
app:layout_constraintBottom_toBottomOf="parent"
26+
app:layout_constraintStart_toStartOf="parent"
27+
app:layout_constraintEnd_toEndOf="parent"
28+
android:background="@color/colorPrimary"
29+
android:visibility="gone"
30+
android:clickable="true"
31+
android:focusable="true"
32+
android:gravity="bottom|center_horizontal"
33+
android:paddingBottom="100sp">
34+
35+
<Button
36+
android:id="@+id/retry_auth_button"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:layout_centerInParent="true"
40+
android:backgroundTint="@color/colorPrimaryDark"
41+
android:padding="21dp"
42+
android:text="@string/authenticate"
43+
android:textColor="@color/white"
44+
android:textSize="16sp" />
45+
46+
</RelativeLayout>
47+
2048
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
<string name="print_failed">Printing failed</string>
3737
<string name="msg_no_internet">No internet connection!</string>
3838
<string name="print_error">Error printing!</string>
39-
<string name="loading_app" tools:ignore="TypographyEllipsis">Loading App View ...</string>
39+
<string name="loading_app" tools:ignore="TypographyEllipsis">Launching app preview...</string>
40+
<string name="authenticate">Authenticate</string>
4041
</resources>

0 commit comments

Comments
 (0)