酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 i.java 源代码,内容仅作参考
package com.kugou.android.app.common.comment.c;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.kugou.android.app.KGApplication;
import com.kugou.android.app.NavigationUtils;
import com.kugou.android.app.common.comment.entity.CommentEntity;
import com.kugou.android.app.flexowebview.KGFlexoWebActivity;
import com.kugou.android.app.process.EnvManager;
import com.kugou.android.lite.R;
import com.kugou.android.musiccircle.bean.DynamicEntity;
import com.kugou.common.base.AbsFrameworkFragment;
import com.kugou.common.userCenter.UserInfoConstant;
import com.kugou.common.utils.br;
import com.kugou.common.utils.bv;
import com.kugou.common.utils.cc;
import com.kugou.common.utils.cj;
import com.kugou.common.utils.cw;
import com.tencent.open.SocialConstants;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
public class i {
protected static void a() {
com.kugou.android.common.utils.e.b();
}
public static <T extends CommentEntity> boolean a(CommentEntity commentEntity, List<ArrayList<T>> list) {
a();
boolean z = false;
if (commentEntity != null) {
String str = commentEntity.f5164a;
Iterator<ArrayList<T>> it = list.iterator();
while (it.hasNext()) {
boolean a2 = a(it.next(), str);
if (!z) {
z = a2;
}
}
}
return z;
}
public static <T extends CommentEntity> boolean a(String str, ArrayList<T> arrayList) {
a();
return a(arrayList, str);
}
public static <T extends CommentEntity> void c(CommentEntity commentEntity, List<ArrayList<T>> list) {
a();
if (commentEntity != null) {
Iterator<ArrayList<T>> it = list.iterator();
while (it.hasNext()) {
a(it.next(), commentEntity);
}
}
}
public static <T extends CommentEntity> boolean d(CommentEntity commentEntity, List<ArrayList<T>> list) {
if (list == null || commentEntity == null) {
return false;
}
for (ArrayList<T> arrayList : list) {
if (arrayList != null && arrayList.contains(commentEntity)) {
return true;
}
}
return false;
}
public static <T extends CommentEntity> boolean a(String str, List<ArrayList<T>> list) {
CommentEntity b2;
a();
for (ArrayList<T> arrayList : list) {
if (arrayList != null && arrayList.size() != 0 && (b2 = b(arrayList, str)) != null) {
arrayList.remove(b2);
return true;
}
}
return false;
}
public static <T extends CommentEntity> void b(CommentEntity commentEntity, List<ArrayList<T>> list) {
a();
if (commentEntity != null) {
String str = commentEntity.f5164a;
if ("0".equals(str) && (commentEntity instanceof DynamicEntity)) {
DynamicEntity dynamicEntity = (DynamicEntity) commentEntity;
if (!TextUtils.isEmpty(dynamicEntity.chash)) {
Iterator<ArrayList<T>> it = list.iterator();
while (it.hasNext()) {
b(it.next(), dynamicEntity.chash, commentEntity.k);
}
return;
}
}
Iterator<ArrayList<T>> it2 = list.iterator();
while (it2.hasNext()) {
a(it2.next(), str, commentEntity.k);
}
}
}
public static <T extends CommentEntity> void a(CommentEntity commentEntity, int i, List<ArrayList<T>> list) {
a();
if (commentEntity == null || Integer.parseInt(commentEntity.n) <= 0) {
return;
}
String str = commentEntity.n;
Iterator<ArrayList<T>> it = list.iterator();
while (it.hasNext()) {
List<CommentEntity> a2 = a((List) it.next(), str, false);
if (!com.kugou.framework.common.utils.f.a(a2)) {
return;
}
for (CommentEntity commentEntity2 : a2) {
if (commentEntity2 != null) {
if (i == 1) {
commentEntity2.x++;
} else if (commentEntity2.x > 0) {
commentEntity2.x--;
}
}
}
}
}
public static <T extends CommentEntity> CommentEntity a(String str, int i, ArrayList<T> arrayList) {
if (!TextUtils.isEmpty(str) && i >= 0) {
Iterator<T> it = arrayList.iterator();
while (it.hasNext()) {
T next = it.next();
if (TextUtils.equals(str, next.f5164a)) {
next.x = i;
return next;
}
}
}
return null;
}
public static void a(List<ArrayList<CommentEntity>> list) {
a();
Iterator<ArrayList<CommentEntity>> it = list.iterator();
while (it.hasNext()) {
it.next().clear();
}
}
private static <T extends CommentEntity> void b(List<T> list, String str, com.kugou.android.app.common.comment.entity.c cVar) {
CommentEntity b2 = b(list, str);
if (b2 == null || b2.k == null || cVar == null) {
return;
}
b2.k.f5174b = cVar.f5174b;
b2.k.f5173a = cVar.f5173a;
}
private static <T extends CommentEntity> void a(List<T> list, String str, com.kugou.android.app.common.comment.entity.c cVar) {
List<CommentEntity> a2 = a((List) list, str, false);
if (com.kugou.framework.common.utils.f.a(a2)) {
for (CommentEntity commentEntity : a2) {
if (commentEntity != null && commentEntity.k != null && cVar != null) {
commentEntity.k.f5174b = cVar.f5174b;
commentEntity.k.f5173a = cVar.f5173a;
}
}
}
}
private static <T extends CommentEntity> void a(List<T> list, CommentEntity commentEntity) {
if (list == null || list.size() < 1 || commentEntity == null || !list.contains(commentEntity)) {
return;
}
list.remove(commentEntity);
}
private static <T extends CommentEntity> boolean a(List<T> list, String str) {
List<CommentEntity> a2 = a((List) list, str, true);
boolean z = false;
if (!com.kugou.framework.common.utils.f.a(a2)) {
return false;
}
for (CommentEntity commentEntity : a2) {
if (commentEntity != null) {
z = list.remove(commentEntity);
}
}
return z;
}
private static <T extends CommentEntity> CommentEntity b(List<T> list, String str) {
T t = null;
if (list != null && list.size() >= 1 && !TextUtils.isEmpty(str)) {
for (T t2 : list) {
if (t2 != null && (t2 instanceof DynamicEntity)) {
if (str.equals(((DynamicEntity) t2).chash)) {
t = t2;
}
if (t != null) {
break;
}
}
}
}
return t;
}
private static <T extends CommentEntity> List<T> a(List<T> list, String str, boolean z) {
if (list == null || list.size() < 1 || TextUtils.isEmpty(str)) {
return null;
}
ArrayList arrayList = new ArrayList();
for (T t : list) {
if (str.equals(t.f5164a)) {
arrayList.add(t);
}
if (z && str.equals(t.n)) {
t.l = true;
t.m = true;
t.q = "该内容已删除";
}
}
return arrayList;
}
public static <T extends CommentEntity> void a(long j, List<ArrayList<T>> list) {
a();
Iterator<ArrayList<T>> it = list.iterator();
while (it.hasNext()) {
a(it.next(), j);
}
}
private static <T extends CommentEntity> void a(ArrayList<T> arrayList, long j) {
if (arrayList == null || arrayList.size() < 1 || j <= 0) {
return;
}
Iterator<T> it = arrayList.iterator();
while (it.hasNext()) {
T next = it.next();
if (next != null && String.valueOf(j).equals(next.f5165b)) {
it.remove();
}
}
}
public static void a(final Context context, View view, String str, final int i, final String str2, final String str3, String str4) {
ImageView imageView = (ImageView) cc.a(view, R.id.d4z);
ImageView imageView2 = (ImageView) cc.a(view, R.id.abs);
if (com.kugou.common.environment.a.Y() == cw.b(str4) && com.kugou.common.q.b.a().bj() != -1) {
str = com.kugou.common.q.b.a().be();
i = com.kugou.common.q.b.a().bj();
}
if (imageView == null || TextUtils.isEmpty(str)) {
if (imageView != null) {
imageView.setVisibility(8);
return;
}
return;
}
com.bumptech.glide.g.b(imageView.getContext()).a(str).a(imageView);
imageView.setVisibility(0);
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) imageView.getLayoutParams();
if (imageView2 != null && imageView2.getVisibility() == 0) {
marginLayoutParams.setMargins(cj.b(KGApplication.getContext(), -8.0f), marginLayoutParams.topMargin, marginLayoutParams.rightMargin, marginLayoutParams.bottomMargin);
} else {
marginLayoutParams.setMargins(cj.b(KGApplication.getContext(), 3.0f), marginLayoutParams.topMargin, marginLayoutParams.rightMargin, marginLayoutParams.bottomMargin);
}
imageView.setLayoutParams(marginLayoutParams);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
if (!br.Q(context)) {
Context context2 = context;
bv.b(context2, context2.getString(R.string.av3));
} else if (!EnvManager.isOnline()) {
br.T(context);
} else if (!com.kugou.common.environment.a.u()) {
NavigationUtils.startLoginFragment(context);
} else {
i.a(context, i);
com.kugou.common.statistics.e.a.a(new com.kugou.common.statistics.song.a.a(context, com.kugou.framework.statistics.easytrace.a.akR).setFo(str2).setSty(TextUtils.isEmpty(str3) ? "其他" : str3).setSvar1(String.valueOf(i)));
}
}
});
}
public static void a(Context context, int i) {
Intent intent = new Intent(context, (Class<?>) KGFlexoWebActivity.class);
Bundle bundle = new Bundle();
bundle.putString("web_title", "粉丝勋章");
String b2 = com.kugou.common.config.c.a().b(com.kugou.android.app.a.a.yS);
if (TextUtils.isEmpty(b2)) {
b2 = "http://h5.kugou.com/apps/user_asset/user_achievement/index.html";
}
bundle.putString("web_url", b2 + "?singer_id=".concat(String.valueOf(i)).concat("&t=").concat(String.valueOf(System.currentTimeMillis())));
bundle.putBoolean("extra_full_page_transparent", true);
bundle.putBoolean("felxo_fragment_has_playing_bar", false);
bundle.putBoolean("edge_left_swipe", false);
intent.putExtras(bundle);
context.startActivity(intent);
}
public static void a(View view, String str) {
View findViewById;
View findViewById2 = view.findViewById(R.id.duc);
if (Build.VERSION.SDK_INT >= 16 && (findViewById = view.findViewById(R.id.cd7)) != null) {
findViewById.setImportantForAccessibility(findViewById2 != null ? 2 : 1);
}
if (findViewById2 != null) {
findViewById2.setFocusable(true);
findViewById2.setContentDescription(str);
}
}
public static void a(AbsFrameworkFragment absFrameworkFragment, long j, String str, String str2, int i, int i2, @Nullable CommentEntity commentEntity) {
Bundle bundle = new Bundle();
bundle.putLong("guest_user_id", j);
bundle.putString("guest_nick_name", str);
bundle.putInt(SocialConstants.PARAM_SOURCE, 0);
bundle.putString("guest_pic", str2);
bundle.putInt("key_svip_type", i);
bundle.putInt("key_smp_type", i2);
bundle.putString("user_info_source_page", UserInfoConstant.LoginSourceType.COMMENT);
bundle.putParcelable("user_avator_denpant_model", com.kugou.android.denpant.b.a(commentEntity));
bundle.putString("ugc_content", commentEntity == null ? "" : com.kugou.android.userCenter.c.c.a(commentEntity.moduleCode, commentEntity.f5164a, "", commentEntity.l, "", commentEntity.getContent().getImages(), commentEntity.getContent().getContent()));
NavigationUtils.a(absFrameworkFragment, bundle);
}
}