mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-30 19:34:45 +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;
|
import retrofit2.Retrofit;
|
||||||
|
|
||||||
public class ViewUserDetailActivity extends BaseActivity implements SortTypeSelectionCallback,
|
public class ViewUserDetailActivity extends BaseActivity implements SortTypeSelectionCallback,
|
||||||
PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, ActivityToolbarInterface,
|
PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
|
||||||
FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
|
ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
|
||||||
RandomBottomSheetFragment.RandomOptionSelectionCallback, MarkPostAsReadInterface {
|
RandomBottomSheetFragment.RandomOptionSelectionCallback, MarkPostAsReadInterface {
|
||||||
|
|
||||||
public static final String EXTRA_USER_NAME_KEY = "EUNK";
|
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());
|
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 static class InsertUserDataAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||||
|
|
||||||
private UserDao userDao;
|
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),
|
||||||
context.getString(R.string.theme_item_post_content_color_detail),
|
context.getString(R.string.theme_item_post_content_color_detail),
|
||||||
customTheme.postContentColor));
|
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(
|
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||||
context.getString(R.string.theme_item_comment_color),
|
context.getString(R.string.theme_item_comment_color),
|
||||||
context.getString(R.string.theme_item_comment_color_detail),
|
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),
|
||||||
context.getString(R.string.theme_item_card_view_background_color_detail),
|
context.getString(R.string.theme_item_card_view_background_color_detail),
|
||||||
customTheme.cardViewBackgroundColor));
|
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(
|
customThemeSettingsItems.add(new CustomThemeSettingsItem(
|
||||||
context.getString(R.string.theme_item_comment_background_color),
|
context.getString(R.string.theme_item_comment_background_color),
|
||||||
context.getString(R.string.theme_item_comment_background_color_detail),
|
context.getString(R.string.theme_item_comment_background_color_detail),
|
||||||
|
@ -173,7 +173,7 @@
|
|||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/bottom_app_bar_other_activities"
|
layout="@layout/bottom_app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom" />
|
android:layout_gravity="bottom" />
|
||||||
|
@ -140,7 +140,7 @@
|
|||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/bottom_app_bar_other_activities"
|
layout="@layout/bottom_app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom" />
|
android:layout_gravity="bottom" />
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/bottom_app_bar_other_activities"
|
layout="@layout/bottom_app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom" />
|
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_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">Post Content Color</string>
|
||||||
<string name="theme_item_post_content_color_detail">Applied to: Post content</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">Comment Color</string>
|
||||||
<string name="theme_item_comment_color_detail">Applied to: Comment</string>
|
<string name="theme_item_comment_color_detail">Applied to: Comment</string>
|
||||||
<string name="theme_item_button_text_color">Button Text Color</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_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">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_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">Comment Background Color</string>
|
||||||
<string name="theme_item_comment_background_color_detail">Applied to: Comment background</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>
|
<string name="theme_item_fully_collapsed_comment_background_color">Fully-Collapsed Comment Background Color</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user