fix(extended-footer): readd visibility indicator
This commit is contained in:
@@ -67,7 +67,7 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
||||
public static class Holder extends StatusDisplayItem.Holder<ExtendedFooterStatusDisplayItem>{
|
||||
private final TextView time, date, app, dateAppSeparator;
|
||||
private final TextView favorites, reblogs, editHistory;
|
||||
// private final ImageView visibility;
|
||||
private final ImageView visibility;
|
||||
private final Context context;
|
||||
|
||||
public Holder(Context context, ViewGroup parent){
|
||||
@@ -79,6 +79,7 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
||||
time=findViewById(R.id.time);
|
||||
date=findViewById(R.id.date);
|
||||
app=findViewById(R.id.app_name);
|
||||
visibility=findViewById(R.id.visibility);
|
||||
dateAppSeparator=findViewById(R.id.date_app_separator);
|
||||
|
||||
reblogs.setOnClickListener(v->startAccountListFragment(StatusReblogsListFragment.class));
|
||||
@@ -118,41 +119,14 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
||||
dateAppSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
//This is the old implementation. TODO: I gotta readd the things missing
|
||||
// Status s=item.status;
|
||||
// favorites.setCompoundDrawablesRelativeWithIntrinsicBounds(GlobalUserPreferences.likeIcon ? R.drawable.ic_fluent_heart_20_regular : R.drawable.ic_fluent_star_20_regular, 0, 0, 0);
|
||||
// favorites.setText(context.getResources().getQuantityString(R.plurals.x_favorites, (int)(s.favouritesCount%1000), s.favouritesCount));
|
||||
// reblogs.setText(context.getResources().getQuantityString(R.plurals.x_reblogs, (int) (s.reblogsCount % 1000), s.reblogsCount));
|
||||
// reblogs.setVisibility(s.visibility != StatusPrivacy.DIRECT ? View.VISIBLE : View.GONE);
|
||||
//
|
||||
// if(s.editedAt!=null){
|
||||
// editHistory.setVisibility(View.VISIBLE);
|
||||
// editHistory.setText(UiUtils.formatRelativeTimestampAsMinutesAgo(itemView.getContext(), s.editedAt, false));
|
||||
// }else{
|
||||
// editHistory.setVisibility(View.GONE);
|
||||
// }
|
||||
// String timeStr=item.status.createdAt != null ? TIME_FORMATTER.format(item.status.createdAt.atZone(ZoneId.systemDefault())) : null;
|
||||
//
|
||||
// if (item.status.application!=null && !TextUtils.isEmpty(item.status.application.name)) {
|
||||
// time.setText(timeStr != null ? item.parentFragment.getString(R.string., timeStr, "") : "");
|
||||
// applicationName.setText(item.status.application.name);
|
||||
// if (item.status.application.website != null && item.status.application.website.toLowerCase().startsWith("https://")) {
|
||||
// applicationName.setOnClickListener(e -> UiUtils.openURL(context, null, item.status.application.website));
|
||||
// } else {
|
||||
// applicationName.setEnabled(false);
|
||||
// }
|
||||
// } else {
|
||||
// time.setText(timeStr);
|
||||
// applicationName.setVisibility(View.GONE);
|
||||
// }
|
||||
//
|
||||
// visibility.setImageResource(switch (s.visibility) {
|
||||
// case PUBLIC -> R.drawable.ic_fluent_earth_20_regular;
|
||||
// case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular;
|
||||
// case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled;
|
||||
// case DIRECT -> R.drawable.ic_fluent_mention_20_regular;
|
||||
// case LOCAL -> R.drawable.ic_fluent_eye_20_regular;
|
||||
// });
|
||||
//TODO: make a snackbar pop up on hold of this
|
||||
visibility.setImageResource(switch (s.visibility) {
|
||||
case PUBLIC -> R.drawable.ic_fluent_earth_20_regular;
|
||||
case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular;
|
||||
case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled;
|
||||
case DIRECT -> R.drawable.ic_fluent_mention_20_regular;
|
||||
case LOCAL -> R.drawable.ic_fluent_eye_20_regular;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,21 @@
|
||||
android:verticalGap="8dp"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/visibility"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="20dp"
|
||||
android:src="@drawable/ic_fluent_earth_20_regular"
|
||||
android:tint="?colorM3Secondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_label_large"
|
||||
android:textColor="?colorM3Secondary"
|
||||
android:importantForAccessibility="no"
|
||||
android:text="·"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -137,123 +152,4 @@
|
||||
|
||||
</org.joinmastodon.android.ui.views.WrappingLinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--TODO: merge things here too-->
|
||||
<!--<?xml version="1.0" encoding="utf-8"?>-->
|
||||
<!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
|
||||
<!-- xmlns:tools="http://schemas.android.com/tools"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:padding="8dp"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:background="@drawable/bg_m3_surface3">-->
|
||||
|
||||
<!-- <org.joinmastodon.android.ui.views.AutoOrientationLinearLayout-->
|
||||
<!-- android:id="@+id/button_bar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content">-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content">-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/reblogs"-->
|
||||
<!-- style="@style/Widget.Mastodon.M3.Button.Text.Icon"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:paddingStart="8dp"-->
|
||||
<!-- android:paddingEnd="12dp"-->
|
||||
<!-- android:minHeight="48dp"-->
|
||||
<!-- android:textColor="?colorM3OnSurfaceVariant"-->
|
||||
<!-- android:fontFamily="sans-serif"-->
|
||||
<!-- android:drawableStart="@drawable/ic_fluent_arrow_repeat_all_20_regular"-->
|
||||
<!-- android:drawablePadding="8dp"-->
|
||||
<!-- android:drawableTint="?colorM3OnSurfaceVariant"-->
|
||||
<!-- tools:text="4 reblogs"/>-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/favorites"-->
|
||||
<!-- style="@style/Widget.Mastodon.M3.Button.Text.Icon"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:paddingStart="8dp"-->
|
||||
<!-- android:paddingEnd="12dp"-->
|
||||
<!-- android:minHeight="48dp"-->
|
||||
<!-- android:textColor="?colorM3OnSurfaceVariant"-->
|
||||
<!-- android:fontFamily="sans-serif"-->
|
||||
<!-- android:drawableStart="@drawable/ic_fluent_star_20_regular"-->
|
||||
<!-- android:drawablePadding="8dp"-->
|
||||
<!-- android:drawableTint="?colorM3OnSurfaceVariant"-->
|
||||
<!-- tools:text="12 favorites"/>-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/edit_history"-->
|
||||
<!-- style="@style/Widget.Mastodon.M3.Button.Text.Icon"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:paddingStart="8dp"-->
|
||||
<!-- android:paddingEnd="12dp"-->
|
||||
<!-- android:minHeight="48dp"-->
|
||||
<!-- android:textColor="?colorM3OnSurfaceVariant"-->
|
||||
<!-- android:fontFamily="sans-serif"-->
|
||||
<!-- android:drawableStart="@drawable/ic_fluent_history_20_regular"-->
|
||||
<!-- android:drawablePadding="8dp"-->
|
||||
<!-- android:drawableTint="?colorM3OnSurfaceVariant"-->
|
||||
<!-- tools:text="Dec 12, 2021, 12:42 PM"/>-->
|
||||
|
||||
<!-- </org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:gravity="start|center"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginHorizontal="8dp"-->
|
||||
<!-- android:minHeight="48dp">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/visibility"-->
|
||||
<!-- android:layout_height="20dp"-->
|
||||
<!-- android:layout_width="20dp"-->
|
||||
<!-- android:src="@drawable/ic_fluent_earth_20_regular"-->
|
||||
<!-- android:tint="?colorM3OnSurfaceVariant" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/timestamp"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="8dp"-->
|
||||
<!-- android:minHeight="20dp"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- android:textColor="?android:textColorSecondary"-->
|
||||
<!-- tools:text="Dec 12, 2021, 12:42 PM via "/>-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/application_name"-->
|
||||
<!-- style="@style/Widget.Mastodon.M3.Button.Text"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:layout_marginStart="-12dp"-->
|
||||
<!-- android:paddingStart="12dp"-->
|
||||
<!-- android:paddingEnd="12dp"-->
|
||||
<!-- android:padding="0dp"-->
|
||||
<!-- android:minWidth="0dp"-->
|
||||
<!-- android:minHeight="48dp"-->
|
||||
<!-- android:textColor="?colorM3OnSurfaceVariant"-->
|
||||
<!-- android:fontFamily="sans-serif"-->
|
||||
<!-- android:singleLine="true"-->
|
||||
<!-- android:ellipsize="end"-->
|
||||
<!-- tools:text="Megalodon"/>-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!--</LinearLayout>-->
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user