Merge branch 'dev' into history

This commit is contained in:
Milos Kozak 2017-05-12 16:35:07 +02:00
commit c6830baf8f
4 changed files with 447 additions and 2 deletions

View file

@ -58,8 +58,9 @@ public class Constants {
//NSClientInternal //NSClientInternal
public static final int MAX_LOG_LINES = 100; public static final int MAX_LOG_LINES = 100;
//Screen: Threshold for width to go into small width layout //Screen: Threshold for width/height to go into small width/height layout
public static final int SMALL_WIDTH = 320; public static final int SMALL_WIDTH = 320;
public static final int SMALL_HEIGHT = 320;
//Autosens //Autosens
public static final double DEVIATION_TO_BE_EQUAL = 2.0; public static final double DEVIATION_TO_BE_EQUAL = 2.0;

View file

@ -157,6 +157,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
Button quickWizardButton; Button quickWizardButton;
boolean smallWidth; boolean smallWidth;
boolean smallHeight;
private int rangeToDisplay = 6; // for graph private int rangeToDisplay = 6; // for graph
@ -186,9 +188,17 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
final DisplayMetrics dm = new DisplayMetrics(); final DisplayMetrics dm = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
int screen_width = dm.widthPixels; int screen_width = dm.widthPixels;
int screen_height = dm.heightPixels;
smallWidth = screen_width < Constants.SMALL_WIDTH; smallWidth = screen_width < Constants.SMALL_WIDTH;
smallHeight = screen_height < Constants.SMALL_HEIGHT;
View view = inflater.inflate(R.layout.overview_fragment, container, false); View view;
if(smallHeight){
view = inflater.inflate(R.layout.overview_fragment_smallheight, container, false);
} else {
view = inflater.inflate(R.layout.overview_fragment, container, false);
}
bgView = (TextView) view.findViewById(R.id.overview_bg); bgView = (TextView) view.findViewById(R.id.overview_bg);
arrowView = (TextView) view.findViewById(R.id.overview_arrow); arrowView = (TextView) view.findViewById(R.id.overview_arrow);

View file

@ -0,0 +1,407 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.Overview.OverviewFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/overview_buttons">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/overview_notifications"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView>
<LinearLayout
android:id="@+id/overview_looplayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="2dp">
<TextView
android:id="@+id/overview_apsmode"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:text="Open Loop"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/overview_activeprofile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:text="Profile"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/overview_temptarget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:text="TempTarget"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/mdtp_white" />
</LinearLayout>
<LinearLayout
android:id="@+id/overview_pumpstatuslayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="2dp">
<TextView
android:id="@+id/overview_pumpstatus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|center_horizontal"
android:text="@string/initializing"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/overview_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:gravity="center_vertical"
android:text="00.0"
android:textSize="70dp"
android:textStyle="bold" />
<TextView
android:id="@+id/overview_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginTop="-15dp"
android:gravity="center_vertical"
android:paddingLeft="-5dp"
android:paddingRight="-5dp"
android:text="→"
android:textSize="70dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="10dp"
android:gravity="top"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<TextView
android:id="@+id/overview_timeago"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="0.5"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/overview_delta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="0.5"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<TextView
android:id="@+id/overview_avgdelta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/overview_basallayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/overview_runningtemp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="normal|bold" />
<TextView
android:layout_width="20dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/overview_basebasal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<TextView
android:id="@+id/overview_iob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp">
<TextView
android:id="@+id/overview_showprediction_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/predictionshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/prediction"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/prediction" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/basalshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/basal"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/basal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/iob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/iob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showiob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/iob" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/cob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/cob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showcob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/cob" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/dev"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/deviations"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showdeviations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginTop="-9dp"
app:buttonTint="@color/deviations" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="160dip" />
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"
android:layout_width="wrap_content"
android:layout_height="100dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/overview_accepttemplayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/overview_accepttempbutton"
style="?android:attr/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginTop="3dp"
android:layout_weight="0.5"
android:text="Accept new temp\n0.25U/h"
android:textColor="@color/colorAcceptTempButton" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/overview_treatmentbutton"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_marginRight="-4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/icon_bolus"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/overview_bolus_label"
android:textColor="@color/colorTreatmentButton"
android:textSize="10sp" />
<Button
android:id="@+id/overview_wizardbutton"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_marginRight="-4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/icon_calculator"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/overview_calculator_label"
android:textColor="@color/colorCalculatorButton"
android:textSize="10sp" />
<Button
android:id="@+id/overview_calibrationbutton"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_marginRight="-4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/icon_calibration"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/overview_calibration"
android:textColor="@color/colorCalibrationButton"
android:textSize="10sp" />
<Button
android:id="@+id/overview_quickwizardbutton"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_marginRight="-4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/icon_quickwizard"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="Quick wizard"
android:textColor="@color/colorQuickWizardButton"
android:textSize="10sp" />
<Button
android:id="@+id/overview_canceltempbutton"
style="?android:attr/buttonStyle"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:drawableTop="@drawable/icon_cancelbasal"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="Cancel temp basal"
android:textColor="@color/colorCancelTempButton"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
</FrameLayout>

View file

@ -333,4 +333,31 @@
<string name="error_only_numeric_digits_range_allowed">Bitte verwenden Sie nur Ziffern von %1$s - %2$s</string> <string name="error_only_numeric_digits_range_allowed">Bitte verwenden Sie nur Ziffern von %1$s - %2$s</string>
<string name="waitingforpump">Warte auf Pumpe</string> <string name="waitingforpump">Warte auf Pumpe</string>
<string name="wear"></string> <string name="wear"></string>
<string name="alert_dialog_storage_permission_text">Bitte starte dein Telefon neu oder starte AndroidAPS in den System-Einstellungen neu. Anderenfalls hat AndroidAPS kein logging (wichtig zum Nachverfolgen und Verifizieren, dass der Algorithmus korrekt funktioniert)</string>
<string name="always_use_shortavg">Immer das kurze Durchschnitts-Delta statt dem einfachen Delta verwenden</string>
<string name="always_use_shortavg_summary">Sinnvoll, wenn die Daten von einer ungefilterten Quelle Signalrauschen haben.</string>
<string name="androidaps_tempbasalstartnote">Basal Temp Anfang</string>
<string name="approachingdailylimit">Tagesinsulin-Limit wird erreicht.</string>
<string name="basalshortlabel">BR</string>
<string name="calibrationsent">Kalibrierung an xDrip gesendet</string>
<string name="child">Kind</string>
<string name="clear_queue">Warteschlange leeren</string>
<string name="clearlog">Logs leeren</string>
<string name="copied_to_clipboard">In den Zwischenspeicher kopiert</string>
<string name="copy_to_clipboard">In den Zwischenspeicher kopieren</string>
<string name="danar_bluetooth_status">Bluetooth-Status</string>
<string name="danar_stats_cumulative_tdd">Kumulative TDD</string>
<string name="danar_stats_date">Datum</string>
<string name="danar_stats_expweight">Exponentiell Gewichtete TDD</string>
<string name="danar_stats_olddata_Message">Veraltete Daten \"Reload\"</string>
<string name="xdripstatus_shortname">xds</string>
<string name="xdripstatus">xDrip Statuszeile (Uhr)</string>
<string name="xdripstatus_settings">xDrip Status (Uhr)</string>
<string name="xdripnotinstalled">xDrip+ nicht installiert</string>
<string name="wear_showbgi_title">Zeige BGI</string>
<string name="wear_showbgi_summary">Füge BGI zur Statuszeile hinzu</string>
<string name="wear_settings">Wear Einstellungen</string>
<string name="wear_detailedIOB_title">Zeige detailliertes IOB</string>
<string name="wear_detailedIOB_summary">Trenne IOB in Bolus- und Basal-IOB auf dem Watchface</string>
<string name="wrongpassword">Falsches Passwort</string>
</resources> </resources>