导航菜单

页面标题

页面副标题

自健身 v3.3.4 - FamilyAccountSubPageActivity.java 源代码

正在查看: 自健身 v3.3.4 应用的 FamilyAccountSubPageActivity.java JAVA 源代码文件

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


package com.mu.gymtrain.Activity;

import android.app.Dialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.OnClick;
import com.google.android.material.tabs.TabLayout;
import com.mu.gymtrain.Adapter.ConsumeTabsAdapter;
import com.mu.gymtrain.Base.BaseActivity;
import com.mu.gymtrain.R;
import com.mu.gymtrain.Utils.WindowUtils;

public class FamilyAccountSubPageActivity extends BaseActivity {
    private ConsumeTabsAdapter mAdapter;

    @BindView(R.id.title_middle)
    TextView mTitleMiddle;

    @BindView(R.id.tab)
    TabLayout tab;

    @BindView(R.id.viewPager)
    ViewPager viewPager;

    public int getContentLayout() {
        return R.layout.activity_family_sub_page_layout;
    }

    public void initData() {
    }

    public void initView() {
        if (this.mAdapter == null) {
            this.mAdapter = new ConsumeTabsAdapter(getSupportFragmentManager());
        }
        this.viewPager.setAdapter(this.mAdapter);
        this.viewPager.setOffscreenPageLimit(this.mAdapter.getCount());
        this.viewPager.setCurrentItem(0);
        this.tab.setupWithViewPager(this.viewPager);
    }

    @OnClick({R.id.title_left, R.id.tvRight})
    public void onViewClicked(View view) {
        int id = view.getId();
        if (id == 2131297253) {
            finish();
        } else {
            if (id != 2131297402) {
                return;
            }
            showDialog();
        }
    }

    private void showDialog() {
        View inflate = LayoutInflater.from(this).inflate(R.layout.dialog_add_family_sub_member_layout, (ViewGroup) null, false);
        final Dialog dialog = new Dialog(this, R.style.progress_dialog);
        dialog.setContentView(inflate);
        Window window = dialog.getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        double wIndowWidth = WindowUtils.getWIndowWidth(this);
        Double.isNaN(wIndowWidth);
        attributes.width = (int) (wIndowWidth * 0.7d);
        attributes.height = -2;
        window.setGravity(17);
        dialog.setCancelable(true);
        inflate.findViewById(R.id.tvSure).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        inflate.findViewById(R.id.tvCancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
        dialog.setCanceledOnTouchOutside(false);
        dialog.show();
    }
}