Skip to content
This repository was archived by the owner on Jun 20, 2021. It is now read-only.

Commit cdae681

Browse files
Fixed possible crashes on various pages
Signed-off-by: sunilpaulmathew <sunil.kde@gmail.com>
1 parent 509cc66 commit cdae681

18 files changed

Lines changed: 53 additions & 72 deletions

app/src/main/java/com/smartpack/smartflasher/fragments/BackupFragment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.app.Activity;
2626
import android.content.Intent;
2727
import android.database.Cursor;
28+
import android.graphics.Color;
2829
import android.net.Uri;
2930
import android.os.AsyncTask;
3031
import android.os.Bundle;
@@ -85,6 +86,9 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
8586

8687
if (Utils.isDarkTheme(requireActivity())) {
8788
mProgressText.setTextColor(Utils.getThemeAccentColor(requireActivity()));
89+
mProgressLayout.setBackgroundColor(Color.BLACK);
90+
} else {
91+
mProgressLayout.setBackgroundColor(Color.WHITE);
8892
}
8993

9094
mBackup.setOnClickListener(v -> {
@@ -465,6 +469,8 @@ public void onBindViewHolder(@NonNull RecycleViewAdapter.ViewHolder holder, int
465469
if (Utils.isDarkTheme(holder.mName.getContext())) {
466470
holder.mName.setTextColor(Utils.getThemeAccentColor(holder.mName.getContext()));
467471
holder.mIcon.setColorFilter(Utils.getThemeAccentColor(holder.mIcon.getContext()));
472+
} else {
473+
holder.mIcon.setColorFilter(Color.BLACK);
468474
}
469475
} catch (ArrayIndexOutOfBoundsException ignored) {
470476
}

app/src/main/java/com/smartpack/smartflasher/fragments/FlasherFragment.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import android.content.Context;
2727
import android.content.Intent;
2828
import android.database.Cursor;
29+
import android.graphics.Color;
2930
import android.net.Uri;
3031
import android.os.AsyncTask;
3132
import android.os.Bundle;
@@ -101,9 +102,17 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
101102

102103
if (Utils.isDarkTheme(requireActivity())) {
103104
mKernel.setTextColor(Utils.getThemeAccentColor(requireActivity()));
105+
mProgressLayout.setBackgroundColor(Color.BLACK);
104106
mProgressText.setTextColor(Utils.getThemeAccentColor(requireActivity()));
105107
mUpdateChannel.setTextColor(Utils.getThemeAccentColor(requireActivity()));
108+
mUpdateChannelMenu.setColorFilter(Utils.getThemeAccentColor(requireActivity()));
106109
mInfoIcon.setColorFilter(Utils.getThemeAccentColor(requireActivity()));
110+
mMenuIcon.setColorFilter(Utils.getThemeAccentColor(requireActivity()));
111+
} else {
112+
mProgressLayout.setBackgroundColor(Color.WHITE);
113+
mUpdateChannelMenu.setColorFilter(Color.BLACK);
114+
mInfoIcon.setColorFilter(Color.BLACK);
115+
mMenuIcon.setColorFilter(Color.BLACK);
107116
}
108117

109118
mRecyclerViewCard.setVisibility(KernelUpdater.getKernelName(requireActivity()).equals("Unavailable") ? View.GONE : View.VISIBLE);
@@ -301,6 +310,7 @@ protected void onPreExecute() {
301310
}
302311
@Override
303312
protected Void doInBackground(Void... voids) {
313+
Utils.runCommand("sleep 5");
304314
KernelUpdater.updateInfo(value, context);
305315
KernelUpdater.updateChannel(value, context);
306316
return null;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<LinearLayout
1010
android:layout_width="match_parent"
1111
android:layout_height="match_parent"
12-
android:background="?android:attr/colorBackground"
1312
android:orientation="vertical" >
1413

1514
<LinearLayout

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
android:layout_width="50dp"
2020
android:layout_height="50dp"
2121
android:background="@color/ColorBlack"
22-
android:tint="?android:attr/colorAccent"
22+
android:tint="?attr/colorAccent"
2323
android:gravity="center_vertical"
2424
android:src="@drawable/ic_back" />
2525

@@ -30,7 +30,7 @@
3030
android:textStyle="bold"
3131
android:gravity="center_vertical"
3232
android:text="@string/change_logs"
33-
android:textColor="?android:attr/colorAccent"
33+
android:textColor="?attr/colorAccent"
3434
android:textIsSelectable="true"
3535
android:textSize="20sp" />
3636
</LinearLayout>
@@ -41,7 +41,6 @@
4141
android:layout_marginTop="50dp"
4242
android:layout_marginBottom="50sp"
4343
android:layout_gravity="start"
44-
android:background="?android:attr/colorBackground"
4544
android:orientation="vertical">
4645

4746
<androidx.appcompat.widget.AppCompatImageView
@@ -59,7 +58,7 @@
5958
android:gravity="center"
6059
android:textSize="23sp"
6160
android:textStyle="bold"
62-
android:textColor="?android:attr/colorAccent"/>
61+
android:textColor="?attr/colorAccent"/>
6362

6463
<androidx.core.widget.NestedScrollView
6564
android:layout_width="match_parent"
@@ -75,16 +74,14 @@
7574

7675
<com.google.android.material.card.MaterialCardView
7776
android:layout_width="match_parent"
78-
android:layout_height="match_parent"
79-
android:background="?android:attr/colorBackground" >
77+
android:layout_height="match_parent" >
8078

8179
<com.google.android.material.textview.MaterialTextView
8280
android:id="@+id/change_log"
8381
android:layout_width="wrap_content"
8482
android:layout_height="wrap_content"
8583
android:padding="16dp"
8684
android:gravity="start"
87-
android:textColor="?android:attr/textColorPrimary"
8885
android:textIsSelectable="true"
8986
app:cardCornerRadius="25dp"
9087
android:textSize="15sp" />
@@ -102,7 +99,7 @@
10299
android:text="@string/cancel"
103100
android:textStyle="bold"
104101
android:background="@color/ColorBlack"
105-
android:textColor="?android:attr/colorAccent"
102+
android:textColor="?attr/colorAccent"
106103
android:textSize="18sp"
107104
android:padding="10dp" />
108105
</com.google.android.material.card.MaterialCardView>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<LinearLayout
88
android:layout_width="match_parent"
99
android:layout_height="match_parent"
10-
android:background="?android:attr/colorBackground"
1110
android:orientation="vertical" >
1211

1312
<com.google.android.material.tabs.TabLayout

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
android:layout_width="wrap_content"
6262
android:layout_height="wrap_content"
6363
android:layout_marginTop="15dp"
64-
android:gravity="start"
65-
android:textColor="?android:attr/textColorPrimary" />
64+
android:gravity="start" />
6665
</androidx.core.widget.NestedScrollView>
6766
</LinearLayout>
6867

@@ -140,7 +139,6 @@
140139
android:id="@+id/flashing_progress"
141140
android:layout_width="match_parent"
142141
android:layout_height="match_parent"
143-
android:background="?android:attr/colorBackground"
144142
android:orientation="vertical"
145143
android:gravity="center"
146144
android:padding="15dp"
@@ -159,7 +157,7 @@
159157
android:layout_height="wrap_content"
160158
android:gravity="center_horizontal"
161159
android:textStyle="bold|italic"
162-
android:textColor="?android:attr/colorAccent"
160+
android:textColor="?attr/colorAccent"
163161
android:textSize="17sp"
164162
android:padding="10dp" />
165163
</com.google.android.material.card.MaterialCardView>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
android:layout_marginTop="50dp"
5454
android:layout_marginBottom="50sp"
5555
android:layout_gravity="start"
56-
android:background="?android:attr/colorBackground"
5756
android:orientation="vertical">
5857

5958
<androidx.core.widget.NestedScrollView
@@ -74,7 +73,6 @@
7473
android:layout_height="wrap_content"
7574
android:padding="16dp"
7675
android:gravity="start"
77-
android:textColor="?android:attr/textColorPrimary"
7876
android:textIsSelectable="true"
7977
app:cardCornerRadius="25dp"
8078
android:textSize="15sp" />
@@ -91,7 +89,7 @@
9189
android:text="@string/cancel"
9290
android:textStyle="bold"
9391
android:background="@color/ColorBlack"
94-
android:textColor="?android:attr/colorAccent"
92+
android:textColor="?attr/colorAccent"
9593
android:textSize="18sp"
9694
android:padding="10dp" />
9795
</com.google.android.material.card.MaterialCardView>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<LinearLayout
88
android:layout_width="match_parent"
99
android:layout_height="match_parent"
10-
android:background="?android:attr/colorBackground"
1110
android:orientation="vertical" >
1211

1312
<FrameLayout

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
android:layout_gravity="start"
2626
android:src="@drawable/ic_back"
2727
android:background="@color/ColorBlack"
28-
android:tint="?android:attr/colorAccent"/>
28+
android:tint="?attr/colorAccent"/>
2929

3030
<com.google.android.material.textview.MaterialTextView
3131
android:layout_width="wrap_content"
@@ -61,7 +61,7 @@
6161
android:scaleType="fitCenter"
6262
android:src="@drawable/ic_info"
6363
android:background="@null"
64-
android:tint="?android:attr/colorAccent"/>
64+
android:tint="?attr/colorAccent"/>
6565

6666
<com.google.android.material.textview.MaterialTextView
6767
android:layout_width="match_parent"
@@ -70,7 +70,6 @@
7070
android:padding="10dp"
7171
android:gravity="start"
7272
android:text="@string/no_root_message"
73-
android:textColor="?android:attr/textColorPrimary"
7473
android:textSize="17sp" />
7574
</LinearLayout>
7675
</androidx.core.widget.NestedScrollView>

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

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
android:layout_gravity="start|center"
8585
android:src="@drawable/ic_info"
8686
android:background="@null"
87-
android:tint="?android:attr/colorAccent"/>
87+
android:tint="?attr/colorAccent"/>
8888

8989
<com.google.android.material.textview.MaterialTextView
9090
android:layout_width="match_parent"
@@ -93,7 +93,6 @@
9393
android:padding="10dp"
9494
android:gravity="start"
9595
android:text="@string/update_channel_instructions"
96-
android:textColor="?android:attr/textColorPrimary"
9796
android:textSize="15sp" />
9897
</LinearLayout>
9998
</com.google.android.material.card.MaterialCardView>
@@ -102,7 +101,6 @@
102101
android:layout_width="wrap_content"
103102
android:layout_height="wrap_content"
104103
android:text="@string/kernel_name"
105-
android:textColor="?android:attr/textColorPrimary"
106104
android:textSize="18sp" />
107105

108106
<androidx.appcompat.widget.AppCompatEditText
@@ -112,8 +110,8 @@
112110
android:background="@null"
113111
android:cursorVisible="true"
114112
android:hint="@string/add_here"
115-
android:textColor="?android:attr/colorAccent"
116-
android:textColorHint="?android:attr/colorAccent"
113+
android:textColor="?attr/colorAccent"
114+
android:textColorHint="?attr/colorAccent"
117115
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
118116
android:layout_marginBottom="10dp"
119117
android:textSize="15sp" />
@@ -122,7 +120,6 @@
122120
android:layout_width="wrap_content"
123121
android:layout_height="wrap_content"
124122
android:text="@string/kernel_version"
125-
android:textColor="?android:attr/textColorPrimary"
126123
android:textSize="18sp" />
127124

128125
<androidx.appcompat.widget.AppCompatEditText
@@ -132,8 +129,8 @@
132129
android:background="@null"
133130
android:cursorVisible="true"
134131
android:hint="@string/add_here"
135-
android:textColor="?android:attr/colorAccent"
136-
android:textColorHint="?android:attr/colorAccent"
132+
android:textColor="?attr/colorAccent"
133+
android:textColorHint="?attr/colorAccent"
137134
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
138135
android:layout_marginBottom="10dp"
139136
android:textSize="15sp" />
@@ -142,7 +139,6 @@
142139
android:layout_width="wrap_content"
143140
android:layout_height="wrap_content"
144141
android:text="@string/download_link"
145-
android:textColor="?android:attr/textColorPrimary"
146142
android:textSize="18sp" />
147143

148144
<androidx.appcompat.widget.AppCompatEditText
@@ -152,8 +148,8 @@
152148
android:background="@null"
153149
android:cursorVisible="true"
154150
android:hint="@string/add_here"
155-
android:textColor="?android:attr/colorAccent"
156-
android:textColorHint="?android:attr/colorAccent"
151+
android:textColor="?attr/colorAccent"
152+
android:textColorHint="?attr/colorAccent"
157153
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
158154
android:layout_marginBottom="10dp"
159155
android:textSize="15sp" />
@@ -162,7 +158,6 @@
162158
android:layout_width="wrap_content"
163159
android:layout_height="wrap_content"
164160
android:text="@string/change_logs"
165-
android:textColor="?android:attr/textColorPrimary"
166161
android:textSize="18sp" />
167162

168163
<androidx.appcompat.widget.AppCompatEditText
@@ -172,8 +167,8 @@
172167
android:background="@null"
173168
android:cursorVisible="true"
174169
android:hint="@string/add_here"
175-
android:textColor="?android:attr/colorAccent"
176-
android:textColorHint="?android:attr/colorAccent"
170+
android:textColor="?attr/colorAccent"
171+
android:textColorHint="?attr/colorAccent"
177172
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
178173
android:layout_marginBottom="10dp"
179174
android:textSize="15sp" />
@@ -182,7 +177,6 @@
182177
android:layout_width="wrap_content"
183178
android:layout_height="wrap_content"
184179
android:text="@string/sha1"
185-
android:textColor="?android:attr/textColorPrimary"
186180
android:textSize="18sp" />
187181

188182
<androidx.appcompat.widget.AppCompatEditText
@@ -192,8 +186,8 @@
192186
android:background="@null"
193187
android:cursorVisible="true"
194188
android:hint="@string/add_here"
195-
android:textColor="?android:attr/colorAccent"
196-
android:textColorHint="?android:attr/colorAccent"
189+
android:textColor="?attr/colorAccent"
190+
android:textColorHint="?attr/colorAccent"
197191
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
198192
android:layout_marginBottom="10dp"
199193
android:textSize="15sp" />
@@ -202,7 +196,6 @@
202196
android:layout_width="wrap_content"
203197
android:layout_height="wrap_content"
204198
android:text="@string/support_group"
205-
android:textColor="?android:attr/textColorPrimary"
206199
android:textSize="18sp" />
207200

208201
<androidx.appcompat.widget.AppCompatEditText
@@ -212,8 +205,8 @@
212205
android:background="@null"
213206
android:cursorVisible="true"
214207
android:hint="@string/add_here"
215-
android:textColor="?android:attr/colorAccent"
216-
android:textColorHint="?android:attr/colorAccent"
208+
android:textColor="?attr/colorAccent"
209+
android:textColorHint="?attr/colorAccent"
217210
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
218211
android:layout_marginBottom="10dp"
219212
android:textSize="15sp" />
@@ -222,7 +215,6 @@
222215
android:layout_width="wrap_content"
223216
android:layout_height="wrap_content"
224217
android:text="@string/donation_link"
225-
android:textColor="?android:attr/textColorPrimary"
226218
android:textSize="18sp" />
227219

228220
<androidx.appcompat.widget.AppCompatEditText
@@ -232,8 +224,8 @@
232224
android:background="@null"
233225
android:cursorVisible="true"
234226
android:hint="@string/add_here"
235-
android:textColor="?android:attr/colorAccent"
236-
android:textColorHint="?android:attr/colorAccent"
227+
android:textColor="?attr/colorAccent"
228+
android:textColorHint="?attr/colorAccent"
237229
android:inputType="textMultiLine|textImeMultiLine|textNoSuggestions"
238230
android:layout_marginBottom="10dp"
239231
android:textSize="15sp" />

0 commit comments

Comments
 (0)