kopia lustrzana https://github.com/ryukoposting/Signal-Android
Apply style changes to shared media, color icon, and wallpaper previews.
rodzic
9dac5691f0
commit
01047f0546
|
@ -371,7 +371,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
|||
|
||||
clickPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__chat_color_and_wallpaper),
|
||||
icon = DSLSettingsIcon.from(R.drawable.ic_wallpaper_24),
|
||||
icon = DSLSettingsIcon.from(R.drawable.ic_color_24),
|
||||
onClick = {
|
||||
startActivity(ChatWallpaperActivity.createIntent(requireContext(), state.recipient.id))
|
||||
}
|
||||
|
|
|
@ -56,17 +56,21 @@ import org.whispersystems.libsignal.util.guava.Optional;
|
|||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
||||
|
||||
private static final long SELECTION_ANIMATION_DURATION = TimeUnit.MILLISECONDS.toMillis(150);
|
||||
|
||||
private final Context context;
|
||||
private final boolean showThread;
|
||||
private final GlideRequests glideRequests;
|
||||
private final ItemClickListener itemClickListener;
|
||||
private final Map<AttachmentId, MediaRecord> selected = new HashMap<>();
|
||||
private final Map<AttachmentId, MediaRecord> selected = new HashMap<>();
|
||||
private final AudioItemListener audioItemListener;
|
||||
|
||||
private GroupedThreadMedia media;
|
||||
|
@ -74,10 +78,12 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
private boolean detailView;
|
||||
|
||||
private static final int AUDIO_DETAIL = 1;
|
||||
private static final int GALLERY = 2;
|
||||
public static final int GALLERY = 2;
|
||||
private static final int GALLERY_DETAIL = 3;
|
||||
private static final int DOCUMENT_DETAIL = 4;
|
||||
|
||||
private static final int PAYLOAD_SELECTED = 1;
|
||||
|
||||
void detach(RecyclerView.ViewHolder holder) {
|
||||
if (holder instanceof SelectableViewHolder) {
|
||||
((SelectableViewHolder) holder).onDetached();
|
||||
|
@ -101,13 +107,13 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
boolean showFileSizes,
|
||||
boolean showThread)
|
||||
{
|
||||
this.context = context;
|
||||
this.glideRequests = glideRequests;
|
||||
this.media = media;
|
||||
this.itemClickListener = clickListener;
|
||||
this.audioItemListener = audioItemListener;
|
||||
this.showFileSizes = showFileSizes;
|
||||
this.showThread = showThread;
|
||||
this.context = context;
|
||||
this.glideRequests = glideRequests;
|
||||
this.media = media;
|
||||
this.itemClickListener = clickListener;
|
||||
this.audioItemListener = audioItemListener;
|
||||
this.showFileSizes = showFileSizes;
|
||||
this.showThread = showThread;
|
||||
}
|
||||
|
||||
public void setMedia(GroupedThreadMedia media) {
|
||||
|
@ -138,16 +144,26 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
MediaDatabase.MediaRecord mediaRecord = media.get(section, offset);
|
||||
Slide slide = MediaUtil.getSlideForAttachment(context, mediaRecord.getAttachment());
|
||||
|
||||
if (slide.hasAudio()) return AUDIO_DETAIL;
|
||||
if (slide.hasAudio()) return AUDIO_DETAIL;
|
||||
if (slide.hasImage() || slide.hasVideo()) return detailView ? GALLERY_DETAIL : GALLERY;
|
||||
if (slide.hasDocument()) return DOCUMENT_DETAIL;
|
||||
if (slide.hasDocument()) return DOCUMENT_DETAIL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindHeaderViewHolder(HeaderViewHolder viewHolder, int section) {
|
||||
((HeaderHolder)viewHolder).textView.setText(media.getName(section));
|
||||
((HeaderHolder) viewHolder).textView.setText(media.getName(section));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position, @NonNull List<Object> payloads) {
|
||||
if (holder instanceof SelectableViewHolder && payloads.contains(PAYLOAD_SELECTED)) {
|
||||
SelectableViewHolder selectableViewHolder = (SelectableViewHolder) holder;
|
||||
selectableViewHolder.animateSelectedView();
|
||||
} else {
|
||||
super.onBindViewHolder(holder, position, payloads);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,7 +171,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
MediaDatabase.MediaRecord mediaRecord = media.get(section, offset);
|
||||
Slide slide = MediaUtil.getSlideForAttachment(context, mediaRecord.getAttachment());
|
||||
|
||||
((SelectableViewHolder)viewHolder).bind(context, mediaRecord, slide);
|
||||
((SelectableViewHolder) viewHolder).bind(context, mediaRecord, slide);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -183,7 +199,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
selected.put(attachmentId, mediaRecord);
|
||||
}
|
||||
|
||||
notifyDataSetChanged();
|
||||
notifyItemRangeChanged(0, getItemCount(), PAYLOAD_SELECTED);
|
||||
}
|
||||
|
||||
public int getSelectedMediaCount() {
|
||||
|
@ -203,7 +219,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
|
||||
public void clearSelection() {
|
||||
selected.clear();
|
||||
notifyDataSetChanged();
|
||||
notifyItemRangeChanged(0, getItemCount(), PAYLOAD_SELECTED);
|
||||
}
|
||||
|
||||
void selectAllMedia() {
|
||||
|
@ -215,7 +231,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
selected.put(mediaRecord.getAttachment().getAttachmentId(), mediaRecord);
|
||||
}
|
||||
}
|
||||
this.notifyDataSetChanged();
|
||||
this.notifyItemRangeChanged(0, getItemCount(), PAYLOAD_SELECTED);
|
||||
}
|
||||
|
||||
void setShowFileSizes(boolean showFileSizes) {
|
||||
|
@ -228,9 +244,10 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
|
||||
class SelectableViewHolder extends ItemViewHolder {
|
||||
|
||||
private final View selectedIndicator;
|
||||
private MediaDatabase.MediaRecord mediaRecord;
|
||||
private boolean bound;
|
||||
protected final View selectedIndicator;
|
||||
|
||||
private MediaDatabase.MediaRecord mediaRecord;
|
||||
private boolean bound;
|
||||
|
||||
SelectableViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
|
@ -250,15 +267,27 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
bound = false;
|
||||
}
|
||||
|
||||
private void updateSelectedView() {
|
||||
protected boolean isSelected() {
|
||||
return selected.containsKey(mediaRecord.getAttachment().getAttachmentId());
|
||||
}
|
||||
|
||||
protected void updateSelectedView() {
|
||||
if (selectedIndicator != null) {
|
||||
selectedIndicator.setVisibility(selected.containsKey(mediaRecord.getAttachment().getAttachmentId()) ? View.VISIBLE : View.GONE);
|
||||
selectedIndicator.animate().cancel();
|
||||
selectedIndicator.setAlpha(isSelected() ? 1f : 0f);
|
||||
}
|
||||
}
|
||||
|
||||
protected void animateSelectedView() {
|
||||
if (selectedIndicator != null) {
|
||||
selectedIndicator.animate()
|
||||
.alpha(isSelected() ? 1f : 0f)
|
||||
.setDuration(SELECTION_ANIMATION_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
boolean onLongClick() {
|
||||
itemClickListener.onMediaLongClicked(mediaRecord);
|
||||
updateSelectedView();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -271,6 +300,9 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
|
||||
private class GalleryViewHolder extends SelectableViewHolder {
|
||||
|
||||
private static final float SCALE_SELECTED = 0.83f;
|
||||
private static final float SCALE_NORMAL = 1f;
|
||||
|
||||
private final ThumbnailView thumbnailView;
|
||||
private final TextView imageFileSize;
|
||||
|
||||
|
@ -296,18 +328,40 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
thumbnailView.setOnLongClickListener(view -> onLongClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateSelectedView() {
|
||||
super.updateSelectedView();
|
||||
|
||||
thumbnailView.animate().cancel();
|
||||
|
||||
float scale = isSelected() ? SCALE_SELECTED : SCALE_NORMAL;
|
||||
thumbnailView.setScaleX(scale);
|
||||
thumbnailView.setScaleY(scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
void unbind() {
|
||||
thumbnailView.clear(glideRequests);
|
||||
super.unbind();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateSelectedView() {
|
||||
super.animateSelectedView();
|
||||
|
||||
float scale = isSelected() ? SCALE_SELECTED : SCALE_NORMAL;
|
||||
thumbnailView.animate()
|
||||
.scaleX(scale)
|
||||
.scaleY(scale)
|
||||
.setDuration(SELECTION_ANIMATION_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class DetailViewHolder extends SelectableViewHolder implements Observer<Pair<Recipient, Recipient>> {
|
||||
|
||||
protected final View itemView;
|
||||
private final TextView line1;
|
||||
private final TextView line2;
|
||||
private final TextView line1;
|
||||
private final TextView line2;
|
||||
private LiveDataPair<Recipient, Recipient> liveDataPair;
|
||||
private Optional<String> fileName;
|
||||
private String fileTypeDescription;
|
||||
|
@ -333,7 +387,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
itemView.setOnClickListener(view -> itemClickListener.onMediaClicked(mediaRecord));
|
||||
itemView.setOnLongClickListener(view -> onLongClick());
|
||||
selectForMarque = () -> line1.setSelected(true);
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
handler.postDelayed(selectForMarque, 2500);
|
||||
|
||||
LiveRecipient from = mediaRecord.isOutgoing() ? Recipient.self().live() : Recipient.live(mediaRecord.getRecipientId());
|
||||
|
@ -358,7 +412,7 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
DateUtils.formatDateWithoutDayOfWeek(Locale.getDefault(), mediaRecord.getDate()));
|
||||
}
|
||||
|
||||
protected String getFileTypeDescription(@NonNull Context context, @NonNull Slide slide){
|
||||
protected String getFileTypeDescription(@NonNull Context context, @NonNull Slide slide) {
|
||||
return context.getString(R.string.MediaOverviewActivity_file);
|
||||
}
|
||||
|
||||
|
@ -529,15 +583,21 @@ final class MediaGalleryAllAdapter extends StickyHeaderGridAdapter {
|
|||
|
||||
interface ItemClickListener {
|
||||
void onMediaClicked(@NonNull MediaDatabase.MediaRecord mediaRecord);
|
||||
|
||||
void onMediaLongClicked(MediaDatabase.MediaRecord mediaRecord);
|
||||
}
|
||||
|
||||
interface AudioItemListener {
|
||||
void onPlay(@NonNull Uri audioUri, double progress, long messageId);
|
||||
|
||||
void onPause(@NonNull Uri audioUri);
|
||||
|
||||
void onSeekTo(@NonNull Uri audioUri, double progress);
|
||||
|
||||
void onStopAndReset(@NonNull Uri audioUri);
|
||||
|
||||
void registerPlaybackStateObserver(@NonNull Observer<VoiceNotePlaybackState> observer);
|
||||
|
||||
void unregisterPlaybackStateObserver(@NonNull Observer<VoiceNotePlaybackState> observer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package org.thoughtcrime.securesms.mediaoverview
|
||||
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import androidx.annotation.Px
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
|
||||
internal class MediaGridDividerDecoration(
|
||||
private val spanCount: Int,
|
||||
@Px private val space: Int,
|
||||
private val adapter: MediaGalleryAllAdapter
|
||||
) : RecyclerView.ItemDecoration() {
|
||||
|
||||
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
|
||||
val holder = parent.getChildViewHolder(view)
|
||||
|
||||
val adapterPosition = holder.adapterPosition
|
||||
val section = adapter.getAdapterPositionSection(adapterPosition)
|
||||
val itemSectionOffset = adapter.getItemSectionOffset(section, adapterPosition)
|
||||
|
||||
if (itemSectionOffset == -1) {
|
||||
return
|
||||
}
|
||||
|
||||
val sectionItemViewType = adapter.getSectionItemViewType(section, itemSectionOffset)
|
||||
if (sectionItemViewType != MediaGalleryAllAdapter.GALLERY) {
|
||||
return
|
||||
}
|
||||
|
||||
val column = itemSectionOffset % spanCount
|
||||
val isRtl = ViewUtil.isRtl(view)
|
||||
|
||||
val distanceFromEnd = spanCount - 1 - column
|
||||
|
||||
val spaceStart = (column / spanCount.toFloat()) * space
|
||||
val spaceEnd = (distanceFromEnd / spanCount.toFloat()) * space
|
||||
|
||||
outRect.setStart(spaceStart.toInt(), isRtl)
|
||||
outRect.setEnd(spaceEnd.toInt(), isRtl)
|
||||
outRect.bottom = space
|
||||
}
|
||||
|
||||
private fun Rect.setEnd(end: Int, isRtl: Boolean) {
|
||||
if (isRtl) {
|
||||
left = end
|
||||
} else {
|
||||
right = end
|
||||
}
|
||||
}
|
||||
|
||||
private fun Rect.setStart(start: Int, isRtl: Boolean) {
|
||||
if (isRtl) {
|
||||
right = start
|
||||
} else {
|
||||
left = start
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ package org.thoughtcrime.securesms.mediaoverview;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -28,6 +29,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
@ -96,8 +98,8 @@ public final class MediaOverviewActivity extends PassphraseRequiredActivity {
|
|||
|
||||
boolean allThreads = threadId == MediaDatabase.ALL_THREADS;
|
||||
|
||||
tabLayout.addOnTabSelectedListener(new OnTabSelectedListener());
|
||||
fillTabLayoutIfFits(tabLayout);
|
||||
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
viewPager.setAdapter(new MediaOverviewPagerAdapter(getSupportFragmentManager()));
|
||||
|
||||
|
@ -283,4 +285,40 @@ public final class MediaOverviewActivity extends PassphraseRequiredActivity {
|
|||
return pages.get(position).second();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class OnTabSelectedListener implements TabLayout.OnTabSelectedListener {
|
||||
|
||||
private final Typeface tabUnselected = Typeface.create("sans-serif", Typeface.NORMAL);
|
||||
private final Typeface tabSelected = Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
||||
|
||||
@Override
|
||||
public void onTabSelected(@NonNull TabLayout.Tab tab) {
|
||||
View view = getCustomView(tab);
|
||||
TextView title = view.findViewById(android.R.id.text1);
|
||||
title.setTypeface(tabSelected);
|
||||
title.setTextColor(ContextCompat.getColor(view.getContext(), R.color.signal_inverse_primary));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(@NonNull TabLayout.Tab tab) {
|
||||
View view = getCustomView(tab);
|
||||
TextView title = view.findViewById(android.R.id.text1);
|
||||
title.setTypeface(tabUnselected);
|
||||
title.setTextColor(ContextCompat.getColor(view.getContext(), R.color.signal_text_secondary));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(@NonNull TabLayout.Tab tab) {
|
||||
// Intentionally Blank.
|
||||
}
|
||||
|
||||
private @NonNull View getCustomView(@NonNull TabLayout.Tab tab) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView == null) {
|
||||
tab.setCustomView(R.layout.custom_tab_layout_text);
|
||||
}
|
||||
|
||||
return tab.getCustomView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.thoughtcrime.securesms.mms.GlideApp;
|
|||
import org.thoughtcrime.securesms.mms.PartAuthority;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.WindowUtil;
|
||||
|
||||
public final class MediaOverviewPageFragment extends Fragment
|
||||
|
@ -109,10 +110,11 @@ public final class MediaOverviewPageFragment extends Fragment
|
|||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
Context context = requireContext();
|
||||
View view = inflater.inflate(R.layout.media_overview_page_fragment, container, false);
|
||||
int spans = getResources().getInteger(R.integer.media_overview_cols);
|
||||
|
||||
this.recyclerView = view.findViewById(R.id.media_grid);
|
||||
this.noMedia = view.findViewById(R.id.no_images);
|
||||
this.gridManager = new StickyHeaderGridLayoutManager(getResources().getInteger(R.integer.media_overview_cols));
|
||||
this.gridManager = new StickyHeaderGridLayoutManager(spans);
|
||||
|
||||
this.adapter = new MediaGalleryAllAdapter(context,
|
||||
GlideApp.with(this),
|
||||
|
@ -124,6 +126,7 @@ public final class MediaOverviewPageFragment extends Fragment
|
|||
this.recyclerView.setAdapter(adapter);
|
||||
this.recyclerView.setLayoutManager(gridManager);
|
||||
this.recyclerView.setHasFixedSize(true);
|
||||
this.recyclerView.addItemDecoration(new MediaGridDividerDecoration(spans, ViewUtil.dpToPx(4), adapter));
|
||||
|
||||
MediaOverviewViewModel viewModel = MediaOverviewViewModel.getMediaOverviewViewModel(requireActivity());
|
||||
|
||||
|
@ -264,7 +267,6 @@ public final class MediaOverviewPageFragment extends Fragment
|
|||
@Override
|
||||
public void onMediaLongClicked(MediaDatabase.MediaRecord mediaRecord) {
|
||||
((MediaGalleryAllAdapter) recyclerView.getAdapter()).toggleSelection(mediaRecord);
|
||||
recyclerView.getAdapter().notifyDataSetChanged();
|
||||
|
||||
if (actionMode == null) {
|
||||
enterMultiSelect();
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package org.thoughtcrime.securesms.wallpaper;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
class ChatWallpaperAlignmentDecoration extends RecyclerView.ItemDecoration {
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
int itemPosition = parent.getChildAdapterPosition(view);
|
||||
int itemCount = state.getItemCount();
|
||||
|
||||
if (itemCount > 0 && itemPosition == itemCount - 1) {
|
||||
outRect.set(0, 0, 0, 0);
|
||||
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
int viewWidth = view.getMeasuredWidth() + params.rightMargin + params.leftMargin;
|
||||
int availableWidth = (parent.getRight() - parent.getPaddingRight()) - (parent.getLeft() + parent.getPaddingLeft());
|
||||
int itemsPerRow = availableWidth / viewWidth;
|
||||
|
||||
if (itemsPerRow == 1 || (itemPosition + 1) % itemsPerRow == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int extraCellsNeeded = itemsPerRow - ((itemPosition + 1) % itemsPerRow);
|
||||
|
||||
setEnd(outRect, ViewUtil.isLtr(view), extraCellsNeeded * viewWidth);
|
||||
} else {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
}
|
||||
}
|
||||
|
||||
private void setEnd(@NonNull Rect outRect, boolean ltr, int end) {
|
||||
if (ltr) {
|
||||
outRect.right = end;
|
||||
} else {
|
||||
outRect.left = end;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,14 @@
|
|||
package org.thoughtcrime.securesms.wallpaper;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.airbnb.lottie.SimpleColorFilter;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
|
||||
|
@ -19,4 +25,13 @@ public final class ChatWallpaperDimLevelUtil {
|
|||
dimmer.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public static @Nullable ColorFilter getDimColorFilterForNightMode(@NonNull Context context, @NonNull ChatWallpaper chatWallpaper) {
|
||||
if (ThemeUtil.isDarkTheme(context)) {
|
||||
int color = Color.argb(Math.round(0xFF * chatWallpaper.getDimLevelForDarkTheme()), 0, 0, 0);
|
||||
return new SimpleColorFilter(color);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ public class ChatWallpaperSelectionFragment extends Fragment {
|
|||
});
|
||||
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new ChatWallpaperAlignmentDecoration());
|
||||
|
||||
viewModel = ViewModelProviders.of(requireActivity()).get(ChatWallpaperViewModel.class);
|
||||
viewModel.getWallpapers().observe(getViewLifecycleOwner(), adapter::submitList);
|
||||
|
|
|
@ -20,14 +20,12 @@ class ChatWallpaperViewHolder extends MappingViewHolder<ChatWallpaperSelectionMa
|
|||
|
||||
private final AspectRatioFrameLayout frame;
|
||||
private final ImageView preview;
|
||||
private final View dimmer;
|
||||
private final EventListener eventListener;
|
||||
|
||||
public ChatWallpaperViewHolder(@NonNull View itemView, @Nullable EventListener eventListener, @Nullable DisplayMetrics windowDisplayMetrics) {
|
||||
super(itemView);
|
||||
this.frame = itemView.findViewById(R.id.chat_wallpaper_preview_frame);
|
||||
this.preview = itemView.findViewById(R.id.chat_wallpaper_preview);
|
||||
this.dimmer = itemView.findViewById(R.id.chat_wallpaper_dim);
|
||||
this.eventListener = eventListener;
|
||||
|
||||
if (windowDisplayMetrics != null) {
|
||||
|
@ -41,7 +39,7 @@ class ChatWallpaperViewHolder extends MappingViewHolder<ChatWallpaperSelectionMa
|
|||
public void bind(@NonNull ChatWallpaperSelectionMappingModel model) {
|
||||
model.loadInto(preview);
|
||||
|
||||
ChatWallpaperDimLevelUtil.applyDimLevelForNightMode(dimmer, model.getWallpaper());
|
||||
preview.setColorFilter(ChatWallpaperDimLevelUtil.getDimColorFilterForNightMode(context, model.getWallpaper()));
|
||||
|
||||
if (eventListener != null) {
|
||||
preview.setOnClickListener(unused -> {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,1a11,11 0,0 0,0 22,2.75 2.75,0 0,0 2.75,-2.75 2.81,2.81 0,0 0,-0.7 -1.84,0.58 0.58,0 0,1 -0.15,-0.36 0.55,0.55 0,0 1,0.55 -0.55L16.4,17.5A6.61,6.61 0,0 0,23 10.9C23,5.44 18.06,1 12,1ZM6.25,7.75a1.5,1.5 0,1 1,-1.5 1.5A1.5,1.5 0,0 1,6.25 7.75ZM6.5,16A1.5,1.5 0,1 1,8 14.5,1.5 1.5,0 0,1 6.5,16ZM10.5,7.5A1.5,1.5 0,1 1,12 6,1.5 1.5,0 0,1 10.5,7.5ZM15.5,8.5A1.5,1.5 0,1 1,17 7,1.5 1.5,0 0,1 15.5,8.5ZM18,13a1.5,1.5 0,1 1,1.5 -1.5A1.5,1.5 0,0 1,18 13Z"
|
||||
android:fillColor="#020202"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,2.5c5.24,0 9.5,3.77 9.5,8.4A5.11,5.11 0,0 1,16.4 16L14.45,16a2.05,2.05 0,0 0,-2 2.05,2.14 2.14,0 0,0 0.47,1.3l0,0 0,0a1.34,1.34 0,0 1,0.33 0.85A1.25,1.25 0,0 1,12 21.5a9.5,9.5 0,0 1,0 -19M12,1a11,11 0,0 0,0 22,2.75 2.75,0 0,0 2.75,-2.75 2.81,2.81 0,0 0,-0.7 -1.84,0.58 0.58,0 0,1 -0.15,-0.36 0.54,0.54 0,0 1,0.55 -0.55L16.4,17.5A6.61,6.61 0,0 0,23 10.9C23,5.44 18.06,1 12,1ZM15.5,5.5A1.5,1.5 0,1 0,17 7,1.5 1.5,0 0,0 15.5,5.5ZM18,10a1.5,1.5 0,1 0,1.5 1.5A1.5,1.5 0,0 0,18 10ZM10.5,4.5A1.5,1.5 0,1 0,12 6,1.5 1.5,0 0,0 10.5,4.5ZM6.25,7.75a1.5,1.5 0,1 0,1.5 1.5A1.5,1.5 0,0 0,6.25 7.75ZM6.5,13A1.5,1.5 0,1 0,8 14.5,1.5 1.5,0 0,0 6.5,13Z"
|
||||
android:fillColor="#020202"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M5,17.5a3,3 0,0 1,-3 -3L2,5A3,3 0,0 1,5 2h9.5a3,3 0,0 1,3 3L16,5a1.5,1.5 0,0 0,-1.5 -1.5L5,3.5A1.5,1.5 0,0 0,3.5 5v9.5A1.5,1.5 0,0 0,5 16ZM22,9.5L22,19a3,3 0,0 1,-3 3L9.5,22a3,3 0,0 1,-3 -3L6.5,9.5a3,3 0,0 1,3 -3L19,6.5A3,3 0,0 1,22 9.5ZM8,9.5v4.75l0.62,-0.93 3.14,-3.15 3.5,3.51 2.5,-2.51 2.06,2.06 0.68,1L20.5,9.5A1.5,1.5 0,0 0,19 8L9.5,8A1.5,1.5 0,0 0,8 9.5ZM20.5,19L20.5,16L17.76,13.3l-1.44,1.44L17.54,16 16.48,17 11.76,12.3 8,16.06L8,19a1.5,1.5 0,0 0,1.5 1.5L19,20.5A1.5,1.5 0,0 0,20.5 19Z"/>
|
||||
</vector>
|
|
@ -12,18 +12,21 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/chat_wallpaper_choose_from_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:drawablePadding="26dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:minHeight="56dp"
|
||||
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||
android:text="@string/ChatWallpaperSelectionFragment__choose_from_photos"
|
||||
android:textAppearance="@style/Signal.Text.Body"
|
||||
android:textColor="@color/signal_text_primary"
|
||||
app:drawableStartCompat="@drawable/ic_photo_album_24"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
@ -31,9 +34,9 @@
|
|||
<View
|
||||
android:id="@+id/chat_wallpaper_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/signal_inverse_transparent_15"
|
||||
android:background="@color/signal_inverse_transparent_05"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chat_wallpaper_choose_from_photos" />
|
||||
|
@ -41,15 +44,17 @@
|
|||
<TextView
|
||||
android:id="@+id/chat_wallpaper_presets"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:minHeight="48dp"
|
||||
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||
android:paddingBottom="12dp"
|
||||
android:text="@string/ChatWallpaperSelectionFragment__presets"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/signal_text_secondary"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chat_wallpaper_divider" />
|
||||
|
@ -59,14 +64,14 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingStart="@dimen/wallpaper_selection_gutter"
|
||||
android:paddingEnd="@dimen/wallpaper_selection_gutter"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chat_wallpaper_presets"
|
||||
app:spanCount="3"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
tools:listitem="@layout/chat_wallpaper_selection_fragment_adapter_item" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -5,25 +5,17 @@
|
|||
android:id="@+id/chat_wallpaper_preview_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="16dp"
|
||||
app:resize_mode="fixed_width">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/chat_wallpaper_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Signal.WallpaperPreview"
|
||||
tools:src="@drawable/test_gradient" />
|
||||
|
||||
<View
|
||||
android:id="@+id/chat_wallpaper_dim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:visibility="gone"
|
||||
tools:alpha="0.2f"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:maxLines="2"
|
||||
tools:text="Media" />
|
|
@ -1,67 +1,80 @@
|
|||
<?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:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navigationIcon="@drawable/ic_arrow_left_24"
|
||||
app:title="@string/EditProfileNameFragment_your_name" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navigationIcon="@drawable/ic_x"
|
||||
app:title="@string/EditProfileNameFragment_your_name"
|
||||
app:titleTextAppearance="@style/Signal.Text.Title" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
android:id="@+id/edit_profile_name_given_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:hint="@string/EditProfileNameFragment_first_name"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/edit_profile_given_name_wrapper"
|
||||
style="@style/Widget.Signal.TextInputLayout.FilledBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:hint="@string/EditProfileNameFragment_first_name"
|
||||
android:minHeight="56dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
android:id="@+id/edit_profile_name_family_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:hint="@string/EditProfileNameFragment_last_name_optional"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintTop_toBottomOf="@id/edit_profile_name_given_name"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
android:id="@+id/edit_profile_name_given_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1" />
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/edit_profile_name_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/EditProfileNameFragment_save"
|
||||
app:cornerRadius="80dp"
|
||||
app:elevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="?colorAccent"
|
||||
app:cpb_cornerRadius="28dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/EditProfileNameFragment_save" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/edit_profile_family_name_wrapper"
|
||||
style="@style/Widget.Signal.TextInputLayout.FilledBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:hint="@string/EditProfileNameFragment_last_name_optional"
|
||||
android:minHeight="56dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/edit_profile_given_name_wrapper">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
android:id="@+id/edit_profile_name_family_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/edit_profile_name_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/EditProfileNameFragment_save"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="80dp"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="?colorAccent"
|
||||
app:cpb_cornerRadius="28dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/EditProfileNameFragment_save"
|
||||
app:elevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -17,95 +17,103 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@color/media_overview_toolbar_background"
|
||||
android:titleTextColor="@color/media_overview_toolbar_foreground"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
||||
android:background="@color/signal_background_primary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:titleTextColor="@color/media_overview_toolbar_foreground" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.ControllableTabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/media_overview_toolbar_background"
|
||||
app:tabIndicatorColor="@color/core_ultramarine"
|
||||
android:background="@color/signal_background_primary"
|
||||
app:tabIndicatorColor="@color/signal_inverse_primary"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabMode="scrollable"
|
||||
app:tabSelectedTextColor="@color/core_ultramarine" />
|
||||
app:tabSelectedTextColor="@color/signal_text_primary"
|
||||
app:tabTextAppearance="@style/TextAppearance.Signal.Body2"
|
||||
app:tabTextColor="@color/signal_text_secondary" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/sorting"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@id/sorting"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@color/media_overview_toolbar_secondary_background"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appBarLayout" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sort_order"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/media_overview_toolbar_foreground"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sorting"
|
||||
app:layout_constraintStart_toStartOf="@+id/sorting"
|
||||
app:layout_constraintTop_toBottomOf="@+id/appBarLayout"
|
||||
tools:text="@string/MediaOverviewActivity_Storage_used" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/sort_order_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:padding="4dp"
|
||||
android:tint="@color/media_overview_toolbar_foreground"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sort_order"
|
||||
app:layout_constraintStart_toEndOf="@+id/sort_order"
|
||||
app:layout_constraintTop_toTopOf="@+id/sort_order"
|
||||
app:srcCompat="@drawable/ic_arrow_down_14" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
||||
android:id="@+id/grid_list_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sorting"
|
||||
app:layout_constraintEnd_toEndOf="@+id/sorting"
|
||||
app:layout_constraintTop_toBottomOf="@+id/appBarLayout">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/view_grid"
|
||||
<TextView
|
||||
android:id="@+id/sort_order"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/MediaOverviewActivity_Grid_view_description"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:tint="@color/media_overview_toolbar_foreground"
|
||||
android:visibility="visible"
|
||||
app:srcCompat="@drawable/ic_grid_20" />
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
||||
android:textColor="@color/signal_inverse_primary"
|
||||
app:layout_constraintStart_toStartOf="@+id/sorting"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/MediaOverviewActivity_Storage_used" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/view_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/MediaOverviewActivity_List_view_description"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:tint="@color/media_overview_toolbar_foreground"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/ic_list_20" />
|
||||
android:id="@+id/sort_order_arrow"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/signal_inverse_primary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sort_order"
|
||||
app:layout_constraintStart_toEndOf="@+id/sort_order"
|
||||
app:layout_constraintTop_toTopOf="@+id/sort_order"
|
||||
app:srcCompat="@drawable/ic_arrow_down_14" />
|
||||
|
||||
|
||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
||||
android:id="@+id/grid_list_toggle"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sort_order_arrow"
|
||||
app:layout_constraintEnd_toEndOf="@+id/sorting"
|
||||
app:layout_constraintTop_toTopOf="@+id/sort_order_arrow">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/view_grid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/MediaOverviewActivity_Grid_view_description"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:tint="@color/signal_inverse_primary"
|
||||
android:visibility="visible"
|
||||
app:srcCompat="@drawable/ic_grid_20" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/view_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/MediaOverviewActivity_List_view_description"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:tint="@color/signal_inverse_primary"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/ic_list_20" />
|
||||
|
||||
</org.thoughtcrime.securesms.components.AnimatingToggle>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</org.thoughtcrime.securesms.components.AnimatingToggle>
|
||||
|
||||
<org.thoughtcrime.securesms.components.ControllableViewPager
|
||||
android:id="@+id/pager"
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="56dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
@ -18,14 +18,14 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:autoRewind="true"
|
||||
app:progressAndPlayTint="@android:color/transparent"
|
||||
app:foregroundTintColor="@color/core_ultramarine"
|
||||
app:progressAndPlayTint="@android:color/transparent"
|
||||
app:small="true" />
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
|
||||
<include layout="@layout/media_overview_detail_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:minHeight="56dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -9,48 +10,38 @@
|
|||
android:id="@+id/image_container"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/document_icon_container"
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_document_large" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/document_extension"
|
||||
style="@style/Signal.Text.Caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="50dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_document_large" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/document_extension"
|
||||
style="@style/Signal.Text.Caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/core_black"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible"
|
||||
tools:text="PDF"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
android:gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/core_black"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible"
|
||||
tools:text="PDF"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
|
||||
<include layout="@layout/media_overview_detail_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -2,27 +2,32 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="56dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/media_preview_activity__media_content_description" />
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/media_preview_activity__media_content_description"
|
||||
app:thumbnail_radius="8dp"
|
||||
app:transparent_overlay_color="@color/transparent_black_08" />
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/media_overview_selected_overlay" />
|
||||
|
||||
|
||||
<include layout="@layout/media_overview_detail_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/image_container"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/media_preview_activity__media_content_description"
|
||||
android:padding="2dp" />
|
||||
app:thumbnail_radius="0dp"
|
||||
app:transparent_overlay_color="@color/transparent_black_08" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/image_file_size"
|
||||
|
@ -32,17 +33,20 @@
|
|||
android:id="@+id/selected_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/MediaOverview_Media_selected_overlay"
|
||||
android:visibility="gone"
|
||||
tools:showIn="@layout/media_overview_gallery_item"
|
||||
tools:visibility="visible">
|
||||
android:alpha="0"
|
||||
tools:alpha="1"
|
||||
tools:showIn="@layout/media_overview_gallery_item">
|
||||
|
||||
<ImageView
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
android:contentDescription="@string/MediaOverviewActivity_Selected_description"
|
||||
android:padding="1dp"
|
||||
app:backgroundTint="@color/signal_background_primary"
|
||||
app:srcCompat="@drawable/ic_check_circle_solid_20" />
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/media_overview_toolbar_background"
|
||||
android:padding="16dp">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/signal_background_primary"
|
||||
android:minHeight="48dp"
|
||||
android:paddingStart="@dimen/dsl_settings_gutter"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="@dimen/dsl_settings_gutter"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<TextView android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:textColor="@color/media_overview_header_foreground"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
tools:text="March 1, 2015" />
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1.Bold"
|
||||
android:textStyle="bold"
|
||||
tools:text="March 1, 2015" />
|
||||
</FrameLayout>
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/media_overview_toolbar_background">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/media_grid"
|
||||
|
|
|
@ -3,18 +3,25 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/selected_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/media_overview_toolbar_background"
|
||||
android:visibility="gone"
|
||||
tools:showIn="@layout/media_overview_detail_item_document"
|
||||
tools:visibility="visible">
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:alpha="0"
|
||||
app:layout_constraintBottom_toBottomOf="@id/image_container"
|
||||
app:layout_constraintEnd_toEndOf="@id/image_container"
|
||||
app:layout_constraintStart_toStartOf="@id/image_container"
|
||||
app:layout_constraintTop_toTopOf="@id/image_container"
|
||||
tools:alpha="1"
|
||||
tools:showIn="@layout/media_overview_detail_item_media">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:background="@drawable/circle_tintable"
|
||||
android:contentDescription="@string/MediaOverviewActivity_Selected_description"
|
||||
android:padding="1dp"
|
||||
android:scaleType="centerInside"
|
||||
app:backgroundTint="@color/signal_background_primary"
|
||||
app:srcCompat="@drawable/ic_check_circle_solid_20" />
|
||||
|
||||
</FrameLayout>
|
|
@ -20,6 +20,8 @@
|
|||
<color name="signal_text_secondary">@color/core_grey_25</color>
|
||||
<color name="signal_text_selected">@color/core_white</color>
|
||||
|
||||
<color name="signal_text_hint">@color/core_grey_15</color>
|
||||
|
||||
<color name="signal_text_toolbar_title">@color/transparent_white_90</color>
|
||||
<color name="signal_text_toolbar_subtitle">@color/transparent_white_80</color>
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
<dimen name="media_bubble_gif_width">260dp</dimen>
|
||||
<dimen name="dsl_settings_gutter">24dp</dimen>
|
||||
<dimen name="wallpaper_selection_gutter">16dp</dimen>
|
||||
|
||||
<dimen name="chat_colors_preview_bubble_max_width">260dp</dimen>
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
<dimen name="mention_corner_radius">4dp</dimen>
|
||||
|
||||
<integer name="media_overview_cols">3</integer>
|
||||
<integer name="media_overview_cols">4</integer>
|
||||
<dimen name="message_details_table_row_pad">8dp</dimen>
|
||||
|
||||
<dimen name="sticker_page_item_padding">8dp</dimen>
|
||||
|
@ -181,6 +181,7 @@
|
|||
<dimen name="payment_recovery_phrase_outline_margin">32dp</dimen>
|
||||
|
||||
<dimen name="dsl_settings_gutter">16dp</dimen>
|
||||
<dimen name="wallpaper_selection_gutter">8dp</dimen>
|
||||
|
||||
<dimen name="chat_colors_preview_bubble_max_width">240dp</dimen>
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
<color name="signal_text_secondary">@color/core_grey_60</color>
|
||||
<color name="signal_text_selected">@color/core_black</color>
|
||||
|
||||
<color name="signal_text_hint">@color/core_grey_45</color>
|
||||
|
||||
<color name="signal_text_toolbar_title">@color/core_white</color>
|
||||
<color name="signal_text_toolbar_subtitle">@color/transparent_white_90</color>
|
||||
|
||||
|
|
|
@ -522,4 +522,18 @@
|
|||
<item name="textAppearanceUnit">@style/TextAppearance.TimeDurationPicker.Unit.Large.Dark</item>
|
||||
<item name="android:layoutDirection">ltr</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Signal.TextInputLayout.FilledBox" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
|
||||
<item name="android:paddingStart">@dimen/dsl_settings_gutter</item>
|
||||
<item name="android:paddingEnd">@dimen/dsl_settings_gutter</item>
|
||||
<item name="boxBackgroundColor">@color/signal_background_secondary</item>
|
||||
<item name="boxCornerRadiusBottomEnd">10dp</item>
|
||||
<item name="boxCornerRadiusBottomStart">10dp</item>
|
||||
<item name="boxCornerRadiusTopEnd">10dp</item>
|
||||
<item name="boxCornerRadiusTopStart">10dp</item>
|
||||
<item name="boxStrokeWidth">0dp</item>
|
||||
<item name="boxStrokeWidthFocused">0dp</item>
|
||||
<item name="hintTextAppearance">@style/Signal.Text.Caption</item>
|
||||
<item name="android:textColorHint">@color/signal_text_hint</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -393,6 +393,14 @@
|
|||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Signal.WallpaperPreview" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">12dp</item>
|
||||
<item name="cornerSizeTopLeft">12dp</item>
|
||||
<item name="cornerSizeBottomLeft">12dp</item>
|
||||
<item name="cornerSizeBottomRight">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Signal.BottomSheet.Rounded" parent="Widget.MaterialComponents.BottomSheet">
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.Signal.BottomSheet.Rounded</item>
|
||||
<item name="backgroundTint">@color/core_grey_75</item>
|
||||
|
|
Ładowanie…
Reference in New Issue