mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Add custom theme entries for read posts. Fix crash in ViewUserDetailActivity.
This commit is contained in:
parent
7cf90856d6
commit
b38025882d
@ -106,8 +106,8 @@ import pl.droidsonroids.gif.GifImageView;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class ViewUserDetailActivity extends BaseActivity implements SortTypeSelectionCallback,
|
||||
PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, ActivityToolbarInterface,
|
||||
FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
|
||||
PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
|
||||
ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
|
||||
RandomBottomSheetFragment.RandomOptionSelectionCallback, MarkPostAsReadInterface {
|
||||
|
||||
public static final String EXTRA_USER_NAME_KEY = "EUNK";
|
||||
@ -1241,6 +1241,28 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
||||
InsertReadPost.insertReadPost(mRedditDataRoomDatabase, mAccountName, post.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postTypeSelected(int postType) {
|
||||
Intent intent;
|
||||
switch (postType) {
|
||||
case PostTypeBottomSheetFragment.TYPE_TEXT:
|
||||
intent = new Intent(this, PostTextActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
case PostTypeBottomSheetFragment.TYPE_LINK:
|
||||
intent = new Intent(this, PostLinkActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
case PostTypeBottomSheetFragment.TYPE_IMAGE:
|
||||
intent = new Intent(this, PostImageActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
case PostTypeBottomSheetFragment.TYPE_VIDEO:
|
||||
intent = new Intent(this, PostVideoActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private static class InsertUserDataAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
private UserDao userDao;
|
||||
|
@ -98,6 +98,16 @@ public class CustomThemeSettingsItem implements Parcelable {
|
||||
context.getString(R.string.theme_item_post_content_color),
|
||||
context.getString(R.string.theme_item_post_content_color_detail),
|
||||
customTheme.postContentColor));
|
||||
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||
context.getString(R.string.theme_item_read_post_title_color),
|
||||
context.getString(R.string.theme_item_read_post_title_color_detail),
|
||||
customTheme.readPostTitleColor
|
||||
));
|
||||
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||
context.getString(R.string.theme_item_read_post_content_color),
|
||||
context.getString(R.string.theme_item_read_post_content_color_detail),
|
||||
customTheme.readPostContentColor
|
||||
));
|
||||
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||
context.getString(R.string.theme_item_comment_color),
|
||||
context.getString(R.string.theme_item_comment_color_detail),
|
||||
@ -130,6 +140,10 @@ public class CustomThemeSettingsItem implements Parcelable {
|
||||
context.getString(R.string.theme_item_card_view_background_color),
|
||||
context.getString(R.string.theme_item_card_view_background_color_detail),
|
||||
customTheme.cardViewBackgroundColor));
|
||||
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||
context.getString(R.string.theme_item_read_post_card_view_background_color),
|
||||
context.getString(R.string.theme_item_read_post_card_view_background_color_detail),
|
||||
customTheme.readPostCardViewBackgroundColor));
|
||||
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||
context.getString(R.string.theme_item_comment_background_color),
|
||||
context.getString(R.string.theme_item_comment_background_color_detail),
|
||||
|
@ -173,7 +173,7 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/bottom_app_bar_other_activities"
|
||||
layout="@layout/bottom_app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom" />
|
||||
|
@ -140,7 +140,7 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/bottom_app_bar_other_activities"
|
||||
layout="@layout/bottom_app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom" />
|
||||
|
@ -52,7 +52,7 @@
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<include
|
||||
layout="@layout/bottom_app_bar_other_activities"
|
||||
layout="@layout/bottom_app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom" />
|
||||
|
@ -630,6 +630,10 @@
|
||||
<string name="theme_item_post_title_color_detail">Applied to: Post title</string>
|
||||
<string name="theme_item_post_content_color">Post Content Color</string>
|
||||
<string name="theme_item_post_content_color_detail">Applied to: Post content</string>
|
||||
<string name="theme_item_read_post_title_color">Read Post Title Color</string>
|
||||
<string name="theme_item_read_post_title_color_detail">Applied to: Read Post Title</string>
|
||||
<string name="theme_item_read_post_content_color">Read Post Content Color</string>
|
||||
<string name="theme_item_read_post_content_color_detail">Applied to: Read Post Content</string>
|
||||
<string name="theme_item_comment_color">Comment Color</string>
|
||||
<string name="theme_item_comment_color_detail">Applied to: Comment</string>
|
||||
<string name="theme_item_button_text_color">Button Text Color</string>
|
||||
@ -646,6 +650,8 @@
|
||||
<string name="theme_item_background_color_detail">Applied to: Background of every page and navigation drawer</string>
|
||||
<string name="theme_item_card_view_background_color">Card View Background Color</string>
|
||||
<string name="theme_item_card_view_background_color_detail">Applied to: Post background and message background</string>
|
||||
<string name="theme_item_read_post_card_view_background_color">Read Post Card View Background Color</string>
|
||||
<string name="theme_item_read_post_card_view_background_color_detail">Applied to: Read Post background</string>
|
||||
<string name="theme_item_comment_background_color">Comment Background Color</string>
|
||||
<string name="theme_item_comment_background_color_detail">Applied to: Comment background</string>
|
||||
<string name="theme_item_fully_collapsed_comment_background_color">Fully-Collapsed Comment Background Color</string>
|
||||
|
Loading…
Reference in New Issue
Block a user