360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 s.java 源代码,内容仅作参考
package com.qihoo.appstore.newsearch.a;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.ImageView;
import android.widget.TextView;
import com.qihoo.appstore.activities.MainActivity;
import com.qihoo.appstore.activities.PopluarizeActivity;
import com.qihoo.appstore.f.cr;
import com.qihoo.appstore.f.cw;
import com.qihoo.appstore.newapplist.y;
import com.qihoo.appstore.newsearch.NewSearchVideo;
import com.qihoo.appstore.newsearch.bf;
import com.qihoo.appstore.resource.app.App;
import com.qihoo.appstore.utils.de;
import com.qihoo.freewifi.push.R;
import com.qihoo.speedometer.Config;
import com.qihoo.videomini.VideoDetailPageActivity;
import com.qihoo.videomini.e.u;
public class s extends b implements View.OnClickListener {
private final int A;
int i;
protected int j;
cr k;
private View l;
private View m;
private ImageView n;
private TextView o;
private TextView p;
private TextView q;
private TextView r;
private TextView s;
private TextView t;
private ImageView u;
private View v;
private ImageView w;
private TextView x;
private TextView y;
private final String[] z;
public s(Context context, int i) {
super(context);
this.i = Color.parseColor("#848484");
this.k = new t(this);
this.f = 5;
this.j = i;
this.z = this.f2702a.getResources().getStringArray(R.array.new_search_video_array);
com.qihoo.appstore.f.g.a(this.k);
this.A = de.a(11.0f);
}
private SpannableStringBuilder a(String str, int i, int i2, int i3) {
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str);
spannableStringBuilder.setSpan(new ForegroundColorSpan(i), i2, i3, 17);
return spannableStringBuilder;
}
private void a(TextView textView, int i, String str) {
textView.setVisibility(0);
String str2 = this.z[i];
textView.setText(a(str2 + str, this.i, 0, str2.length()));
}
private void a(String str) {
Intent intent = new Intent(MainActivity.e(), (Class<?>) PopluarizeActivity.class);
if (TextUtils.isEmpty(str)) {
str = "http://www.so.com";
}
intent.putExtra("detail_url", str);
intent.putExtra("showScan", false);
MainActivity.e().startActivity(intent);
if (this.f == 1) {
com.qihoo.appstore.r.a.a("spxqs", 1);
} else if (this.f == 5) {
com.qihoo.appstore.r.a.a("spxq", 1);
}
}
public static void a(String str, String str2, String str3, Context context) {
try {
Intent intent = new Intent(context, (Class<?>) VideoDetailPageActivity.class);
Bundle bundle = new Bundle();
bundle.putString("videoid", str);
bundle.putString("title", str2);
bundle.putByte("cat", Byte.decode(str3).byteValue());
intent.putExtras(bundle);
u.b().b(context, intent);
} catch (Exception e) {
e.printStackTrace();
}
}
private void b(NewSearchVideo newSearchVideo) {
com.a.a.b.g.a().a(newSearchVideo.aV(), this.n, com.qihoo.appstore.iconmanager.c.f);
this.p.setText(newSearchVideo.aK());
String aJ = newSearchVideo.aJ();
if (!TextUtils.isEmpty(newSearchVideo.aM())) {
this.o.setText(R.string.action_play);
Drawable drawable = this.f2702a.getResources().getDrawable(R.drawable.play_state);
drawable.setBounds(this.A, 0, drawable.getMinimumWidth() + this.A, drawable.getMinimumHeight());
this.o.setCompoundDrawablesWithIntrinsicBounds(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
} else if (!TextUtils.isEmpty(newSearchVideo.aN())) {
this.o.setText(R.string.vip_play);
this.o.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, (Drawable) null, (Drawable) null);
}
if (TextUtils.isEmpty(aJ)) {
this.u.setVisibility(8);
} else {
this.u.setVisibility(0);
App.a(this.u, (int) Float.parseFloat(aJ));
}
a(newSearchVideo);
String aL = newSearchVideo.aL();
if (aL.equals("电影")) {
c(newSearchVideo);
return;
}
if (aL.equals("电视剧")) {
d(newSearchVideo);
return;
}
if (aL.equals("综艺")) {
e(newSearchVideo);
} else if (aL.equals("动漫")) {
f(newSearchVideo);
} else {
g(newSearchVideo);
}
}
private void c(NewSearchVideo newSearchVideo) {
a(this.q, 0, newSearchVideo.aO());
this.q.setTextColor(this.f2702a.getResources().getColor(R.color.new_app_info_color_3));
a(this.r, 1, newSearchVideo.aP());
a(this.s, 3, newSearchVideo.aQ());
a(this.t, 4, newSearchVideo.aR() + "/" + newSearchVideo.aS());
}
private void d(NewSearchVideo newSearchVideo) {
int aU = newSearchVideo.aU();
String format = aU == newSearchVideo.aT() ? String.format(this.f2702a.getString(R.string.video_upinfo_all), Integer.valueOf(aU)) : String.format(this.f2702a.getString(R.string.video_upinfo_up), Integer.valueOf(aU));
this.q.setVisibility(0);
this.q.setText(format);
this.q.setTextColor(this.f2702a.getResources().getColor(R.color.new_search_xgtj));
a(this.r, 0, newSearchVideo.aO());
a(this.s, 1, newSearchVideo.aP());
a(this.t, 7, newSearchVideo.aQ() + "/" + newSearchVideo.aR());
}
private void e(NewSearchVideo newSearchVideo) {
String format = String.format(this.f2702a.getString(R.string.video_variety_upinfo), newSearchVideo.aW());
this.q.setVisibility(0);
this.q.setText(format);
this.q.setTextColor(this.f2702a.getResources().getColor(R.color.new_search_xgtj));
a(this.r, 2, newSearchVideo.aO());
a(this.s, 3, newSearchVideo.aQ());
a(this.t, 5, newSearchVideo.aR());
}
private void f(NewSearchVideo newSearchVideo) {
int aU = newSearchVideo.aU();
String format = aU == newSearchVideo.aT() ? String.format(this.f2702a.getString(R.string.video_upinfo_all), Integer.valueOf(aU)) : String.format(this.f2702a.getString(R.string.video_upinfo_up), Integer.valueOf(aU));
this.q.setVisibility(0);
this.q.setText(format);
this.q.setTextColor(this.f2702a.getResources().getColor(R.color.new_search_xgtj));
a(this.r, 6, newSearchVideo.aS());
a(this.s, 3, newSearchVideo.aQ());
a(this.t, 5, newSearchVideo.aR());
}
private void g(NewSearchVideo newSearchVideo) {
this.u.setVisibility(8);
this.q.setVisibility(4);
this.r.setVisibility(4);
this.s.setVisibility(4);
this.t.setVisibility(4);
}
@Override
public View a(int i, View view, ViewGroup viewGroup, Object obj) {
if (obj != null && (obj instanceof NewSearchVideo)) {
NewSearchVideo newSearchVideo = (NewSearchVideo) obj;
this.m.setTag(newSearchVideo);
this.o.setTag(newSearchVideo);
b(newSearchVideo);
this.e = i;
b(view);
}
return view;
}
public void a(Context context, App app, TextView textView, int i) {
String Y = app.Y();
if (!app.bJ()) {
if (i == 192) {
textView.setVisibility(0);
textView.setText(context.getString(R.string.download_alert_dialog_download_cannel));
return;
} else if (cw.f(i)) {
textView.setVisibility(0);
textView.setText(context.getString(R.string.action_install) + Y);
return;
} else if (com.qihoo.appstore.f.g.l(app.W()) == 1) {
textView.setVisibility(0);
textView.setText(Y + context.getString(R.string.make_install));
return;
} else {
textView.setVisibility(0);
textView.setText(context.getString(R.string.download) + Y);
return;
}
}
if (!app.h(context)) {
textView.setVisibility(0);
textView.setText(String.format(context.getString(R.string.open_in_xx), Y));
return;
}
if (i == -2) {
textView.setText(context.getString(R.string.action_update) + Y);
textView.setVisibility(0);
return;
}
if (i == 192) {
textView.setVisibility(0);
textView.setText(context.getString(R.string.download_alert_dialog_download_cannel));
}
if (cw.f(i)) {
textView.setVisibility(0);
textView.setText(context.getString(R.string.action_install) + Y);
}
}
@Override
public void a(View view) {
this.l = view;
this.l.setOnClickListener(this);
this.m = view.findViewById(R.id.video_body);
this.n = (ImageView) view.findViewById(R.id.icon);
this.o = (TextView) view.findViewById(R.id.action);
this.o.setOnClickListener(this);
this.p = (TextView) view.findViewById(R.id.title);
this.q = (TextView) view.findViewById(R.id.info_1);
this.r = (TextView) view.findViewById(R.id.info_2);
this.s = (TextView) view.findViewById(R.id.info_3);
this.t = (TextView) view.findViewById(R.id.info_4);
this.u = (ImageView) view.findViewById(R.id.progress);
if (this.j == 1) {
((ViewStub) view.findViewById(R.id.openinapp)).inflate();
this.v = view.findViewById(R.id.open_body);
this.v.setOnClickListener(this);
this.w = (ImageView) view.findViewById(R.id.open_icon);
this.y = (TextView) view.findViewById(R.id.open_action);
this.y.setOnClickListener(this);
this.x = (TextView) view.findViewById(R.id.open_title);
}
}
public void a(NewSearchVideo newSearchVideo) {
if (this.j == 1) {
App aX = newSearchVideo.aX();
com.a.a.b.g.a().a(aX.ah(), this.w, com.qihoo.appstore.iconmanager.c.f);
this.x.setText(newSearchVideo.aK() + this.f2702a.getString(R.string.cinecism) + "-" + aX.Y());
this.y.setText(this.f2702a.getString(R.string.action_download) + aX.Y());
this.y.setTag(aX);
this.v.setTag(aX);
a(this.f2702a, aX, this.y, aX.by());
}
}
public void a(App app) {
if (!app.bJ() || app.h(this.f2702a)) {
y.a(this.f2702a, app, -100);
} else {
com.qihoo.appstore.ui.b.b(this.f2702a, app);
}
}
@Override
public void b() {
super.b();
com.qihoo.appstore.f.g.b(this.k);
}
@Override
public void onClick(View view) {
if (view == this.l) {
view = this.m;
}
switch (view.getId()) {
case R.id.action:
case R.id.video_body:
NewSearchVideo newSearchVideo = (NewSearchVideo) view.getTag();
String aM = newSearchVideo.aM();
if (TextUtils.isEmpty(aM)) {
aM = newSearchVideo.aN();
}
if (com.qihoo.appstore.newvideo.c.f()) {
a(newSearchVideo.aI(), newSearchVideo.aK(), newSearchVideo.aH(), this.f2702a);
return;
} else {
a(aM);
return;
}
case R.id.open_body:
App app = (App) view.getTag();
bf.a(app, app.I, Config.INVALID_IP);
com.qihoo.appstore.r.a.a("sqxq", 1);
return;
case R.id.open_action:
a((App) view.getTag());
return;
default:
return;
}
}
}