Skip to content

Commit

Permalink
Continue adding Card Layout 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Docile-Alligator committed Sep 10, 2023
1 parent 89cd1cc commit d9f2016
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1635,8 +1635,9 @@ public void onLayoutChange(View v, int left, int top, int right, int bottom, int
((PostMaterial3CardBaseViewHolder) holder).userTextView.setText(authorPrefixed);
}

((PostMaterial3CardBaseViewHolder) holder).userTextView.setTextColor(
post.isModerator() ? mModeratorColor : mUsernameColor);
//TODO change color
/*((PostMaterial3CardBaseViewHolder) holder).userTextView.setTextColor(
post.isModerator() ? mModeratorColor : mUsernameColor);*/

if (mDisplaySubredditName) {
if (authorPrefixed.equals(post.getSubredditNamePrefixed())) {
Expand Down Expand Up @@ -5938,8 +5939,10 @@ void setBaseView(AspectRatioGifImageView iconGifImageView,
titleTextView.setTypeface(mActivity.titleTypeface);
}

subredditTextView.setTextColor(mSubredditColor);
userTextView.setTextColor(mUsernameColor);
/*subredditTextView.setTextColor(mSubredditColor);
userTextView.setTextColor(mUsernameColor);*/
subredditTextView.setTextColor(mPrimaryTextColor);
userTextView.setTextColor(mPrimaryTextColor);
postTimeTextView.setTextColor(mSecondaryTextColor);
titleTextView.setTextColor(mPostTitleColor);
stickiedPostImageView.setColorFilter(mStickiedPostIconTint, PorterDuff.Mode.SRC_IN);
Expand Down
144 changes: 74 additions & 70 deletions app/src/main/res/layout/item_post_card_3_with_preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:layout_margin="8dp"
app:cardCornerRadius="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardCornerRadius="12dp"
app:cardBackgroundColor="#FBEEFC"
style="?attr/materialCardViewFilledStyle">

Expand All @@ -14,6 +17,54 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<FrameLayout
android:id="@+id/image_wrapper_relative_layout_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">

<ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView
android:id="@+id/image_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />

<ImageView
android:id="@+id/video_or_gif_indicator_image_view_item_post_with_preview"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_margin="16dp"
android:scaleType="center"
android:background="@drawable/play_button_round_background"
android:visibility="gone" />

<ProgressBar
android:id="@+id/progress_bar_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />

<TextView
android:id="@+id/load_image_error_text_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:visibility="gone" />

</FrameLayout>

<ImageView
android:id="@+id/image_view_no_preview_gallery_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="center"
android:visibility="gone" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -106,7 +157,8 @@
android:padding="16dp"
app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp">
app:flRowSpacing="8dp"
android:visibility="gone">

<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_with_preview"
Expand Down Expand Up @@ -205,54 +257,6 @@
android:fontFamily="?attr/font_family"
android:visibility="gone" />

<FrameLayout
android:id="@+id/image_wrapper_relative_layout_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">

<ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView
android:id="@+id/image_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />

<ImageView
android:id="@+id/video_or_gif_indicator_image_view_item_post_with_preview"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_margin="16dp"
android:scaleType="center"
android:background="@drawable/play_button_round_background"
android:visibility="gone" />

<ProgressBar
android:id="@+id/progress_bar_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />

<TextView
android:id="@+id/load_image_error_text_view_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_error_outline_black_24dp"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/error_loading_image_tap_to_retry"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family"
android:visibility="gone" />

</FrameLayout>

<ImageView
android:id="@+id/image_view_no_preview_gallery_item_post_with_preview"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="center"
android:visibility="gone" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_constraint_layout_item_post_with_preview"
android:layout_width="match_parent"
Expand Down Expand Up @@ -295,45 +299,45 @@
</com.google.android.material.button.MaterialButtonToggleGroup>

<com.google.android.material.button.MaterialButton
style="?attr/materialButtonOutlinedStyle"
android:id="@+id/comments_count_button_item_post_with_preview"
android:id="@+id/save_button_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:minWidth="0dp"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:fontFamily="?attr/font_family"
app:strokeWidth="0dp"
app:iconTint="@null"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_with_preview" />
app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_with_preview"
style="?attr/materialIconButtonOutlinedStyle" />

<com.google.android.material.button.MaterialButton
style="?attr/materialIconButtonOutlinedStyle"
android:id="@+id/save_button_item_post_with_preview"
android:id="@+id/share_button_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:strokeWidth="0dp"
app:layout_constraintHorizontal_bias="1"
app:icon="@drawable/ic_share_grey_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_with_preview"
app:layout_constraintEnd_toStartOf="@id/share_button_item_post_with_preview" />
app:layout_constraintStart_toEndOf="@id/save_button_item_post_with_preview"
style="?attr/materialIconButtonOutlinedStyle" />

<com.google.android.material.button.MaterialButton
style="?attr/materialIconButtonOutlinedStyle"
android:id="@+id/share_button_item_post_with_preview"
android:id="@+id/comments_count_button_item_post_with_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:minWidth="0dp"
android:textSize="?attr/font_12"
android:textStyle="bold"
android:fontFamily="?attr/font_family"
app:strokeWidth="0dp"
app:icon="@drawable/ic_share_grey_24dp"
app:iconTint="@null"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintStart_toEndOf="@id/share_button_item_post_with_preview"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
style="?attr/materialButtonOutlinedStyle" />

<!--<ImageView
android:id="@+id/plus_button_item_post_with_preview"
Expand Down

0 comments on commit d9f2016

Please sign in to comment.