Merge pull request #1038 from jotomo/upstreaming
[Polish] Dialog/color consistency, translations and other small stuff
This commit is contained in:
commit
66e50f5b62
19 changed files with 96 additions and 53 deletions
|
@ -44,7 +44,7 @@ def generateGitBuild = { ->
|
|||
stringBuilder.append('NoGitSystemAvailable')
|
||||
}
|
||||
stringBuilder.append('-')
|
||||
stringBuilder.append((new Date()).format('yyyy.MM.dd'))
|
||||
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
|
||||
stringBuilder.append('"')
|
||||
return stringBuilder.toString()
|
||||
}
|
||||
|
|
|
@ -179,10 +179,10 @@ public class FillDialog extends DialogFragment implements OnClickListener {
|
|||
}
|
||||
|
||||
if (pumpSiteChangeCheckbox.isChecked())
|
||||
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.high) + "'>" + MainApp.gs(R.string.record_pump_site_change) + "</font>");
|
||||
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.actionsConfirm) + "'>" + MainApp.gs(R.string.record_pump_site_change) + "</font>");
|
||||
|
||||
if (insulinCartridgeChangeCheckbox.isChecked())
|
||||
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.high) + "'>" + MainApp.gs(R.string.record_insulin_cartridge_change) + "</font>");
|
||||
confirmMessage.add("" + "<font color='" + MainApp.gc(R.color.actionsConfirm) + "'>" + MainApp.gs(R.string.record_insulin_cartridge_change) + "</font>");
|
||||
|
||||
final String notes = notesEdit.getText().toString();
|
||||
if (!notes.isEmpty()) {
|
||||
|
|
|
@ -303,21 +303,21 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C
|
|||
if (currentProfile.getUnits().equals(Constants.MMOL)) {
|
||||
unitLabel = "mmol/l";
|
||||
}
|
||||
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to1Decimal(activityTT) + " " + unitLabel + " (" + activityTTDuration + " min)</font>");
|
||||
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to1Decimal(activityTT) + " " + unitLabel + " (" + activityTTDuration + " min)</font>");
|
||||
}
|
||||
if (startEatingSoonTTCheckbox.isChecked()) {
|
||||
if (currentProfile.getUnits().equals(Constants.MMOL)) {
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to1Decimal(eatingSoonTT) + " mmol/l (" + eatingSoonTTDuration + " min)</font>");
|
||||
} else
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to0Decimal(eatingSoonTT) + " mg/dl (" + eatingSoonTTDuration + " min)</font>");
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to1Decimal(eatingSoonTT) + " mmol/l (" + eatingSoonTTDuration + " min)</font>");
|
||||
} else {
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to0Decimal(eatingSoonTT) + " mg/dl (" + eatingSoonTTDuration + " min)</font>");
|
||||
}
|
||||
}
|
||||
if (startHypoTTCheckbox.isChecked()) {
|
||||
if (currentProfile.getUnits().equals(Constants.MMOL)) {
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to1Decimal(hypoTT) + " mmol/l (" + hypoTTDuration + " min)</font>");
|
||||
} else
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to0Decimal(hypoTT) + " mg/dl (" + hypoTTDuration + " min)</font>");
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to1Decimal(hypoTT) + " mmol/l (" + hypoTTDuration + " min)</font>");
|
||||
} else {
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to0Decimal(hypoTT) + " mg/dl (" + hypoTTDuration + " min)</font>");
|
||||
}
|
||||
}
|
||||
|
||||
int timeOffset = editTime.getValue().intValue();
|
||||
|
|
|
@ -217,9 +217,9 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener
|
|||
|
||||
if (startEatingSoonTTCheckbox.isChecked()) {
|
||||
if (currentProfile.getUnits().equals(Constants.MMOL)) {
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to1Decimal(eatingSoonTT) + " mmol/l (" + eatingSoonTTDuration + " min)</font>");
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to1Decimal(eatingSoonTT) + " mmol/l (" + eatingSoonTTDuration + " min)</font>");
|
||||
} else
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.high) + "'>" + DecimalFormatter.to0Decimal(eatingSoonTT) + " mg/dl (" + eatingSoonTTDuration + " min)</font>");
|
||||
actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "<font color='" + MainApp.gc(R.color.tempTargetConfirmation) + "'>" + DecimalFormatter.to0Decimal(eatingSoonTT) + " mg/dl (" + eatingSoonTTDuration + " min)</font>");
|
||||
}
|
||||
|
||||
int timeOffset = editTime.getValue().intValue();
|
||||
|
|
|
@ -7,6 +7,12 @@ package info.nightscout.utils;
|
|||
public class T {
|
||||
private long time; // in msec
|
||||
|
||||
public static T now() {
|
||||
T t = new T();
|
||||
t.time = System.currentTimeMillis();
|
||||
return t;
|
||||
}
|
||||
|
||||
public static T msecs(long msec) {
|
||||
T t = new T();
|
||||
t.time = msec;
|
||||
|
@ -56,4 +62,12 @@ public class T {
|
|||
public long days() {
|
||||
return time / 24 / 60 / 60 / 1000L;
|
||||
}
|
||||
|
||||
public T plus(T plus) {
|
||||
return T.msecs(time + plus.time);
|
||||
}
|
||||
|
||||
public T minus(T minus) {
|
||||
return T.msecs(time - minus.time);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,27 +11,24 @@
|
|||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/icon_cp_pump_canula" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/primefill"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/colorInsulinButton" />
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
|
@ -20,10 +20,16 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="10dp"
|
||||
android:text="@string/overview_calibration_bg_label"
|
||||
android:text="@string/overview_calibration"
|
||||
android:textColor="@color/colorCalibrationButton"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/icon_calibration" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_calibration_units"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -20,28 +20,25 @@
|
|||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_cp_bolus_carbs" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/carbs"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/colorCarbsButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -17,26 +17,23 @@
|
|||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_bolus" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textAlignment="center"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/overview_insulin_label"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/colorInsulinButton" />
|
||||
|
@ -59,7 +56,7 @@
|
|||
android:id="@+id/newinsulin_record_only"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/don_t_bolus_record_only" />
|
||||
android:text="@string/do_not_bolus_record_only" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -124,6 +121,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/insulin_unit_shortname" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
android:id="@+id/newtreatment_record_only"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/don_t_bolus_record_only" />
|
||||
android:text="@string/do_not_bolus_record_only" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -810,7 +810,7 @@
|
|||
<string name="data_choices">Избор на данни</string>
|
||||
<string name="allow_automated_crash_reporting">Позволява автоматично изпращане на данни за грешки и статистически данни до разработчиците чрез fabric.io service.</string>
|
||||
<string name="g5appnotdetected">Моля обновете G5 приложението до поддържана версия.</string>
|
||||
<string name="don_t_bolus_record_only">Не доставяй болус, само запис</string>
|
||||
<string name="do_not_bolus_record_only">Не доставяй болус, само запис</string>
|
||||
<string name="category">Категория</string>
|
||||
<string name="subcategory">Подкатегория</string>
|
||||
<string name="bolusrecordedonly">Болусът ще бъде само записан</string>
|
||||
|
|
|
@ -810,7 +810,7 @@
|
|||
<string name="start_eating_soon_tt">Spustit Dočasný cíl Blížící se jídlo</string>
|
||||
<string name="temptargetshort">DoCíl</string>
|
||||
<string name="insight_min">min</string>
|
||||
<string name="don_t_bolus_record_only">Nepouštět bolus, jen zaznamenat</string>
|
||||
<string name="do_not_bolus_record_only">Nepouštět bolus, jen zaznamenat</string>
|
||||
<string name="subcategory">Podkategorie</string>
|
||||
<string name="category">Kategorie</string>
|
||||
<string name="bolusrecordedonly">Bolus bude pouze zaznamenán</string>
|
||||
|
|
|
@ -797,4 +797,6 @@
|
|||
<string name="connectionsettings_title">Verbindungs-Einstellungen</string>
|
||||
<string formatted="false" name="objectivenotstarted">Zielsetzung %d nicht gestartet</string>
|
||||
<string formatted="false" name="objectivenotfinished">Zielsetzung %d nicht abgeschlossen</string>
|
||||
<string name="do_not_bolus_record_only">Bolus nur erfassen</string>
|
||||
<string name="bolusrecordedonly">Bolus wird nur erfasst</string>
|
||||
</resources>
|
||||
|
|
|
@ -744,7 +744,7 @@
|
|||
<string name="bolusrecordedonly">El Bolo solo será anotado</string>
|
||||
<string name="category">Categoría</string>
|
||||
<string name="subcategory">Subcategoría</string>
|
||||
<string name="don_t_bolus_record_only">No administrar Bolo, solo anotar</string>
|
||||
<string name="do_not_bolus_record_only">No administrar Bolo, solo anotar</string>
|
||||
<string name="insight_min">min</string>
|
||||
<string name="temptargetshort">TT</string>
|
||||
<string name="start_activity_tt">Inicio TT Actividad</string>
|
||||
|
|
|
@ -835,7 +835,7 @@
|
|||
<string name="start_activity_tt">Rozpocznij TT Ćwiczenia</string>
|
||||
<string name="start_eating_soon_tt">Rozpocznij TT WkrótcePosiłek</string>
|
||||
<string name="temptargetshort">TT</string>
|
||||
<string name="don_t_bolus_record_only">Nie podawaj bolusa, tylko zapisz rekord</string>
|
||||
<string name="do_not_bolus_record_only">Nie podawaj bolusa, tylko zapisz rekord</string>
|
||||
<string name="category">Kategoria</string>
|
||||
<string name="subcategory">Podkategoria</string>
|
||||
<string name="bolusrecordedonly">Bolus zostanie tylko zapisany w rekordach</string>
|
||||
|
|
|
@ -813,7 +813,7 @@
|
|||
<string name="g5appnotdetected">Vänligen uppdatera din G5-app till en supportad version</string>
|
||||
<string name="start_activity_tt">Starta \"Träning\"</string>
|
||||
<string name="start_eating_soon_tt">Starta \"Äta snart\"</string>
|
||||
<string name="don_t_bolus_record_only">Ge ingen bolus, logga bara</string>
|
||||
<string name="do_not_bolus_record_only">Ge ingen bolus, logga bara</string>
|
||||
<string name="category">Kategori</string>
|
||||
<string name="subcategory">Underkategori</string>
|
||||
<string name="bolusrecordedonly">Bolusen sparas bara i loggboken</string>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<color name="inrange">#00FF00</color>
|
||||
<color name="low">#FF0000</color>
|
||||
<color name="high">#FFFF00</color>
|
||||
<color name="actionsConfirm">#FFFF00</color>
|
||||
<color name="listdelimiter">#505050</color>
|
||||
<color name="tabBgColor">#f0003f59</color>
|
||||
<color name="tabBgColorSelected">#FF33B5E5</color>
|
||||
|
@ -28,6 +29,7 @@
|
|||
<color name="defaultbackground">#424242</color>
|
||||
|
||||
<color name="tempTargetBackground">#77dd77</color>
|
||||
<color name="tempTargetConfirmation">#77dd77</color>
|
||||
<color name="tempTargetDisabledBackground">#303F9F</color>
|
||||
|
||||
|
||||
|
|
|
@ -923,7 +923,7 @@
|
|||
<string name="start_activity_tt">Start Activity TT</string>
|
||||
<string name="start_eating_soon_tt">Start Eating soon TT</string>
|
||||
<string name="temptargetshort">TT</string>
|
||||
<string name="don_t_bolus_record_only">Don\'t bolus, record only</string>
|
||||
<string name="do_not_bolus_record_only">Do not bolus, record only</string>
|
||||
<string name="category">Category</string>
|
||||
<string name="subcategory">Subcategory</string>
|
||||
<string name="bolusrecordedonly">Bolus will be recorded only</string>
|
||||
|
|
|
@ -9,11 +9,11 @@ import org.powermock.modules.junit4.PowerMockRunner;
|
|||
* Created by mike on 26.03.2018.
|
||||
*/
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
//@RunWith(PowerMockRunner.class)
|
||||
public class TTest {
|
||||
|
||||
@Test
|
||||
public void doTests() {
|
||||
public void toUnits() {
|
||||
Assert.assertEquals(1, T.msecs(1000).secs());
|
||||
Assert.assertEquals(1, T.secs(60).mins());
|
||||
Assert.assertEquals(1, T.mins(60).hours());
|
||||
|
@ -21,4 +21,31 @@ public class TTest {
|
|||
Assert.assertEquals(24, T.days(1).hours());
|
||||
Assert.assertEquals(60000, T.mins(1).msecs());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void now() {
|
||||
Assert.assertTrue(Math.abs(T.now().msecs() - System.currentTimeMillis()) < 5000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void additions() {
|
||||
long nowMsecs = System.currentTimeMillis();
|
||||
T now = T.msecs(nowMsecs);
|
||||
|
||||
Assert.assertEquals(now.plus(T.secs(5)).msecs(), nowMsecs + 5 * 1000);
|
||||
Assert.assertEquals(now.plus(T.mins(5)).msecs(), nowMsecs + 5 * 60 * 1000);
|
||||
Assert.assertEquals(now.plus(T.hours(5)).msecs(), nowMsecs + 5 * 60 * 60 * 1000);
|
||||
Assert.assertEquals(now.plus(T.days(5)).msecs(), nowMsecs + 5 * 24 * 60 * 60 * 1000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void subtractions() {
|
||||
long nowMsecs = System.currentTimeMillis();
|
||||
T now = T.msecs(nowMsecs);
|
||||
|
||||
Assert.assertEquals(now.minus(T.secs(5)).msecs(), nowMsecs - 5 * 1000);
|
||||
Assert.assertEquals(now.minus(T.mins(5)).msecs(), nowMsecs - 5 * 60 * 1000);
|
||||
Assert.assertEquals(now.minus(T.hours(5)).msecs(), nowMsecs - 5 * 60 * 60 * 1000);
|
||||
Assert.assertEquals(now.minus(T.days(5)).msecs(), nowMsecs - 5 * 24 * 60 * 60 * 1000);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue