|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 |
| -<LinearLayout |
3 |
| - xmlns:android="http://schemas.android.com/apk/res/android" |
4 |
| - xmlns:app="http://schemas.android.com/apk/res-auto" |
5 |
| - xmlns:tools="http://schemas.android.com/tools" |
6 |
| - android:layout_height="match_parent" |
7 |
| - android:layout_width="match_parent" |
8 |
| - android:orientation="vertical"> |
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | + xmlns:tools="http://schemas.android.com/tools" |
| 5 | + android:layout_width="match_parent" |
| 6 | + android:layout_height="match_parent" |
| 7 | + android:orientation="vertical"> |
9 | 8 |
|
10 | 9 | <com.google.android.material.progressindicator.LinearProgressIndicator
|
11 |
| - android:layout_height="wrap_content" |
12 |
| - android:layout_width="match_parent" |
13 |
| - android:visibility="gone" |
14 |
| - android:max="100" |
15 |
| - tools:visibility="visible" |
16 |
| - style="@style/Widget.MaterialComponents.LinearProgressIndicator" |
17 |
| - tools:progress="20" |
18 |
| - android:id="@+id/progress_indicator" |
19 |
| - app:indicatorColor="@color/colorAccent" /> |
20 |
| - |
21 |
| - <LinearLayout |
22 |
| - android:layout_height="wrap_content" |
23 |
| - android:layout_width="match_parent" |
24 |
| - android:foregroundGravity="center" |
25 |
| - android:gravity="center_horizontal" |
26 |
| - android:orientation="horizontal" |
27 |
| - android:layout_gravity="center"> |
28 |
| - |
29 |
| - <TextView |
30 |
| - android:layout_height="wrap_content" |
31 |
| - android:layout_width="match_parent" |
32 |
| - android:layout_marginEnd="5sp" |
33 |
| - android:gravity="center_horizontal|end" |
34 |
| - android:textSize="20sp" |
35 |
| - android:layout_weight="1" |
36 |
| - android:text="@string/selected_language" /> |
37 |
| - |
38 |
| - <TextView |
39 |
| - android:layout_height="wrap_content" |
40 |
| - android:layout_width="match_parent" |
41 |
| - android:gravity="start" |
42 |
| - android:textSize="20sp" |
43 |
| - android:layout_marginStart="5sp" |
44 |
| - android:layout_weight="1" |
45 |
| - android:id="@+id/language_name1" /> |
46 |
| - |
47 |
| - </LinearLayout> |
48 |
| - |
49 |
| - <FrameLayout |
50 |
| - android:layout_height="match_parent" |
51 |
| - android:layout_width="match_parent"> |
52 |
| - |
53 |
| - <androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
54 |
| - android:layout_height="match_parent" |
55 |
| - android:layout_width="match_parent" |
56 |
| - android:id="@+id/swipe_to_refresh"> |
57 |
| - |
58 |
| - <ImageView |
59 |
| - android:layout_height="match_parent" |
60 |
| - android:layout_width="match_parent" |
61 |
| - android:contentDescription="@string/generic_image_description" |
62 |
| - android:scaleType="fitCenter" |
63 |
| - tools:src="@tools:sample/backgrounds/scenic" |
64 |
| - android:id="@+id/source_image" /> |
65 |
| - |
66 |
| - </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
| 10 | + android:id="@+id/progress_indicator" |
| 11 | + style="@style/Widget.MaterialComponents.LinearProgressIndicator" |
| 12 | + android:layout_width="match_parent" |
| 13 | + android:layout_height="wrap_content" |
| 14 | + android:max="100" |
| 15 | + android:visibility="gone" |
| 16 | + app:indicatorColor="@color/colorAccent" |
| 17 | + tools:progress="20" |
| 18 | + tools:visibility="visible" /> |
| 19 | + |
| 20 | + <RelativeLayout |
| 21 | + android:layout_width="match_parent" |
| 22 | + android:layout_height="wrap_content" |
| 23 | + android:layout_gravity="center" |
| 24 | + android:id="@+id/download_layout" |
| 25 | + android:foregroundGravity="center" |
| 26 | + android:gravity="center_horizontal" |
| 27 | + android:orientation="horizontal" |
| 28 | + android:visibility="visible"> |
67 | 29 |
|
68 | 30 | <TextView
|
69 | 31 | android:id="@+id/progress_title"
|
70 | 32 | android:layout_width="wrap_content"
|
71 | 33 | android:layout_height="wrap_content"
|
72 |
| - android:text="Downloading" |
73 |
| - android:textSize="18sp" |
74 |
| - android:layout_centerHorizontal="true" |
75 | 34 | android:layout_marginTop="16dp"
|
76 |
| - android:visibility="gone" /> <!-- Initially hidden --> |
| 35 | + android:text="Downloading language data" |
| 36 | + android:textSize="18sp" |
| 37 | + /> |
| 38 | + |
77 | 39 |
|
78 |
| - <!-- Message TextView --> |
79 | 40 | <TextView
|
80 | 41 | android:id="@+id/progress_message"
|
81 | 42 | android:layout_width="wrap_content"
|
82 | 43 | android:layout_height="wrap_content"
|
83 |
| - android:text="Downloading language data..." |
84 |
| - android:textSize="16sp" |
85 | 44 | android:layout_below="@id/progress_title"
|
86 | 45 | android:layout_centerHorizontal="true"
|
87 |
| - android:visibility="gone" /> <!-- Initially hidden --> |
| 46 | + android:text="0% downloaded of total 10MB..." |
| 47 | + android:textSize="16sp" |
| 48 | + /> |
| 49 | + |
88 | 50 |
|
89 |
| - <!-- Circular indeterminate ProgressBar --> |
90 |
| - <ProgressBar |
| 51 | + <com.google.android.material.progressindicator.LinearProgressIndicator |
91 | 52 | android:id="@+id/progress_spinner"
|
92 | 53 | style="?android:attr/progressBarStyleLarge"
|
93 | 54 | android:layout_width="wrap_content"
|
94 | 55 | android:layout_height="wrap_content"
|
95 | 56 | android:layout_below="@id/progress_message"
|
96 | 57 | android:layout_centerHorizontal="true"
|
97 | 58 | android:layout_marginTop="16dp"
|
98 |
| - android:visibility="gone" /> <!-- Initially hidden --> |
| 59 | + app:indicatorColor="@color/colorAccent" |
| 60 | + /> |
99 | 61 |
|
100 |
| - <!-- Horizontal determinate ProgressBar --> |
101 |
| - <ProgressBar |
| 62 | + <com.google.android.material.progressindicator.LinearProgressIndicator |
102 | 63 | android:id="@+id/progress_bar"
|
103 | 64 | style="?android:attr/progressBarStyleHorizontal"
|
104 | 65 | android:layout_width="match_parent"
|
105 | 66 | android:layout_height="wrap_content"
|
106 | 67 | android:layout_below="@id/progress_spinner"
|
107 | 68 | android:layout_marginTop="16dp"
|
108 |
| - android:visibility="gone" |
109 |
| - android:max="100" /> |
| 69 | + android:max="100" |
| 70 | + app:indicatorColor="@color/colorAccent" |
| 71 | + /> |
| 72 | + |
| 73 | + </RelativeLayout> |
| 74 | + |
| 75 | + <LinearLayout |
| 76 | + android:layout_width="match_parent" |
| 77 | + android:layout_height="wrap_content" |
| 78 | + android:layout_gravity="center" |
| 79 | + android:foregroundGravity="center" |
| 80 | + android:gravity="center_horizontal" |
| 81 | + android:orientation="horizontal"> |
| 82 | + |
| 83 | + <TextView |
| 84 | + android:layout_width="match_parent" |
| 85 | + android:layout_height="wrap_content" |
| 86 | + android:layout_marginEnd="5sp" |
| 87 | + android:layout_weight="1" |
| 88 | + android:gravity="center_horizontal|end" |
| 89 | + android:text="@string/selected_language" |
| 90 | + android:textSize="20sp" /> |
| 91 | + |
| 92 | + <TextView |
| 93 | + android:id="@+id/language_name1" |
| 94 | + android:layout_width="match_parent" |
| 95 | + android:layout_height="wrap_content" |
| 96 | + android:layout_marginStart="5sp" |
| 97 | + android:layout_weight="1" |
| 98 | + android:gravity="start" |
| 99 | + android:textSize="20sp" /> |
| 100 | + |
| 101 | + </LinearLayout> |
| 102 | + |
| 103 | + <FrameLayout |
| 104 | + android:layout_width="match_parent" |
| 105 | + android:layout_height="match_parent"> |
| 106 | + |
| 107 | + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
| 108 | + android:id="@+id/swipe_to_refresh" |
| 109 | + android:layout_width="match_parent" |
| 110 | + android:layout_height="match_parent"> |
| 111 | + |
| 112 | + <ImageView |
| 113 | + android:id="@+id/source_image" |
| 114 | + android:layout_width="match_parent" |
| 115 | + android:layout_height="match_parent" |
| 116 | + android:contentDescription="@string/generic_image_description" |
| 117 | + android:scaleType="fitCenter" |
| 118 | + tools:src="@tools:sample/backgrounds/scenic" /> |
| 119 | + |
| 120 | + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
110 | 121 |
|
111 | 122 | <com.google.android.material.floatingactionbutton.FloatingActionButton
|
112 |
| - android:layout_height="wrap_content" |
113 |
| - android:layout_width="wrap_content" |
114 |
| - android:contentDescription="@string/generic_image_description" |
115 |
| - android:clickable="true" |
116 |
| - android:layout_margin="16dp" |
117 |
| - android:focusable="true" |
118 |
| - app:srcCompat="@drawable/ic_baseline_photo_library_24" |
119 |
| - android:id="@+id/btn_scan" |
120 |
| - android:layout_gravity="bottom|end" /> |
| 123 | + android:id="@+id/btn_scan" |
| 124 | + android:layout_width="wrap_content" |
| 125 | + android:layout_height="wrap_content" |
| 126 | + android:layout_gravity="bottom|end" |
| 127 | + android:layout_margin="16dp" |
| 128 | + android:clickable="true" |
| 129 | + android:contentDescription="@string/generic_image_description" |
| 130 | + android:focusable="true" |
| 131 | + app:srcCompat="@drawable/ic_baseline_photo_library_24" /> |
121 | 132 |
|
122 | 133 | </FrameLayout>
|
123 | 134 |
|
|
0 commit comments