kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add My Story row polish.
rodzic
8d4f87641d
commit
01e4a7fd79
|
@ -19,22 +19,17 @@ object MyStoriesItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
class Model(
|
class Model(
|
||||||
val onClick: () -> Unit,
|
val onClick: () -> Unit
|
||||||
val onClickThumbnail: () -> Unit
|
|
||||||
) : PreferenceModel<Model>() {
|
) : PreferenceModel<Model>() {
|
||||||
override fun areItemsTheSame(newItem: Model): Boolean = true
|
override fun areItemsTheSame(newItem: Model): Boolean = true
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ViewHolder(itemView: View) : MappingViewHolder<Model>(itemView) {
|
private class ViewHolder(itemView: View) : MappingViewHolder<Model>(itemView) {
|
||||||
|
|
||||||
private val thumbnail: View = itemView.findViewById(R.id.story)
|
|
||||||
private val avatarView: AvatarView = itemView.findViewById(R.id.avatar)
|
private val avatarView: AvatarView = itemView.findViewById(R.id.avatar)
|
||||||
|
|
||||||
override fun bind(model: Model) {
|
override fun bind(model: Model) {
|
||||||
itemView.setOnClickListener { model.onClick() }
|
itemView.setOnClickListener { model.onClick() }
|
||||||
thumbnail.setOnClickListener { model.onClickThumbnail() }
|
|
||||||
avatarView.setOnClickListener { model.onClickThumbnail() }
|
|
||||||
|
|
||||||
avatarView.displayProfileAvatar(Recipient.self())
|
avatarView.displayProfileAvatar(Recipient.self())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,9 +172,6 @@ class StoriesLandingFragment : DSLSettingsFragment(layoutId = R.layout.stories_l
|
||||||
customPref(
|
customPref(
|
||||||
MyStoriesItem.Model(
|
MyStoriesItem.Model(
|
||||||
onClick = {
|
onClick = {
|
||||||
startActivityIfAble(Intent(requireContext(), MyStoriesActivity::class.java))
|
|
||||||
},
|
|
||||||
onClickThumbnail = {
|
|
||||||
cameraFab.performClick()
|
cameraFab.performClick()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
tools:viewBindingIgnore="true"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
android:background="@drawable/conversation_list_item_background"
|
||||||
android:layout_marginEnd="@dimen/dsl_settings_gutter">
|
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||||
|
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||||
|
tools:viewBindingIgnore="true">
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.avatar.view.AvatarView
|
<org.thoughtcrime.securesms.avatar.view.AvatarView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||||
android:textColor="@color/signal_colorOnSurface"
|
android:textColor="@color/signal_colorOnSurface"
|
||||||
app:layout_constraintBottom_toTopOf="@id/date"
|
app:layout_constraintBottom_toTopOf="@id/date"
|
||||||
app:layout_constraintEnd_toStartOf="@id/story"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
app:layout_constraintStart_toEndOf="@id/avatar"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_chainStyle="packed" />
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
@ -49,28 +50,12 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/StoriesLandingFragment__add_a_story"
|
android:text="@string/StoriesLandingFragment__tap_to_add_a_story"
|
||||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/story"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
app:layout_constraintStart_toEndOf="@id/avatar"
|
||||||
app:layout_constraintTop_toBottomOf="@id/sender" />
|
app:layout_constraintTop_toBottomOf="@id/sender" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
|
||||||
android:id="@+id/story"
|
|
||||||
android:layout_width="@dimen/stories_landing_item_thumb_width"
|
|
||||||
android:layout_height="@dimen/stories_landing_item_thumb_height"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:background="@color/signal_colorSurfaceVariant"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Signal.Story.Preview"
|
|
||||||
app:srcCompat="@drawable/ic_plus_24"
|
|
||||||
app:tint="@color/signal_colorOnSurface" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -4578,7 +4578,7 @@
|
||||||
<!-- Title for "My Stories" row item in Stories landing page -->
|
<!-- Title for "My Stories" row item in Stories landing page -->
|
||||||
<string name="StoriesLandingFragment__my_stories">My Stories</string>
|
<string name="StoriesLandingFragment__my_stories">My Stories</string>
|
||||||
<!-- Subtitle for "My Stories" row item when user has not added stories -->
|
<!-- Subtitle for "My Stories" row item when user has not added stories -->
|
||||||
<string name="StoriesLandingFragment__add_a_story">Add a story</string>
|
<string name="StoriesLandingFragment__tap_to_add_a_story">Tap to add a story</string>
|
||||||
<!-- Displayed when there are no stories to display -->
|
<!-- Displayed when there are no stories to display -->
|
||||||
<string name="StoriesLandingFragment__no_recent_updates_to_show_right_now_tap_plus_to_add_to_your_story">No recent updates to show right now. Tap + to add to your story.</string>
|
<string name="StoriesLandingFragment__no_recent_updates_to_show_right_now_tap_plus_to_add_to_your_story">No recent updates to show right now. Tap + to add to your story.</string>
|
||||||
<!-- Context menu option to hide a story -->
|
<!-- Context menu option to hide a story -->
|
||||||
|
|
Ładowanie…
Reference in New Issue