App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

DebugToolDialogFragment.java
Go to the documentation of this file.
1 package mhr.app.debug;
2
3 import mhr.app.AppMainActivity;
4 import mhr.app.R;
5 import mhr.appandroid.feedback.APDFeedback;
6 import mhr.appcore.commands.AppCommand;
7 import android.app.Fragment;
8 import android.os.Bundle;
9 import android.view.LayoutInflater;
10 import android.view.View;
11 import android.view.View.OnClickListener;
12 import android.view.ViewGroup;
13 import android.widget.TextView;
14 import android.widget.Toast;
15
16 public class DebugToolDialogFragment extends Fragment implements OnClickListener {
17
18 protected View root;
19 protected AppMainActivity activity;
20
21 @Override
22 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
23 View v = inflater.inflate(R.layout.fragment_debug_tool_dialog, container, false);
24 root = v;
25 return v;
26 }
27
28 @Override
29 public void onActivityCreated(Bundle savedInstanceState) {
30 super.onActivityCreated(savedInstanceState);
31 activity = (AppMainActivity) getActivity();
32 root.findViewById(R.id.DebugToolDialogDismissBtn).setOnClickListener(this);
33 root.findViewById(R.id.GetDumpBtn).setOnClickListener(this);
34 }
35
36 public void onClick(View v) {
37 int id = v.getId();
38 switch (id) {
39 case R.id.DebugToolDialogDismissBtn:
40 activity.dismissDialog();
41 break;
42 case R.id.GetDumpBtn:
43 getDump();
44 default:
45 break;
46 }
47 }
48
49 protected void getDump() {
50 TextView d = (TextView) root.findViewById(R.id.DumpTV);
51 d.setText(activity.getAppCore().getDump());
52 return;
53 }
54 }