kopia lustrzana https://github.com/ryukoposting/Signal-Android
Text Camera Switch view positioning fixes.
rodzic
782464f664
commit
ef6e846512
|
@ -74,14 +74,10 @@ class MediaSelectionActivity :
|
|||
val cameraSwitch: View = findViewById(R.id.camera_switch)
|
||||
|
||||
textSwitch.setOnClickListener {
|
||||
textSwitch.isSelected = true
|
||||
cameraSwitch.isSelected = false
|
||||
viewModel.sendCommand(HudCommand.GoToText)
|
||||
}
|
||||
|
||||
cameraSwitch.setOnClickListener {
|
||||
textSwitch.isSelected = false
|
||||
cameraSwitch.isSelected = true
|
||||
viewModel.sendCommand(HudCommand.GoToCapture)
|
||||
}
|
||||
|
||||
|
@ -103,8 +99,16 @@ class MediaSelectionActivity :
|
|||
|
||||
(supportFragmentManager.findFragmentByTag(NAV_HOST_TAG) as NavHostFragment).navController.addOnDestinationChangedListener { _, d, _ ->
|
||||
when (d.id) {
|
||||
R.id.mediaCaptureFragment -> textStoryToggle.visible = canDisplayStorySwitch()
|
||||
R.id.textStoryPostCreationFragment -> textStoryToggle.visible = canDisplayStorySwitch()
|
||||
R.id.mediaCaptureFragment -> {
|
||||
textStoryToggle.visible = canDisplayStorySwitch()
|
||||
textSwitch.isSelected = false
|
||||
cameraSwitch.isSelected = true
|
||||
}
|
||||
R.id.textStoryPostCreationFragment -> {
|
||||
textStoryToggle.visible = canDisplayStorySwitch()
|
||||
textSwitch.isSelected = true
|
||||
cameraSwitch.isSelected = false
|
||||
}
|
||||
else -> textStoryToggle.visible = false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:layout_marginBottom="6dp"
|
||||
android:contentDescription="@string/CameraXFragment_capture_description"
|
||||
app:imageCaptureSize="72dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/toggle_spacer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:recordSize="54dp" />
|
||||
|
@ -82,5 +82,14 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/toggle_spacer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
android:layout_marginBottom="6dp"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/story_text_background_button_overlay"
|
||||
app:layout_constraintBottom_toBottomOf="@id/story_text_post"
|
||||
app:layout_constraintBottom_toTopOf="@id/button_bar_barrier"
|
||||
app:layout_constraintStart_toStartOf="@id/story_text_post"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
|
||||
tools:background="@color/signal_alert_primary" />
|
||||
|
@ -40,7 +40,7 @@
|
|||
android:background="@drawable/story_text_circle_button_background_inset_6"
|
||||
android:scaleType="centerInside"
|
||||
app:backgroundTint="@color/transparent_black_40"
|
||||
app:layout_constraintBottom_toBottomOf="@id/story_text_post"
|
||||
app:layout_constraintBottom_toTopOf="@id/button_bar_barrier"
|
||||
app:layout_constraintStart_toEndOf="@id/background_selector"
|
||||
app:srcCompat="@drawable/ic_link_24"
|
||||
app:tint="@color/core_white" />
|
||||
|
@ -50,13 +50,35 @@
|
|||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:background="@drawable/story_text_circle_button_background_inset_5"
|
||||
android:scaleType="centerInside"
|
||||
app:backgroundTint="@color/core_ultramarine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/toggle_spacer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/toggle_spacer"
|
||||
app:srcCompat="@drawable/ic_arrow_end_24"
|
||||
app:tint="@color/core_white" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/button_bar_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:constraint_referenced_ids="barrier_helper,toggle_spacer" />
|
||||
|
||||
<View
|
||||
android:id="@+id/barrier_helper"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/story_text_post" />
|
||||
|
||||
<View
|
||||
android:id="@+id/toggle_spacer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Ładowanie…
Reference in New Issue