mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-02-09 18:44:43 +00:00
This commit is contained in:
parent
56455fc89d
commit
5c95fd29c9
1 changed files with 5 additions and 1 deletions
|
@ -24,6 +24,7 @@ import com.nutomic.syncthingandroid.http.ImageGetRequest;
|
|||
import com.nutomic.syncthingandroid.service.Constants;
|
||||
import com.nutomic.syncthingandroid.service.RestApi;
|
||||
import com.nutomic.syncthingandroid.service.SyncthingService;
|
||||
import com.nutomic.syncthingandroid.util.Util;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
|
@ -59,6 +60,8 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi
|
|||
private MainActivity mActivity;
|
||||
private SharedPreferences sharedPreferences = null;
|
||||
|
||||
private Boolean mRunningOnTV = false;
|
||||
|
||||
@Override
|
||||
public void onServiceStateChange(SyncthingService.State currentState) {
|
||||
mServiceState = currentState;
|
||||
|
@ -88,6 +91,7 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi
|
|||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
mActivity = (MainActivity) getActivity();
|
||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mActivity);
|
||||
mRunningOnTV = Util.isRunningOnTV(mActivity);
|
||||
|
||||
mVersion = view.findViewById(R.id.version);
|
||||
mDrawerActionShowQrCode = view.findViewById(R.id.drawerActionShowQrCode);
|
||||
|
@ -130,7 +134,7 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi
|
|||
mVersion.setVisibility(View.VISIBLE);
|
||||
mDrawerActionShowQrCode.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE);
|
||||
mDrawerRecentChanges.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE);
|
||||
mDrawerActionWebGui.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE);
|
||||
mDrawerActionWebGui.setVisibility((syncthingRunning && !mRunningOnTV) ? View.VISIBLE : View.GONE);
|
||||
mDrawerActionRestart.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE);
|
||||
mDrawerTipsAndTricks.setVisibility(View.VISIBLE);
|
||||
mDrawerActionExit.setVisibility(View.VISIBLE);
|
||||
|
|
Loading…
Reference in a new issue