Skip to content

Commit

Permalink
CHANGELOG: Two more LS Clock (Lottie)
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Apr 30, 2024
1 parent c795933 commit 21dc789
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ public static void loadLottieAnimationView(
}
String rawResName = "lottie_lockscreen_clock_" + currentStyleIndex;

Log.d("Oxygen Customizer Loading Lottie", "Loading Lottie Animation: " + rawResName + " (Style: " + currentStyleIndex + ")");

Object lottieAnimView;
if (isXposedMode) {
if (lottieAnimationViewClass == null) {
Expand Down Expand Up @@ -399,7 +401,7 @@ public static void loadLottieAnimationView(
if (isXposedMode) {
try {
callMethod(lottieAnimView, "setLayoutParams", animationParams);
callMethod(lottieAnimView, "setAnimation", rawRes, "cacheKey");
callMethod(lottieAnimView, "setAnimation", rawRes, "cacheKey_" + styleIndex);
callMethod(lottieAnimView, "setRepeatCount", LottieDrawable.INFINITE);
callMethod(lottieAnimView, "setScaleType", ImageView.ScaleType.FIT_CENTER);
callMethod(lottieAnimView, "setAdjustViewBounds", true);
Expand All @@ -409,7 +411,7 @@ public static void loadLottieAnimationView(
} else {
LottieAnimationView lottieAnimationView = (LottieAnimationView) lottieAnimView;
lottieAnimationView.setLayoutParams(animationParams);
lottieAnimationView.setAnimation(rawRes, "cacheKey");
lottieAnimationView.setAnimation(rawRes, "cacheKey_" + styleIndex);
lottieAnimationView.setRepeatCount(LottieDrawable.INFINITE);
lottieAnimationView.setRenderMode(RenderMode.HARDWARE);
lottieAnimationView.setScaleType(ImageView.ScaleType.FIT_CENTER);
Expand Down
70 changes: 0 additions & 70 deletions app/src/main/res/layout/preference_clock_layout.xml

This file was deleted.

51 changes: 51 additions & 0 deletions app/src/main/res/layout/preview_lockscreen_clock_22.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- LottieAnimationView for the background -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="300dp"
android:tag="lottie"
android:layout_centerInParent="true"
tools:ignore="UselessLeaf" />

<LinearLayout
android:layout_marginTop="65.0dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top">

<!-- Hour TextClock -->
<TextClock
android:id="@+id/clockHour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="4dp"
android:format12Hour="hh"
android:format24Hour="kk"
android:textColor="@android:color/system_accent1_300"
android:tag="accent1"
android:textSize="108sp" />

<!-- Minute TextClock -->
<TextClock
android:id="@+id/clockMinute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="4dp"
android:tag="text1"
android:format12Hour="mm"
android:format24Hour="mm"
android:textColor="@android:color/white"
android:textSize="56sp" />

</LinearLayout>

</RelativeLayout>
51 changes: 51 additions & 0 deletions app/src/main/res/layout/preview_lockscreen_clock_23.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- LottieAnimationView for the background -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="300dp"
android:tag="lottie"
android:layout_centerInParent="true"
tools:ignore="UselessLeaf" />

<LinearLayout
android:layout_marginTop="65.0dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top">

<!-- Hour TextClock -->
<TextClock
android:id="@+id/clockHour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="4dp"
android:format12Hour="hh"
android:format24Hour="kk"
android:textColor="@android:color/system_accent1_300"
android:tag="accent1"
android:textSize="108sp" />

<!-- Minute TextClock -->
<TextClock
android:id="@+id/clockMinute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="4dp"
android:tag="text1"
android:format12Hour="mm"
android:format24Hour="mm"
android:textColor="@android:color/white"
android:textSize="56sp" />

</LinearLayout>

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/raw/lottie_lockscreen_clock_22.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/src/main/res/raw/lottie_lockscreen_clock_23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nm":"Success","ddd":0,"h":512,"w":512,"meta":{"g":"@lottiefiles/toolkit-js 0.33.2"},"layers":[{"ty":4,"nm":"Shape Layer 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[160,160,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[256,256,0],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[160],"t":0},{"s":[880],"t":600}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":60,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Polystar 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sr","bm":0,"hd":false,"mn":"ADBE Vector Shape - Star","nm":"Polystar Path 1","ix":1,"d":1,"ir":{"a":0,"k":100,"ix":6},"is":{"a":0,"k":85,"ix":8},"pt":{"a":0,"k":10,"ix":3},"p":{"a":0,"k":[0,0],"ix":4},"or":{"a":0,"k":110,"ix":7},"os":{"a":0,"k":75,"ix":9},"r":{"a":0,"k":0,"ix":5},"sy":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.6157,0.1294,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[160,160,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[256,256,0],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":599}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":60,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Polystar 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sr","bm":0,"hd":false,"mn":"ADBE Vector Shape - Star","nm":"Polystar Path 1","ix":1,"d":1,"ir":{"a":0,"k":100,"ix":6},"is":{"a":0,"k":85,"ix":8},"pt":{"a":0,"k":10,"ix":3},"p":{"a":0,"k":[0,0],"ix":4},"or":{"a":0,"k":110,"ix":7},"os":{"a":0,"k":75,"ix":9},"r":{"a":0,"k":0,"ix":5},"sy":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0,0.6353,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2}],"v":"5.5.2","fr":60,"op":600,"ip":0,"assets":[]}

0 comments on commit 21dc789

Please sign in to comment.