diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java index c5d2188..3147522 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java @@ -369,13 +369,12 @@ public class GeofavoriteDetailActivity extends AppCompatActivity implements Loca } public void setAccuracy(float accuracy) { + // Display accuracy in meters binding.accuracyTv.setText(getString(R.string.accuracy).replace("{accuracy}", ((int)accuracy) + "")); - // Color the accuracy background with a scale from red (MINIMUM_ACCEPTABLE_ACCURACY) to green (0 meters) - float red = accuracy / MINIMUM_ACCEPTABLE_ACCURACY; - if (red > 1.0f) red = 1.0f; - float green = 1.0f - red; - if (Build.VERSION.SDK_INT >= 26) - binding.accuracyTv.setBackgroundColor(Color.rgb(red, green, 0.0f)); + // Display accuracy in progress bar + int accuracyPercent = (int)accuracy > 100 ? 0 : Math.abs((int)accuracy - 100); + binding.accuracyProgress.setIndeterminate(false); + binding.accuracyProgress.setProgress(accuracyPercent); } public void setCategories(HashSet categories) { diff --git a/app/src/main/res/drawable/ic_accuracy_fail.xml b/app/src/main/res/drawable/ic_accuracy_fail.xml new file mode 100644 index 0000000..43912e0 --- /dev/null +++ b/app/src/main/res/drawable/ic_accuracy_fail.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_accuracy_ok.xml b/app/src/main/res/drawable/ic_accuracy_ok.xml new file mode 100644 index 0000000..b050330 --- /dev/null +++ b/app/src/main/res/drawable/ic_accuracy_ok.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_geofavorite_detail.xml b/app/src/main/res/layout/activity_geofavorite_detail.xml index 45db2d7..47dbd16 100644 --- a/app/src/main/res/layout/activity_geofavorite_detail.xml +++ b/app/src/main/res/layout/activity_geofavorite_detail.xml @@ -89,15 +89,42 @@ android:orientation="vertical" android:padding="20dp"> + + + + + + + android:text="@string/accuracy_nosignal" + android:textColor="@color/defaultBrand"/> + app:tint="@color/defaultBrand"/> + app:tint="@color/defaultBrand"/> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3d8cb8f..a18c9c4 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -56,6 +56,7 @@ Categoria Coordinate Accuratezza: {accuracy} m + Nessun segnale GPS! Per creare un geosegnalibro รจ necessario consentire l\'accesso alla posizione. Salva Impossibile salvare il geosegnalibro diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 76c623d..90836a0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -25,14 +25,16 @@ #550082C9 @android:color/white #202124 + #666666 + #333333 - #666666 + @color/disabled @color/defaultBrand - #666666 + @color/disabled #fff diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 420c207..16c1486 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -55,6 +55,7 @@ Category Coordinates Accuracy: {accuracy} m + No GPS signal! Location permission is required to create a geofavorite. Save Unable to save geofavorite