mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-12-25 00:00:19 +02:00
New layout for focused message
This commit is contained in:
parent
5e9b666a52
commit
24b58e0450
4 changed files with 92 additions and 43 deletions
|
|
@ -76,6 +76,9 @@ public class Status implements Serializable, Cloneable {
|
|||
public long reblogs_count;
|
||||
@SerializedName("favourites_count")
|
||||
public long favourites_count;
|
||||
@SerializedName("quotes_count")
|
||||
public long quotes_count;
|
||||
|
||||
@SerializedName("favourited")
|
||||
public boolean favourited;
|
||||
@SerializedName("reblogged")
|
||||
|
|
|
|||
|
|
@ -1421,8 +1421,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
}
|
||||
|
||||
if (status.isFocused) {
|
||||
holder.binding.statusInfo.setVisibility(View.VISIBLE);
|
||||
holder.binding.statusInfoContainer.setVisibility(View.VISIBLE);
|
||||
holder.binding.reblogInfo.setText(String.valueOf(status.reblogs_count));
|
||||
holder.binding.quoteInfo.setText(String.valueOf(status.quotes_count));
|
||||
holder.binding.favouriteInfo.setText(String.valueOf(status.favourites_count));
|
||||
|
||||
if (statusToDeal.edited_at != null) {
|
||||
|
|
@ -1492,7 +1493,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
holder.binding.replyCount.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
holder.binding.statusInfo.setVisibility(View.GONE);
|
||||
holder.binding.statusInfoContainer.setVisibility(View.GONE);
|
||||
holder.binding.dateShort.setVisibility(View.VISIBLE);
|
||||
holder.binding.visibilitySmall.setVisibility(View.VISIBLE);
|
||||
if (statusToDeal.edited_at != null) {
|
||||
|
|
@ -2093,6 +2094,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
});
|
||||
}
|
||||
});
|
||||
holder.binding.quoteInfo.setOnClickListener(v->{
|
||||
if (statusToDeal.quotes_count > 0) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
holder.binding.favouriteInfo.setOnClickListener(v -> {
|
||||
if (statusToDeal.favourites_count > 0) {
|
||||
|
|
@ -3272,8 +3278,10 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
holder.binding.cardDescription.setTextColor(theme_text_color);
|
||||
holder.binding.time.setTextColor(theme_text_color);
|
||||
holder.binding.reblogInfo.setTextColor(theme_text_color);
|
||||
holder.binding.quoteInfo.setTextColor(theme_text_color);
|
||||
holder.binding.favouriteInfo.setTextColor(theme_text_color);
|
||||
Helper.changeDrawableColor(context, holder.binding.reblogInfo, theme_text_color);
|
||||
Helper.changeDrawableColor(context, holder.binding.quoteInfo, theme_text_color);
|
||||
Helper.changeDrawableColor(context, holder.binding.favouriteInfo, theme_text_color);
|
||||
Helper.changeDrawableColor(context, R.drawable.ic_baseline_lock_24, theme_text_color);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?attr/colorControlNormal" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="?attr/colorControlNormal" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2z"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -532,43 +532,76 @@
|
|||
tools:text="1 January 2021, 12:00"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="6dp"
|
||||
android:textColor="?colorPrimary"
|
||||
android:visibility="gone"
|
||||
tools:text="Fedilab"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<HorizontalScrollView
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/status_info_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:fillViewport="true"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="6dp">
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/status_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="6dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
android:orientation="horizontal">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="1 January 2021, 12:00" />
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/baseline_circle_24"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/language"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
tools:text="EN" />
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/baseline_circle_24"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/visibility"
|
||||
android:contentDescription="@string/visibility"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:srcCompat="@drawable/ic_baseline_public_24" />
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/baseline_circle_24"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?colorPrimary"
|
||||
android:visibility="gone"
|
||||
tools:text="Fedilab"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/reblog_info"
|
||||
|
|
@ -579,42 +612,42 @@
|
|||
android:textColor="?attr/colorControlNormal"
|
||||
app:icon="@drawable/ic_repeat"
|
||||
app:iconTint="?attr/colorControlNormal"
|
||||
tools:text="10" />
|
||||
tools:text="10"
|
||||
android:layout_marginEnd="10dp"/>
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/baseline_circle_24"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/quote_info"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="48dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:textColor="?attr/colorControlNormal"
|
||||
app:icon="@drawable/ic_baseline_format_quote_24"
|
||||
app:iconTint="?attr/colorControlNormal"
|
||||
tools:text="10" />
|
||||
<ImageView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/baseline_circle_24"/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/favourite_info"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="?attr/colorControlNormal"
|
||||
app:icon="@drawable/ic_star_outline"
|
||||
app:iconTint="?attr/colorControlNormal"
|
||||
tools:text="10" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/language"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
tools:text="EN" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/visibility"
|
||||
android:contentDescription="@string/visibility"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:srcCompat="@drawable/ic_baseline_public_24" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</HorizontalScrollView>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
|
|
|||
Loading…
Reference in a new issue