|
10 | 10 |
|
11 | 11 | import org.qpython.qpy.R; |
12 | 12 | //import org.qpython.qpy.databinding.DialogLogoBinding; |
| 13 | +import org.qpython.qpy.databinding.DialogLogoBinding; |
13 | 14 | import org.qpython.qpy.main.activity.HomeMainActivity; |
14 | 15 | import org.qpython.qpy.main.utils.Bus; |
15 | 16 |
|
16 | 17 | public class LogoDialog extends DialogFragment { |
17 | 18 | public static final String TAG = "LogoDialog"; |
18 | | - //private DialogLogoBinding mBinding; |
| 19 | + private DialogLogoBinding mBinding; |
19 | 20 |
|
20 | 21 | public static LogoDialog newInstance() { |
21 | 22 | return new LogoDialog(); |
22 | 23 | } |
23 | 24 |
|
24 | | -// @Nullable |
25 | | -// @Override |
26 | | -// public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
27 | | -// mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_logo, container, false); |
28 | | -// |
29 | | -// mBinding.btnQrcode.setOnClickListener(v -> { |
30 | | -// Bus.getDefault().post(new HomeMainActivity.StartQrCodeActivityEvent()); |
31 | | -// dismiss(); |
32 | | -// }); |
33 | | -// mBinding.btnScript.setOnClickListener(v -> { |
34 | | -// Bus.getDefault().post(new HomeMainActivity.ShowProgramDialogEvent(false)); |
35 | | -// dismiss(); |
36 | | -// }); |
37 | | -// mBinding.btnProject.setOnClickListener(v -> { |
38 | | -// Bus.getDefault().post(new HomeMainActivity.ShowProgramDialogEvent(true)); |
39 | | -// dismiss(); |
40 | | -// }); |
41 | | -// |
42 | | -// return mBinding.getRoot(); |
43 | | -// } |
| 25 | + @Nullable |
| 26 | + @Override |
| 27 | + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 28 | + mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_logo, container, false); |
| 29 | + |
| 30 | + mBinding.btnQrcode.setOnClickListener(v -> { |
| 31 | + Bus.getDefault().post(new HomeMainActivity.StartQrCodeActivityEvent()); |
| 32 | + dismiss(); |
| 33 | + }); |
| 34 | + mBinding.btnScript.setOnClickListener(v -> { |
| 35 | + Bus.getDefault().post(new HomeMainActivity.ShowProgramDialogEvent(false)); |
| 36 | + dismiss(); |
| 37 | + }); |
| 38 | + mBinding.btnProject.setOnClickListener(v -> { |
| 39 | + Bus.getDefault().post(new HomeMainActivity.ShowProgramDialogEvent(true)); |
| 40 | + dismiss(); |
| 41 | + }); |
| 42 | + |
| 43 | + return mBinding.getRoot(); |
| 44 | + } |
44 | 45 | } |
0 commit comments