mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 20:57:25 +01:00
Continue adding Gallery Layout.
This commit is contained in:
parent
83ffdb5511
commit
538827f11e
@ -3424,11 +3424,29 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
||||
super(itemView);
|
||||
ButterKnife.bind(this, itemView);
|
||||
|
||||
itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor));
|
||||
titleTextView.setTextColor(mPostTitleColor);
|
||||
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent));
|
||||
noPreviewImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor);
|
||||
noPreviewImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
errorTextView.setTextColor(mPrimaryTextColor);
|
||||
|
||||
itemView.setOnClickListener(view -> {
|
||||
int position = getBindingAdapterPosition();
|
||||
if (position >= 0 && canStartActivity) {
|
||||
Post post = getItem(position);
|
||||
if (post != null) {
|
||||
//markPostRead(post, true);
|
||||
canStartActivity = false;
|
||||
|
||||
Intent intent = new Intent(mActivity, ViewPostDetailActivity.class);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_DATA, post);
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_LIST_POSITION, getBindingAdapterPosition());
|
||||
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_FRAGMENT_ID, mFragment.getPostFragmentId());
|
||||
mActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1711,9 +1711,9 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
||||
int halfOffset = mItemOffset / 2;
|
||||
|
||||
if (spanIndex == 0) {
|
||||
outRect.set(0, 0, halfOffset, 0);
|
||||
outRect.set(halfOffset, 0, halfOffset, 0);
|
||||
} else {
|
||||
outRect.set(halfOffset, 0, 0, 0);
|
||||
outRect.set(halfOffset, 0, halfOffset, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView 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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar_item_post_gallery"
|
||||
@ -52,12 +60,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:background="@drawable/thumbnail_compact_layout_rounded_edge"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text_view_item_post_gallery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textSize="?attr/title_font_18"
|
||||
@ -65,3 +76,5 @@
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
@ -7,7 +7,6 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:id="@+id/card_view_item_post_text_type"
|
||||
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:id="@+id/card_view_item_post_video_type_autoplay"
|
||||
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:id="@+id/card_view_item_post_with_preview"
|
||||
app:cardBackgroundColor="?attr/cardViewBackgroundColor"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user