Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 q.java 源代码,内容仅作参考
package in.swiggy.android.track.viewmodels.v3;
import android.animation.Animator;
import androidx.databinding.ObservableInt;
import androidx.databinding.j;
import androidx.lifecycle.y;
import com.swiggy.pos.service.grpc.v1.Messages;
import com.swiggy.pos.service.grpc.v1.OrderDetails;
import com.swiggy.pos.service.grpc.v1.TrackOrderV3;
import in.swiggy.android.commons.extension.KotlinExtensionsKt;
import in.swiggy.android.tejas.feature.trackv3.responsedatatypes.MessagesMetaDataType;
import in.swiggy.android.tejas.oldapi.models.intdef.TrackOrderState;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.MutablePropertyReference1Impl;
public final class q extends in.swiggy.android.commonsFeature.baseviewmodels.a {
private final ObservableInt k;
private String l;
private final String m;
private final y<Integer> n;
private final y<Boolean> o;
private final y<Boolean> p;
private boolean q;
private final y<Integer> r;
private int s;
private ObservableInt t;
public TrackOrderV3 u;
private final kotlin.properties.e v;
private final kotlin.properties.e w;
private in.swiggy.android.commonsui.view.f x;
private final b y;
static final kotlin.reflect.l<Object>[] A = {kotlin.jvm.internal.r.f(new MutablePropertyReference1Impl(q.class, "rainLottieAnim", "getRainLottieAnim()Ljava/lang/String;", 0)), kotlin.jvm.internal.r.f(new MutablePropertyReference1Impl(q.class, "setRainAnimBottomPadding", "getSetRainAnimBottomPadding()I", 0))};
public static final a z = new a(null);
public static final int B = 8;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private a() {
}
}
public static final class b extends j.a {
b() {
}
@Override
public void d(androidx.databinding.j sender, int i) {
ObservableInt observableInt;
int i2;
kotlin.jvm.internal.o.k(sender, "sender");
q qVar = q.this;
if (sender instanceof ObservableInt) {
observableInt = (ObservableInt) sender;
} else {
observableInt = null;
}
if (observableInt != null) {
i2 = observableInt.g();
} else {
i2 = 0;
}
qVar.w7(i2);
}
}
public static final class c extends in.swiggy.android.commonsui.view.f {
c() {
}
@Override
public void onAnimationRepeat(Animator animation) {
kotlin.jvm.internal.o.k(animation, "animation");
super.onAnimationRepeat(animation);
Integer f = q.this.i7().f();
if (f != null) {
q qVar = q.this;
qVar.i7().r(Integer.valueOf(f.intValue() + 1));
Integer f2 = qVar.i7().f();
int j7 = qVar.j7();
if (f2 != null && f2.intValue() == j7) {
qVar.r7().r(8);
qVar.h7().r(Boolean.TRUE);
qVar.k7().r(Boolean.FALSE);
}
}
}
}
public static final class d extends kotlin.properties.c<String> {
final q b;
public d(Object obj, q qVar) {
super(obj);
this.b = qVar;
}
@Override
protected void c(kotlin.reflect.l<?> property, String str, String str2) {
kotlin.jvm.internal.o.k(property, "property");
if (!kotlin.jvm.internal.o.f(str, str2)) {
this.b.t7();
}
}
}
public static final class e extends kotlin.properties.c<Integer> {
final q b;
public e(Object obj, q qVar) {
super(obj);
this.b = qVar;
}
@Override
protected void c(kotlin.reflect.l<?> property, Integer num, Integer num2) {
kotlin.jvm.internal.o.k(property, "property");
int intValue = num2.intValue();
if (num.intValue() != intValue) {
this.b.l7().h(intValue);
}
}
}
public q(in.swiggy.android.commonsFeature.baseviewmodels.b sharedState, ObservableInt bottomSheetHeight) {
super(sharedState);
kotlin.jvm.internal.o.k(sharedState, "sharedState");
kotlin.jvm.internal.o.k(bottomSheetHeight, "bottomSheetHeight");
this.k = bottomSheetHeight;
this.l = "https://media-assets.swiggy.com/swiggy/raw/upload/v1630054046/lottie/rain.json";
this.m = "TrackRainAnimViewModel";
this.n = new y<>(8);
Boolean bool = Boolean.FALSE;
this.o = new y<>(bool);
this.p = new y<>(bool);
this.q = true;
this.r = new y<>(0);
String string = N().getString("track_rain_lottie_anim_repeat_count", TrackOrderState.ORDER_CANCELLED);
this.s = KotlinExtensionsKt.w(string == null ? "" : string, 5);
this.t = new ObservableInt(bottomSheetHeight);
kotlin.properties.a aVar = kotlin.properties.a.a;
this.v = new d("", this);
this.w = new e(-1, this);
this.x = new c();
this.y = new b();
}
public final void t7() {
String str;
String str2;
String str3;
in.swiggy.android.analytics.interfaces.c g3 = g3();
OrderDetails orderDetails = p7().getOrderDetails();
String str4 = null;
if (orderDetails != null) {
str = orderDetails.getOrderId();
} else {
str = null;
}
if (str == null) {
str2 = "-";
} else {
kotlin.jvm.internal.o.h(str);
str2 = str;
}
OrderDetails orderDetails2 = p7().getOrderDetails();
if (orderDetails2 != null) {
str4 = orderDetails2.getOrderId();
}
if (str4 == null) {
str3 = "-";
} else {
kotlin.jvm.internal.o.h(str4);
str3 = str4;
}
g3.j(g3.q("track_v3", "rain-animation", str2, 9999, str3));
}
@Override
public void M6() {
super.M6();
this.k.f3(this.y);
}
public final y<Boolean> h7() {
return this.o;
}
public final y<Integer> i7() {
return this.r;
}
public final int j7() {
return this.s;
}
public final y<Boolean> k7() {
return this.p;
}
public final ObservableInt l7() {
return this.t;
}
public final in.swiggy.android.commonsui.view.f m7() {
return this.x;
}
public final String n7() {
return this.l;
}
public final String o7() {
return this.m;
}
public final TrackOrderV3 p7() {
TrackOrderV3 trackOrderV3 = this.u;
if (trackOrderV3 != null) {
return trackOrderV3;
}
kotlin.jvm.internal.o.C("trackOrderResponse");
return null;
}
public final void q7() {
this.k.Y(this.y);
}
public final y<Integer> r7() {
return this.n;
}
public final void s7(TrackOrderV3 trackOrderResponse) {
kotlin.jvm.internal.o.k(trackOrderResponse, "trackOrderResponse");
if (this.q) {
Messages v = in.swiggy.android.track.utils.d.v(trackOrderResponse);
if (v != null) {
this.n.r(0);
this.p.r(Boolean.TRUE);
this.q = false;
x7(trackOrderResponse);
u7(String.valueOf(v.getMetaMap().get(MessagesMetaDataType.RAIN_ANIMATION_ENABLE)));
}
} else if (in.swiggy.android.track.utils.d.v(trackOrderResponse) == null) {
this.n.r(8);
this.o.r(Boolean.TRUE);
this.p.r(Boolean.FALSE);
this.q = true;
}
}
public final void u7(String str) {
kotlin.jvm.internal.o.k(str, "<set-?>");
this.v.b(this, A[0], str);
}
public final void v7(boolean z2) {
this.q = z2;
}
public final void w7(int i) {
this.w.b(this, A[1], Integer.valueOf(i));
}
public final void x7(TrackOrderV3 trackOrderV3) {
kotlin.jvm.internal.o.k(trackOrderV3, "<set-?>");
this.u = trackOrderV3;
}
}