mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-01 13:57:10 +01:00
Continue adding Card Layout 2.
This commit is contained in:
parent
947be2101d
commit
5b831aafbc
@ -1755,8 +1755,13 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) holder.itemView.getLayoutParams();
|
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) holder.itemView.getLayoutParams();
|
||||||
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||||
int marginPixel = (int) Utils.convertDpToPixel(8, mActivity);
|
int marginPixel = (int) Utils.convertDpToPixel(8, mActivity);
|
||||||
params.topMargin = marginPixel;
|
if (holder instanceof PostCard2VideoAutoplayViewHolder || holder instanceof PostCard2WithPreviewViewHolder
|
||||||
params.bottomMargin = marginPixel;
|
|| holder instanceof PostCard2TextTypeViewHolder) {
|
||||||
|
((PostBaseViewHolder) holder).itemView.setPadding(0, marginPixel, 0, 0);
|
||||||
|
} else {
|
||||||
|
params.topMargin = marginPixel;
|
||||||
|
params.bottomMargin = marginPixel;
|
||||||
|
}
|
||||||
holder.itemView.setLayoutParams(params);
|
holder.itemView.setLayoutParams(params);
|
||||||
((PostBaseViewHolder) holder).itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor));
|
((PostBaseViewHolder) holder).itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor));
|
||||||
((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
|
((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
@ -264,6 +263,7 @@
|
|||||||
<View
|
<View
|
||||||
android:id="@+id/divider_item_post_card_2_text"
|
android:id="@+id/divider_item_post_card_2_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp" />
|
android:layout_height="1dp"
|
||||||
|
android:paddingBottom="8dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -5,7 +5,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
@ -303,6 +302,7 @@
|
|||||||
<View
|
<View
|
||||||
android:id="@+id/divider_item_post_card_2_video_autoplay"
|
android:id="@+id/divider_item_post_card_2_video_autoplay"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp" />
|
android:layout_height="1dp"
|
||||||
|
android:paddingBottom="8dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -5,7 +5,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
@ -320,6 +319,7 @@
|
|||||||
<View
|
<View
|
||||||
android:id="@+id/divider_item_post_card_2_with_preview"
|
android:id="@+id/divider_item_post_card_2_with_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp" />
|
android:layout_height="1dp"
|
||||||
|
android:paddingBottom="8dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user