kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update camera UX to match Material3 Spec.
rodzic
d30714bfd4
commit
dc66583ef1
|
@ -27,6 +27,7 @@ import android.widget.ImageView;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.MultiTransformation;
|
||||
|
@ -45,7 +46,6 @@ import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
|||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.stories.Stories;
|
||||
import org.thoughtcrime.securesms.stories.viewer.page.StoryDisplay;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.util.Stopwatch;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
@ -72,6 +72,10 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
private OrderEnforcer<Stage> orderEnforcer;
|
||||
private Camera1Controller.Properties properties;
|
||||
|
||||
private final Observer<Optional<Media>> thumbObserver = this::presentRecentItemThumbnail;
|
||||
private boolean isThumbAvailable;
|
||||
private boolean isMediaSelected;
|
||||
|
||||
public static Camera1Fragment newInstance() {
|
||||
return new Camera1Fragment();
|
||||
}
|
||||
|
@ -124,8 +128,6 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
GestureDetector gestureDetector = new GestureDetector(flipGestureListener);
|
||||
cameraPreview.setOnTouchListener((v, event) -> gestureDetector.onTouchEvent(event));
|
||||
|
||||
controller.getMostRecentMediaItem().observe(getViewLifecycleOwner(), this::presentRecentItemThumbnail);
|
||||
|
||||
view.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||
// Let's assume portrait for now, so 9:16
|
||||
float aspectRatio = CameraFragment.getAspectRatioForOrientation(getResources().getConfiguration().orientation);
|
||||
|
@ -173,7 +175,14 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
orderEnforcer.reset();
|
||||
}
|
||||
|
||||
@Override public void onDestroy() {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
controller.getMostRecentMediaItem().removeObserver(thumbObserver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
}
|
||||
|
@ -251,6 +260,8 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
|
||||
private void presentRecentItemThumbnail(Optional<Media> media) {
|
||||
if (media == null) {
|
||||
isThumbAvailable = false;
|
||||
updateGalleryVisibility();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -266,17 +277,36 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
thumbnail.setVisibility(View.GONE);
|
||||
thumbnail.setImageResource(0);
|
||||
}
|
||||
|
||||
isThumbAvailable = media.isPresent();
|
||||
updateGalleryVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void presentHud(int selectedMediaCount) {
|
||||
MediaCountIndicatorButton countButton = controlsContainer.findViewById(R.id.camera_review_button);
|
||||
MediaCountIndicatorButton countButton = controlsContainer.findViewById(R.id.camera_review_button);
|
||||
View cameraGalleryContainer = controlsContainer.findViewById(R.id.camera_gallery_button_background);
|
||||
|
||||
if (selectedMediaCount > 0) {
|
||||
countButton.setVisibility(View.VISIBLE);
|
||||
countButton.setCount(selectedMediaCount);
|
||||
cameraGalleryContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
countButton.setVisibility(View.GONE);
|
||||
cameraGalleryContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
isMediaSelected = selectedMediaCount > 0;
|
||||
updateGalleryVisibility();
|
||||
}
|
||||
|
||||
private void updateGalleryVisibility() {
|
||||
View cameraGalleryContainer = controlsContainer.findViewById(R.id.camera_gallery_button_background);
|
||||
|
||||
if (isMediaSelected || !isThumbAvailable) {
|
||||
cameraGalleryContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
cameraGalleryContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,6 +318,9 @@ public class Camera1Fragment extends LoggingFragment implements CameraFragment,
|
|||
View countButton = requireView().findViewById(R.id.camera_review_button);
|
||||
View toggleSpacer = requireView().findViewById(R.id.toggle_spacer);
|
||||
|
||||
controller.getMostRecentMediaItem().removeObserver(thumbObserver);
|
||||
controller.getMostRecentMediaItem().observeForever(thumbObserver);
|
||||
|
||||
if (toggleSpacer != null) {
|
||||
if (Stories.isFeatureEnabled()) {
|
||||
StoryDisplay storyDisplay = StoryDisplay.Companion.getStoryDisplay(getResources().getDisplayMetrics().widthPixels, getResources().getDisplayMetrics().heightPixels);
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.mediasend;
|
|||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
|
@ -17,6 +18,7 @@ import android.view.animation.Interpolator;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.signal.core.util.DimensionUnit;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
@ -25,19 +27,20 @@ public class CameraButtonView extends View {
|
|||
|
||||
private enum CameraButtonMode { IMAGE, MIXED }
|
||||
|
||||
private static final int CAPTURE_ARC_STROKE_WIDTH = 4;
|
||||
private static final int HALF_CAPTURE_ARC_STROKE_WIDTH = CAPTURE_ARC_STROKE_WIDTH / 2;
|
||||
private static final float CAPTURE_ARC_STROKE_WIDTH = 3.5f;
|
||||
private static final int CAPTURE_FILL_PROTECTION = 10;
|
||||
private static final int PROGRESS_ARC_STROKE_WIDTH = 4;
|
||||
private static final int HALF_PROGRESS_ARC_STROKE_WIDTH = PROGRESS_ARC_STROKE_WIDTH / 2;
|
||||
private static final float DEADZONE_REDUCTION_PERCENT = 0.35f;
|
||||
private static final int DRAG_DISTANCE_MULTIPLIER = 3;
|
||||
private static final Interpolator ZOOM_INTERPOLATOR = new DecelerateInterpolator();
|
||||
|
||||
private final @NonNull Paint outlinePaint = outlinePaint();
|
||||
private final @NonNull Paint backgroundPaint = backgroundPaint();
|
||||
private final @NonNull Paint arcPaint = arcPaint();
|
||||
private final @NonNull Paint recordPaint = recordPaint();
|
||||
private final @NonNull Paint progressPaint = progressPaint();
|
||||
private final @NonNull Paint outlinePaint = outlinePaint();
|
||||
private final @NonNull Paint backgroundPaint = backgroundPaint();
|
||||
private final @NonNull Paint arcPaint = arcPaint();
|
||||
private final @NonNull Paint recordPaint = recordPaint();
|
||||
private final @NonNull Paint progressPaint = progressPaint();
|
||||
private final @NonNull Paint captureFillPaint = captureFillPaint();
|
||||
|
||||
private Animation growAnimation;
|
||||
private Animation shrinkAnimation;
|
||||
|
@ -50,8 +53,8 @@ public class CameraButtonView extends View {
|
|||
|
||||
private final float imageCaptureSize;
|
||||
private final float recordSize;
|
||||
private final RectF progressRect = new RectF();
|
||||
private final Rect deadzoneRect = new Rect();
|
||||
private final RectF progressRect = new RectF();
|
||||
private final Rect deadzoneRect = new Rect();
|
||||
|
||||
private final @NonNull OnLongClickListener internalLongClickListener = v -> {
|
||||
notifyVideoCaptureStarted();
|
||||
|
@ -112,10 +115,19 @@ public class CameraButtonView extends View {
|
|||
arcPaint.setColor(0xFFFFFFFF);
|
||||
arcPaint.setAntiAlias(true);
|
||||
arcPaint.setStyle(Paint.Style.STROKE);
|
||||
arcPaint.setStrokeWidth(ViewUtil.dpToPx(CAPTURE_ARC_STROKE_WIDTH));
|
||||
arcPaint.setStrokeWidth(DimensionUnit.DP.toPixels(CAPTURE_ARC_STROKE_WIDTH));
|
||||
return arcPaint;
|
||||
}
|
||||
|
||||
private static Paint captureFillPaint() {
|
||||
Paint arcPaint = new Paint();
|
||||
arcPaint.setColor(0xFFFFFFFF);
|
||||
arcPaint.setAntiAlias(true);
|
||||
arcPaint.setStyle(Paint.Style.FILL);
|
||||
return arcPaint;
|
||||
}
|
||||
|
||||
|
||||
private static Paint progressPaint() {
|
||||
Paint progressPaint = new Paint();
|
||||
progressPaint.setColor(0xFFFFFFFF);
|
||||
|
@ -153,8 +165,8 @@ public class CameraButtonView extends View {
|
|||
|
||||
float radius = imageCaptureSize / 2f;
|
||||
canvas.drawCircle(centerX, centerY, radius, backgroundPaint);
|
||||
canvas.drawCircle(centerX, centerY, radius, outlinePaint);
|
||||
canvas.drawCircle(centerX, centerY, radius - ViewUtil.dpToPx(HALF_CAPTURE_ARC_STROKE_WIDTH), arcPaint);
|
||||
canvas.drawCircle(centerX, centerY, radius, arcPaint);
|
||||
canvas.drawCircle(centerX, centerY, radius - DimensionUnit.DP.toPixels(CAPTURE_FILL_PROTECTION), captureFillPaint);
|
||||
}
|
||||
|
||||
private void drawForVideoCapture(Canvas canvas) {
|
||||
|
|
|
@ -32,10 +32,12 @@ import androidx.camera.lifecycle.ProcessCameraProvider;
|
|||
import androidx.camera.view.PreviewView;
|
||||
import androidx.camera.view.SignalCameraView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.util.Executors;
|
||||
|
||||
import org.signal.core.util.concurrent.SimpleTask;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.LoggingFragment;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
@ -49,11 +51,9 @@ import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
|||
import org.thoughtcrime.securesms.mms.MediaConstraints;
|
||||
import org.thoughtcrime.securesms.stories.Stories;
|
||||
import org.thoughtcrime.securesms.stories.viewer.page.StoryDisplay;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.MemoryFileDescriptor;
|
||||
import org.thoughtcrime.securesms.util.Stopwatch;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.signal.core.util.concurrent.SimpleTask;
|
||||
import org.thoughtcrime.securesms.video.VideoUtil;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
|
@ -76,6 +76,10 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
private View selfieFlash;
|
||||
private MemoryFileDescriptor videoFileDescriptor;
|
||||
|
||||
private final Observer<Optional<Media>> thumbObserver = this::presentRecentItemThumbnail;
|
||||
private boolean isThumbAvailable;
|
||||
private boolean isMediaSelected;
|
||||
|
||||
public static CameraXFragment newInstanceForAvatarCapture() {
|
||||
CameraXFragment fragment = new CameraXFragment();
|
||||
Bundle args = new Bundle();
|
||||
|
@ -129,8 +133,6 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
|
||||
onOrientationChanged(getResources().getConfiguration().orientation);
|
||||
|
||||
controller.getMostRecentMediaItem().observe(getViewLifecycleOwner(), this::presentRecentItemThumbnail);
|
||||
|
||||
view.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||
// Let's assume portrait for now, so 9:16
|
||||
float aspectRatio = CameraFragment.getAspectRatioForOrientation(getResources().getConfiguration().orientation);
|
||||
|
@ -162,6 +164,7 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
controller.getMostRecentMediaItem().removeObserver(thumbObserver);
|
||||
closeVideoFileDescriptor();
|
||||
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
}
|
||||
|
@ -223,6 +226,8 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
|
||||
private void presentRecentItemThumbnail(Optional<Media> media) {
|
||||
if (media == null) {
|
||||
isThumbAvailable = false;
|
||||
updateGalleryVisibility();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -238,6 +243,9 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
thumbnail.setVisibility(View.GONE);
|
||||
thumbnail.setImageResource(0);
|
||||
}
|
||||
|
||||
isThumbAvailable = media.isPresent();
|
||||
updateGalleryVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -250,6 +258,19 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
} else {
|
||||
countButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
isMediaSelected = selectedMediaCount > 0;
|
||||
updateGalleryVisibility();
|
||||
}
|
||||
|
||||
private void updateGalleryVisibility() {
|
||||
View cameraGalleryContainer = controlsContainer.findViewById(R.id.camera_gallery_button_background);
|
||||
|
||||
if (isMediaSelected || !isThumbAvailable) {
|
||||
cameraGalleryContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
cameraGalleryContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"ClickableViewAccessibility", "MissingPermission"})
|
||||
|
@ -274,6 +295,9 @@ public class CameraXFragment extends LoggingFragment implements CameraFragment {
|
|||
}
|
||||
}
|
||||
|
||||
controller.getMostRecentMediaItem().removeObserver(thumbObserver);
|
||||
controller.getMostRecentMediaItem().observeForever(thumbObserver);
|
||||
|
||||
selfieFlash = requireView().findViewById(R.id.camera_selfie_flash);
|
||||
|
||||
captureButton.setOnClickListener(v -> {
|
||||
|
|
|
@ -5,8 +5,5 @@
|
|||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="@color/core_white"
|
||||
android:pathData="M23.53,10.63l-4,4 1.06,1.06 1.48,-1.48L22.78,13v1a8.78,8.78 0,0 1,-15 6.21L6.73,21.27A10.28,10.28 0,0 0,24.28 14V13L25,14.21l1.48,1.48 1.06,-1.06Z"/>
|
||||
<path
|
||||
android:fillColor="@color/core_white"
|
||||
android:pathData="M7.41,12.31 L5.93,13.79 5.22,15L5.22,14a8.78,8.78 0,0 1,15 -6.21l1.06,-1.06A10.28,10.28 0,0 0,3.72 14v1L3,13.79 1.53,12.31 0.47,13.37l4,4 4,-4ZM4.47,16.31Z"/>
|
||||
android:pathData="M8.3,13.2l-3.5,3.5c-0.3,0.3 -0.8,0.3 -1.1,0l-3.5,-3.5l1.1,-1.1l1.6,1.6c0,0 0.3,0.4 0.7,1v-1.2l0,0c0.2,-5.8 5.1,-10.3 10.9,-10c2.6,0.1 5.1,1.2 7,3.1l-1.1,1.1c-3.5,-3.5 -9.2,-3.5 -12.7,0C5.9,9.3 5,11.6 5,14v0.7c0.3,-0.5 0.7,-1 0.7,-1l1.6,-1.6L8.3,13.2zM24.3,11.2c-0.3,-0.3 -0.8,-0.3 -1.1,0l-3.5,3.5l1.1,1.1l1.6,-1.6c0,0 0.3,-0.4 0.7,-1V14c0,5 -4,9 -9,9c-2.4,0 -4.7,-1 -6.4,-2.7l-1.1,1.1c4.1,4.1 10.7,4.1 14.8,0c1.9,-1.8 2.9,-4.3 3.1,-6.9l0,0v-1.2c0.4,0.5 0.7,1 0.7,1l1.6,1.6l1.1,-1.1L24.3,11.2z"/>
|
||||
</vector>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/signal_colorSurfaceVariant_38" />
|
||||
<stroke android:color="@color/core_white" android:width="2dp" />
|
||||
</shape>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="38dp"/>
|
||||
<solid android:color="@color/signal_light_colorNeutral"/>
|
||||
<corners android:radius="32dp"/>
|
||||
</shape>
|
|
@ -9,7 +9,7 @@
|
|||
android:id="@+id/camera_capture_button"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="96dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginEnd="18dp"
|
||||
android:contentDescription="@string/CameraXFragment_capture_description"
|
||||
app:imageCaptureSize="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -26,47 +26,56 @@
|
|||
android:background="@drawable/circle_transparent_black_40"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/camerax_flash_toggle"
|
||||
app:layout_constraintStart_toEndOf="@+id/camera_flip_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/camera_flip_button"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="@drawable/circle_transparent_black_40"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/media_selection_camera_switch_background"
|
||||
android:contentDescription="@string/CameraXFragment_change_camera_description"
|
||||
android:scaleType="centerInside"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_switch_camera_24"
|
||||
app:srcCompat="@drawable/ic_switch_camera_28"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/camera_gallery_button"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginBottom="42dp"
|
||||
android:contentDescription="@string/CameraXFragment_open_gallery_description"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toTopOf="@id/camera_capture_button"
|
||||
app:layout_constraintEnd_toEndOf="@id/camera_capture_button"
|
||||
app:layout_constraintStart_toStartOf="@id/camera_capture_button"
|
||||
app:riv_border_color="@color/core_white"
|
||||
app:riv_border_width="2dp"
|
||||
app:riv_corner_radius="10dp" />
|
||||
<FrameLayout
|
||||
android:id="@+id/camera_gallery_button_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/camera_gallery_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:contentDescription="@string/CameraXFragment_open_gallery_description"
|
||||
android:padding="2dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
|
||||
tools:src="@color/black" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.mediasend.v2.MediaCountIndicatorButton
|
||||
android:id="@+id/camera_review_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/v2_media_count_indicator_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/camera_capture_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/camera_capture_button"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
|
|
@ -7,11 +7,10 @@
|
|||
|
||||
<org.thoughtcrime.securesms.mediasend.CameraButtonView
|
||||
android:id="@+id/camera_capture_button"
|
||||
android:layout_width="128dp"
|
||||
android:layout_height="128dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_width="124dp"
|
||||
android:layout_height="124dp"
|
||||
android:contentDescription="@string/CameraXFragment_capture_description"
|
||||
app:imageCaptureSize="72dp"
|
||||
app:imageCaptureSize="76dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/toggle_spacer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -32,39 +31,48 @@
|
|||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/camera_flip_button"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/circle_transparent_black_40"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/media_selection_camera_switch_background"
|
||||
android:contentDescription="@string/CameraXFragment_change_camera_description"
|
||||
android:scaleType="centerInside"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@id/camera_flash_button"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_switch_camera_24"
|
||||
app:layout_constraintBottom_toTopOf="@id/toggle_spacer"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@drawable/ic_switch_camera_28"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/camera_gallery_button"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:contentDescription="@string/CameraXFragment_open_gallery_description"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="@id/camera_capture_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/camera_capture_button"
|
||||
app:riv_border_color="@color/core_white"
|
||||
app:riv_border_width="1.5dp"
|
||||
app:riv_corner_radius="10dp" />
|
||||
<FrameLayout
|
||||
android:id="@+id/camera_gallery_button_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
app:layout_constraintBottom_toTopOf="@id/toggle_spacer"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/camera_gallery_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:contentDescription="@string/CameraXFragment_open_gallery_description"
|
||||
android:padding="2dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
|
||||
tools:src="@color/black" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.mediasend.v2.MediaCountIndicatorButton
|
||||
android:id="@+id/camera_review_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/v2_media_count_indicator_background"
|
||||
android:minHeight="44dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/camera_capture_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -6,21 +6,22 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/v2_media_count_indicator_background"
|
||||
android:contentDescription="@string/MediaCountIndicatorButton__send"
|
||||
android:paddingTop="13dp"
|
||||
android:paddingBottom="13dp"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/media_count_indicator_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_height="18sp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="@drawable/v2_media_count_indicator_text_background"
|
||||
android:paddingStart="9.5dp"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingEnd="9.5dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:textColor="@color/core_white"
|
||||
android:paddingStart="5.5dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="5.5dp"
|
||||
android:paddingBottom="1dp"
|
||||
android:textAppearance="@style/Signal.Text.MaterialCaption"
|
||||
android:textColor="@color/signal_light_colorBackground"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -28,15 +29,15 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/media_count_indicator_chevron"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/media_count_indicator_text"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_arrow_right" />
|
||||
app:srcCompat="@drawable/ic_chevron_end_24" />
|
||||
|
||||
</merge>
|
|
@ -46,6 +46,7 @@
|
|||
<!-- Core color alpha variants -->
|
||||
<color name="signal_colorSecondaryContainer_12">#1F414659</color>
|
||||
<color name="signal_colorSurface_60">#991B1C1F</color>
|
||||
<color name="signal_colorSurfaceVariant_38">#61303133</color>
|
||||
<color name="signal_colorOnSurface_12">#1FE2E1E5</color>
|
||||
<color name="signal_colorOnSurfaceVariant_60">#99BEBFC5</color>
|
||||
<color name="signal_colorOnBackground_60">#99E2E1E5</color>
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
<!-- Core color alpha variants -->
|
||||
<color name="signal_colorSecondaryContainer_12">#1FDCE5F9</color>
|
||||
<color name="signal_colorSurface_60">#99FBFCFF</color>
|
||||
<color name="signal_colorSurfaceVariant_38">#61E7EBF3</color>
|
||||
<color name="signal_colorOnSurface_12">#1F1B1B1D</color>
|
||||
<color name="signal_colorOnSurfaceVariant_60">#99545863</color>
|
||||
<color name="signal_colorOnBackground_60">#991B1D1D</color>
|
||||
|
|
Ładowanie…
Reference in New Issue