Merge pull request #45 from AdrianLxM/disableLoopLabel
Disable loop label
This commit is contained in:
commit
57b032065f
3 changed files with 22 additions and 3 deletions
|
@ -11,6 +11,7 @@ import android.os.Handler;
|
||||||
import android.os.HandlerThread;
|
import android.os.HandlerThread;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -429,9 +430,18 @@ public class OverviewFragment extends Fragment {
|
||||||
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
|
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
|
||||||
if (Config.APS) {
|
if (Config.APS) {
|
||||||
apsModeView.setVisibility(View.VISIBLE);
|
apsModeView.setVisibility(View.VISIBLE);
|
||||||
if (MainApp.getConfigBuilder().isClosedModeEnabled())
|
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
|
||||||
apsModeView.setText(MainApp.sResources.getString(R.string.closedloop));
|
LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
|
||||||
else apsModeView.setText(MainApp.sResources.getString(R.string.openloop));
|
if(activeloop != null && activeloop.isEnabled(activeloop.getType())) {
|
||||||
|
if (MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
|
apsModeView.setText(MainApp.sResources.getString(R.string.closedloop));
|
||||||
|
} else {
|
||||||
|
apsModeView.setText(MainApp.sResources.getString(R.string.openloop));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
apsModeView.setBackgroundResource(R.drawable.loopmodedisabledborder);
|
||||||
|
apsModeView.setText(MainApp.sResources.getString(R.string.disabledloop));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
apsModeView.setVisibility(View.GONE);
|
apsModeView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
7
app/src/main/res/drawable/loopmodedisabledborder.xml
Normal file
7
app/src/main/res/drawable/loopmodedisabledborder.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<solid android:color="@color/colorSetExtendedButton" />
|
||||||
|
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||||
|
<corners
|
||||||
|
android:radius="2dp" >
|
||||||
|
</corners>
|
||||||
|
</shape>
|
|
@ -132,6 +132,8 @@
|
||||||
|
|
||||||
<string name="closedloop">Closed Loop</string>
|
<string name="closedloop">Closed Loop</string>
|
||||||
<string name="openloop">Open Loop</string>
|
<string name="openloop">Open Loop</string>
|
||||||
|
<string name="disabledloop">Loop Disabled</string>
|
||||||
|
|
||||||
<string name="openloop_newsuggestion">New suggestion available</string>
|
<string name="openloop_newsuggestion">New suggestion available</string>
|
||||||
<string name="unsupportedclientver">Unsupported version of NSClient</string>
|
<string name="unsupportedclientver">Unsupported version of NSClient</string>
|
||||||
<string name="nsclientnotinstalled">NSClient not installed. Record lost!</string>
|
<string name="nsclientnotinstalled">NSClient not installed. Record lost!</string>
|
||||||
|
|
Loading…
Reference in a new issue