mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-26 17:44:45 +01:00
Add a custom theme table in database.
This commit is contained in:
parent
b101e4c87d
commit
f3f9642a0e
@ -20,6 +20,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -56,6 +57,7 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean isInLazyMode = false;
|
||||
private boolean mNullAccessToken = false;
|
||||
|
@ -65,6 +65,7 @@ public class AccountSavedThingActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private SectionsPagerAdapter sectionsPagerAdapter;
|
||||
private Menu mMenu;
|
||||
|
@ -50,8 +50,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
case 0:
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
|
||||
getTheme().applyStyle(R.style.Theme_Purple, true);
|
||||
lightStatusbar = !transparentStatusBarAfterToolbarCollapsed;
|
||||
changeStatusBarIconColor = false;
|
||||
changeStatusBarIconColor = immersiveInterface;
|
||||
break;
|
||||
case 1:
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
|
||||
@ -70,8 +69,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_NO) {
|
||||
getTheme().applyStyle(R.style.Theme_Purple, true);
|
||||
lightStatusbar = !transparentStatusBarAfterToolbarCollapsed;
|
||||
changeStatusBarIconColor = false;
|
||||
changeStatusBarIconColor = immersiveInterface;
|
||||
} else {
|
||||
if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
|
||||
getTheme().applyStyle(R.style.Theme_Default_AmoledDark, true);
|
||||
@ -172,4 +170,14 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
public void setTransparentStatusBarAfterToolbarCollapsed(boolean transparentStatusBarAfterToolbarCollapsed) {
|
||||
this.transparentStatusBarAfterToolbarCollapsed = transparentStatusBarAfterToolbarCollapsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
|
||||
super.onApplyThemeResource(theme, resid, first);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resources.Theme getTheme() {
|
||||
return super.getTheme();
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ public class CommentActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -66,6 +66,7 @@ public class CreateMultiRedditActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -63,6 +63,7 @@ public class EditCommentActivity extends BaseActivity {
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String mFullName;
|
||||
private String mAccessToken;
|
||||
|
@ -62,6 +62,7 @@ public class EditPostActivity extends BaseActivity {
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String mFullName;
|
||||
private String mAccessToken;
|
||||
|
@ -20,6 +20,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -64,6 +65,7 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean isInLazyMode = false;
|
||||
private boolean mNullAccessToken = false;
|
||||
|
@ -18,6 +18,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.Infinity;
|
||||
import ml.docilealligator.infinityforreddit.R;
|
||||
@ -44,6 +45,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
||||
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
|
||||
public static Uri getRedditUriByPath(String path) {
|
||||
|
@ -59,6 +59,7 @@ public class LoginActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String authCode;
|
||||
|
||||
|
@ -152,6 +152,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private SectionsPagerAdapter sectionsPagerAdapter;
|
||||
private AppBarLayout.LayoutParams params;
|
||||
|
@ -70,6 +70,7 @@ public class MultiRedditListingActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
@Inject
|
||||
@Named("oauth")
|
||||
|
@ -122,6 +122,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -99,6 +99,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -99,6 +99,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -127,6 +127,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -62,6 +62,7 @@ public class RulesActivity extends BaseActivity {
|
||||
@Named("no_oauth")
|
||||
Retrofit mRetrofit;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String mSubredditName;
|
||||
private RulesRecyclerViewAdapter mAdapter;
|
||||
|
@ -22,6 +22,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -53,6 +54,7 @@ public class SearchActivity extends BaseActivity {
|
||||
@BindView(R.id.subreddit_name_text_view_search_activity)
|
||||
TextView subredditNameTextView;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String query;
|
||||
private String subredditName;
|
||||
|
@ -25,6 +25,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -66,6 +67,7 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -19,6 +19,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -48,6 +49,7 @@ public class SearchSubredditsResultActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -14,6 +14,7 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -34,6 +35,7 @@ public class SettingsActivity extends BaseActivity implements
|
||||
Toolbar toolbar;
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
|
||||
@Override
|
||||
|
@ -74,6 +74,7 @@ public class SubredditMultiselectionActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -65,6 +65,7 @@ public class SubredditSelectionActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -65,6 +65,7 @@ public class SubscribedThingListingActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -47,6 +47,7 @@ import com.github.pwittchen.swipe.library.rx2.Swipe;
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -74,6 +75,7 @@ public class ViewGIFActivity extends AppCompatActivity {
|
||||
@BindView(R.id.load_image_error_linear_layout_view_gif_activity)
|
||||
LinearLayout mLoadErrorLinearLayout;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean isActionBarHidden = false;
|
||||
private boolean isDownloading = false;
|
||||
@ -406,7 +408,8 @@ public class ViewGIFActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void saveFailed() {
|
||||
|
||||
Toast.makeText(ViewGIFActivity.this,
|
||||
R.string.cannot_save_gif, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}).execute();
|
||||
} else {
|
||||
|
@ -52,6 +52,7 @@ import com.github.pwittchen.swipe.library.rx2.Swipe;
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -78,6 +79,7 @@ public class ViewImageActivity extends AppCompatActivity {
|
||||
@BindView(R.id.load_image_error_linear_layout_view_image_activity)
|
||||
LinearLayout mLoadErrorLinearLayout;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean isActionBarHidden = false;
|
||||
private boolean isDownloading = false;
|
||||
|
@ -79,6 +79,7 @@ public class ViewMessageActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -68,6 +68,7 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -154,6 +154,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private RequestManager mGlide;
|
||||
private Locale mLocale;
|
||||
|
@ -70,6 +70,7 @@ public class ViewSidebarActivity extends BaseActivity {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private String subredditName;
|
||||
private SubredditViewModel mSubredditViewModel;
|
||||
|
@ -132,6 +132,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -122,6 +122,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private SectionsPagerAdapter sectionsPagerAdapter;
|
||||
private SubscribedUserDao subscribedUserDao;
|
||||
|
@ -54,6 +54,7 @@ import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -91,6 +92,7 @@ public class ViewVideoActivity extends AppCompatActivity {
|
||||
private float touchY = -1.0f;
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ml.docilealligator.infinityforreddit;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
@ -13,6 +14,7 @@ import javax.inject.Singleton;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import ml.docilealligator.infinityforreddit.Utils.RedditUtils;
|
||||
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.OkHttpClient;
|
||||
import retrofit2.Retrofit;
|
||||
@ -97,8 +99,16 @@ class AppModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("default")
|
||||
@Singleton
|
||||
SharedPreferences provideSharedPreferences() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(mApplication);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("theme")
|
||||
@Singleton
|
||||
SharedPreferences provideThemeSharedPreferences() {
|
||||
return mApplication.getSharedPreferences(SharedPreferencesUtils.THEME_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,116 @@
|
||||
package ml.docilealligator.infinityforreddit.CustomTheme;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "custom_themes")
|
||||
public class CustomTheme {
|
||||
@PrimaryKey
|
||||
@NonNull
|
||||
@ColumnInfo(name = "name")
|
||||
public String name;
|
||||
@ColumnInfo(name = "color_primary")
|
||||
public int colorPrimary;
|
||||
@ColumnInfo(name = "color_primary_dark")
|
||||
public int colorPrimaryDark;
|
||||
@ColumnInfo(name = "color_accent")
|
||||
public int colorAccent;
|
||||
@ColumnInfo(name = "color_primary_light_theme")
|
||||
public int colorPrimaryLightTheme;
|
||||
@ColumnInfo(name = "primary_text_color")
|
||||
public int primaryTextColor;
|
||||
@ColumnInfo(name = "secondary_text_color")
|
||||
public int secondaryTextColor;
|
||||
@ColumnInfo(name = "background_color")
|
||||
public int backgroundColor;
|
||||
@ColumnInfo(name = "rounded_bottom_sheet_primary_background")
|
||||
public int roundedBottomSheetPrimaryBackground;
|
||||
@ColumnInfo(name = "card_view_background_color")
|
||||
public int cardViewBackgroundColor;
|
||||
@ColumnInfo(name = "toolbar_primary_text_and_icon_color")
|
||||
public int toolbarPrimaryTextAndIconColor;
|
||||
@ColumnInfo(name = "toolbar_and_tab_background_color")
|
||||
public int toolbarAndTabBackgroundColor;
|
||||
@ColumnInfo(name = "circular_progress_bar_background")
|
||||
public int circularProgressBarBackground;
|
||||
@ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_tab_background")
|
||||
public int tabLayoutWithExpandedCollapsingToolbarTabBackground;
|
||||
@ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_text_color")
|
||||
public int tabLayoutWithExpandedCollapsingToolbarTextColor;
|
||||
@ColumnInfo(name = "tab_layout_with_expanded_collapsing_toolbar_tab_indicator")
|
||||
public int tabLayoutWithExpandedCollapsingToolbarTabIndicator;
|
||||
@ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_tab_background")
|
||||
public int tabLayoutWithCollapsedCollapsingToolbarTabBackground;
|
||||
@ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_text_color")
|
||||
public int tabLayoutWithCollapsedCollapsingToolbarTextColor;
|
||||
@ColumnInfo(name = "tab_layout_with_collapsed_collapsing_toolbar_tab_indicator")
|
||||
public int tabLayoutWithCollapsedCollapsingToolbarTabIndicator;
|
||||
@ColumnInfo(name = "nav_bar_color")
|
||||
public int navBarColor;
|
||||
@ColumnInfo(name = "upvoted")
|
||||
public int upvoted;
|
||||
@ColumnInfo(name = "downvoted")
|
||||
public int downvoted;
|
||||
@ColumnInfo(name = "post_type")
|
||||
public int postType;
|
||||
@ColumnInfo(name = "spoiler_color")
|
||||
public int spoilerColor;
|
||||
@ColumnInfo(name = "nsfw_color")
|
||||
public int nsfwColor;
|
||||
@ColumnInfo(name = "flair_color")
|
||||
public int flairColor;
|
||||
@ColumnInfo(name = "archived_tint")
|
||||
public int archivedTint;
|
||||
@ColumnInfo(name = "locked_icon_tint")
|
||||
public int lockedIconTint;
|
||||
@ColumnInfo(name = "crosspost")
|
||||
public int crosspost;
|
||||
@ColumnInfo(name = "stickied_post")
|
||||
public int stickiedPost;
|
||||
@ColumnInfo(name = "subscribed")
|
||||
public int subscribed;
|
||||
@ColumnInfo(name = "unsubscribed")
|
||||
public int unsubscribed;
|
||||
@ColumnInfo(name = "username")
|
||||
public int username;
|
||||
@ColumnInfo(name = "subreddit")
|
||||
public int subreddit;
|
||||
@ColumnInfo(name = "author_flair_text_color")
|
||||
public int authorFlairTextColor;
|
||||
@ColumnInfo(name = "submitter")
|
||||
public int submitter;
|
||||
@ColumnInfo(name = "moderator")
|
||||
public int moderator;
|
||||
@ColumnInfo(name = "notification_icon_color")
|
||||
public int notificationIconColor;
|
||||
@ColumnInfo(name = "single_comment_thread_background_color")
|
||||
public int singleCommentThreadBackgroundColor;
|
||||
@ColumnInfo(name = "unread_message_background_color")
|
||||
public int unreadMessageBackgroundColor;
|
||||
@ColumnInfo(name = "divider_color")
|
||||
public int dividerColor;
|
||||
@ColumnInfo(name = "no_preview_link_background_color")
|
||||
public int noPreviewLinkBackgroundColor;
|
||||
@ColumnInfo(name = "vote_and_reply_unavailable_vote_button_color")
|
||||
public int voteAndReplyUnavailableVoteButtonColor;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_1")
|
||||
public int commentVerticalBarColor1;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_2")
|
||||
public int commentVerticalBarColor2;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_3")
|
||||
public int commentVerticalBarColor3;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_4")
|
||||
public int commentVerticalBarColor4;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_5")
|
||||
public int commentVerticalBarColor5;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_6")
|
||||
public int commentVerticalBarColor6;
|
||||
@ColumnInfo(name = "comment_vertical_bar_color_7")
|
||||
public int commentVerticalBarColor7;
|
||||
|
||||
public CustomTheme(@NonNull String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package ml.docilealligator.infinityforreddit.CustomTheme;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Dao
|
||||
public interface CustomThemeDao {
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(CustomTheme customTheme);
|
||||
|
||||
@Query("SELECT * FROM custom_themes")
|
||||
LiveData<List<CustomTheme>> getAllCustomThemes();
|
||||
|
||||
@Query("SELECT * FROM custom_themes WHERE name = :name AND username = :username COLLATE NOCASE LIMIT 1")
|
||||
CustomTheme getCustomTheme(String name, String username);
|
||||
|
||||
@Query("DELETE FROM custom_themes WHERE name = :name AND username = :username")
|
||||
void deleteCustomTheme(String name, String username);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package ml.docilealligator.infinityforreddit.CustomTheme;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
|
||||
|
||||
public class CustomThemeRepository {
|
||||
private LiveData<List<CustomTheme>> mAllCustomThemes;
|
||||
|
||||
CustomThemeRepository(RedditDataRoomDatabase redditDataRoomDatabase) {
|
||||
mAllCustomThemes = redditDataRoomDatabase.customThemeDao().getAllCustomThemes();
|
||||
}
|
||||
|
||||
LiveData<List<CustomTheme>> getAllCustomThemes() {
|
||||
return mAllCustomThemes;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package ml.docilealligator.infinityforreddit.CustomTheme;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
|
||||
|
||||
public class CustomThemeViewModel extends ViewModel {
|
||||
private LiveData<List<CustomTheme>> mAllCustomThemes;
|
||||
|
||||
public CustomThemeViewModel(RedditDataRoomDatabase redditDataRoomDatabase) {
|
||||
mAllCustomThemes = new CustomThemeRepository(redditDataRoomDatabase).getAllCustomThemes();
|
||||
}
|
||||
|
||||
public LiveData<List<CustomTheme>> getAllCustomThemes() {
|
||||
return mAllCustomThemes;
|
||||
}
|
||||
|
||||
public static class Factory extends ViewModelProvider.NewInstanceFactory {
|
||||
private RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
|
||||
public Factory(RedditDataRoomDatabase redditDataRoomDatabase) {
|
||||
mRedditDataRoomDatabase = redditDataRoomDatabase;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
|
||||
return (T) new CustomThemeViewModel(mRedditDataRoomDatabase);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -81,6 +80,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private boolean mNullAccessToken = false;
|
||||
private String mAccessToken;
|
||||
|
@ -60,6 +60,7 @@ public class FollowedUsersListingFragment extends Fragment implements FragmentCo
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
|
@ -112,6 +112,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private RequestManager mGlide;
|
||||
private AppCompatActivity activity;
|
||||
|
@ -5,7 +5,6 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -79,6 +78,7 @@ public class SubredditListingFragment extends Fragment implements FragmentCommun
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private LinearLayoutManager mLinearLayoutManager;
|
||||
private SubredditListingRecyclerViewAdapter mAdapter;
|
||||
|
@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -66,6 +65,7 @@ public class SubscribedSubredditsListingFragment extends Fragment implements Fra
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
|
@ -4,7 +4,6 @@ package ml.docilealligator.infinityforreddit.Fragment;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -75,6 +74,7 @@ public class UserListingFragment extends Fragment implements FragmentCommunicato
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private LinearLayoutManager mLinearLayoutManager;
|
||||
private String mQuery;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package ml.docilealligator.infinityforreddit.MultiReddit;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.List;
|
||||
@ -9,14 +7,13 @@ import java.util.List;
|
||||
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
|
||||
|
||||
public class MultiRedditRepository {
|
||||
private MultiRedditDao mMultiRedditDao;
|
||||
private LiveData<List<MultiReddit>> mAllMultiReddits;
|
||||
private LiveData<List<MultiReddit>> mAllFavoriteMultiReddits;
|
||||
|
||||
MultiRedditRepository(RedditDataRoomDatabase redditDataRoomDatabase, String accountName) {
|
||||
mMultiRedditDao = redditDataRoomDatabase.multiRedditDao();
|
||||
mAllMultiReddits = mMultiRedditDao.getAllMultiReddits(accountName);
|
||||
mAllFavoriteMultiReddits = mMultiRedditDao.getAllFavoriteMultiReddits(accountName);
|
||||
MultiRedditDao multiRedditDao = redditDataRoomDatabase.multiRedditDao();
|
||||
mAllMultiReddits = multiRedditDao.getAllMultiReddits(accountName);
|
||||
mAllFavoriteMultiReddits = multiRedditDao.getAllFavoriteMultiReddits(accountName);
|
||||
}
|
||||
|
||||
LiveData<List<MultiReddit>> getAllMultiReddits() {
|
||||
@ -26,23 +23,4 @@ public class MultiRedditRepository {
|
||||
LiveData<List<MultiReddit>> getAllFavoriteMultiReddits() {
|
||||
return mAllFavoriteMultiReddits;
|
||||
}
|
||||
|
||||
public void insert(MultiReddit MultiReddit) {
|
||||
new MultiRedditRepository.insertAsyncTask(mMultiRedditDao).execute();
|
||||
}
|
||||
|
||||
private static class insertAsyncTask extends AsyncTask<MultiReddit, Void, Void> {
|
||||
|
||||
private MultiRedditDao mAsyncTaskDao;
|
||||
|
||||
insertAsyncTask(MultiRedditDao dao) {
|
||||
mAsyncTaskDao = dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(final MultiReddit... params) {
|
||||
mAsyncTaskDao.insert(params[0]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,10 +32,6 @@ public class MultiRedditViewModel extends AndroidViewModel {
|
||||
return mAllFavoriteMultiReddits;
|
||||
}
|
||||
|
||||
public void insert(MultiReddit MultiReddit) {
|
||||
mMultiRedditRepository.insert(MultiReddit);
|
||||
}
|
||||
|
||||
public static class Factory extends ViewModelProvider.NewInstanceFactory {
|
||||
private Application mApplication;
|
||||
private RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
|
@ -45,6 +45,7 @@ public class PullNotificationWorker extends Worker {
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences mSharedPreferences;
|
||||
private Context context;
|
||||
|
||||
|
@ -11,6 +11,8 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.Account.Account;
|
||||
import ml.docilealligator.infinityforreddit.Account.AccountDao;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme;
|
||||
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeDao;
|
||||
import ml.docilealligator.infinityforreddit.MultiReddit.MultiReddit;
|
||||
import ml.docilealligator.infinityforreddit.MultiReddit.MultiRedditDao;
|
||||
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
|
||||
@ -23,7 +25,7 @@ import ml.docilealligator.infinityforreddit.User.UserDao;
|
||||
import ml.docilealligator.infinityforreddit.User.UserData;
|
||||
|
||||
@Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class,
|
||||
SubscribedUserData.class, MultiReddit.class}, version = 5)
|
||||
SubscribedUserData.class, MultiReddit.class, CustomTheme.class}, version = 6)
|
||||
public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
private static RedditDataRoomDatabase INSTANCE;
|
||||
|
||||
@ -33,7 +35,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
||||
RedditDataRoomDatabase.class, "reddit_data")
|
||||
.addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5)
|
||||
.addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5,
|
||||
MIGRATION_5_6)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@ -53,6 +56,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
|
||||
public abstract MultiRedditDao multiRedditDao();
|
||||
|
||||
public abstract CustomThemeDao customThemeDao();
|
||||
|
||||
private static final Migration MIGRATION_1_2 = new Migration(1, 2) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@ -106,4 +111,39 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
|
||||
+ " ADD COLUMN sidebar_description TEXT");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Migration MIGRATION_5_6 = new Migration(5, 6) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE custom_themes" +
|
||||
"(name TEXT NOT NULL PRIMARY KEY, color_primary INTEGER NOT NULL," +
|
||||
"color_primary_dark INTEGER NOT NULL, color_accent INTEGER NOT NULL," +
|
||||
"color_primary_light_theme INTEGER NOT NULL, primary_text_color INTEGER NOT NULL," +
|
||||
"secondary_text_color INTEGER NOT NULL, background_color INTEGER NOT NULL," +
|
||||
"rounded_bottom_sheet_primary_background INTEGER NOT NULL," +
|
||||
"card_view_background_color INTEGER NOT NULL, toolbar_primary_text_and_icon_color INTEGER NOT NULL," +
|
||||
"toolbar_and_tab_background_color INTEGER NOT NULL, circular_progress_bar_background INTEGER NOT NULL," +
|
||||
"tab_layout_with_expanded_collapsing_toolbar_tab_background INTEGER NOT NULL," +
|
||||
"tab_layout_with_expanded_collapsing_toolbar_text_color INTEGER NOT NULL," +
|
||||
"tab_layout_with_expanded_collapsing_toolbar_tab_indicator INTEGER NOT NULL," +
|
||||
"tab_layout_with_collapsed_collapsing_toolbar_tab_background INTEGER NOT NULL," +
|
||||
"tab_layout_with_collapsed_collapsing_toolbar_text_color INTEGER NOT NULL," +
|
||||
"tab_layout_with_collapsed_collapsing_toolbar_tab_indicator INTEGER NOT NULL," +
|
||||
"nav_bar_color INTEGER NOT NULL, upvoted INTEGER NOT NULL, downvoted INTEGER NOT NULL," +
|
||||
"post_type INTEGER NOT NULL, spoiler_color INTEGER NOT NULL, nsfw_color INTEGER NOT NULL," +
|
||||
"flair_color INTEGER NOT NULL, archived_tint INTEGER NOT NULL, locked_icon_tint INTEGER NOT NULL," +
|
||||
"crosspost INTEGER NOT NULL, stickied_post INTEGER NOT NULL, subscribed INTEGER NOT NULL," +
|
||||
"unsubscribed INTEGER NOT NULL, username INTEGER NOT NULL, subreddit INTEGER NOT NULL," +
|
||||
"author_flair_text_color INTEGER NOT NULL, submitter INTEGER NOT NULL," +
|
||||
"moderator INTEGER NOT NULL, notification_icon_color INTEGER NOT NULL," +
|
||||
"single_comment_thread_background_color INTEGER NOT NULL," +
|
||||
"unread_message_background_color INTEGER NOT NULL, divider_color INTEGER NOT NULL," +
|
||||
"no_preview_link_background_color INTEGER NOT NULL," +
|
||||
"vote_and_reply_unavailable_vote_button_color INTEGER NOT NULL," +
|
||||
"comment_vertical_bar_color_1 INTEGER NOT NULL, comment_vertical_bar_color_2 INTEGER NOT NULL," +
|
||||
"comment_vertical_bar_color_3 INTEGER NOT NULL, comment_vertical_bar_color_4 INTEGER NOT NULL," +
|
||||
"comment_vertical_bar_color_5 INTEGER NOT NULL, comment_vertical_bar_color_6 INTEGER NOT NULL," +
|
||||
"comment_vertical_bar_color_7 INTEGER NOT NULL)");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import androidx.preference.SwitchPreference;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.Event.ChangeLockBottomAppBarEvent;
|
||||
import ml.docilealligator.infinityforreddit.Infinity;
|
||||
@ -26,6 +27,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
public class GesturesAndButtonsPreferenceFragment extends PreferenceFragmentCompat {
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences sharedPreferences;
|
||||
private Activity activity;
|
||||
|
||||
|
@ -14,6 +14,7 @@ import androidx.preference.SwitchPreference;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWBlurEvent;
|
||||
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
|
||||
@ -29,6 +30,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
public class MainPreferenceFragment extends PreferenceFragmentCompat {
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences sharedPreferences;
|
||||
private Activity activity;
|
||||
|
||||
|
@ -20,6 +20,7 @@ import androidx.work.WorkManager;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import ml.docilealligator.infinityforreddit.Infinity;
|
||||
import ml.docilealligator.infinityforreddit.PullNotificationWorker;
|
||||
@ -32,6 +33,7 @@ import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||
public class NotificationPreferenceFragment extends PreferenceFragmentCompat {
|
||||
|
||||
@Inject
|
||||
@Named("default")
|
||||
SharedPreferences sharedPreferences;
|
||||
private boolean enableNotification;
|
||||
private long notificationInterval;
|
||||
|
@ -77,4 +77,56 @@ public class SharedPreferencesUtils {
|
||||
public static final String LOCK_BOTTOM_APP_BAR = "lock_bottom_app_bar";
|
||||
public static final String SHOW_COMMENT_DIVIDER = "show_comment_divider";
|
||||
public static final String SHOW_ABSOLUTE_NUMBER_OF_VOTES = "show_absolute_number_of_votes";
|
||||
|
||||
//Theme
|
||||
public static final String THEME_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.theme";
|
||||
public static final String COLOR_PRIMARY = "colorPrimary";
|
||||
public static final String COLOR_PRIMARY_DARK = "colorPrimaryDark";
|
||||
public static final String COLOR_ACCENT = "colorAccent";
|
||||
public static final String COLOR_PRIMARY_LIGHT_THEME = "colorPrimaryLightTheme";
|
||||
public static final String PRIMARY_TEXT_COLOR = "primaryTextColor";
|
||||
public static final String SECONDARY_TEXT_COLOR = "secondaryTextColor";
|
||||
public static final String BACKGROUND_COLOR = "backgroundColor";
|
||||
public static final String ROUNDED_BOTTOM_SHEET_PRIMARY_BACKGROUND = "roundedBottomSheetPrimaryBackground";
|
||||
public static final String CARD_VIEW_BACKGROUND_COLOR = "cardViewBackgroundColor";
|
||||
public static final String TOOLBAR_PRIMARY_TEXT_AND_ICON_COLOR = "toolbarPrimaryTextAndIconColor";
|
||||
public static final String TOOLBAR_AND_TAB_BACKGROUND_COLOR = "toolbarAndTabBackgroundColor";
|
||||
public static final String CIRCULAR_PROGRESS_BAR_BACKGROUND = "circularProgressBarBackground";
|
||||
public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TAB_BACKGROUND = "tabLayoutWithExpandedCollapsingToolbarTabBackground";
|
||||
public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TEXT_COLOR = "tabLayoutWithExpandedCollapsingToolbarTextColor";
|
||||
public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TAB_INDICATOR = "tabLayoutWithExpandedCollapsingToolbarTabIndicator";
|
||||
public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TAB_BACKGROUND = "tabLayoutWithCollapsedCollapsingToolbarTabBackground";
|
||||
public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TEXT_COLOR = "tabLayoutWithCollapsedCollapsingToolbarTextColor";
|
||||
public static final String TAB_LAYOUT_WITH_COLLAPSED_COLLAPSING_TOOLBAR_TAB_INDICATOR = "tabLayoutWithCollapsedCollapsingToolbarTabIndicator";
|
||||
public static final String NAV_BAR_COLOR = "navBarColor";
|
||||
public static final String UPVOTED = "upvoted";
|
||||
public static final String DOWNVOTED = "downvoted";
|
||||
public static final String POST_TYPE = "postType";
|
||||
public static final String SPOILER_COLOR = "spoilerColor";
|
||||
public static final String NSFW_COLOR = "nsfwColor";
|
||||
public static final String FLAIR_COLOR = "flairColor";
|
||||
public static final String ARCHIVED_TINT = "archivedTint";
|
||||
public static final String LOCKED_ICON_TINT = "lockedIconTint";
|
||||
public static final String CROSSPOST = "crosspost";
|
||||
public static final String STICKIED_POST = "stickiedPost";
|
||||
public static final String SUBSCRIBED = "subscribed";
|
||||
public static final String UNSUBSCRIBED = "unsubscribed";
|
||||
public static final String USERNAME = "username";
|
||||
public static final String SUBREDDIT = "subreddit";
|
||||
public static final String AUTHOR_FLAIR_TEXT_COLOR = "authorFlairTextColor";
|
||||
public static final String SUBMITTER = "submitter";
|
||||
public static final String MODERATOR = "moderator";
|
||||
public static final String NOTIFICATION_ICON_COLOR = "notificationIconColor";
|
||||
public static final String SINGLE_COMMENT_THREAD_BACKGROUND = "singleCommentThreadBackgroundColor";
|
||||
public static final String UNREAD_MESSAGE_BACKGROUND_COLOR = "unreadMessageBackgroundColor";
|
||||
public static final String DIVIDER_COLOR = "dividerColor";
|
||||
public static final String NO_PREVIEW_LINK_BACKGROUND_COLOR = "noPreviewLinkBackgroundColor";
|
||||
public static final String VOTE_AND_REPLY_UNAVAILABLE_VOTE_BUTTON_COLOR = "voteAndReplyUnavailableVoteButtonColor";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_1 = "commentVerticalBarColor1";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_2 = "commentVerticalBarColor2";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_3 = "commentVerticalBarColor3";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_4 = "commentVerticalBarColor4";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_5 = "commentVerticalBarColor5";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_6 = "commentVerticalBarColor6";
|
||||
public static final String COMMENT_VERTICAL_BAR_COLOR_7 = "commentVerticalBarColor7";
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:text="@string/tap_to_retry"
|
||||
android:text="@string/error_loading_gif_tap_to_retry"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -33,7 +33,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:text="@string/tap_to_retry"
|
||||
android:text="@string/error_loading_image_tap_to_retry"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -127,8 +127,8 @@
|
||||
android:padding="4dp"
|
||||
android:textSize="?attr/font_12"
|
||||
android:textColor="@android:color/white"
|
||||
app:lib_setRoundedBGColor="?attr/post_type"
|
||||
app:lib_setRoundedBorderColor="?attr/post_type"
|
||||
app:lib_setRoundedBGColor="?attr/postType"
|
||||
app:lib_setRoundedBorderColor="?attr/postType"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
@ -273,7 +273,7 @@
|
||||
android:drawableTop="@drawable/ic_error_outline_black_24dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="@string/tap_to_retry"
|
||||
android:text="@string/error_loading_image_tap_to_retry"
|
||||
android:textSize="?attr/font_default" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -115,8 +115,8 @@
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="?attr/font_10"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedBGColor="?attr/post_type"
|
||||
app:lib_setRoundedBorderColor="?attr/post_type"
|
||||
app:lib_setRoundedBGColor="?attr/postType"
|
||||
app:lib_setRoundedBorderColor="?attr/postType"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
|
||||
|
@ -109,8 +109,8 @@
|
||||
android:padding="4dp"
|
||||
android:textSize="?attr/font_12"
|
||||
android:textColor="@android:color/white"
|
||||
app:lib_setRoundedBGColor="?attr/post_type"
|
||||
app:lib_setRoundedBorderColor="?attr/post_type"
|
||||
app:lib_setRoundedBGColor="?attr/postType"
|
||||
app:lib_setRoundedBorderColor="?attr/postType"
|
||||
app:lib_setRadius="3dp"
|
||||
app:lib_setRoundedView="true"
|
||||
app:lib_setShape="rectangle" />
|
||||
@ -255,7 +255,7 @@
|
||||
android:drawableTop="@drawable/ic_error_outline_black_24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/tap_to_retry"
|
||||
android:text="@string/error_loading_image_tap_to_retry"
|
||||
android:textSize="?attr/font_default"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
<attr name="backgroundColor" format="color"/>
|
||||
<attr name="roundedBottomSheetPrimaryBackground" format="color"/>
|
||||
<attr name="cardViewBackgroundColor" format="color"/>
|
||||
<attr name="toolbarPrimaryTextAndIconColor" format="color" />
|
||||
<attr name="toolbarPrimaryTextAndIconColor" format="color"/>
|
||||
<attr name="toolbarAndTabBackgroundColor" format="color"/>
|
||||
<attr name="circularProgressBarBackground" format="color"/>
|
||||
<attr name="tabLayoutWithExpandedCollapsingToolbarTabBackground" format="color"/>
|
||||
@ -49,7 +49,7 @@
|
||||
<attr name="navBarColor" format="color"/>
|
||||
<attr name="upvoted" format="color"/>
|
||||
<attr name="downvoted" format="color"/>
|
||||
<attr name="post_type" format="color"/>
|
||||
<attr name="postType" format="color"/>
|
||||
<attr name="spoilerColor" format="color"/>
|
||||
<attr name="nsfwColor" format="color"/>
|
||||
<attr name="flairColor" format="color"/>
|
||||
|
@ -56,7 +56,8 @@
|
||||
<string name="access_denied">Access denied</string>
|
||||
<string name="parse_user_info_error">Error occurred when parsing the user info</string>
|
||||
|
||||
<string name="tap_to_retry">Error loading image. Tap to retry.</string>
|
||||
<string name="error_loading_image_tap_to_retry">Error loading the image. Tap to retry.</string>
|
||||
<string name="error_loading_gif_tap_to_retry">Error loading the gif. Tap to retry.</string>
|
||||
<string name="load_posts_error">Error loading posts.\nTap to retry.</string>
|
||||
<string name="load_more_posts_error">Error loading posts.</string>
|
||||
<string name="load_post_error">Error loading this post.\nTap to retry.</string>
|
||||
|
@ -244,7 +244,7 @@
|
||||
<item name="navBarColor">@color/backgroundColor</item>
|
||||
<item name="upvoted">#E91E63</item>
|
||||
<item name="downvoted">#007DDE</item>
|
||||
<item name="post_type">@color/colorPrimaryDark</item>
|
||||
<item name="postType">@color/colorPrimaryDark</item>
|
||||
<item name="spoilerColor">#EE02EB</item>
|
||||
<item name="nsfwColor">@color/colorAccent</item>
|
||||
<item name="flairColor">#00AA8C</item>
|
||||
@ -296,7 +296,7 @@
|
||||
<item name="navBarColor">@color/backgroundColor</item>
|
||||
<item name="upvoted">#E91E63</item>
|
||||
<item name="downvoted">#007DDE</item>
|
||||
<item name="post_type">#0D47A1</item>
|
||||
<item name="postType">#0D47A1</item>
|
||||
<item name="spoilerColor">#EE02EB</item>
|
||||
<item name="nsfwColor">@color/colorAccent</item>
|
||||
<item name="flairColor">#00AA8C</item>
|
||||
@ -348,7 +348,7 @@
|
||||
<item name="navBarColor">#000000</item>
|
||||
<item name="upvoted">#E91E63</item>
|
||||
<item name="downvoted">#007DDE</item>
|
||||
<item name="post_type">#0D47A1</item>
|
||||
<item name="postType">#0D47A1</item>
|
||||
<item name="spoilerColor">#EE02EB</item>
|
||||
<item name="nsfwColor">@color/colorAccent</item>
|
||||
<item name="flairColor">#00AA8C</item>
|
||||
@ -379,16 +379,17 @@
|
||||
</style>
|
||||
|
||||
<style name="Theme.Purple">
|
||||
<item name="colorPrimary">#00C3E9</item>
|
||||
<item name="colorPrimaryDark">#009EBA</item>
|
||||
<item name="colorAccent">#EE2502</item>
|
||||
<item name="colorPrimary">#6002EE</item>
|
||||
<item name="colorPrimaryDark">#3D00E0</item>
|
||||
<item name="colorAccent">#0098DD</item>
|
||||
<item name="colorPrimaryLightTheme">?attr/colorPrimary</item>
|
||||
<item name="primaryTextColor">#000000</item>
|
||||
<item name="secondaryTextColor">#8A000000</item>
|
||||
<item name="backgroundColor">@color/backgroundColor</item>
|
||||
<item name="roundedBottomSheetPrimaryBackground">@color/roundedBottomSheetPrimaryBackground</item>
|
||||
<item name="cardViewBackgroundColor">#FFFFFF</item>
|
||||
<item name="toolbarPrimaryTextAndIconColor">#FF3C4043</item>
|
||||
<!--<item name="toolbarPrimaryTextAndIconColor">#FF3C4043</item>-->
|
||||
<item name="toolbarPrimaryTextAndIconColor">#FFFFFF</item>
|
||||
<item name="toolbarAndTabBackgroundColor">?attr/colorPrimary</item>
|
||||
<item name="circularProgressBarBackground">#FFFFFF</item>
|
||||
<item name="tabLayoutWithExpandedCollapsingToolbarTabBackground">#FFFFFF</item>
|
||||
@ -398,23 +399,23 @@
|
||||
<item name="tabLayoutWithCollapsedCollapsingToolbarTextColor">?attr/toolbarPrimaryTextAndIconColor</item>
|
||||
<item name="tabLayoutWithCollapsedCollapsingToolbarTabIndicator">?attr/toolbarPrimaryTextAndIconColor</item>
|
||||
<item name="navBarColor">@color/backgroundColor</item>
|
||||
<item name="upvoted">#E91E63</item>
|
||||
<item name="downvoted">#007DDE</item>
|
||||
<item name="post_type">#7B1FA2</item>
|
||||
<item name="upvoted">#FC2727</item>
|
||||
<item name="downvoted">#276BFC</item>
|
||||
<item name="postType">#6002EE</item>
|
||||
<item name="spoilerColor">#EE02EB</item>
|
||||
<item name="nsfwColor">#03A9F4</item>
|
||||
<item name="flairColor">#00AA8C</item>
|
||||
<item name="nsfwColor">#FC27A1</item>
|
||||
<item name="flairColor">#00D039</item>
|
||||
<item name="archivedTint">#B4009F</item>
|
||||
<item name="lockedIconTint">#EE7302</item>
|
||||
<item name="crosspost">#03A9F4</item>
|
||||
<item name="stickiedPost">#7B1FA2</item>
|
||||
<item name="subscribed">#03A9F4</item>
|
||||
<item name="unsubscribed">#7B1FA2</item>
|
||||
<item name="username">#7B1FA2</item>
|
||||
<item name="subreddit">#03A9F4</item>
|
||||
<item name="username">#FB9E25</item>
|
||||
<item name="subreddit">#4D27FC</item>
|
||||
<item name="authorFlairTextColor">#EE02C4</item>
|
||||
<item name="submitter">#EE8A02</item>
|
||||
<item name="moderator">#00BA81</item>
|
||||
<item name="submitter">#EE8002</item>
|
||||
<item name="moderator">#02EEDD</item>
|
||||
<item name="notificationIconColor">?attr/colorPrimary</item>
|
||||
<item name="singleCommentThreadBackgroundColor">#B3E5F9</item>
|
||||
<item name="unreadMessageBackgroundColor">#B3E5F9</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user