From 93e887fc31ad243ad85ee0515b78d03293d06bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Thu, 13 Aug 2020 15:50:32 -0400 Subject: [PATCH] call: cleanup Change-Id: Ife063b2ca7df4b138785d8989ee8d1a5ab9c65bc --- .../java/cx/ring/fragments/CallFragment.java | 9 +++----- .../app/src/main/res/drawable/ic_plugin.xml | 2 +- .../app/src/main/res/layout/item_picker.xml | 22 +++++-------------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java index f89298709..9727b907d 100644 --- a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java +++ b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java @@ -109,14 +109,12 @@ import cx.ring.model.CallContact; import cx.ring.model.Conference; import cx.ring.model.SipCall; import cx.ring.mvp.BaseSupportFragment; -import cx.ring.plugins.PluginUtils; import cx.ring.plugins.RecyclerPicker.RecyclerPicker; import cx.ring.plugins.RecyclerPicker.RecyclerPickerLayoutManager; import cx.ring.service.DRingService; import cx.ring.services.DeviceRuntimeService; import cx.ring.services.HardwareService; import cx.ring.services.NotificationService; -import cx.ring.settings.pluginssettings.PluginDetails; import cx.ring.utils.ActionHelper; import cx.ring.utils.ContentUriHandler; import cx.ring.utils.ConversationPath; @@ -326,7 +324,6 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - ((JamiApplication) requireActivity().getApplication()).getInjectionComponent().inject(this); binding = DataBindingUtil.inflate(inflater, R.layout.frag_call, container, false); binding.setPresenter(this); @@ -1025,7 +1022,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements @Override public void initMenu(boolean isSpeakerOn, boolean displayFlip, boolean canDial, boolean showPluginBtn, boolean onGoingCall) { - if (binding.callCameraFlipBtn != null) { + if (binding != null) { binding.callCameraFlipBtn.setVisibility(displayFlip ? View.VISIBLE : View.GONE); } if (dialPadBtn != null) { @@ -1127,7 +1124,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements private void configureTransform(int viewWidth, int viewHeight) { Activity activity = getActivity(); - if (null == binding.previewSurface || null == activity) { + if (null == binding || null == activity) { return; } int rotation = activity.getWindowManager().getDefaultDisplay().getRotation(); @@ -1377,7 +1374,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements public void toggleVideoPluginsCarousel(boolean toggle) { toggleVideoPluginsCarousel = toggle; if (choosePluginMode) { - if (toggleVideoPluginsCarousel) { + if (toggle) { binding.recyclerPicker.setVisibility(View.VISIBLE); movePreview(true); } else { diff --git a/ring-android/app/src/main/res/drawable/ic_plugin.xml b/ring-android/app/src/main/res/drawable/ic_plugin.xml index 09abe39a9..c5f7df2c1 100644 --- a/ring-android/app/src/main/res/drawable/ic_plugin.xml +++ b/ring-android/app/src/main/res/drawable/ic_plugin.xml @@ -1,6 +1,6 @@ <vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" - android:height="24.018764dp" + android:height="24dp" android:width="24dp" android:viewportHeight="1280" android:viewportWidth="1279" diff --git a/ring-android/app/src/main/res/layout/item_picker.xml b/ring-android/app/src/main/res/layout/item_picker.xml index 1f6c859eb..14d2af42c 100644 --- a/ring-android/app/src/main/res/layout/item_picker.xml +++ b/ring-android/app/src/main/res/layout/item_picker.xml @@ -1,18 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="112dp" - android:layout_height="112dp" +<ImageView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" - android:padding="24dp"> - - <ImageView - android:id="@+id/item_image_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - tools:src="@drawable/ic_plugin"/> -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file + android:id="@+id/item_image_view" + android:layout_width="64dp" + android:layout_height="64dp" + tools:src="@drawable/ic_plugin" + android:layout_margin="24dp" /> -- GitLab