Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 k0.java 源代码,内容仅作参考
package myobfuscated.c02;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.GestureDetector;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.airbnb.lottie.LottieAnimationView;
import com.facebook.drawee.view.SimpleDraweeView;
import com.picsart.createflow.model.Item;
import com.picsart.image.ImageItem;
import com.picsart.imageloader.request.b;
import com.picsart.studio.R;
import com.picsart.studio.apiv3.model.card.Card;
import com.picsart.studio.model.ItemControl;
import com.picsart.studio.views.PicsartProgressBar;
import com.tokens.color.model.SemanticColor;
import com.tokens.radius.RadiusSystem;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
import myobfuscated.li1.v1;
public final class k0 extends p<ImageItem, a> {
public static final int s = 0;
public Card m;
public myobfuscated.d02.c n;
public boolean o;
public int p;
public boolean q;
public boolean r;
public static class a extends RecyclerView.d0 {
public SimpleDraweeView b;
public PicsartProgressBar c;
public TextView d;
public SimpleDraweeView e;
public LottieAnimationView f;
}
@Override
public final void F(List<ImageItem> list) {
super.F(list);
}
@Override
public final boolean I() {
return this.j.isEmpty();
}
public final void L(List<ImageItem> list) {
this.j.clear();
super.F(list);
}
@Override
public final int c(long j) {
for (int i = 0; i < this.j.size() && j > 0; i++) {
if (this.j.get(i) != null && ((ImageItem) this.j.get(i)).m() == j) {
return i;
}
}
return -1;
}
@Override
public final long getItemId(int i) {
return ((ImageItem) this.j.get(i)).m();
}
@Override
public final void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
@Override
public final void onBindViewHolder(@NonNull RecyclerView.d0 d0Var, int i) {
a aVar = (a) d0Var;
int bindingAdapterPosition = aVar.getBindingAdapterPosition();
boolean z = bindingAdapterPosition > this.h;
myobfuscated.d02.c cVar = this.n;
cVar.setScrollingDown(z);
this.h = bindingAdapterPosition;
aVar.c.setVisibility(8);
ImageItem imageItem = (ImageItem) this.j.get(bindingAdapterPosition);
Float valueOf = Float.valueOf(imageItem.l());
SimpleDraweeView simpleDraweeView = aVar.b;
simpleDraweeView.setTag(R.id.zoomable_item_ratio_id, valueOf);
simpleDraweeView.setTag(R.id.zoomable_item_is_sticker, Boolean.valueOf(imageItem.isSticker()));
simpleDraweeView.setTag(R.id.zoomable_item_item_image_url, myobfuscated.ry0.c.f(imageItem));
com.picsart.imageloader.b a2 = myobfuscated.sz0.a.a();
b.a k = com.appsflyer.internal.h.k(simpleDraweeView);
k.b = myobfuscated.ry0.c.f(imageItem);
k.b(new myobfuscated.tf1.e(1, this, aVar), new myobfuscated.b02.o(1, this, aVar));
((com.picsart.imageloader.c) a2).a(k.a());
ItemControl itemControl = v1.a() == ItemControl.DOUBLE_TAP_TO_SAVE ? ItemControl.STICKER_SAVE_REMOVE : ItemControl.DOUBLE_TAP_TO_LIKE;
simpleDraweeView.setClickable(true);
GestureDetector gestureDetector = new GestureDetector(aVar.itemView.getContext(), this);
gestureDetector.setOnDoubleTapListener(new i0(this, aVar, imageItem, itemControl));
simpleDraweeView.setOnTouchListener(new myobfuscated.bj.c(gestureDetector, 2));
Card card = this.m;
TextView textView = aVar.d;
if (card != null && "cards:search:sticker:download".equals(card.key)) {
textView.setVisibility(8);
} else if (Item.LICENSE_SHOP.equals(imageItem.A())) {
boolean z2 = this.r;
boolean z3 = this.q;
if (z2 || z3) {
textView.setVisibility(8);
boolean equals = Item.LICENSE_SHOP.equals(imageItem.A());
SimpleDraweeView simpleDraweeView2 = aVar.e;
if (!equals || imageItem.z0 || imageItem.y0 || z3) {
simpleDraweeView2.setVisibility(8);
} else {
simpleDraweeView2.setVisibility(0);
com.picsart.imageloader.b a3 = myobfuscated.sz0.a.a();
b.a k2 = com.appsflyer.internal.h.k(simpleDraweeView2);
k2.b = "https://cdn140.picsart.com/87539458872958089591.png";
((com.picsart.imageloader.c) a3).a(k2.a());
}
} else {
textView.setVisibility(0);
textView.setText(imageItem.p0());
textView.setTextColor(aVar.itemView.getResources().getColor(R.color.color_7852A2));
}
} else if (this.o) {
textView.setVisibility(8);
} else {
textView.setVisibility(0);
textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
textView.setTextColor(myobfuscated.b3.a.getColor(aVar.itemView.getContext(), R.color.gray));
textView.setText(String.format("%s%s", '@', imageItem.U0().U()));
}
textView.setOnClickListener(new j0(this, aVar, imageItem));
cVar.addViewForAnalytics(aVar.itemView, (ImageItem) this.j.get(i), bindingAdapterPosition);
}
@Override
public final void onBindViewHolder(@NonNull RecyclerView.d0 d0Var, int i, @NonNull List list) {
a aVar = (a) d0Var;
if (list.isEmpty() || !(list.get(0) instanceof Integer)) {
super.onBindViewHolder(aVar, i, list);
} else {
this.f.y(0, ItemControl.HIDE_FROM_PROFILE, aVar.b, this.j.get(((Integer) list.get(0)).intValue()));
}
}
@Override
@NonNull
public final RecyclerView.d0 onCreateViewHolder(ViewGroup viewGroup, int i) {
View f = com.appsflyer.internal.c.f(viewGroup, R.layout.item_sticker, viewGroup, false);
?? d0Var = new RecyclerView.d0(f);
if (f.findViewById(R.id.zoomable_item_id) != null) {
View findViewById = f.findViewById(R.id.zoomable_item_id);
float pxValue = RadiusSystem.R8.getPxValue();
SemanticColor semanticColor = myobfuscated.fi2.a.d.e;
Context context = f.getContext();
Intrinsics.checkNotNullParameter(context, "<this>");
com.picsart.extensions.android.b.e(findViewById, semanticColor.a((context.getResources().getConfiguration().uiMode & 48) == 32), pxValue);
}
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) f.findViewById(R.id.zoomable_item_id);
d0Var.b = simpleDraweeView;
d0Var.d = (TextView) f.findViewById(R.id.item_sticker_username);
d0Var.c = (PicsartProgressBar) f.findViewById(R.id.sticker_item_loading);
d0Var.e = (SimpleDraweeView) f.findViewById(R.id.plus_text);
d0Var.f = (LottieAnimationView) f.findViewById(R.id.double_tap_save);
simpleDraweeView.setVisibility(0);
ViewGroup.LayoutParams layoutParams = f.getLayoutParams();
int i2 = this.p;
layoutParams.width = i2;
simpleDraweeView.setAspectRatio(1.0f);
simpleDraweeView.getHierarchy().o(new ColorDrawable(myobfuscated.fi2.a.d.i.c()), 1);
f.setLayoutParams(layoutParams);
if (f.findViewById(R.id.sticker_layout) != null) {
ViewGroup.LayoutParams layoutParams2 = f.findViewById(R.id.sticker_layout).getLayoutParams();
layoutParams2.height = i2;
f.findViewById(R.id.sticker_layout).setLayoutParams(layoutParams2);
}
return d0Var;
}
@Override
public final void onViewRecycled(RecyclerView.d0 d0Var) {
a aVar = (a) d0Var;
SimpleDraweeView simpleDraweeView = aVar.b;
if (simpleDraweeView != null && simpleDraweeView.getHierarchy() != null) {
aVar.b.getHierarchy().reset();
}
super.onViewRecycled(aVar);
}
}