Skip to content

Commit

Permalink
Make codes better
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Jan 27, 2024
1 parent 2e9ba80 commit 36cbcdb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,12 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
try {
Context appContext = AndroidAppHelper.currentApplication().createPackageContext(PACKAGE, Context.CONTEXT_IGNORE_SECURITY);
SharedPreferences prefs = appContext.getSharedPreferences("io.github.chipppppppppp.lime-options", Context.MODE_PRIVATE);
limeOptions.deleteVoom.checked = prefs.getBoolean("delete_voom", true);
limeOptions.deleteWallet.checked = prefs.getBoolean("delete_wallet", true);
limeOptions.distributeEvenly.checked = prefs.getBoolean("distribute_evenly", true);
limeOptions.deleteIconLabels.checked= prefs.getBoolean("delete_icon_labels", true);
limeOptions.deleteAds.checked = prefs.getBoolean("delete_ads", true);
limeOptions.deleteRecommendation.checked = prefs.getBoolean("delete_recommendation", true);
limeOptions.redirectWebView.checked = prefs.getBoolean("redirect_webview", true);
limeOptions.openInBrowser.checked = prefs.getBoolean("open_in_browser", false);
for (int i = 0; i < limeOptions.size; ++i) {
LimeOptions.LimeOption option = limeOptions.getByIndex(i);
option.checked = prefs.getBoolean(option.name, option.checked);
}
} catch (Exception e) {
XposedBridge.log(e.toString());
return;
}
}
});
Expand Down Expand Up @@ -169,7 +164,7 @@ public void onClick(View view) {
String name = option.name;

Switch switchView = new Switch(context);
switchView.setText(moduleContext.getString(limeOptions.getByIndex(i).id));
switchView.setText(moduleContext.getString(option.id));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
Expand Down

0 comments on commit 36cbcdb

Please sign in to comment.