导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui.show;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.showself.ui.EditActivity;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.tencent.tauth.AuthActivity;
import java.util.HashMap;

public class ShowSettingActivity extends com.showself.ui.c implements View.OnClickListener {
    private Button a;
    private boolean b = false;
    private String c;
    private String d;

    private int f3287e;

    private TextView f3288f;

    private TextView f3289g;

    private void A(int i2) {
        findViewById(R.id.iv_arrow1).setVisibility(i2);
        findViewById(R.id.iv_arrow2).setVisibility(i2);
    }

    private void B() {
        this.f3288f.setText(this.c);
        this.f3289g.setText(this.d);
    }

    private void z() {
        HashMap hashMap = new HashMap();
        hashMap.put("roomid", Integer.valueOf(this.f3287e));
        hashMap.put("fuid", Integer.valueOf(r0.y(getApplicationContext()).getUserId()));
        hashMap.put(AuthActivity.ACTION_KEY, 21);
        hashMap.put("note", this.c);
        hashMap.put("note1", this.d);
        addTask(new com.showself.service.f(20004, hashMap), this);
    }

    @Override
    public void finish() {
        Intent intent = new Intent();
        intent.putExtra("notice", this.c);
        intent.putExtra("greetings", this.d);
        setResult(-1, intent);
        super.finish();
    }

    @Override
    public void init() {
        findViewById(R.id.layout1).setOnClickListener(this);
        findViewById(R.id.layout2).setOnClickListener(this);
        ((TextView) findViewById(R.id.tv_nav_title)).setText("设置");
        findViewById(R.id.btn_nav_left).setOnClickListener(this);
        Button button = (Button) findViewById(R.id.btn_nav_right);
        this.a = button;
        button.setText(getString(R.string.edit_profile));
        this.a.setOnClickListener(this);
        this.a.setVisibility(0);
        this.f3288f = (TextView) findViewById(R.id.tv_value1);
        this.f3289g = (TextView) findViewById(R.id.tv_value2);
        B();
    }

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        if (i3 == -1) {
            if (i2 == 200) {
                this.d = intent.getStringExtra("edit");
            }
            if (i2 == 100) {
                this.c = intent.getStringExtra("edit");
            }
            B();
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_nav_left:
                finish();
                break;
            case R.id.btn_nav_right:
                if (this.b) {
                    A(8);
                    this.a.setText(getString(R.string.edit_profile));
                    z();
                } else {
                    A(0);
                    this.a.setText(R.string.finish);
                }
                this.b = !this.b;
                break;
            case R.id.layout1:
                if (this.b) {
                    Intent intent = new Intent((Context) this, (Class<?>) EditActivity.class);
                    intent.putExtra("title", "公告");
                    intent.putExtra("context", this.c);
                    intent.putExtra("editnum", 30);
                    intent.putExtra("hint", "快给你的粉丝写一条房间公告吧(5-30个字)");
                    startActivityForResult(intent, 100);
                    break;
                }
                break;
            case R.id.layout2:
                if (this.b) {
                    Intent intent2 = new Intent((Context) this, (Class<?>) EditActivity.class);
                    intent2.putExtra("title", "欢迎语");
                    intent2.putExtra("context", this.d);
                    intent2.putExtra("editnum", 50);
                    intent2.putExtra("hint", "给每个新进房间的粉丝写上自己的个性欢迎语吧!!(5-50个字)");
                    startActivityForResult(intent2, 200);
                    break;
                }
                break;
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.show_set_layout);
        this.c = getIntent().getStringExtra("notice");
        this.d = getIntent().getStringExtra("greetings");
        this.f3287e = getIntent().getIntExtra("roomid", 0);
        init();
    }

    @Override
    public void refresh(Object... objArr) {
        com.showself.service.g.i(this);
        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 != 20004) {
                return;
            }
            if (intValue2 == com.showself.net.e.m1) {
                Intent intent = new Intent();
                intent.putExtra("notice", this.c);
                intent.putExtra("greetings", this.d);
                setResult(-1, intent);
            }
            Utils.Z0(this, str);
        }
    }
}