diff --git a/sensorhub-android-app/res/color/bottom_nav_selector.xml b/sensorhub-android-app/res/color/bottom_nav_selector.xml index 68a6dc2..32651b2 100644 --- a/sensorhub-android-app/res/color/bottom_nav_selector.xml +++ b/sensorhub-android-app/res/color/bottom_nav_selector.xml @@ -1,5 +1,5 @@ - - + + diff --git a/sensorhub-android-app/res/layout/activity_edit_server_profile.xml b/sensorhub-android-app/res/layout/activity_edit_server_profile.xml index 87f7256..b819919 100644 --- a/sensorhub-android-app/res/layout/activity_edit_server_profile.xml +++ b/sensorhub-android-app/res/layout/activity_edit_server_profile.xml @@ -36,7 +36,7 @@ app:cardCornerRadius="@dimen/card_corner_radius" app:cardElevation="0dp" app:strokeColor="@color/md_theme_outline" - app:strokeWidth="1dp"> + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> + app:cardBackgroundColor="@color/dialog_bg"> @@ -36,7 +36,7 @@ android:layout_height="24dp" android:layout_marginStart="8dp" android:src="@drawable/ic_expand_more" - app:tint="@color/md_theme_onSurfaceVariant" + app:tint="@android:color/white" android:contentDescription="Expand" /> @@ -46,7 +46,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp" - android:textColor="@color/md_theme_onSurfaceVariant" + android:textColor="@android:color/white" android:textSize="14sp" android:lineSpacingExtra="4dp" android:visibility="gone" /> diff --git a/sensorhub-android-app/res/layout/item_server_profile.xml b/sensorhub-android-app/res/layout/item_server_profile.xml index 45fa407..19bdf7d 100644 --- a/sensorhub-android-app/res/layout/item_server_profile.xml +++ b/sensorhub-android-app/res/layout/item_server_profile.xml @@ -11,8 +11,7 @@ app:cardCornerRadius="@dimen/card_corner_radius" app:cardElevation="0dp" app:cardBackgroundColor="@color/surface_card" - app:strokeColor="@color/md_theme_outline" - app:strokeWidth="1dp"> + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> - + android:clickable="false" /> diff --git a/sensorhub-android-app/res/layout/pref_switch_mid.xml b/sensorhub-android-app/res/layout/pref_switch_mid.xml index 4141a24..82b7919 100644 --- a/sensorhub-android-app/res/layout/pref_switch_mid.xml +++ b/sensorhub-android-app/res/layout/pref_switch_mid.xml @@ -35,12 +35,10 @@ android:layout_marginTop="2dp" /> - + android:clickable="false" /> diff --git a/sensorhub-android-app/res/layout/pref_switch_top.xml b/sensorhub-android-app/res/layout/pref_switch_top.xml index 9bf2228..e23458f 100644 --- a/sensorhub-android-app/res/layout/pref_switch_top.xml +++ b/sensorhub-android-app/res/layout/pref_switch_top.xml @@ -35,12 +35,10 @@ android:layout_marginTop="2dp" /> - + android:clickable="false" /> diff --git a/sensorhub-android-app/res/layout/preference_switch_item.xml b/sensorhub-android-app/res/layout/preference_switch_item.xml index 24ec3c5..6a6101c 100644 --- a/sensorhub-android-app/res/layout/preference_switch_item.xml +++ b/sensorhub-android-app/res/layout/preference_switch_item.xml @@ -30,16 +30,13 @@ android:textAlignment="viewStart" /> - + android:paddingEnd="0dp" /> \ No newline at end of file diff --git a/sensorhub-android-app/res/values/colors.xml b/sensorhub-android-app/res/values/colors.xml index d04f4a1..42b44bf 100644 --- a/sensorhub-android-app/res/values/colors.xml +++ b/sensorhub-android-app/res/values/colors.xml @@ -1,73 +1,74 @@ - #D35400 + #E64A19 #FFFFFF - #24160A - #E6B89C + #4E1700 + #FFCCBC - #C24E00 + #BF360C - #9A9A9A + #9E9E9E #0A0A0A - #242424 - #F5F5F5 + #424242 + #E0E0E0 - #B84A0D + #FF7043 #FFFFFF - #1C0A00 - #E6B89C + #4E1700 + #FFCCBC #CF6679 #1C0006 - #4A0011 - #FFB3BA + #93000A + #FFDAD6 - #0A0A0A + #121212 - #F5F5F5 + #E0E0E0 - #141414 - #F5F5F5 + #1E1E1E + #E0E0E0 - #1C1C1C - #9A9A9A + #2C2C2C + #BDBDBD - #2E2E2E + #616161 - #0A0A0A - #141414 - #1C1C1C - #242424 + #E64A19 + #1E1E1E + #2C2C2C + #333333 - #F5F5F5 - #9A9A9A - #5A5A5A + #E0E0E0 + #BDBDBD + #757575 - #D35400 - #C24E00 - #1AD35400 + #E64A19 + #BF360C + #1AE64A19 - #141414 - #F5F5F5 + #E64A19 + #FFFFFF - #141414 - #D35400 - #6A6A6A + #1E1E1E + #E64A19 + #757575 #4CAF50 - #F44336 + #EF5350 #FF9800 - #5A5A5A + #757575 #1AFFFFFF #99000000 - #1C1C1C + #212121 + #212121 - \ No newline at end of file + diff --git a/sensorhub-android-app/res/values/styles.xml b/sensorhub-android-app/res/values/styles.xml index f7d52d6..bdd6d7f 100644 --- a/sensorhub-android-app/res/values/styles.xml +++ b/sensorhub-android-app/res/values/styles.xml @@ -4,7 +4,7 @@ - + - + + + android:selectAllOnFocus="true" + app:useSimpleSummaryProvider="true" + android:layout="@layout/pref_value_single" /> - - - + + android:layout="@layout/pref_switch_top" /> + android:layout="@layout/pref_switch_mid" /> + android:layout="@layout/pref_switch_bottom" /> + android:layout="@layout/pref_edit_bottom" /> - - \ No newline at end of file + diff --git a/sensorhub-android-app/src/org/sensorhub/android/DashboardFragment.java b/sensorhub-android-app/src/org/sensorhub/android/DashboardFragment.java index a4b1545..f41e01f 100644 --- a/sensorhub-android-app/src/org/sensorhub/android/DashboardFragment.java +++ b/sensorhub-android-app/src/org/sensorhub/android/DashboardFragment.java @@ -639,6 +639,24 @@ private void updateVideoControlsVisibility() { boolean showFlip = hasVideo && android.hardware.Camera.getNumberOfCameras() > 1; btnFlipCamera.setVisibility(showFlip ? View.VISIBLE : View.GONE); } + + boolean isBackCamera = isBackCameraActive(); + if (btnZoomIn != null) btnZoomIn.setVisibility(isBackCamera ? View.VISIBLE : View.GONE); + if (btnZoomOut != null) btnZoomOut.setVisibility(isBackCamera ? View.VISIBLE : View.GONE); + } + + @SuppressWarnings("deprecation") + private boolean isBackCameraActive() { + AndroidSensorsDriver sensors = provider.getAndroidSensors(); + if (sensors == null) return true; + try { + int cameraId = sensors.getConfiguration().selectedCameraId; + android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo(); + android.hardware.Camera.getCameraInfo(cameraId, info); + return info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK; + } catch (Exception e) { + return true; + } } @SuppressWarnings("deprecation") @@ -671,6 +689,7 @@ private void flipCamera() { if (targetId >= 0) { sensors.switchCamera(targetId); currentZoomLevel = 0; + updateVideoControlsVisibility(); Toast.makeText(requireContext(), "Switched to " + targetFacing.toLowerCase() + " camera", Toast.LENGTH_SHORT).show(); } } catch (Exception e) {