Adjust text story button protections.

fork-5.53.8
Alex Hart 2022-03-28 13:29:22 -03:00 zatwierdzone przez Greyson Parrelli
rodzic 6476e585c4
commit a3a79fc58d
2 zmienionych plików z 37 dodań i 15 usunięć

Wyświetl plik

@ -21,7 +21,6 @@ import org.thoughtcrime.securesms.util.navigation.safeNavigate
class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creation_fragment), TextStoryPostTextEntryFragment.Callback { class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creation_fragment), TextStoryPostTextEntryFragment.Callback {
private lateinit var scene: ConstraintLayout private lateinit var scene: ConstraintLayout
private lateinit var linkButton: View
private lateinit var backgroundButton: AppCompatImageView private lateinit var backgroundButton: AppCompatImageView
private lateinit var send: View private lateinit var send: View
private lateinit var storyTextPostView: StoryTextPostView private lateinit var storyTextPostView: StoryTextPostView
@ -53,11 +52,13 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
scene = view.findViewById(R.id.scene) scene = view.findViewById(R.id.scene)
linkButton = view.findViewById(R.id.add_link)
backgroundButton = view.findViewById(R.id.background_selector) backgroundButton = view.findViewById(R.id.background_selector)
send = view.findViewById(R.id.send) send = view.findViewById(R.id.send)
storyTextPostView = view.findViewById(R.id.story_text_post) storyTextPostView = view.findViewById(R.id.story_text_post)
val backgroundProtection: View = view.findViewById(R.id.background_protection)
val addLinkProtection: View = view.findViewById(R.id.add_link_protection)
storyTextPostView.showCloseButton() storyTextPostView.showCloseButton()
lifecycleDisposable.bindTo(viewLifecycleOwner) lifecycleDisposable.bindTo(viewLifecycleOwner)
@ -97,11 +98,11 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
TextStoryPostTextEntryFragment().show(childFragmentManager, null) TextStoryPostTextEntryFragment().show(childFragmentManager, null)
} }
backgroundButton.setOnClickListener { backgroundProtection.setOnClickListener {
viewModel.cycleBackgroundColor() viewModel.cycleBackgroundColor()
} }
linkButton.setOnClickListener { addLinkProtection.setOnClickListener {
TextStoryPostLinkEntryFragment().show(childFragmentManager, null) TextStoryPostLinkEntryFragment().show(childFragmentManager, null)
} }

Wyświetl plik

@ -11,37 +11,58 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
app:layout_constraintVertical_bias="0"
app:layout_constraintBottom_toTopOf="@id/toggle_spacer" app:layout_constraintBottom_toTopOf="@id/toggle_spacer"
app:layout_constraintDimensionRatio="9:16" app:layout_constraintDimensionRatio="9:16"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0" />
<com.google.android.material.imageview.ShapeableImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/background_selector" android:id="@+id/background_protection"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:padding="6dp" android:padding="2dp"
android:src="@drawable/story_text_background_button_overlay" android:src="@drawable/circle_tintable"
app:layout_constraintBottom_toTopOf="@id/button_bar_barrier" app:layout_constraintBottom_toTopOf="@id/button_bar_barrier"
app:layout_constraintStart_toStartOf="@id/story_text_post" app:layout_constraintStart_toStartOf="@id/story_text_post"
app:tint="@color/transparent_black_40" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/background_selector"
android:layout_width="28dp"
android:layout_height="28dp"
android:src="@drawable/story_text_background_button_overlay"
app:layout_constraintBottom_toBottomOf="@id/background_protection"
app:layout_constraintEnd_toEndOf="@id/background_protection"
app:layout_constraintStart_toStartOf="@id/background_protection"
app:layout_constraintTop_toTopOf="@id/background_protection"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle" app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
tools:background="@color/signal_alert_primary" /> tools:background="@color/signal_alert_primary" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/add_link" android:id="@+id/add_link_protection"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:background="@drawable/story_text_circle_button_background_inset_6" android:padding="2dp"
android:scaleType="centerInside" android:src="@drawable/circle_tintable"
app:backgroundTint="@color/transparent_black_40"
app:layout_constraintBottom_toTopOf="@id/button_bar_barrier" app:layout_constraintBottom_toTopOf="@id/button_bar_barrier"
app:layout_constraintStart_toEndOf="@id/background_selector" app:layout_constraintStart_toEndOf="@id/background_protection"
app:tint="@color/transparent_black_40" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/add_link"
android:layout_width="28dp"
android:layout_height="28dp"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="@id/add_link_protection"
app:layout_constraintEnd_toEndOf="@id/add_link_protection"
app:layout_constraintStart_toStartOf="@id/add_link_protection"
app:layout_constraintTop_toTopOf="@id/add_link_protection"
app:srcCompat="@drawable/ic_link_24" app:srcCompat="@drawable/ic_link_24"
app:tint="@color/core_white" /> app:tint="@color/core_white" />