From 482f69e0031af2695fc68d7850ea03e9bb64bef3 Mon Sep 17 00:00:00 2001 From: free-bots Date: Tue, 6 Feb 2024 19:03:13 +0100 Subject: [PATCH] added border for selected camera view --- .../it/danieleverducci/ojo/ui/SurveillanceFragment.java | 1 + app/src/main/res/drawable/focus_border.xml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 app/src/main/res/drawable/focus_border.xml diff --git a/app/src/main/java/it/danieleverducci/ojo/ui/SurveillanceFragment.java b/app/src/main/java/it/danieleverducci/ojo/ui/SurveillanceFragment.java index ba5fa14..9a73350 100644 --- a/app/src/main/java/it/danieleverducci/ojo/ui/SurveillanceFragment.java +++ b/app/src/main/java/it/danieleverducci/ojo/ui/SurveillanceFragment.java @@ -277,6 +277,7 @@ public class SurveillanceFragment extends Fragment { } }); + surfaceView.setOnFocusChangeListener((view, hasFocus) -> view.setBackgroundResource(hasFocus ? R.drawable.focus_border : 0)); SurfaceHolder holder = surfaceView.getHolder(); holder.setKeepScreenOn(true); diff --git a/app/src/main/res/drawable/focus_border.xml b/app/src/main/res/drawable/focus_border.xml new file mode 100644 index 0000000..7a91dd1 --- /dev/null +++ b/app/src/main/res/drawable/focus_border.xml @@ -0,0 +1,6 @@ + + +