Admin
2021-02-22 abd45567c3fc695d0f360929b80730cbb61d69c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package safeluck.drive.evaluation.fragment;
 
import android.os.Bundle;
 
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
 
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
 
import me.yokeyword.fragmentation.SupportFragment;
import safeluck.drive.evaluation.R;
 
/**
 * MyApplication2
 * Created by lzw on 2019/3/29. 13:22:38
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class PasswordFragment extends SupportFragment implements View.OnClickListener {
 
 
    private Button btn_sure;
    private Button btn_cancle;
    private EditText editText;
 
    public static SupportFragment newInstance() {
 
 
        PasswordFragment fragment = new PasswordFragment();
        return fragment;
    }
 
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.layout_pwd_fragment, container, false);
        initView(view);
        return view;
    }
 
    private void initView(View view) {
        btn_cancle = view.findViewById(R.id.btn_cancle);
        btn_sure = view.findViewById(R.id.btn_sure);
        editText = view.findViewById(R.id.et_pwd);
        btn_sure.setOnClickListener(this);
        btn_cancle.setOnClickListener(this);
    }
 
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_cancle:
 
          pop();
                break;
            case R.id.btn_sure:
                String pwd = editText.getText().toString().trim();
                if (!TextUtils.isEmpty(pwd) && pwd.equals("1")) {
                    BaseSettingFragment sysSetingFragment = findFragment(BaseSettingFragment.class);
                    if (sysSetingFragment == null) {
                        sysSetingFragment = (BaseSettingFragment) BaseSettingFragment.newInstance();
                    }
                    startWithPop(sysSetingFragment);
                }else{
                    Toast.makeText(_mActivity, "密码错误!!", Toast.LENGTH_SHORT).show();
                }
                break;
            default:
                break;
        }
    }
}