diff options
author | cyBerta <richy@cyborgsociety.org> | 2013-12-04 21:40:26 +0100 |
---|---|---|
committer | cyBerta <richy@cyborgsociety.org> | 2013-12-04 21:40:26 +0100 |
commit | a651099981ddc9ed5c17a25b2bb618b161cec048 (patch) | |
tree | e7fc5efa9b2ac6848ccf3cca1a8e57cb03e970b8 /src/se/leap/bitmaskclient/EipServiceFragment.java | |
parent | 853d2aac3a1b5f532695d8daa0cba2c4787d8aa7 (diff) | |
parent | 6f31f91a82f9822a34ae55c5275130d23be29f4b (diff) |
Merge branch 'develop' of ssh://leap.se:22/bitmask_android into develop
Diffstat (limited to 'src/se/leap/bitmaskclient/EipServiceFragment.java')
-rw-r--r-- | src/se/leap/bitmaskclient/EipServiceFragment.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/se/leap/bitmaskclient/EipServiceFragment.java b/src/se/leap/bitmaskclient/EipServiceFragment.java index 4d778b1a..e182b3fd 100644 --- a/src/se/leap/bitmaskclient/EipServiceFragment.java +++ b/src/se/leap/bitmaskclient/EipServiceFragment.java @@ -12,6 +12,7 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.ResultReceiver; +import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -38,6 +39,9 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli private EIPReceiver mEIPReceiver; + + public static String TAG = "se.leap.bitmask.EipServiceFragment"; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -57,6 +61,8 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli eipStatus.setOnClickListener(this); eipSwitch = (Switch) eipFragment.findViewById(R.id.eipSwitch); + + eipSwitch.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { @@ -66,6 +72,7 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli }); eipSwitch.setOnCheckedChangeListener(this); + return eipFragment; } @@ -152,6 +159,8 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli eipAutoSwitched = true; } + + /** * Send a command to EIP * @@ -186,15 +195,14 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli statusMessage = getString(R.string.eip_state_connected); getActivity().findViewById(R.id.eipProgress).setVisibility(View.GONE); mEipStartPending = false; - } else if ( (state.equals("NOPROCESS") && !mEipStartPending ) || state.equals("EXITING")) { + } else if ( (state.equals("NOPROCESS") && !mEipStartPending ) || state.equals("EXITING") || state.equals("FATAL")) { statusMessage = getString(R.string.eip_state_not_connected); getActivity().findViewById(R.id.eipProgress).setVisibility(View.GONE); mEipStartPending = false; switchState = false; } else if (state.equals("NOPROCESS")){ statusMessage = logmessage; - } - else { + } else { statusMessage = prefix + " " + logmessage; } @@ -207,6 +215,7 @@ public class EipServiceFragment extends Fragment implements StateListener, OnCli }); } + /** * Inner class for handling messages related to EIP status and control requests * |