导航菜单

页面标题

页面副标题

95爱播免登录版 v3.1.9 - AuctionActivity.java 源代码

正在查看: 95爱播免登录版 v3.1.9 应用的 AuctionActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.showself.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.android.volley.toolbox.ImageLoader;
import com.mifeng.ui.R;
import com.showself.utils.Utils;
import com.showself.utils.l;
import com.showself.view.PullToRefreshView;
import com.showself.wheel.ArrayWheelAdapter;
import com.showself.wheel.OnWheelChangedListener;
import com.showself.wheel.WheelView;
import java.util.HashMap;

public class AuctionActivity extends com.showself.ui.c implements PullToRefreshView.b {
    private WheelView a;
    private PullToRefreshView b;
    private ListView c;
    private View d;

    private ImageView f2578e;

    private ImageView f2579f;

    private TextView f2580g;

    private TextView f2581h;

    private Button f2582i;

    private int f2583j;

    private int f2584k;
    private String l;
    private int m;
    private int n;
    private int o;
    private boolean p;
    ImageLoader q;

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            AuctionActivity.this.finish();
        }
    }

    class b implements View.OnClickListener {
        b() {
        }

        @Override
        public void onClick(View view) {
            if (AuctionActivity.this.o != 0) {
                Intent intent = new Intent(AuctionActivity.this.getApplicationContext(), (Class<?>) CardActivity.class);
                intent.putExtra("id", AuctionActivity.this.o);
                AuctionActivity.this.startActivity(intent);
            }
        }
    }

    class c implements OnWheelChangedListener {
        final String[] a;

        c(String[] strArr) {
            this.a = strArr;
        }

        @Override
        public void onChanged(WheelView wheelView, int i2, int i3) {
            AuctionActivity.this.m = Integer.parseInt(this.a[i3]);
        }
    }

    class d implements View.OnTouchListener {
        final int a;
        final int b;

        d(int i2, int i3) {
            this.a = i2;
            this.b = i3;
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            int y;
            if (motionEvent.getAction() == 0 && (y = (int) motionEvent.getY()) > this.a && y < this.b) {
                AuctionActivity.this.a.dispatchTouchEvent(motionEvent);
                return true;
            }
            return false;
        }
    }

    class e implements View.OnClickListener {
        e() {
        }

        @Override
        public void onClick(View view) {
            AuctionActivity.this.D();
        }
    }

    class f implements l {
        f() {
        }

        @Override
        public void a(boolean z) {
            if (z) {
                com.showself.utils.c1.e.a(AuctionActivity.this);
            }
        }
    }

    class g implements l {
        g() {
        }

        @Override
        public void a(boolean z) {
            AuctionActivity.this.finish();
        }
    }

    public void D() {
        if (this.p) {
            return;
        }
        this.p = true;
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.f2583j));
        hashMap.put("gid", Integer.valueOf(this.f2584k));
        hashMap.put("money", Integer.valueOf(this.n));
        hashMap.put("addrate", Integer.valueOf(this.m));
        addTask(new com.showself.service.f(10094, hashMap), this);
    }

    private void E(String str) {
        Utils.Q0(this, getString(2131690737), str, getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.get_money_free), getResources().getColor(2131099758), new f(), true);
    }

    private void F() {
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.f2583j));
        hashMap.put("gid", Integer.valueOf(this.f2584k));
        addTask(new com.showself.service.f(10093, hashMap), this);
    }

    private void G(String str) {
        Utils.Q0(this, null, str, null, 0, getString(R.string.positive), getResources().getColor(2131099758), new g(), true);
    }

    @Override
    public void init() {
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        Button button = (Button) findViewById(R.id.btn_nav_left);
        textView.setText(R.string.auction);
        button.setOnClickListener(new a());
        PullToRefreshView pullToRefreshView = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.b = pullToRefreshView;
        pullToRefreshView.setOnHeaderRefreshListener(this);
        this.c = (ListView) findViewById(R.id.lv_auction);
        View inflate = View.inflate(getApplicationContext(), R.layout.auction_header, null);
        this.d = inflate;
        this.f2578e = (ImageView) inflate.findViewById(R.id.iv_gift_image);
        this.f2580g = (TextView) this.d.findViewById(R.id.tv_gift_price);
        this.f2581h = (TextView) this.d.findViewById(R.id.tv_left_time);
        ImageView imageView = (ImageView) this.d.findViewById(R.id.iv_avatar);
        this.f2579f = imageView;
        imageView.setOnClickListener(new b());
        this.a = (WheelView) findViewById(R.id.wv_price);
        this.f2582i = (Button) findViewById(R.id.btn_buy);
        this.c.addHeaderView(this.d);
        this.c.setAdapter((ListAdapter) null);
        this.q.displayImage(this.l, this.f2578e);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.auction);
        this.q = ImageLoader.getInstance(getApplicationContext());
        this.f2583j = getIntent().getIntExtra("fuid", 0);
        this.f2584k = getIntent().getIntExtra("gid", 9999);
        this.l = getIntent().getStringExtra("gift_image");
        init();
        this.b.f();
    }

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        F();
    }

    @Override
    public void refresh(Object... objArr) {
        this.p = false;
        this.b.k();
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
            String str = (String) hashMap.get(com.showself.net.e.o1);
            if (intValue != 10093) {
                if (intValue != 10094) {
                    return;
                }
                if (intValue2 == 0) {
                    this.b.f();
                    Utils.Z0(getApplicationContext(), str);
                    return;
                }
                if (intValue2 == -1400) {
                    Utils.Z0(getApplicationContext(), str);
                    return;
                }
                if (intValue2 == -1500) {
                    Utils.Z0(getApplicationContext(), str);
                    this.b.f();
                    return;
                } else if (intValue2 == -1600) {
                    Utils.Z0(getApplicationContext(), str);
                    this.b.f();
                    return;
                } else {
                    if (intValue2 == -300) {
                        E(str);
                        return;
                    }
                    return;
                }
            }
            if (intValue2 != 0) {
                if (intValue2 == -1200 || intValue2 == -1300) {
                    G(str);
                    return;
                } else {
                    Utils.Z0(getApplicationContext(), str);
                    return;
                }
            }
            this.q.displayImage((String) hashMap.get("auctor_avatar"), this.f2579f);
            this.n = ((Integer) hashMap.get("cost")).intValue();
            this.o = ((Integer) hashMap.get("auctor")).intValue();
            this.f2580g.setText(this.n + getString(R.string.pay_money));
            this.f2581h.setText(Utils.D(((Long) hashMap.get("duration")).longValue()));
            String[] strArr = (String[]) hashMap.get("rate");
            String[] strArr2 = new String[strArr.length];
            int length = strArr.length;
            for (int i2 = 0; i2 < length; i2++) {
                strArr2[i2] = "+ " + strArr[i2] + "  " + getString(R.string.pay_money);
            }
            this.a.setVisibleItems(5);
            this.a.setViewAdapter(new ArrayWheelAdapter(this, strArr2));
            this.a.addChangingListener(new c(strArr));
            this.a.setCurrentItem(0);
            this.m = Integer.parseInt(strArr[0]);
            this.b.setOnTouchListener(new d(this.a.getTop(), this.a.getBottom()));
            this.f2582i.setOnClickListener(new e());
        }
    }
}