android: Properly hide the IMC state fragment initially
This commit is contained in:
@@ -62,6 +62,8 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
|
|||||||
Context context = getActivity().getApplicationContext();
|
Context context = getActivity().getApplicationContext();
|
||||||
context.bindService(new Intent(context, VpnStateService.class),
|
context.bindService(new Intent(context, VpnStateService.class),
|
||||||
mServiceConnection, Service.BIND_AUTO_CREATE);
|
mServiceConnection, Service.BIND_AUTO_CREATE);
|
||||||
|
/* hide it initially */
|
||||||
|
getFragmentManager().beginTransaction().hide(this).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +97,6 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
|
|||||||
public void updateView()
|
public void updateView()
|
||||||
{
|
{
|
||||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||||
ft.show(this);
|
|
||||||
|
|
||||||
switch (mService.getImcState())
|
switch (mService.getImcState())
|
||||||
{
|
{
|
||||||
@@ -106,10 +107,12 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
|
|||||||
case ISOLATE:
|
case ISOLATE:
|
||||||
mStateView.setText(R.string.imc_state_isolate);
|
mStateView.setText(R.string.imc_state_isolate);
|
||||||
mStateView.setTextColor(getResources().getColor(R.color.warning_text));
|
mStateView.setTextColor(getResources().getColor(R.color.warning_text));
|
||||||
|
ft.show(this);
|
||||||
break;
|
break;
|
||||||
case BLOCK:
|
case BLOCK:
|
||||||
mStateView.setText(R.string.imc_state_block);
|
mStateView.setText(R.string.imc_state_block);
|
||||||
mStateView.setTextColor(getResources().getColor(R.color.error_text));
|
mStateView.setTextColor(getResources().getColor(R.color.error_text));
|
||||||
|
ft.show(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ft.commit();
|
ft.commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user