mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-08-26 22:17:44 +10:00
Syllable Level Lyrics <3
This commit is contained in:
@@ -448,11 +448,7 @@
|
||||
|
||||
move-result-object v4
|
||||
|
||||
const-string v5, "text"
|
||||
|
||||
const-string v6, ""
|
||||
|
||||
invoke-virtual {v4, v5, v6}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||||
invoke-static {v4}, Lradiant/WordLyrics;->lineText(Lorg/json/JSONObject;)Ljava/lang/String;
|
||||
|
||||
move-result-object v5
|
||||
|
||||
@@ -679,6 +675,17 @@
|
||||
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-static {}, Lradiant/WordLyrics;->romanizeOn()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :no_romanize
|
||||
|
||||
const-string v0, "&romanize=true"
|
||||
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
:no_romanize
|
||||
const-string v0, "&platform=rl-mobile"
|
||||
|
||||
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
.class public final Lradiant/SylBrush;
|
||||
.super Landroidx/compose/ui/graphics/ShaderBrush;
|
||||
|
||||
# Paints the syllable wipe gradient
|
||||
# x0 = wipe edge, x1 = end of the soft trail
|
||||
|
||||
|
||||
# instance state
|
||||
|
||||
.field public final x0:F
|
||||
|
||||
.field public final x1:F
|
||||
|
||||
.field public final c0:I
|
||||
|
||||
.field public final c1:I
|
||||
|
||||
|
||||
.method public constructor <init>(FFII)V
|
||||
.locals 0
|
||||
|
||||
invoke-direct {p0}, Landroidx/compose/ui/graphics/ShaderBrush;-><init>()V
|
||||
|
||||
iput p1, p0, Lradiant/SylBrush;->x0:F
|
||||
|
||||
iput p2, p0, Lradiant/SylBrush;->x1:F
|
||||
|
||||
iput p3, p0, Lradiant/SylBrush;->c0:I
|
||||
|
||||
iput p4, p0, Lradiant/SylBrush;->c1:I
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# Gradient across the whole line
|
||||
.method public createShader-uvyYCjk(J)Landroid/graphics/Shader;
|
||||
.locals 8
|
||||
|
||||
new-instance v0, Landroid/graphics/LinearGradient;
|
||||
|
||||
iget v1, p0, Lradiant/SylBrush;->x0:F
|
||||
|
||||
const/4 v2, 0x0
|
||||
|
||||
iget v3, p0, Lradiant/SylBrush;->x1:F
|
||||
|
||||
const/4 v4, 0x0
|
||||
|
||||
iget v5, p0, Lradiant/SylBrush;->c0:I
|
||||
|
||||
iget v6, p0, Lradiant/SylBrush;->c1:I
|
||||
|
||||
sget-object v7, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;
|
||||
|
||||
invoke-direct/range {v0 .. v7}, Landroid/graphics/LinearGradient;-><init>(FFFFIILandroid/graphics/Shader$TileMode;)V
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
@@ -0,0 +1,264 @@
|
||||
.class public final Lradiant/SylLayout;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
# interfaces
|
||||
.implements Lam0/l;
|
||||
|
||||
# Remembers where each line's glyphs landed
|
||||
|
||||
|
||||
# static state
|
||||
|
||||
.field public static cbs:[Lradiant/SylLayout;
|
||||
|
||||
.field public static layouts:[Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
|
||||
# instance state
|
||||
|
||||
.field public final idx:I
|
||||
|
||||
|
||||
.method public constructor <init>(I)V
|
||||
.locals 0
|
||||
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
iput p1, p0, Lradiant/SylLayout;->idx:I
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# One reusable callback per line
|
||||
.method public static cb(I)Lam0/l;
|
||||
.locals 5
|
||||
|
||||
if-gez p0, :have_idx
|
||||
|
||||
const/4 p0, 0x0
|
||||
|
||||
:have_idx
|
||||
sget-object v0, Lradiant/SylLayout;->cbs:[Lradiant/SylLayout;
|
||||
|
||||
if-eqz v0, :grow
|
||||
|
||||
array-length v1, v0
|
||||
|
||||
if-gt v1, p0, :have_arr
|
||||
|
||||
:grow
|
||||
add-int/lit8 v1, p0, 0x1
|
||||
|
||||
const/16 v2, 0x40
|
||||
|
||||
if-ge v1, v2, :cap_ok
|
||||
|
||||
const/16 v1, 0x40
|
||||
|
||||
:cap_ok
|
||||
if-nez v0, :copy
|
||||
|
||||
new-array v0, v1, [Lradiant/SylLayout;
|
||||
|
||||
goto :store_arr
|
||||
|
||||
:copy
|
||||
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
check-cast v0, [Lradiant/SylLayout;
|
||||
|
||||
:store_arr
|
||||
sput-object v0, Lradiant/SylLayout;->cbs:[Lradiant/SylLayout;
|
||||
|
||||
:have_arr
|
||||
aget-object v1, v0, p0
|
||||
|
||||
if-nez v1, :ret
|
||||
|
||||
new-instance v1, Lradiant/SylLayout;
|
||||
|
||||
invoke-direct {v1, p0}, Lradiant/SylLayout;-><init>(I)V
|
||||
|
||||
aput-object v1, v0, p0
|
||||
|
||||
:ret
|
||||
return-object v1
|
||||
.end method
|
||||
|
||||
.method public static get(I)Landroidx/compose/ui/text/TextLayoutResult;
|
||||
.locals 2
|
||||
|
||||
if-ltz p0, :none
|
||||
|
||||
sget-object v0, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
if-eqz v0, :none
|
||||
|
||||
array-length v1, v0
|
||||
|
||||
if-ge p0, v1, :none
|
||||
|
||||
aget-object v0, v0, p0
|
||||
|
||||
return-object v0
|
||||
|
||||
:none
|
||||
const/4 v0, 0x0
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
# Forget the layouts on track change
|
||||
.method public static reset()V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
sput-object v0, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
# Font size in pixels
|
||||
.method public static em(Landroidx/compose/ui/text/TextLayoutResult;)F
|
||||
.locals 8
|
||||
|
||||
invoke-virtual {p0}, Landroidx/compose/ui/text/TextLayoutResult;->getLayoutInput()Landroidx/compose/ui/text/TextLayoutInput;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-virtual {v0}, Landroidx/compose/ui/text/TextLayoutInput;->getStyle()Landroidx/compose/ui/text/TextStyle;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v1}, Landroidx/compose/ui/text/TextStyle;->getFontSize-XSAIIZE()J
|
||||
|
||||
move-result-wide v1
|
||||
|
||||
# Only Sp converts to pixels
|
||||
invoke-static {v1, v2}, Landroidx/compose/ui/unit/TextUnit;->getType-UIouoOA(J)J
|
||||
|
||||
move-result-wide v3
|
||||
|
||||
sget-object v5, Landroidx/compose/ui/unit/TextUnitType;->Companion:Landroidx/compose/ui/unit/TextUnitType$Companion;
|
||||
|
||||
invoke-virtual {v5}, Landroidx/compose/ui/unit/TextUnitType$Companion;->getSp-UIouoOA()J
|
||||
|
||||
move-result-wide v5
|
||||
|
||||
invoke-static {v3, v4, v5, v6}, Landroidx/compose/ui/unit/TextUnitType;->equals-impl0(JJ)Z
|
||||
|
||||
move-result v3
|
||||
|
||||
if-eqz v3, :fallback
|
||||
|
||||
invoke-virtual {v0}, Landroidx/compose/ui/text/TextLayoutInput;->getDensity()Landroidx/compose/ui/unit/Density;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-interface {v0, v1, v2}, Landroidx/compose/ui/unit/Density;->toPx--R2X_6o(J)F
|
||||
|
||||
move-result v0
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
cmpg-float v1, v0, v1
|
||||
|
||||
if-lez v1, :fallback
|
||||
|
||||
return v0
|
||||
|
||||
:fallback
|
||||
# No font size, guess from the line box
|
||||
const/4 v0, 0x0
|
||||
|
||||
invoke-virtual {p0, v0}, Landroidx/compose/ui/text/TextLayoutResult;->getLineBottom(I)F
|
||||
|
||||
move-result v1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
invoke-virtual {p0, v0}, Landroidx/compose/ui/text/TextLayoutResult;->getLineTop(I)F
|
||||
|
||||
move-result v2
|
||||
|
||||
sub-float/2addr v1, v2
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
cmpg-float v0, v1, v0
|
||||
|
||||
if-lez v0, :default_em
|
||||
|
||||
const v0, 0x3f4ccccd # 0.8f
|
||||
|
||||
mul-float/2addr v0, v1
|
||||
|
||||
return v0
|
||||
|
||||
:default_em
|
||||
const/high16 v0, 0x42200000 # 40.0f
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
|
||||
.method public invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
||||
.locals 4
|
||||
|
||||
iget v0, p0, Lradiant/SylLayout;->idx:I
|
||||
|
||||
if-ltz v0, :ret
|
||||
|
||||
instance-of v1, p1, Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
if-eqz v1, :ret
|
||||
|
||||
sget-object v1, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
if-eqz v1, :grow
|
||||
|
||||
array-length v2, v1
|
||||
|
||||
if-gt v2, v0, :store
|
||||
|
||||
:grow
|
||||
add-int/lit8 v2, v0, 0x1
|
||||
|
||||
const/16 v3, 0x40
|
||||
|
||||
if-ge v2, v3, :cap_ok
|
||||
|
||||
const/16 v2, 0x40
|
||||
|
||||
:cap_ok
|
||||
if-nez v1, :copy
|
||||
|
||||
new-array v1, v2, [Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
goto :store
|
||||
|
||||
:copy
|
||||
invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
check-cast v1, [Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
:store
|
||||
sput-object v1, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
check-cast p1, Landroidx/compose/ui/text/TextLayoutResult;
|
||||
|
||||
aput-object p1, v1, v0
|
||||
|
||||
:ret
|
||||
sget-object v0, Lkotlin/u;->a:Lkotlin/u;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user