kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add polish to stories link previews.
rodzic
19af68a27c
commit
c7cd261641
|
@ -0,0 +1,35 @@
|
|||
package org.thoughtcrime.securesms.components
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Path
|
||||
import android.graphics.Rect
|
||||
import android.graphics.RectF
|
||||
import android.util.AttributeSet
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.graphics.withClip
|
||||
|
||||
/**
|
||||
* Adds manual clipping around the card. This ensures that software rendering
|
||||
* still maintains border radius of cards.
|
||||
*/
|
||||
class ClippedCardView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
) : CardView(context, attrs) {
|
||||
|
||||
private val bounds = Rect()
|
||||
private val boundsF = RectF()
|
||||
private val path = Path()
|
||||
|
||||
override fun draw(canvas: Canvas) {
|
||||
canvas.getClipBounds(bounds)
|
||||
boundsF.set(bounds)
|
||||
path.reset()
|
||||
|
||||
path.addRoundRect(boundsF, radius, radius, Path.Direction.CW)
|
||||
canvas.withClip(path) {
|
||||
super.draw(canvas)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import android.content.res.TypedArray;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
|
@ -14,6 +15,7 @@ import android.widget.FrameLayout;
|
|||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.Px;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
|
@ -280,6 +282,14 @@ public class ThumbnailView extends FrameLayout {
|
|||
forceLayout();
|
||||
}
|
||||
|
||||
public void setImageDrawable(@NonNull GlideRequests glideRequests, @Nullable Drawable drawable) {
|
||||
glideRequests.clear(image);
|
||||
glideRequests.clear(blurhash);
|
||||
|
||||
image.setImageDrawable(drawable);
|
||||
blurhash.setImageDrawable(null);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public ListenableFuture<Boolean> setImageResource(@NonNull GlideRequests glideRequests, @NonNull Slide slide,
|
||||
boolean showControls, boolean isPreview)
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.thoughtcrime.securesms.safety.SafetyNumberBottomSheet
|
|||
import org.thoughtcrime.securesms.stories.Stories
|
||||
import org.thoughtcrime.securesms.stories.StoryTextPostView
|
||||
import org.thoughtcrime.securesms.util.LifecycleDisposable
|
||||
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
|
||||
class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creation_fragment), TextStoryPostTextEntryFragment.Callback, SafetyNumberBottomSheet.Callbacks {
|
||||
|
@ -102,8 +103,10 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
|
|||
send.isEnabled = canSend
|
||||
}
|
||||
|
||||
linkPreviewViewModel.linkPreviewState.observe(viewLifecycleOwner) { state ->
|
||||
storyTextPostView.bindLinkPreviewState(state, View.GONE)
|
||||
LiveDataUtil.combineLatest(viewModel.state, linkPreviewViewModel.linkPreviewState) { viewState, linkState ->
|
||||
Pair(viewState.body.isBlank(), linkState)
|
||||
}.observe(viewLifecycleOwner) { (useLargeThumb, linkState) ->
|
||||
storyTextPostView.bindLinkPreviewState(linkState, View.GONE, useLargeThumb)
|
||||
storyTextPostView.postAdjustLinkPreviewTranslationY()
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class TextStoryPostLinkEntryFragment : KeyboardEntryDialogFragment(
|
|||
}
|
||||
|
||||
linkPreviewViewModel.linkPreviewState.observe(viewLifecycleOwner) { state ->
|
||||
linkPreview.bind(state)
|
||||
linkPreview.bind(state, useLargeThumbnail = false)
|
||||
shareALinkGroup.visible = !state.isLoading && !state.linkPreview.isPresent && (state.error == null && state.activeUrlForError == null)
|
||||
confirmButton.isEnabled = state.linkPreview.isPresent || state.activeUrlForError != null
|
||||
}
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
package org.thoughtcrime.securesms.stories
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import org.signal.core.util.DimensionUnit
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.OutlinedThumbnailView
|
||||
import org.thoughtcrime.securesms.components.ThumbnailView
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreviewUtil
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreviewViewModel
|
||||
import org.thoughtcrime.securesms.mms.GlideApp
|
||||
import org.thoughtcrime.securesms.mms.ImageSlide
|
||||
import org.thoughtcrime.securesms.mms.Slide
|
||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture
|
||||
import org.thoughtcrime.securesms.util.concurrent.SettableFuture
|
||||
import org.thoughtcrime.securesms.util.views.Stub
|
||||
|
@ -32,26 +33,54 @@ class StoryLinkPreviewView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private val close: View = findViewById(R.id.link_preview_close)
|
||||
private val image: OutlinedThumbnailView = findViewById(R.id.link_preview_image)
|
||||
private val smallImage: ThumbnailView = findViewById(R.id.link_preview_image)
|
||||
private val largeImage: ThumbnailView = findViewById(R.id.link_preview_large)
|
||||
private val title: TextView = findViewById(R.id.link_preview_title)
|
||||
private val url: TextView = findViewById(R.id.link_preview_url)
|
||||
private val description: TextView = findViewById(R.id.link_preview_description)
|
||||
private val fallbackIcon: ImageView = findViewById(R.id.link_preview_fallback_icon)
|
||||
private val loadingSpinner: Stub<View> = Stub(findViewById(R.id.loading_spinner))
|
||||
|
||||
fun bind(linkPreview: LinkPreview?, hiddenVisibility: Int = View.INVISIBLE): ListenableFuture<Boolean> {
|
||||
var listenableFuture: ListenableFuture<Boolean>? = null
|
||||
private fun getThumbnailTarget(useLargeThumbnail: Boolean): ThumbnailView {
|
||||
return if (useLargeThumbnail) largeImage else smallImage
|
||||
}
|
||||
|
||||
fun getThumbnailViewWidth(useLargeThumbnail: Boolean): Int {
|
||||
return getThumbnailTarget(useLargeThumbnail).measuredWidth
|
||||
}
|
||||
|
||||
fun getThumbnailViewHeight(useLargeThumbnail: Boolean): Int {
|
||||
return getThumbnailTarget(useLargeThumbnail).measuredHeight
|
||||
}
|
||||
|
||||
fun setThumbnailDrawable(drawable: Drawable?, useLargeThumbnail: Boolean) {
|
||||
val image = getThumbnailTarget(useLargeThumbnail)
|
||||
image.setImageDrawable(GlideApp.with(this), drawable)
|
||||
}
|
||||
|
||||
fun bind(linkPreview: LinkPreview?, hiddenVisibility: Int = View.INVISIBLE, useLargeThumbnail: Boolean, loadThumbnail: Boolean = true): ListenableFuture<Boolean> {
|
||||
var future: ListenableFuture<Boolean>? = null
|
||||
|
||||
if (linkPreview != null) {
|
||||
visibility = View.VISIBLE
|
||||
isClickable = true
|
||||
|
||||
val corners = DimensionUnit.DP.toPixels(18f).toInt()
|
||||
image.setCorners(corners, corners, corners, corners)
|
||||
val image = getThumbnailTarget(useLargeThumbnail)
|
||||
val notImage = getThumbnailTarget(!useLargeThumbnail)
|
||||
|
||||
val imageSlide: ImageSlide? = linkPreview.thumbnail.map { ImageSlide(image.context, it) }.orElse(null)
|
||||
notImage.visible = false
|
||||
|
||||
val imageSlide: Slide? = linkPreview.thumbnail.map { ImageSlide(context, it) }.orElse(null)
|
||||
if (imageSlide != null) {
|
||||
listenableFuture = image.setImageResource(GlideApp.with(image), imageSlide, false, false)
|
||||
if (loadThumbnail) {
|
||||
future = image.setImageResource(
|
||||
GlideApp.with(this),
|
||||
imageSlide,
|
||||
false,
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
image.visible = true
|
||||
fallbackIcon.visible = false
|
||||
} else {
|
||||
|
@ -69,17 +98,17 @@ class StoryLinkPreviewView @JvmOverloads constructor(
|
|||
isClickable = false
|
||||
}
|
||||
|
||||
return listenableFuture ?: SettableFuture(false)
|
||||
return future ?: SettableFuture(false)
|
||||
}
|
||||
|
||||
fun bind(linkPreviewState: LinkPreviewViewModel.LinkPreviewState, hiddenVisibility: Int = View.INVISIBLE) {
|
||||
fun bind(linkPreviewState: LinkPreviewViewModel.LinkPreviewState, hiddenVisibility: Int = View.INVISIBLE, useLargeThumbnail: Boolean) {
|
||||
val linkPreview: LinkPreview? = linkPreviewState.linkPreview.orElseGet {
|
||||
linkPreviewState.activeUrlForError?.let {
|
||||
LinkPreview(it, LinkPreviewUtil.getTopLevelDomain(it) ?: it, null, -1L, null)
|
||||
}
|
||||
}
|
||||
|
||||
bind(linkPreview, hiddenVisibility)
|
||||
bind(linkPreview, hiddenVisibility, useLargeThumbnail)
|
||||
|
||||
loadingSpinner.get().visible = linkPreviewState.isLoading
|
||||
if (linkPreviewState.isLoading) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.graphics.drawable.ColorDrawable
|
|||
import android.graphics.drawable.Drawable
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.View
|
||||
import androidx.core.graphics.scale
|
||||
import androidx.core.view.drawToBitmap
|
||||
|
@ -14,6 +15,7 @@ import com.bumptech.glide.load.Options
|
|||
import com.bumptech.glide.load.ResourceDecoder
|
||||
import com.bumptech.glide.load.engine.Resource
|
||||
import com.bumptech.glide.load.resource.SimpleResource
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.conversation.colors.ChatColors
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||
|
@ -23,6 +25,8 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
|||
import org.thoughtcrime.securesms.fonts.TextFont
|
||||
import org.thoughtcrime.securesms.fonts.TextToScript
|
||||
import org.thoughtcrime.securesms.fonts.TypefaceCache
|
||||
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader
|
||||
import org.thoughtcrime.securesms.mms.GlideApp
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.Base64
|
||||
|
@ -109,7 +113,7 @@ data class StoryTextPostModel(
|
|||
|
||||
override fun decode(source: StoryTextPostModel, width: Int, height: Int, options: Options): Resource<Bitmap> {
|
||||
val message = SignalDatabase.mmsSms.getMessageFor(source.storySentAtMillis, source.storyAuthor)
|
||||
val view = StoryTextPostView(ApplicationDependencies.getApplication())
|
||||
val view = StoryTextPostView(ContextThemeWrapper(ApplicationDependencies.getApplication(), R.style.TextSecure_DarkNoActionBar))
|
||||
val typeface = TypefaceCache.get(
|
||||
ApplicationDependencies.getApplication(),
|
||||
TextFont.fromStyle(source.storyTextPost.style),
|
||||
|
@ -119,9 +123,30 @@ data class StoryTextPostModel(
|
|||
val displayWidth: Int = ApplicationDependencies.getApplication().resources.displayMetrics.widthPixels
|
||||
val arHeight: Int = (RENDER_HW_AR * displayWidth).toInt()
|
||||
|
||||
val linkPreview = (message as? MmsMessageRecord)?.linkPreviews?.firstOrNull()
|
||||
val useLargeThumbnail = source.text.isBlank()
|
||||
|
||||
view.setTypeface(typeface)
|
||||
view.bindFromStoryTextPost(source.storyTextPost)
|
||||
view.bindLinkPreview((message as? MmsMessageRecord)?.linkPreviews?.firstOrNull())
|
||||
view.bindLinkPreview(linkPreview, useLargeThumbnail, loadThumbnail = false)
|
||||
view.postAdjustLinkPreviewTranslationY()
|
||||
|
||||
view.invalidate()
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(displayWidth, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(arHeight, View.MeasureSpec.EXACTLY))
|
||||
view.layout(0, 0, view.measuredWidth, view.measuredHeight)
|
||||
|
||||
val drawable = if (linkPreview != null && linkPreview.thumbnail.isPresent) {
|
||||
GlideApp
|
||||
.with(view)
|
||||
.load(DecryptableStreamUriLoader.DecryptableUri(linkPreview.thumbnail.get().uri!!))
|
||||
.centerCrop()
|
||||
.submit(view.getLinkPreviewThumbnailWidth(useLargeThumbnail), view.getLinkPreviewThumbnailHeight(useLargeThumbnail))
|
||||
.get()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
view.setLinkPreviewDrawable(drawable, useLargeThumbnail)
|
||||
|
||||
view.invalidate()
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(displayWidth, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(arHeight, View.MeasureSpec.EXACTLY))
|
||||
|
|
|
@ -48,6 +48,14 @@ class StoryTextPostView @JvmOverloads constructor(
|
|||
TextStoryTextWatcher.install(textView)
|
||||
}
|
||||
|
||||
fun getLinkPreviewThumbnailWidth(useLargeThumbnail: Boolean): Int {
|
||||
return linkPreviewView.getThumbnailViewWidth(useLargeThumbnail)
|
||||
}
|
||||
|
||||
fun getLinkPreviewThumbnailHeight(useLargeThumbnail: Boolean): Int {
|
||||
return linkPreviewView.getThumbnailViewHeight(useLargeThumbnail)
|
||||
}
|
||||
|
||||
fun showCloseButton() {
|
||||
linkPreviewView.setCanClose(true)
|
||||
}
|
||||
|
@ -148,12 +156,16 @@ class StoryTextPostView @JvmOverloads constructor(
|
|||
postAdjustLinkPreviewTranslationY()
|
||||
}
|
||||
|
||||
fun bindLinkPreview(linkPreview: LinkPreview?): ListenableFuture<Boolean> {
|
||||
return linkPreviewView.bind(linkPreview, View.GONE)
|
||||
fun bindLinkPreview(linkPreview: LinkPreview?, useLargeThumbnail: Boolean, loadThumbnail: Boolean = true): ListenableFuture<Boolean> {
|
||||
return linkPreviewView.bind(linkPreview, View.GONE, useLargeThumbnail, loadThumbnail)
|
||||
}
|
||||
|
||||
fun bindLinkPreviewState(linkPreviewState: LinkPreviewViewModel.LinkPreviewState, hiddenVisibility: Int) {
|
||||
linkPreviewView.bind(linkPreviewState, hiddenVisibility)
|
||||
fun setLinkPreviewDrawable(drawable: Drawable?, useLargeThumbnail: Boolean) {
|
||||
linkPreviewView.setThumbnailDrawable(drawable, useLargeThumbnail)
|
||||
}
|
||||
|
||||
fun bindLinkPreviewState(linkPreviewState: LinkPreviewViewModel.LinkPreviewState, hiddenVisibility: Int, useLargeThumbnail: Boolean) {
|
||||
linkPreviewView.bind(linkPreviewState, hiddenVisibility, useLargeThumbnail)
|
||||
}
|
||||
|
||||
fun postAdjustLinkPreviewTranslationY() {
|
||||
|
@ -186,7 +198,7 @@ class StoryTextPostView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private fun canDisplayText(): Boolean {
|
||||
return !(linkPreviewView.isVisible && isPlaceholder)
|
||||
return !(linkPreviewView.isVisible && (isPlaceholder || textView.text.isEmpty()))
|
||||
}
|
||||
|
||||
private fun adjustLinkPreviewTranslationY() {
|
||||
|
|
|
@ -46,7 +46,8 @@ class StoryTextPostPreviewFragment : Fragment(R.layout.stories_text_post_preview
|
|||
StoryTextPostState.LoadState.INIT -> Unit
|
||||
StoryTextPostState.LoadState.LOADED -> {
|
||||
storyTextPostView.bindFromStoryTextPost(state.storyTextPost!!)
|
||||
storyTextPostView.bindLinkPreview(state.linkPreview)
|
||||
storyTextPostView.bindLinkPreview(state.linkPreview, state.storyTextPost.body.isBlank())
|
||||
storyTextPostView.postAdjustLinkPreviewTranslationY()
|
||||
|
||||
if (state.linkPreview != null) {
|
||||
storyTextPostView.setLinkPreviewClickListener {
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:background="@color/signal_dark_colorBackground"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<org.thoughtcrime.securesms.components.ClippedCardView
|
||||
android:id="@+id/link_preview_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:cardBackgroundColor="@color/transparent_black_40"
|
||||
android:maxWidth="280dp"
|
||||
app:cardBackgroundColor="#F6F8FB"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -23,30 +25,44 @@
|
|||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/link_preview_fallback_icon"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@color/core_grey_02"
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
android:id="@+id/link_preview_large"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="#FAFAFA"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
app:thumbnail_radius="0dp"
|
||||
app:layout_constraintDimensionRatio="280:161"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/link_preview_fallback_icon"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#FAFAFA"
|
||||
android:importantForAccessibility="no"
|
||||
android:padding="12dp"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Signal.Story.LinkPreview.Icon"
|
||||
app:srcCompat="@drawable/ic_link_24"
|
||||
app:tint="@color/core_grey_75" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.OutlinedThumbnailView
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
android:id="@+id/link_preview_image"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="76dp"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#FAFAFA"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
app:thumbnail_radius="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -64,15 +80,18 @@
|
|||
android:id="@+id/link_preview_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
||||
android:textColor="@color/core_white"
|
||||
android:textAppearance="@style/Signal.Text.LabelLarge"
|
||||
android:textColor="@color/signal_light_colorOnSurface"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/link_preview_description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/image_barrier"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/link_preview_large"
|
||||
app:layout_goneMarginBottom="12dp"
|
||||
app:layout_goneMarginStart="0dp"
|
||||
tools:text="ASDF dot com, the resource of your asdf dreams and whatnot. This needs to be 3 lines for testing." />
|
||||
|
||||
|
@ -82,22 +101,24 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/core_white"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_light_colorOnSurfaceVariant"
|
||||
app:layout_constraintBottom_toTopOf="@id/link_preview_url"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/link_preview_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/link_preview_title"
|
||||
app:layout_goneMarginBottom="12dp"
|
||||
tools:text="Blah blah blah" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/link_preview_url"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/transparent_white_60"
|
||||
android:textAppearance="@style/Signal.Text.BodySmall"
|
||||
android:textColor="@color/signal_light_colorOnSurfaceVariant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/link_preview_title"
|
||||
|
@ -116,13 +137,13 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</org.thoughtcrime.securesms.components.ClippedCardView>
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/link_preview_close"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/transparent_black_80"
|
||||
android:background="@color/transparent_white_80"
|
||||
android:padding="6dp"
|
||||
android:scaleType="centerInside"
|
||||
android:visibility="gone"
|
||||
|
@ -130,6 +151,6 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.Circle"
|
||||
app:srcCompat="@drawable/ic_x_24"
|
||||
app:tint="@color/core_white"
|
||||
app:tint="@color/signal_light_colorOnSurface"
|
||||
tools:visibility="visible" />
|
||||
</merge>
|
|
@ -13,8 +13,7 @@
|
|||
<item name="contactCheckboxBackground">@drawable/contact_selection_checkbox</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Signal.DayNight.NoActionBar" parent="TextSecure.LightNoActionBar">
|
||||
</style>
|
||||
<style name="Theme.Signal.DayNight.NoActionBar" parent="TextSecure.LightNoActionBar"></style>
|
||||
|
||||
<style name="TextSecure.LightNoActionBar" parent="@style/TextSecure.BaseLightNoActionBar">
|
||||
<!-- leave empty to allow overriding -->
|
||||
|
@ -335,18 +334,15 @@
|
|||
</style>
|
||||
|
||||
|
||||
<style name="Theme.Signal.Insights.Modal" parent="@style/Theme.AppCompat.Dialog.MinWidth">
|
||||
</style>
|
||||
<style name="Theme.Signal.Insights.Modal" parent="@style/Theme.AppCompat.Dialog.MinWidth"></style>
|
||||
|
||||
<style name="TextSecure.MediaSendProgressDialog" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:background">@color/core_grey_95</item>
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.LightRegistrationTheme" parent="TextSecure.LightNoActionBar">
|
||||
</style>
|
||||
<style name="TextSecure.LightRegistrationTheme" parent="TextSecure.LightNoActionBar"></style>
|
||||
|
||||
<style name="TextSecure.DarkRegistrationTheme" parent="TextSecure.DarkNoActionBar">
|
||||
</style>
|
||||
<style name="TextSecure.DarkRegistrationTheme" parent="TextSecure.DarkNoActionBar"></style>
|
||||
|
||||
<style name="TextSecure.LightNoActionBar.ConversationSettings" parent="TextSecure.LightNoActionBar">
|
||||
<item name="android:windowBackground">@color/transparent_black_20</item>
|
||||
|
@ -412,11 +408,9 @@
|
|||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Signal.Light.BottomSheetDialog" parent="Theme.Material3.Light.BottomSheetDialog">
|
||||
</style>
|
||||
<style name="Theme.Signal.Light.BottomSheetDialog" parent="Theme.Material3.Light.BottomSheetDialog"></style>
|
||||
|
||||
<style name="Theme.Signal.BottomSheetDialog" parent="Theme.Material3.Dark.BottomSheetDialog">
|
||||
</style>
|
||||
<style name="Theme.Signal.BottomSheetDialog" parent="Theme.Material3.Dark.BottomSheetDialog"></style>
|
||||
|
||||
<style name="Theme.Signal.Light.BottomSheetDialog.Fixed">
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
|
@ -499,14 +493,6 @@
|
|||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Signal.Story.LinkPreview.Icon" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">8dp</item>
|
||||
<item name="cornerSizeTopLeft">8dp</item>
|
||||
<item name="cornerSizeBottomLeft">8dp</item>
|
||||
<item name="cornerSizeBottomRight">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Signal.Story.Preview" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">10dp</item>
|
||||
|
@ -632,7 +618,7 @@
|
|||
<item name="chipCornerRadius">8dp</item>
|
||||
<item name="android:textAppearance">@style/Signal.Text.LabelLarge</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="ThemeOverlay.Signal.EditProfileInput" parent="ThemeOverlay.MaterialComponents">
|
||||
<item name="colorAccent">@color/signal_accent_primary</item>
|
||||
<item name="colorControlNormal">@color/signal_accent_primary</item>
|
||||
|
|
Ładowanie…
Reference in New Issue