11package com .aexon ;
22
3- import android .annotation .SuppressLint ;
43import android .app .Activity ;
54import android .content .Intent ;
65import android .graphics .PorterDuff ;
76import android .net .Uri ;
8- import android .os .Build ;
97import android .os .Bundle ;
10- import android .provider .Settings ;
118import android .text .Html ;
129import android .text .method .LinkMovementMethod ;
13- import android .view .View ;
1410import android .widget .ImageView ;
1511import android .widget .LinearLayout ;
1612import android .widget .ScrollView ;
1713import android .widget .TextView ;
1814
19- import androidx .annotation .NonNull ;
2015import androidx .annotation .Nullable ;
21- import androidx .annotation .RequiresApi ;
22- import androidx .core .app .NotificationManagerCompat ;
2316
2417import com .aexon .aexon .AexonWindowHelper ;
2518import com .aexon .material .dialog .AexonAlertDialog ;
@@ -45,7 +38,6 @@ public class ActivasiActivity extends Activity {
4538 private TextView textview1 ;
4639 private LinearLayout linear1 ;
4740 private LinearLayout card1 ;
48- private LinearLayout card4 ;
4941 private LinearLayout card2 ;
5042 private LinearLayout card3 ;
5143 private LinearLayout linear11 ;
@@ -54,14 +46,6 @@ public class ActivasiActivity extends Activity {
5446 private AexonButton start_shizuku ;
5547 private ImageView imageview6 ;
5648 private TextView textview2 ;
57- private LinearLayout linear14 ;
58- private TextView textview8 ;
59- private TextView textview10 ;
60- private AexonButton stepbystep ;
61- private AexonButton connect_pair ;
62- private AexonButton start_pair ;
63- private ImageView imageview7 ;
64- private TextView textview9 ;
6549 private LinearLayout linear3 ;
6650 private TextView textview5 ;
6751 private AexonButton view_cmd ;
@@ -92,7 +76,6 @@ private void initialize(@Nullable Bundle _savedInstanceState) {
9276 textview1 = findViewById (R .id .textview1 );
9377 linear1 = findViewById (R .id .linear1 );
9478 card1 = findViewById (R .id .card1 );
95- card4 = findViewById (R .id .card4 );
9679 card2 = findViewById (R .id .card2 );
9780 card3 = findViewById (R .id .card3 );
9881 linear11 = findViewById (R .id .linear11 );
@@ -101,14 +84,6 @@ private void initialize(@Nullable Bundle _savedInstanceState) {
10184 start_shizuku = findViewById (R .id .start_shizuku );
10285 imageview6 = findViewById (R .id .imageview6 );
10386 textview2 = findViewById (R .id .textview2 );
104- linear14 = findViewById (R .id .linear14 );
105- textview8 = findViewById (R .id .textview8 );
106- textview10 = findViewById (R .id .textview10 );
107- stepbystep = findViewById (R .id .stepbystep );
108- connect_pair = findViewById (R .id .connect_pair );
109- start_pair = findViewById (R .id .start_pair );
110- imageview7 = findViewById (R .id .imageview7 );
111- textview9 = findViewById (R .id .textview9 );
11287 linear3 = findViewById (R .id .linear3 );
11388 textview5 = findViewById (R .id .textview5 );
11489 view_cmd = findViewById (R .id .view_cmd );
@@ -213,40 +188,29 @@ private void initializeLogic() {
213188 imageview2 .setColorFilter (theme .getColorPrimary (), PorterDuff .Mode .SRC_ATOP );
214189 imageview4 .setColorFilter (theme .getColorPrimary (), PorterDuff .Mode .SRC_ATOP );
215190 imageview6 .setColorFilter (theme .getColorPrimary (), PorterDuff .Mode .SRC_ATOP );
216- imageview7 .setColorFilter (theme .getColorPrimary (), PorterDuff .Mode .SRC_ATOP );
217191 toolbar .setBackgroundColor (theme .getColorSurface ());
218192 vscroll1 .setBackgroundColor (theme .getColorSurface ());
219193
220- //card card1 & card2 & card3 & card4
194+ // card card1 & card2 & card3
221195 card1 .setBackground (new AexonDrawable .Builder (theme .getColorSurfaceContainer ()).cornerRadius (SketchwareUtil .getDimension (this , R .dimen .card_radius_medium )).build ().build (ActivasiActivity .this ));
222196 card2 .setBackground (new AexonDrawable .Builder (theme .getColorSurfaceContainer ()).cornerRadius (SketchwareUtil .getDimension (this , R .dimen .card_radius_medium )).build ().build (ActivasiActivity .this ));
223197 card3 .setBackground (new AexonDrawable .Builder (theme .getColorSurfaceContainer ()).cornerRadius (SketchwareUtil .getDimension (this , R .dimen .card_radius_medium )).build ().build (ActivasiActivity .this ));
224- card4 .setBackground (new AexonDrawable .Builder (theme .getColorSurfaceContainer ()).cornerRadius (SketchwareUtil .getDimension (this , R .dimen .card_radius_medium )).build ().build (ActivasiActivity .this ));
225198
226- //warna icon button
199+ // warna icon button
227200 connect_shizuku .setIconTint (theme .getColorOnPrimary ());
228201 start_shizuku .setIconTint (theme .getColorOnPrimary ());
229202 view_cmd .setIconTint (theme .getColorOnPrimary ());
230203 start_root .setIconTint (theme .getColorOnPrimary ());
231- stepbystep .setIconTint (theme .getColorOnPrimary ());
232- connect_pair .setIconTint (theme .getColorOnPrimary ());
233- start_pair .setIconTint (theme .getColorOnPrimary ());
234204
235205 connect_shizuku .setBackgroundColor (theme .getColorPrimary ());
236206 start_shizuku .setBackgroundColor (theme .getColorPrimary ());
237207 view_cmd .setBackgroundColor (theme .getColorPrimary ());
238208 start_root .setBackgroundColor (theme .getColorPrimary ());
239- stepbystep .setBackgroundColor (theme .getColorPrimary ());
240- connect_pair .setBackgroundColor (theme .getColorPrimary ());
241- start_pair .setBackgroundColor (theme .getColorPrimary ());
242209 AexonWindowHelper .setWindowStyle (getWindow (), theme .getColorSurface ());
243210 start_root .setTextColor (theme .getColorOnPrimary ());
244211 view_cmd .setTextColor (theme .getColorOnPrimary ());
245212 connect_shizuku .setTextColor (theme .getColorOnPrimary ());
246213 start_shizuku .setTextColor (theme .getColorOnPrimary ());
247- stepbystep .setTextColor (theme .getColorOnPrimary ());
248- connect_pair .setTextColor (theme .getColorOnPrimary ());
249- start_pair .setTextColor (theme .getColorOnPrimary ());
250214
251215 textview1 .setTextColor (theme .getColorOnSurface ());
252216 textview2 .setTextColor (theme .getColorOnSurface ());
@@ -255,56 +219,6 @@ private void initializeLogic() {
255219 textview5 .setTextColor (theme .getColorOnSurfaceVariant ());
256220 textview6 .setTextColor (theme .getColorOnSurface ());
257221 textview7 .setTextColor (theme .getColorOnSurfaceVariant ());
258- textview8 .setTextColor (theme .getColorOnSurfaceVariant ());
259- textview9 .setTextColor (theme .getColorOnSurface ());
260- textview10 .setTextColor (theme .getColorOnSurfaceVariant ());
261- }
262-
263- @ SuppressLint ("SetTextI18n" )
264- private void updateConnectPairState () {
265- boolean isNotificationGranted = NotificationManagerCompat .from (this ).areNotificationsEnabled ();
266-
267- if (!isNotificationGranted ) {
268- // Jika notifikasi belum diizinkan
269- connect_pair .setIcon (R .drawable .ic_notifications );
270- connect_pair .setText (getString (R .string .tag_btn_enable_notif ));
271-
272- connect_pair .setOnClickListener (new View .OnClickListener () {
273- @ Override
274- public void onClick (@ NonNull View _view ) {
275- // Pengecekan versi OS yang aman
276- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
277- openNotificationSettingsModern ();
278- } else {
279- openNotificationSettingsLegacy ();
280- }
281- }
282- });
283- } else {
284- // Jika notifikasi sudah diizinkan
285- connect_pair .setIcon (R .drawable .ic_url );
286- connect_pair .setText (getString (R .string .tag_btn_pairing ));
287-
288- connect_pair .setOnClickListener (new View .OnClickListener () {
289- @ Override
290- public void onClick (@ NonNull View _view ) {
291- // Masukkan logika connect pair di sini
292- }
293- });
294- }
295- }
296-
297- @ RequiresApi (api = Build .VERSION_CODES .O )
298- private void openNotificationSettingsModern () {
299- Intent intent = new Intent (Settings .ACTION_APP_NOTIFICATION_SETTINGS );
300- intent .putExtra (Settings .EXTRA_APP_PACKAGE , getPackageName ());
301- startActivity (intent );
302- }
303-
304- private void openNotificationSettingsLegacy () {
305- Intent intent = new Intent (Settings .ACTION_APPLICATION_DETAILS_SETTINGS );
306- intent .setData (Uri .parse ("package:" + getPackageName ()));
307- startActivity (intent );
308222 }
309223
310224 @ Override
@@ -313,12 +227,6 @@ public void onBackPressed() {
313227 overridePendingTransition (R .anim .fade_in_back , R .anim .fade_out_back );
314228 }
315229
316- @ Override
317- public void onResume () {
318- super .onResume ();
319- updateConnectPairState ();
320- }
321-
322230 @ Override
323231 public void onStop () {
324232 super .onStop ();
0 commit comments