Skip to content

Commit

Permalink
Update Drawable
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Apr 26, 2024
1 parent 4fe1d12 commit 0e4378b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/makeBetaRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ jobs:

- name: Telegram File Attachment
run: |
curl -v "https://api.telegram.org/bot${{ secrets.TELEGRAM_TK }}/sendMediaGroup?chat_id=${{ secrets.OC_CHANNEL }}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FXposed%22%7D%5D" -F Xposed="app/build/outputs/apk/release/*.apk"
curl -v "https://api.telegram.org/bot${{ secrets.TELEGRAM_TK }}/sendMediaGroup?chat_id=${{ secrets.OC_CHANNEL }}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FXposed%22%7D%5D" -F Xposed="@app/build/outputs/apk/release/OxygenCustomizer.apk"
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ public void updatePrefs(String... Key) {
removeLeftAffordance = Xprefs.getBoolean(LOCKSCREEN_REMOVE_LEFT_AFFORDANCE, false);
removeRightAffordance = Xprefs.getBoolean(LOCKSCREEN_REMOVE_RIGHT_AFFORDANCE, false);

updateDrawable();

if (Key.length > 0) {
if (Key[0].equals(LOCKSCREEN_FINGERPRINT_STYLE)
|| Key[0].equals(LOCKSCREEN_CUSTOM_FINGERPRINT)
|| Key[0].equals(LOCKSCREEN_HIDE_FINGERPRINT)
|| Key[0].equals(LOCKSCREEN_FINGERPRINT_SCALING)) {
updateDrawable();
} else if (Key[0].equals(LOCKSCREEN_REMOVE_LEFT_AFFORDANCE)
if (Key[0].equals(LOCKSCREEN_REMOVE_LEFT_AFFORDANCE)
|| Key[0].equals(LOCKSCREEN_REMOVE_RIGHT_AFFORDANCE)) {
updateAffordance();
}
Expand Down Expand Up @@ -212,13 +209,23 @@ private void updateDrawable() {
mContext.getTheme()));
} else {
try {
ImageDecoder.Source source = ImageDecoder.createSource(new File(Environment.getExternalStorageDirectory() + "/.oxygen_customizer/lockscreen_fp_icon.png"));
mFpDrawable = ImageDecoder.decodeDrawable(source);
if (mFpDrawable instanceof AnimatedImageDrawable) {
((AnimatedImageDrawable) mFpDrawable).setRepeatCount(AnimatedImageDrawable.REPEAT_INFINITE);
((AnimatedImageDrawable) mFpDrawable).start();
}
} catch (Throwable ignored) {}
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleAtFixedRate(() -> {
File Android = new File(Environment.getExternalStorageDirectory() + "/Android");

if (Android.isDirectory()) {
try {
ImageDecoder.Source source = ImageDecoder.createSource(new File(Environment.getExternalStorageDirectory() + "/.oxygen_customizer/lockscreen_fp_icon.png"));
mFpDrawable = ImageDecoder.decodeDrawable(source);
if (mFpDrawable instanceof AnimatedImageDrawable) {
((AnimatedImageDrawable) mFpDrawable).setRepeatCount(AnimatedImageDrawable.REPEAT_INFINITE);
((AnimatedImageDrawable) mFpDrawable).start();
}
} catch (Throwable ignored) {}
}
}, 0, 5, TimeUnit.SECONDS);
} catch (Throwable ignored) {
}
}
} else {
mFpDrawable = null;
Expand Down

0 comments on commit 0e4378b

Please sign in to comment.