Merge pull request #45 from AdrianLxM/disableLoopLabel

Disable loop label
This commit is contained in:
Milos Kozak 2016-11-02 22:20:48 +01:00 committed by GitHub
commit 57b032065f
3 changed files with 22 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
@ -429,9 +430,18 @@ public class OverviewFragment extends Fragment {
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
if (Config.APS) {
apsModeView.setVisibility(View.VISIBLE);
if (MainApp.getConfigBuilder().isClosedModeEnabled())
apsModeView.setText(MainApp.sResources.getString(R.string.closedloop));
else apsModeView.setText(MainApp.sResources.getString(R.string.openloop));
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
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 {
apsModeView.setVisibility(View.GONE);
}

View 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>

View file

@ -132,6 +132,8 @@
<string name="closedloop">Closed Loop</string>
<string name="openloop">Open Loop</string>
<string name="disabledloop">Loop Disabled</string>
<string name="openloop_newsuggestion">New suggestion available</string>
<string name="unsupportedclientver">Unsupported version of NSClient</string>
<string name="nsclientnotinstalled">NSClient not installed. Record lost!</string>