Change project structures.

This commit is contained in:
Alex Ning 2019-09-29 21:18:45 +08:00
parent 3227e43fc4
commit 456429725b
136 changed files with 1292 additions and 744 deletions

View File

@ -21,11 +21,11 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity
android:name=".AccountSavedThingActivity"
android:name=".Activity.AccountSavedThingActivity"
android:label="@string/account_saved_thing_activity"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".ShareDataResolverActivity">
<activity android:name=".Activity.ShareDataResolverActivity">
<intent-filter>
<action android:name="android.intent.action.SEND" />
@ -49,41 +49,41 @@
</intent-filter>
</activity>
<activity
android:name=".SettingsActivity"
android:name=".Activity.SettingsActivity"
android:label="@string/settings_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/PreferenceActivityTheme" />
<activity
android:name=".ViewMessageActivity"
android:name=".Activity.ViewMessageActivity"
android:label="@string/view_message_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".AccountPostsActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.AccountPostsActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".EditCommentActivity"
android:name=".Activity.EditCommentActivity"
android:label="@string/edit_comment_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".EditPostActivity"
android:name=".Activity.EditPostActivity"
android:label="@string/edit_post_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".FilteredThingActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.FilteredThingActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".SearchSubredditsResultActivity"
android:name=".Activity.SearchSubredditsResultActivity"
android:label="@string/search_subreddits_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".LinkResolverActivity">
<activity android:name=".Activity.LinkResolverActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -153,62 +153,62 @@
</intent-filter>
</activity>
<activity
android:name=".SearchActivity"
android:name=".Activity.SearchActivity"
android:label="@string/search_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".RulesActivity"
android:name=".Activity.RulesActivity"
android:label="@string/rules_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".PostVideoActivity"
android:name=".Activity.PostVideoActivity"
android:label="@string/post_video_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".PostImageActivity"
android:name=".Activity.PostImageActivity"
android:label="@string/post_image_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".PostLinkActivity"
android:name=".Activity.PostLinkActivity"
android:label="@string/post_link_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".SubscribedThingListingActivity"
android:name=".Activity.SubscribedThingListingActivity"
android:label="@string/subscriptions"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".SubredditSelectionActivity"
android:name=".Activity.SubredditSelectionActivity"
android:label="@string/subreddit_selection_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".PostTextActivity"
android:name=".Activity.PostTextActivity"
android:label="@string/post_text_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".CommentActivity"
android:name=".Activity.CommentActivity"
android:label="@string/comment_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".SearchResultActivity"
android:name=".Activity.SearchResultActivity"
android:label="@string/search_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".MainActivity"
android:name=".Activity.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.Launcher">
<intent-filter>
@ -218,29 +218,29 @@
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:name=".Activity.LoginActivity"
android:label="@string/login_activity_label"
android:parentActivityName=".MainActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ViewImageActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.ViewImageActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.ActionBar.Transparent" />
<activity
android:name=".ViewVideoActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.ViewVideoActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.ActionBar.Transparent" />
<activity
android:name=".ViewPostDetailActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.ViewPostDetailActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ViewSubredditDetailActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.ViewSubredditDetailActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBarWithTranslucentWindow" />
<activity
android:name=".ViewUserDetailActivity"
android:parentActivityName=".MainActivity"
android:name=".Activity.ViewUserDetailActivity"
android:parentActivityName=".Activity.MainActivity"
android:theme="@style/AppTheme.NoActionBarWithTranslucentWindow" />
<provider

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -28,6 +28,21 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Fragment.UserThingSortTypeBottomSheetFragment;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
@ -105,7 +120,7 @@ public class AccountPostsActivity extends AppCompatActivity implements UserThing
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -33,6 +33,21 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.Fragment.CommentsListingFragment;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Retrofit;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
@ -113,7 +128,7 @@ public class AccountSavedThingActivity extends AppCompatActivity {
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Context;
import android.content.Intent;
@ -39,6 +39,17 @@ import io.noties.markwon.AbstractMarkwonPlugin;
import io.noties.markwon.Markwon;
import io.noties.markwon.MarkwonConfiguration;
import io.noties.markwon.linkify.LinkifyPlugin;
import ml.docilealligator.infinityforreddit.CommentData;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SendComment;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Retrofit;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
@ -48,13 +59,13 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class CommentActivity extends AppCompatActivity {
static final String EXTRA_COMMENT_PARENT_TEXT_KEY = "ECPTK";
static final String EXTRA_PARENT_FULLNAME_KEY = "EPFK";
static final String EXTRA_COMMENT_DATA_KEY = "ECDK";
static final String EXTRA_PARENT_DEPTH_KEY = "EPDK";
static final String EXTRA_PARENT_POSITION_KEY = "EPPK";
static final String EXTRA_IS_REPLYING_KEY = "EIRK";
static final int WRITE_COMMENT_REQUEST_CODE = 1;
public static final String EXTRA_COMMENT_PARENT_TEXT_KEY = "ECPTK";
public static final String EXTRA_PARENT_FULLNAME_KEY = "EPFK";
public static final String EXTRA_COMMENT_DATA_KEY = "ECDK";
public static final String EXTRA_PARENT_DEPTH_KEY = "EPDK";
public static final String EXTRA_PARENT_POSITION_KEY = "EPPK";
public static final String EXTRA_IS_REPLYING_KEY = "EIRK";
public static final int WRITE_COMMENT_REQUEST_CODE = 1;
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
private static final String ACCESS_TOKEN_STATE = "ATS";

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Context;
import android.content.Intent;
@ -34,6 +34,15 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditAPI;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@ -46,10 +55,10 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class EditCommentActivity extends AppCompatActivity {
static final String EXTRA_CONTENT = "EC";
static final String EXTRA_FULLNAME = "EF";
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_POSITION = "EP";
public static final String EXTRA_CONTENT = "EC";
public static final String EXTRA_FULLNAME = "EF";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_POSITION = "EP";
static final String EXTRA_EDITED_COMMENT_CONTENT = "EECC";
static final String EXTRA_EDITED_COMMENT_POSITION = "EECP";

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Context;
import android.content.Intent;
@ -35,6 +35,15 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditAPI;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -28,6 +28,23 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.Post;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.Fragment.SearchPostSortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Fragment.SortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Fragment.UserThingSortTypeBottomSheetFragment;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
@ -37,12 +54,12 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class FilteredThingActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback,
SearchPostSortTypeBottomSheetFragment.SearchSortTypeSelectionCallback, UserThingSortTypeBottomSheetFragment.UserThingSortTypeSelectionCallback {
static final String EXTRA_NAME = "ESN";
static final String EXTRA_QUERY = "EQ";
static final String EXTRA_FILTER = "EF";
static final String EXTRA_POST_TYPE = "EPT";
static final String EXTRA_SORT_TYPE = "EST";
static final String EXTRA_USER_WHERE = "EUW";
public static final String EXTRA_NAME = "ESN";
public static final String EXTRA_QUERY = "EQ";
public static final String EXTRA_FILTER = "EF";
public static final String EXTRA_POST_TYPE = "EPT";
public static final String EXTRA_SORT_TYPE = "EST";
public static final String EXTRA_USER_WHERE = "EUW";
private static final String IS_IN_LAZY_MODE_STATE = "IILMS";
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
@ -116,7 +133,7 @@ public class FilteredThingActivity extends AppCompatActivity implements SortType
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
@ -19,6 +19,10 @@ import java.util.List;
import javax.inject.Inject;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
@ -27,8 +31,8 @@ import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_C
public class LinkResolverActivity extends AppCompatActivity {
static final String EXTRA_MESSAGE_FULLNAME = "ENF";
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
public static final String EXTRA_MESSAGE_FULLNAME = "ENF";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/{0,1}";
private static final String COMMENT_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/\\w+/{0,1}";

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
import android.content.Intent;
@ -29,6 +29,15 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.FetchMyInfo;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.AsyncTask.ParseAndInsertNewAccountAsyncTask;
import ml.docilealligator.infinityforreddit.ParseAndSaveAccountInfo;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditAPI;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
import android.content.Intent;
@ -59,12 +59,38 @@ import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.Account.AccountViewModel;
import ml.docilealligator.infinityforreddit.Adapter.AccountRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeFontSizeEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FetchMyInfo;
import ml.docilealligator.infinityforreddit.FetchSubscribedThing;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask;
import ml.docilealligator.infinityforreddit.ParseAndSaveAccountInfo;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.Fragment.PostTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.PullNotificationWorker;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.ReadMessage;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Fragment.SortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditData;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserData;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchToAnonymousAccountAsyncTask;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
@ -202,7 +228,7 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -47,6 +47,20 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SubmitImagePostEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubmitPostService;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -37,6 +37,21 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SubmitTextOrLinkPostEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubmitPostService;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -37,6 +37,21 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SubmitTextOrLinkPostEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubmitPostService;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -49,6 +49,20 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubmitPostService;
import ml.docilealligator.infinityforreddit.Event.SubmitVideoPostEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -36,6 +36,19 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Adapter.RulesRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.JSONUtils;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditAPI;
import ml.docilealligator.infinityforreddit.Rule;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Utils;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@ -107,7 +120,7 @@ public class RulesActivity extends AppCompatActivity {
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
import android.content.Context;
@ -31,6 +31,13 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -32,6 +32,24 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.Fragment.SearchPostSortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Fragment.SearchUserAndSubredditSortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Fragment.SubredditListingFragment;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Fragment.UserListingFragment;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
@ -106,7 +124,7 @@ public class SearchResultActivity extends AppCompatActivity implements SearchPos
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
import android.content.Intent;
@ -28,6 +28,17 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.Fragment.SubredditListingFragment;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
@ -97,7 +108,7 @@ public class SearchSubredditsResultActivity extends AppCompatActivity {
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
@ -177,7 +188,7 @@ public class SearchSubredditsResultActivity extends AppCompatActivity {
}).execute();
}
void getSelectedSubreddit(String name, String iconUrl) {
public void getSelectedSubreddit(String name, String iconUrl) {
Intent returnIntent = new Intent();
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name);
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -19,10 +19,16 @@ import androidx.preference.PreferenceFragmentCompat;
import javax.inject.Inject;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Settings.AboutPreferenceFragment;
import ml.docilealligator.infinityforreddit.Settings.MainPreferenceFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.net.Uri;
@ -8,6 +8,12 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import ml.docilealligator.infinityforreddit.Activity.PostImageActivity;
import ml.docilealligator.infinityforreddit.Activity.PostLinkActivity;
import ml.docilealligator.infinityforreddit.Activity.PostTextActivity;
import ml.docilealligator.infinityforreddit.Activity.PostVideoActivity;
import ml.docilealligator.infinityforreddit.R;
public class ShareDataResolverActivity extends AppCompatActivity {
@Override

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.app.Activity;
import android.content.Intent;
@ -31,11 +31,24 @@ import java.util.ArrayList;
import javax.inject.Inject;
import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FetchSubscribedThing;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.SubscribedSubredditsListingFragment;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditData;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserData;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Retrofit;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
@ -119,7 +132,7 @@ public class SubredditSelectionActivity extends AppCompatActivity {
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
@ -258,7 +271,7 @@ public class SubredditSelectionActivity extends AppCompatActivity {
return false;
}
void getSelectedSubreddit(String name, String iconUrl, boolean subredditIsUser) {
public void getSelectedSubreddit(String name, String iconUrl, boolean subredditIsUser) {
Intent returnIntent = new Intent();
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_NAME, name);
returnIntent.putExtra(EXTRA_RETURN_SUBREDDIT_ICON_URL, iconUrl);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -31,11 +31,25 @@ import java.util.ArrayList;
import javax.inject.Inject;
import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FetchSubscribedThing;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.FollowedUsersListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.SubscribedSubredditsListingFragment;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditData;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserData;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Retrofit;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
@ -112,7 +126,7 @@ public class SubscribedThingListingActivity extends AppCompatActivity {
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if(state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.Manifest;
import android.animation.Animator;
@ -50,14 +50,20 @@ import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
public class ViewImageActivity extends AppCompatActivity {
private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0;
static final String TITLE_KEY = "TK";
static final String IMAGE_URL_KEY = "IUK";
static final String FILE_NAME_KEY = "FNK";
public static final String TITLE_KEY = "TK";
public static final String IMAGE_URL_KEY = "IUK";
public static final String FILE_NAME_KEY = "FNK";
@BindView(R.id.parent_relative_layout_view_image_activity) RelativeLayout mRelativeLayout;
@BindView(R.id.progress_bar_view_image_activity) ProgressBar mProgressBar;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@ -39,6 +39,21 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.FetchMessages;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.Adapter.MessageRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.MessageViewModel;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Retrofit;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
@ -48,7 +63,7 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class ViewMessageActivity extends AppCompatActivity {
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
private static final String ACCESS_TOKEN_STATE = "ATS";
@ -126,7 +141,7 @@ public class ViewMessageActivity extends AppCompatActivity {
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -48,6 +48,36 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWBlurEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeSpoilerBlurEvent;
import ml.docilealligator.infinityforreddit.Adapter.CommentAndPostRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.CommentData;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.DeleteThing;
import ml.docilealligator.infinityforreddit.FetchComment;
import ml.docilealligator.infinityforreddit.FetchPost;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.HidePost;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.ParseComment;
import ml.docilealligator.infinityforreddit.ParsePost;
import ml.docilealligator.infinityforreddit.Post;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToDetailActivity;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToPostList;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.ReadMessage;
import ml.docilealligator.infinityforreddit.RedditAPI;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SaveThing;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@ -57,20 +87,20 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
import static ml.docilealligator.infinityforreddit.CommentActivity.EXTRA_COMMENT_DATA_KEY;
import static ml.docilealligator.infinityforreddit.CommentActivity.WRITE_COMMENT_REQUEST_CODE;
import static ml.docilealligator.infinityforreddit.Activity.CommentActivity.EXTRA_COMMENT_DATA_KEY;
import static ml.docilealligator.infinityforreddit.Activity.CommentActivity.WRITE_COMMENT_REQUEST_CODE;
public class ViewPostDetailActivity extends AppCompatActivity implements FlairBottomSheetFragment.FlairSelectionCallback {
static final String EXTRA_POST_DATA = "EPD";
static final String EXTRA_POST_LIST_POSITION = "EPLI";
static final String EXTRA_POST_ID = "EPI";
static final String EXTRA_SINGLE_COMMENT_ID = "ESCI";
static final String EXTRA_MESSAGE_FULLNAME = "ENI";
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
public static final String EXTRA_POST_DATA = "EPD";
public static final String EXTRA_POST_LIST_POSITION = "EPLI";
public static final String EXTRA_POST_ID = "EPI";
public static final String EXTRA_SINGLE_COMMENT_ID = "ESCI";
public static final String EXTRA_MESSAGE_FULLNAME = "ENI";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final int EDIT_POST_REQUEST_CODE = 2;
static final int EDIT_COMMENT_REQUEST_CODE = 3;
public static final int EDIT_COMMENT_REQUEST_CODE = 3;
private RequestManager mGlide;
private Locale mLocale;
@ -180,7 +210,7 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
}
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
@ -881,7 +911,7 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
});
}
void deleteComment(String fullName, int position) {
public void deleteComment(String fullName, int position) {
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.delete_this_comment)
.setMessage(R.string.are_you_sure)
@ -902,7 +932,7 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
.show();
}
void changeToSingleThreadMode() {
public void changeToSingleThreadMode() {
isSingleCommentThreadMode = false;
mSingleCommentId = null;
refresh(false, true);
@ -1241,7 +1271,7 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
comments = mAdapter.getVisibleComments();
comments = mAdapter == null ? null : mAdapter.getVisibleComments();
Bridge.saveInstanceState(this, outState);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -39,12 +39,33 @@ import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
import javax.inject.Named;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditViewModel;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.AsyncTask.CheckIsSubscribedToSubredditAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FetchSubredditData;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.Fragment.PostTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Fragment.SortTypeBottomSheetFragment;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.ReadMessage;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditViewModel;
import ml.docilealligator.infinityforreddit.SubredditSubscription;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
@ -56,9 +77,9 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class ViewSubredditDetailActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback,
PostTypeBottomSheetFragment.PostTypeSelectionCallback {
static final String EXTRA_SUBREDDIT_NAME_KEY = "ESN";
static final String EXTRA_MESSAGE_FULLNAME = "ENF";
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
public static final String EXTRA_SUBREDDIT_NAME_KEY = "ESN";
public static final String EXTRA_MESSAGE_FULLNAME = "ENF";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final String FETCH_SUBREDDIT_INFO_STATE = "FSIS";
private static final String CURRENT_ONLINE_SUBSCRIBERS_STATE = "COSS";
@ -155,7 +176,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -43,13 +43,35 @@ import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
import javax.inject.Named;
import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWEvent;
import ml.docilealligator.infinityforreddit.AsyncTask.CheckIsFollowingUserAsyncTask;
import ml.docilealligator.infinityforreddit.Fragment.CommentsListingFragment;
import ml.docilealligator.infinityforreddit.ContentFontStyle;
import ml.docilealligator.infinityforreddit.DeleteThing;
import ml.docilealligator.infinityforreddit.FetchUserData;
import ml.docilealligator.infinityforreddit.FontStyle;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.ReadMessage;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserDao;
import ml.docilealligator.infinityforreddit.AsyncTask.SwitchAccountAsyncTask;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.TitleFontStyle;
import ml.docilealligator.infinityforreddit.User.UserDao;
import ml.docilealligator.infinityforreddit.User.UserData;
import ml.docilealligator.infinityforreddit.User.UserViewModel;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.UserFollowing;
import ml.docilealligator.infinityforreddit.Fragment.UserThingSortTypeBottomSheetFragment;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
@ -60,9 +82,9 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class ViewUserDetailActivity extends AppCompatActivity implements UserThingSortTypeBottomSheetFragment.UserThingSortTypeSelectionCallback {
static final String EXTRA_USER_NAME_KEY = "EUNK";
static final String EXTRA_MESSAGE_FULLNAME = "ENF";
static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
public static final String EXTRA_USER_NAME_KEY = "EUNK";
public static final String EXTRA_MESSAGE_FULLNAME = "ENF";
public static final String EXTRA_NEW_ACCOUNT_NAME = "ENAN";
private static final String FETCH_USER_INFO_STATE = "FSIS";
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
@ -232,7 +254,7 @@ public class ViewUserDetailActivity extends AppCompatActivity implements UserThi
View decorView = window.getDecorView();
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
if(finalLightNavBar) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
@ -255,7 +277,7 @@ public class ViewUserDetailActivity extends AppCompatActivity implements UserThi
} else {
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
void onStateChanged(AppBarLayout appBarLayout, State state) {
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.EXPANDED) {
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
@ -492,7 +514,7 @@ public class ViewUserDetailActivity extends AppCompatActivity implements UserThi
}
}
void deleteComment(String fullName) {
public void deleteComment(String fullName) {
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.delete_this_comment)
.setMessage(R.string.are_you_sure)

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Activity;
import android.Manifest;
import android.animation.Animator;
@ -46,14 +46,15 @@ import com.google.android.exoplayer2.util.Util;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.R;
public class ViewVideoActivity extends AppCompatActivity {
private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0;
static final String TITLE_KEY = "TK";
static final String SUBREDDIT_KEY = "SK";
static final String ID_KEY = "IK";
public static final String TITLE_KEY = "TK";
public static final String SUBREDDIT_KEY = "SK";
public static final String ID_KEY = "IK";
@BindView(R.id.relative_layout_view_video_activity) RelativeLayout relativeLayout;
@BindView(R.id.player_view_view_video_activity) PlayerView videoPlayerView;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.view.LayoutInflater;
@ -19,11 +19,12 @@ import ml.docilealligator.infinityforreddit.Account.Account;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.R;
import pl.droidsonroids.gif.GifImageView;
class AccountRecyclerViewAdapter extends RecyclerView.Adapter<AccountRecyclerViewAdapter.AccountViewHolder> {
public class AccountRecyclerViewAdapter extends RecyclerView.Adapter<AccountRecyclerViewAdapter.AccountViewHolder> {
interface ItemSelectedListener {
public interface ItemSelectedListener {
void accountSelected(Account account);
void addAccountSelected();
void anonymousSelected();
@ -36,7 +37,7 @@ class AccountRecyclerViewAdapter extends RecyclerView.Adapter<AccountRecyclerVie
private RequestManager mGlide;
private ItemSelectedListener mItemSelectedListener;
AccountRecyclerViewAdapter(Context context, RequestManager glide, String currentAccountName, ItemSelectedListener itemSelectedListener) {
public AccountRecyclerViewAdapter(Context context, RequestManager glide, String currentAccountName, ItemSelectedListener itemSelectedListener) {
mContext = context;
mGlide = glide;
mCurrentAccountName = currentAccountName;
@ -112,7 +113,7 @@ class AccountRecyclerViewAdapter extends RecyclerView.Adapter<AccountRecyclerVie
holder.profileImageGifImageView.clearColorFilter();
}
void changeAccountsDataset(List<Account> accounts) {
public void changeAccountsDataset(List<Account> accounts) {
mAccounts = accounts;
notifyDataSetChanged();
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.app.Activity;
import android.content.ActivityNotFoundException;
@ -39,6 +39,15 @@ import com.santalu.aspectratioimageview.AspectRatioImageView;
import java.util.ArrayList;
import java.util.Locale;
import ml.docilealligator.infinityforreddit.Activity.CommentActivity;
import ml.docilealligator.infinityforreddit.Activity.FilteredThingActivity;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewImageActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewVideoActivity;
import ml.docilealligator.infinityforreddit.CommentData;
import ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -50,11 +59,22 @@ import io.noties.markwon.linkify.LinkifyPlugin;
import io.noties.markwon.urlprocessor.UrlProcessorRelativeToAbsolute;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.FetchComment;
import ml.docilealligator.infinityforreddit.Fragment.ModifyCommentBottomSheetFragment;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadUserDataAsyncTask;
import ml.docilealligator.infinityforreddit.Post;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SaveThing;
import ml.docilealligator.infinityforreddit.VoteThing;
import retrofit2.Retrofit;
import static ml.docilealligator.infinityforreddit.CommentActivity.WRITE_COMMENT_REQUEST_CODE;
import static ml.docilealligator.infinityforreddit.Activity.CommentActivity.WRITE_COMMENT_REQUEST_CODE;
class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int VIEW_TYPE_POST_DETAIL = 0;
private static final int VIEW_TYPE_FIRST_LOADING = 1;
private static final int VIEW_TYPE_FIRST_LOADING_FAILED = 2;
@ -87,18 +107,18 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
private boolean mHasMoreComments;
private boolean loadMoreCommentsFailed;
interface CommentRecyclerViewAdapterCallback {
public interface CommentRecyclerViewAdapterCallback {
void updatePost(Post post);
void retryFetchingComments();
void retryFetchingMoreComments();
}
CommentAndPostRecyclerViewAdapter(Activity activity, Retrofit retrofit, Retrofit oauthRetrofit,
RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide,
String accessToken, String accountName, Post post, Locale locale,
String singleCommentId, boolean isSingleCommentThreadMode,
boolean needBlurNSFW, boolean needBlurSpoiler,
CommentRecyclerViewAdapterCallback commentRecyclerViewAdapterCallback) {
public CommentAndPostRecyclerViewAdapter(Activity activity, Retrofit retrofit, Retrofit oauthRetrofit,
RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide,
String accessToken, String accountName, Post post, Locale locale,
String singleCommentId, boolean isSingleCommentThreadMode,
boolean needBlurNSFW, boolean needBlurSpoiler,
CommentRecyclerViewAdapterCallback commentRecyclerViewAdapterCallback) {
mActivity = activity;
mRetrofit = retrofit;
mOauthRetrofit = oauthRetrofit;
@ -951,7 +971,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void updatePost(Post post) {
public void updatePost(Post post) {
mPost = post;
notifyItemChanged(0);
}
@ -1009,7 +1029,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void addComments(ArrayList<CommentData> comments, boolean hasMoreComments) {
public void addComments(ArrayList<CommentData> comments, boolean hasMoreComments) {
if(mVisibleComments.size() == 0) {
isInitiallyLoading = false;
isInitiallyLoadingFailed = false;
@ -1046,7 +1066,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
mHasMoreComments = hasMoreComments;
}
void addComment(CommentData comment) {
public void addComment(CommentData comment) {
if(mVisibleComments.size() == 0 || isInitiallyLoadingFailed) {
notifyItemRemoved(1);
}
@ -1060,7 +1080,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void addChildComment(CommentData comment, String parentFullname, int parentPosition) {
public void addChildComment(CommentData comment, String parentFullname, int parentPosition) {
if(!parentFullname.equals(mVisibleComments.get(parentPosition).getFullName())) {
for(int i = 0; i < mVisibleComments.size(); i++) {
if(parentFullname.equals(mVisibleComments.get(i).getFullName())) {
@ -1089,16 +1109,16 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void setSingleComment(String singleCommentId, boolean isSingleCommentThreadMode) {
public void setSingleComment(String singleCommentId, boolean isSingleCommentThreadMode) {
mSingleCommentId = singleCommentId;
mIsSingleCommentThreadMode = isSingleCommentThreadMode;
}
ArrayList<CommentData> getVisibleComments() {
public ArrayList<CommentData> getVisibleComments() {
return mVisibleComments;
}
void initiallyLoading() {
public void initiallyLoading() {
if(mVisibleComments.size() != 0) {
int previousSize = mVisibleComments.size();
mVisibleComments.clear();
@ -1120,13 +1140,13 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void initiallyLoadCommentsFailed() {
public void initiallyLoadCommentsFailed() {
isInitiallyLoading = false;
isInitiallyLoadingFailed = true;
notifyItemChanged(1);
}
void loadMoreCommentsFailed() {
public void loadMoreCommentsFailed() {
loadMoreCommentsFailed = true;
if(mIsSingleCommentThreadMode) {
notifyItemChanged(mVisibleComments.size() + 2);
@ -1135,7 +1155,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void editComment(String commentContent, int position) {
public void editComment(String commentContent, int position) {
mVisibleComments.get(position).setCommentContent(commentContent);
if(mIsSingleCommentThreadMode) {
notifyItemChanged(position + 2);
@ -1144,7 +1164,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void deleteComment(int position) {
public void deleteComment(int position) {
if(mVisibleComments.get(position).hasReply()) {
mVisibleComments.get(position).setAuthor("[deleted]");
mVisibleComments.get(position).setCommentContent("[deleted]");
@ -1163,11 +1183,11 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
void setBlurNSFW(boolean needBlurNSFW) {
public void setBlurNSFW(boolean needBlurNSFW) {
mNeedBlurNSFW = needBlurNSFW;
}
void setBlurSpoiler(boolean needBlurSpoiler) {
public void setBlurSpoiler(boolean needBlurSpoiler) {
mNeedBlurSpoiler = needBlurSpoiler;
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.ActivityNotFoundException;
import android.content.Context;
@ -29,9 +29,20 @@ import io.noties.markwon.Markwon;
import io.noties.markwon.MarkwonConfiguration;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.linkify.LinkifyPlugin;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.CommentData;
import ml.docilealligator.infinityforreddit.Fragment.ModifyCommentBottomSheetFragment;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SaveThing;
import ml.docilealligator.infinityforreddit.VoteThing;
import retrofit2.Retrofit;
class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, RecyclerView.ViewHolder> {
public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, RecyclerView.ViewHolder> {
private Context mContext;
private Retrofit mOauthRetrofit;
private Markwon mMarkwon;
@ -47,11 +58,11 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R
private NetworkState networkState;
private RetryLoadingMoreCallback mRetryLoadingMoreCallback;
interface RetryLoadingMoreCallback {
public interface RetryLoadingMoreCallback {
void retryLoadingMore();
}
protected CommentsListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit,
public CommentsListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit,
String accessToken, String accountName,
RetryLoadingMoreCallback retryLoadingMoreCallback) {
super(DIFF_CALLBACK);
@ -370,7 +381,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R
return networkState != null && networkState.getStatus() != NetworkState.Status.SUCCESS;
}
void setNetworkState(NetworkState newNetworkState) {
public void setNetworkState(NetworkState newNetworkState) {
NetworkState previousState = this.networkState;
boolean previousExtraRow = hasExtraRow();
this.networkState = newNetworkState;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.app.Activity;
import android.content.Context;
@ -19,9 +19,11 @@ import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.R;
class FlairBottomSheetRecyclerViewAdapter extends RecyclerView.Adapter<FlairBottomSheetRecyclerViewAdapter.FlairViewHolder> {
interface ItemClickListener {
public class FlairBottomSheetRecyclerViewAdapter extends RecyclerView.Adapter<FlairBottomSheetRecyclerViewAdapter.FlairViewHolder> {
public interface ItemClickListener {
void onClick(Flair flair);
}
@ -29,7 +31,7 @@ class FlairBottomSheetRecyclerViewAdapter extends RecyclerView.Adapter<FlairBott
private ArrayList<Flair> flairs;
private ItemClickListener itemClickListener;
FlairBottomSheetRecyclerViewAdapter(Context context, ItemClickListener itemClickListener) {
public FlairBottomSheetRecyclerViewAdapter(Context context, ItemClickListener itemClickListener) {
this.context = context;
this.itemClickListener = itemClickListener;
}
@ -86,7 +88,7 @@ class FlairBottomSheetRecyclerViewAdapter extends RecyclerView.Adapter<FlairBott
holder.editFlairImageView.setVisibility(View.GONE);
}
void changeDataset(ArrayList<Flair> flairs) {
public void changeDataset(ArrayList<Flair> flairs) {
this.flairs = flairs;
notifyDataSetChanged();
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.content.Intent;
@ -16,6 +16,8 @@ import com.bumptech.glide.request.RequestOptions;
import java.util.List;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserData;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pl.droidsonroids.gif.GifImageView;
@ -25,7 +27,7 @@ public class FollowedUsersRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
private Context mContext;
private RequestManager glide;
FollowedUsersRecyclerViewAdapter(Context context) {
public FollowedUsersRecyclerViewAdapter(Context context) {
mContext = context;
glide = Glide.with(context.getApplicationContext());
}
@ -70,7 +72,7 @@ public class FollowedUsersRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
glide.clear(((UserViewHolder) holder).iconGifImageView);
}
void setSubscribedUsers(List<SubscribedUserData> subscribedUsers){
public void setSubscribedUsers(List<SubscribedUserData> subscribedUsers){
mSubscribedUserData = subscribedUsers;
notifyDataSetChanged();
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.content.Intent;
@ -23,9 +23,15 @@ import io.noties.markwon.Markwon;
import io.noties.markwon.MarkwonConfiguration;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.linkify.LinkifyPlugin;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.Message;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.ReadMessage;
import retrofit2.Retrofit;
class MessageRecyclerViewAdapter extends PagedListAdapter<Message, RecyclerView.ViewHolder> {
public class MessageRecyclerViewAdapter extends PagedListAdapter<Message, RecyclerView.ViewHolder> {
private static final int VIEW_TYPE_DATA = 0;
private static final int VIEW_TYPE_ERROR = 1;
private static final int VIEW_TYPE_LOADING = 2;
@ -39,11 +45,11 @@ class MessageRecyclerViewAdapter extends PagedListAdapter<Message, RecyclerView.
private NetworkState networkState;
private RetryLoadingMoreCallback mRetryLoadingMoreCallback;
interface RetryLoadingMoreCallback {
public interface RetryLoadingMoreCallback {
void retryLoadingMore();
}
MessageRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, String accessToken,
public MessageRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, String accessToken,
RetryLoadingMoreCallback retryLoadingMoreCallback) {
super(DIFF_CALLBACK);
mContext = context;
@ -193,7 +199,7 @@ class MessageRecyclerViewAdapter extends PagedListAdapter<Message, RecyclerView.
return networkState != null && networkState.getStatus() != NetworkState.Status.SUCCESS;
}
void setNetworkState(NetworkState newNetworkState) {
public void setNetworkState(NetworkState newNetworkState) {
NetworkState previousState = this.networkState;
boolean previousExtraRow = hasExtraRow();
this.networkState = newNetworkState;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.ActivityNotFoundException;
import android.content.Context;
@ -38,19 +38,38 @@ import com.libRG.CustomTextView;
import org.greenrobot.eventbus.EventBus;
import ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView;
import ml.docilealligator.infinityforreddit.User.UserDao;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.Activity.CommentActivity;
import ml.docilealligator.infinityforreddit.Activity.FilteredThingActivity;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewImageActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewVideoActivity;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadSubredditIconAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.LoadUserDataAsyncTask;
import ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToDetailActivity;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.Post;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.RedditUtils;
import ml.docilealligator.infinityforreddit.SaveThing;
import ml.docilealligator.infinityforreddit.User.UserDao;
import ml.docilealligator.infinityforreddit.VoteThing;
import retrofit2.Retrofit;
/**
* Created by alex on 2/25/18.
*/
class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHolder> {
public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHolder> {
private Context mContext;
private Retrofit mOauthRetrofit;
private Retrofit mRetrofit;
@ -71,15 +90,15 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
private NetworkState networkState;
private Callback mCallback;
interface Callback {
public interface Callback {
void retryLoadingMore();
void typeChipClicked(int filter);
}
PostRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
RedditDataRoomDatabase redditDataRoomDatabase, String accessToken,
int postType, boolean displaySubredditName, boolean needBlurNSFW,
boolean needBlurSpoiler, Callback callback) {
public PostRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
RedditDataRoomDatabase redditDataRoomDatabase, String accessToken,
int postType, boolean displaySubredditName, boolean needBlurNSFW,
boolean needBlurSpoiler, Callback callback) {
super(DIFF_CALLBACK);
if(context != null) {
mContext = context;
@ -111,7 +130,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
}
};
void setCanStartActivity(boolean canStartActivity) {
public void setCanStartActivity(boolean canStartActivity) {
this.canStartActivity = canStartActivity;
}
@ -742,11 +761,11 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
return super.getItemCount();
}
void setBlurNSFW(boolean needBlurNSFW) {
public void setBlurNSFW(boolean needBlurNSFW) {
mNeedBlurNSFW = needBlurNSFW;
}
void setBlurSpoiler(boolean needBlurSpoiler) {
public void setBlurSpoiler(boolean needBlurSpoiler) {
mNeedBlurSpoiler = needBlurSpoiler;
}
@ -754,7 +773,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
return networkState != null && networkState.getStatus() != NetworkState.Status.SUCCESS;
}
void setNetworkState(NetworkState newNetworkState) {
public void setNetworkState(NetworkState newNetworkState) {
NetworkState previousState = this.networkState;
boolean previousExtraRow = hasExtraRow();
this.networkState = newNetworkState;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.content.Intent;
@ -21,12 +21,15 @@ import io.noties.markwon.Markwon;
import io.noties.markwon.MarkwonConfiguration;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.linkify.LinkifyPlugin;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Rule;
class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecyclerViewAdapter.RuleViewHolder> {
public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecyclerViewAdapter.RuleViewHolder> {
private Markwon markwon;
private ArrayList<Rule> rules;
RulesRecyclerViewAdapter(Context context) {
public RulesRecyclerViewAdapter(Context context) {
markwon = Markwon.builder(context)
.usePlugin(new AbstractMarkwonPlugin() {
@Override
@ -75,7 +78,7 @@ class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecyclerViewAda
holder.descriptionMarkwonView.setVisibility(View.VISIBLE);
}
void changeDataset(ArrayList<Rule> rules) {
public void changeDataset(ArrayList<Rule> rules) {
this.rules = rules;
notifyDataSetChanged();
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.view.LayoutInflater;
@ -20,15 +20,20 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.AsyncTask.CheckIsSubscribedToSubredditAsyncTask;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubredditSubscription;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<SubredditData, RecyclerView.ViewHolder> {
interface Callback {
public interface Callback {
void retryLoadingMore();
void subredditSelected(String subredditName, String iconUrl);
}
@ -49,10 +54,10 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<Subred
private NetworkState networkState;
private Callback callback;
SubredditListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
String accessToken, String accountName,
RedditDataRoomDatabase redditDataRoomDatabase,
Callback callback) {
public SubredditListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
String accessToken, String accountName,
RedditDataRoomDatabase redditDataRoomDatabase,
Callback callback) {
super(DIFF_CALLBACK);
this.context = context;
this.oauthRetrofit = oauthRetrofit;
@ -169,7 +174,7 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<Subred
return networkState != null && networkState.getStatus() != NetworkState.Status.SUCCESS;
}
void setNetworkState(NetworkState newNetworkState) {
public void setNetworkState(NetworkState newNetworkState) {
NetworkState previousState = this.networkState;
boolean previousExtraRow = hasExtraRow();
this.networkState = newNetworkState;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.content.Intent;
@ -16,11 +16,13 @@ import com.bumptech.glide.request.RequestOptions;
import java.util.List;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditData;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pl.droidsonroids.gif.GifImageView;
class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private Context mContext;
private List<SubscribedSubredditData> mSubscribedSubredditData;
private RequestManager glide;
@ -30,16 +32,16 @@ class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
private String userIconUrl;
private boolean hasClearSelectionRow;
interface ItemClickListener {
public interface ItemClickListener {
void onClick(String name, String iconUrl, boolean subredditIsUser);
}
SubscribedSubredditsRecyclerViewAdapter(Context context) {
public SubscribedSubredditsRecyclerViewAdapter(Context context) {
mContext = context;
glide = Glide.with(context.getApplicationContext());
}
SubscribedSubredditsRecyclerViewAdapter(Context context, boolean hasClearSelectionRow, ItemClickListener itemClickListener) {
public SubscribedSubredditsRecyclerViewAdapter(Context context, boolean hasClearSelectionRow, ItemClickListener itemClickListener) {
mContext = context;
this.hasClearSelectionRow = hasClearSelectionRow;
glide = Glide.with(context.getApplicationContext());
@ -129,12 +131,12 @@ class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
glide.clear(((SubredditViewHolder) holder).iconGifImageView);
}
void setSubscribedSubreddits(List<SubscribedSubredditData> subscribedSubreddits){
public void setSubscribedSubreddits(List<SubscribedSubredditData> subscribedSubreddits){
mSubscribedSubredditData = subscribedSubreddits;
notifyDataSetChanged();
}
void addUser(String username, String userIconUrl) {
public void addUser(String username, String userIconUrl) {
this.username = username;
this.userIconUrl = userIconUrl;
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Adapter;
import android.content.Context;
import android.content.Intent;
@ -21,16 +21,21 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.AsyncTask.CheckIsFollowingUserAsyncTask;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserDao;
import ml.docilealligator.infinityforreddit.User.UserData;
import butterknife.BindView;
import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.UserFollowing;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, RecyclerView.ViewHolder> {
interface RetryLoadingMoreCallback {
public interface RetryLoadingMoreCallback {
void retryLoadingMore();
}
@ -50,7 +55,7 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
private NetworkState networkState;
private UserListingRecyclerViewAdapter.RetryLoadingMoreCallback retryLoadingMoreCallback;
UserListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
public UserListingRecyclerViewAdapter(Context context, Retrofit oauthRetrofit, Retrofit retrofit,
String accessToken, String accountName, SubscribedUserDao subscribedUserDao,
UserListingRecyclerViewAdapter.RetryLoadingMoreCallback retryLoadingMoreCallback) {
super(DIFF_CALLBACK);
@ -172,7 +177,7 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
return networkState != null && networkState.getStatus() != NetworkState.Status.SUCCESS;
}
void setNetworkState(NetworkState newNetworkState) {
public void setNetworkState(NetworkState newNetworkState) {
NetworkState previousState = this.networkState;
boolean previousExtraRow = hasExtraRow();
this.networkState = newNetworkState;

View File

@ -2,7 +2,7 @@ package ml.docilealligator.infinityforreddit;
import com.google.android.material.appbar.AppBarLayout;
abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
// State
public enum State {
EXPANDED,
@ -37,5 +37,5 @@ abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChanged
* @param appBarLayout Layout
* @param state Collapse state
*/
abstract void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state);
public abstract void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state);
}

View File

@ -2,6 +2,38 @@ package ml.docilealligator.infinityforreddit;
import javax.inject.Singleton;
import ml.docilealligator.infinityforreddit.Activity.AccountPostsActivity;
import ml.docilealligator.infinityforreddit.Activity.AccountSavedThingActivity;
import ml.docilealligator.infinityforreddit.Activity.CommentActivity;
import ml.docilealligator.infinityforreddit.Activity.EditCommentActivity;
import ml.docilealligator.infinityforreddit.Activity.EditPostActivity;
import ml.docilealligator.infinityforreddit.Activity.FilteredThingActivity;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.LoginActivity;
import ml.docilealligator.infinityforreddit.Activity.MainActivity;
import ml.docilealligator.infinityforreddit.Activity.PostImageActivity;
import ml.docilealligator.infinityforreddit.Activity.PostLinkActivity;
import ml.docilealligator.infinityforreddit.Activity.PostTextActivity;
import ml.docilealligator.infinityforreddit.Activity.PostVideoActivity;
import ml.docilealligator.infinityforreddit.Activity.RulesActivity;
import ml.docilealligator.infinityforreddit.Activity.SearchActivity;
import ml.docilealligator.infinityforreddit.Activity.SearchResultActivity;
import ml.docilealligator.infinityforreddit.Activity.SearchSubredditsResultActivity;
import ml.docilealligator.infinityforreddit.Activity.SettingsActivity;
import ml.docilealligator.infinityforreddit.Activity.SubredditSelectionActivity;
import ml.docilealligator.infinityforreddit.Activity.SubscribedThingListingActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewImageActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewMessageActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.Fragment.CommentsListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.FlairBottomSheetFragment;
import ml.docilealligator.infinityforreddit.Fragment.FollowedUsersListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
import ml.docilealligator.infinityforreddit.Fragment.SubredditListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.SubscribedSubredditsListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.UserListingFragment;
import ml.docilealligator.infinityforreddit.Settings.MainPreferenceFragment;
import ml.docilealligator.infinityforreddit.Settings.NotificationPreferenceFragment;
import dagger.Component;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
@ -12,13 +12,13 @@ public class CheckIsFollowingUserAsyncTask extends AsyncTask<Void, Void, Void> {
private SubscribedUserData subscribedUserData;
private CheckIsFollowingUserListener checkIsFollowingUserListener;
interface CheckIsFollowingUserListener {
public interface CheckIsFollowingUserListener {
void isSubscribed();
void isNotSubscribed();
}
CheckIsFollowingUserAsyncTask(SubscribedUserDao subscribedUserDao, String username, String accountName,
CheckIsFollowingUserListener checkIsFollowingUserListener) {
public CheckIsFollowingUserAsyncTask(SubscribedUserDao subscribedUserDao, String username, String accountName,
CheckIsFollowingUserListener checkIsFollowingUserListener) {
this.subscribedUserDao = subscribedUserDao;
this.username = username;
this.accountName = accountName;

View File

@ -1,10 +1,11 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditData;
class CheckIsSubscribedToSubredditAsyncTask extends AsyncTask<Void, Void, Void> {
public class CheckIsSubscribedToSubredditAsyncTask extends AsyncTask<Void, Void, Void> {
private RedditDataRoomDatabase redditDataRoomDatabase;
private String subredditName;
@ -12,12 +13,12 @@ class CheckIsSubscribedToSubredditAsyncTask extends AsyncTask<Void, Void, Void>
private SubscribedSubredditData subscribedSubredditData;
private CheckIsSubscribedToSubredditListener checkIsSubscribedToSubredditListener;
interface CheckIsSubscribedToSubredditListener {
public interface CheckIsSubscribedToSubredditListener {
void isSubscribed();
void isNotSubscribed();
}
CheckIsSubscribedToSubredditAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase,
public CheckIsSubscribedToSubredditAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase,
String subredditName, String accountName,
CheckIsSubscribedToSubredditListener checkIsSubscribedToSubredditListener) {
this.redditDataRoomDatabase = redditDataRoomDatabase;

View File

@ -1,13 +1,13 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.Account.AccountDao;
class GetCurrentAccountAsyncTask extends AsyncTask<Void, Void, Void> {
public class GetCurrentAccountAsyncTask extends AsyncTask<Void, Void, Void> {
interface GetCurrentAccountAsyncTaskListener {
public interface GetCurrentAccountAsyncTaskListener {
void success(Account account);
}
@ -15,7 +15,7 @@ class GetCurrentAccountAsyncTask extends AsyncTask<Void, Void, Void> {
AccountDao accountDao;
GetCurrentAccountAsyncTaskListener getCurrentAccountAsyncTaskListener;
GetCurrentAccountAsyncTask(AccountDao accountDao, GetCurrentAccountAsyncTaskListener getCurrentAccountAsyncTaskListener) {
public GetCurrentAccountAsyncTask(AccountDao accountDao, GetCurrentAccountAsyncTaskListener getCurrentAccountAsyncTaskListener) {
this.accountDao = accountDao;
this.getCurrentAccountAsyncTaskListener = getCurrentAccountAsyncTaskListener;
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
@ -6,6 +6,7 @@ import androidx.annotation.Nullable;
import java.util.List;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditDao;
@ -13,9 +14,9 @@ import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.Subscrib
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserDao;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserData;
class InsertSubscribedThingsAsyncTask extends AsyncTask<Void, Void, Void> {
public class InsertSubscribedThingsAsyncTask extends AsyncTask<Void, Void, Void> {
interface InsertSubscribedThingListener {
public interface InsertSubscribedThingListener {
void insertSuccess();
}
@ -29,7 +30,7 @@ class InsertSubscribedThingsAsyncTask extends AsyncTask<Void, Void, Void> {
private List<SubredditData> subredditData;
private InsertSubscribedThingListener insertSubscribedThingListener;
InsertSubscribedThingsAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, @Nullable String accountName,
public InsertSubscribedThingsAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, @Nullable String accountName,
List<SubscribedSubredditData> subscribedSubredditData,
List<SubscribedUserData> subscribedUserData,
List<SubredditData> subredditData,

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;

View File

@ -1,15 +1,17 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import java.util.ArrayList;
import ml.docilealligator.infinityforreddit.FetchSubredditData;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditDao;
import ml.docilealligator.infinityforreddit.SubredditDatabase.SubredditData;
import retrofit2.Retrofit;
class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> {
interface LoadSubredditIconAsyncTaskListener {
public class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> {
public interface LoadSubredditIconAsyncTaskListener {
void loadIconSuccess(String iconImageUrl);
}
@ -21,7 +23,7 @@ class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> {
private boolean hasSubredditInDb;
private LoadSubredditIconAsyncTaskListener loadSubredditIconAsyncTaskListener;
LoadSubredditIconAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, String subredditName, Retrofit retrofit,
public LoadSubredditIconAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, String subredditName, Retrofit retrofit,
LoadSubredditIconAsyncTaskListener loadSubredditIconAsyncTaskListener) {
this.redditDataRoomDatabase = redditDataRoomDatabase;
this.subredditDao = redditDataRoomDatabase.subredditDao();

View File

@ -1,13 +1,14 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.FetchUserData;
import ml.docilealligator.infinityforreddit.User.UserData;
import ml.docilealligator.infinityforreddit.User.UserDao;
import retrofit2.Retrofit;
public class LoadUserDataAsyncTask extends AsyncTask<Void, Void, Void> {
interface LoadUserDataAsyncTaskListener {
public interface LoadUserDataAsyncTaskListener {
void loadUserDataSuccess(String iconImageUrl);
}
@ -18,7 +19,7 @@ public class LoadUserDataAsyncTask extends AsyncTask<Void, Void, Void> {
private Retrofit retrofit;
private LoadUserDataAsyncTaskListener loadUserDataAsyncTaskListener;
LoadUserDataAsyncTask(UserDao userDao, String userName, Retrofit retrofit, LoadUserDataAsyncTaskListener loadUserDataAsyncTaskListener) {
public LoadUserDataAsyncTask(UserDao userDao, String userName, Retrofit retrofit, LoadUserDataAsyncTaskListener loadUserDataAsyncTaskListener) {
this.userDao = userDao;
this.userName = userName;
this.retrofit = retrofit;

View File

@ -1,13 +1,13 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.Account.AccountDao;
class ParseAndInsertNewAccountAsyncTask extends AsyncTask<Void, Void, Void> {
public class ParseAndInsertNewAccountAsyncTask extends AsyncTask<Void, Void, Void> {
interface ParseAndInsertAccountListener {
public interface ParseAndInsertAccountListener {
void success();
}
@ -21,7 +21,7 @@ class ParseAndInsertNewAccountAsyncTask extends AsyncTask<Void, Void, Void> {
private AccountDao accountDao;
private ParseAndInsertAccountListener parseAndInsertAccountListener;
ParseAndInsertNewAccountAsyncTask(String username, String accessToken, String refreshToken, String profileImageUrl, String bannerImageUrl,
public ParseAndInsertNewAccountAsyncTask(String username, String accessToken, String refreshToken, String profileImageUrl, String bannerImageUrl,
int karma, String code, AccountDao accountDao,
ParseAndInsertAccountListener parseAndInsertAccountListener) {
this.username = username;

View File

@ -1,11 +1,12 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
class SwitchAccountAsyncTask extends AsyncTask<Void, Void, Void> {
interface SwitchAccountAsyncTaskListener {
public class SwitchAccountAsyncTask extends AsyncTask<Void, Void, Void> {
public interface SwitchAccountAsyncTaskListener {
void switched(Account account);
}
@ -14,8 +15,8 @@ class SwitchAccountAsyncTask extends AsyncTask<Void, Void, Void> {
private Account account;
private SwitchAccountAsyncTaskListener switchAccountAsyncTaskListener;
SwitchAccountAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, String newAccountName,
SwitchAccountAsyncTaskListener switchAccountAsyncTaskListener) {
public SwitchAccountAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, String newAccountName,
SwitchAccountAsyncTaskListener switchAccountAsyncTaskListener) {
this.redditDataRoomDatabase = redditDataRoomDatabase;
this.newAccountName = newAccountName;
this.switchAccountAsyncTaskListener = switchAccountAsyncTaskListener;

View File

@ -1,11 +1,12 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.AsyncTask;
import android.os.AsyncTask;
import ml.docilealligator.infinityforreddit.Account.AccountDao;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
class SwitchToAnonymousAccountAsyncTask extends AsyncTask<Void, Void, Void> {
interface SwitchToAnonymousAccountAsyncTaskListener {
public class SwitchToAnonymousAccountAsyncTask extends AsyncTask<Void, Void, Void> {
public interface SwitchToAnonymousAccountAsyncTaskListener {
void logoutSuccess();
}
@ -13,7 +14,7 @@ class SwitchToAnonymousAccountAsyncTask extends AsyncTask<Void, Void, Void> {
private boolean removeCurrentAccount;
private SwitchToAnonymousAccountAsyncTaskListener switchToAnonymousAccountAsyncTaskListener;
SwitchToAnonymousAccountAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, boolean removeCurrentAccount,
public SwitchToAnonymousAccountAsyncTask(RedditDataRoomDatabase redditDataRoomDatabase, boolean removeCurrentAccount,
SwitchToAnonymousAccountAsyncTaskListener switchToAnonymousAccountAsyncTaskListener) {
this.redditDataRoomDatabase = redditDataRoomDatabase;
this.removeCurrentAccount = removeCurrentAccount;

View File

@ -1,3 +0,0 @@
package ml.docilealligator.infinityforreddit;
public class ChangeFontSizeEvent { }

View File

@ -5,10 +5,10 @@ import android.os.Parcelable;
import java.util.ArrayList;
class CommentData implements Parcelable {
static final int VOTE_TYPE_NO_VOTE = 0;
static final int VOTE_TYPE_UPVOTE = 1;
static final int VOTE_TYPE_DOWNVOTE = -1;
public class CommentData implements Parcelable {
public static final int VOTE_TYPE_NO_VOTE = 0;
public static final int VOTE_TYPE_UPVOTE = 1;
public static final int VOTE_TYPE_DOWNVOTE = -1;
private String id;
private String fullName;
@ -38,7 +38,7 @@ class CommentData implements Parcelable {
private boolean isLoadingMoreChildren;
private boolean loadMoreChildrenFailed;
CommentData(String id, String fullName, String author, String linkAuthor, String commentTime,
public CommentData(String id, String fullName, String author, String linkAuthor, String commentTime,
String commentContent, String linkId, String subredditName, String parentId, int score,
int voteType, boolean isSubmitter, String distinguished, String permalink,
int depth, boolean collapsed, boolean hasReply, boolean scoreHidden, boolean saved) {
@ -66,7 +66,7 @@ class CommentData implements Parcelable {
isPlaceHolder = false;
}
CommentData(String parentFullName, int depth) {
public CommentData(String parentFullName, int depth) {
this.fullName = parentFullName;
this.depth = depth;
isPlaceHolder = true;

View File

@ -48,31 +48,31 @@ public class CommentViewModel extends ViewModel {
});
}
LiveData<PagedList<CommentData>> getComments() {
public LiveData<PagedList<CommentData>> getComments() {
return comments;
}
LiveData<NetworkState> getPaginationNetworkState() {
public LiveData<NetworkState> getPaginationNetworkState() {
return paginationNetworkState;
}
LiveData<NetworkState> getInitialLoadingState() {
public LiveData<NetworkState> getInitialLoadingState() {
return initialLoadingState;
}
LiveData<Boolean> hasComment() {
public LiveData<Boolean> hasComment() {
return hasCommentLiveData;
}
void refresh() {
public void refresh() {
commentDataSourceFactory.getCommentDataSource().invalidate();
}
void retryLoadingMore() {
public void retryLoadingMore() {
commentDataSourceFactory.getCommentDataSource().retryLoadingMore();
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
sortTypeLiveData.postValue(sortType);
}

View File

@ -10,13 +10,13 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class DeleteThing {
interface DeleteThingListener {
public class DeleteThing {
public interface DeleteThingListener {
void deleteSuccess();
void deleteFailed();
}
static void delete(Retrofit oauthRetrofit, String fullname, String accessToken, DeleteThingListener deleteThingListener) {
public static void delete(Retrofit oauthRetrofit, String fullname, String accessToken, DeleteThingListener deleteThingListener) {
Map<String, String> params = new HashMap<>();
params.put(RedditUtils.ID_KEY, fullname);
oauthRetrofit.create(RedditAPI.class).delete(RedditUtils.getOAuthHeader(accessToken), params).enqueue(new Callback<String>() {

View File

@ -0,0 +1,3 @@
package ml.docilealligator.infinityforreddit.Event;
public class ChangeFontSizeEvent { }

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class ChangeNSFWBlurEvent {
public boolean needBlurNSFW;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class ChangeNSFWEvent {
public boolean nsfw;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class ChangeSpoilerBlurEvent {
public boolean needBlurSpoiler;

View File

@ -1,4 +1,6 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
import ml.docilealligator.infinityforreddit.Post;
public class PostUpdateEventToDetailActivity {
public final Post post;

View File

@ -1,4 +1,6 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
import ml.docilealligator.infinityforreddit.Post;
public class PostUpdateEventToPostList {
public final Post post;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class SubmitImagePostEvent {
public boolean postSuccess;

View File

@ -1,4 +1,6 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
import ml.docilealligator.infinityforreddit.Post;
public class SubmitTextOrLinkPostEvent {
public boolean postSuccess;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class SubmitVideoPostEvent {
public boolean postSuccess;

View File

@ -1,7 +1,7 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Event;
public class SwitchAccountEvent {
String excludeActivityClassName;
public String excludeActivityClassName;
public SwitchAccountEvent() {}
public SwitchAccountEvent(String excludeActivityClassName) {
this.excludeActivityClassName = excludeActivityClassName;

View File

@ -11,19 +11,19 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchComment {
interface FetchCommentListener {
public class FetchComment {
public interface FetchCommentListener {
void onFetchCommentSuccess(ArrayList<CommentData> expandedComments, String parentId, ArrayList<String> children);
void onFetchCommentFailed();
}
interface FetchMoreCommentListener {
public interface FetchMoreCommentListener {
void onFetchMoreCommentSuccess(ArrayList<CommentData> expandedComments, int childrenStartingIndex);
void onFetchMoreCommentFailed();
}
static void fetchComments(Retrofit retrofit, @Nullable String accessToken, String article, String commentId,
Locale locale, FetchCommentListener fetchCommentListener) {
public static void fetchComments(Retrofit retrofit, @Nullable String accessToken, String article, String commentId,
Locale locale, FetchCommentListener fetchCommentListener) {
RedditAPI api = retrofit.create(RedditAPI.class);
Call<String> comments;
if(accessToken == null) {
@ -70,9 +70,9 @@ class FetchComment {
});
}
static void fetchMoreComment(Retrofit retrofit, @Nullable String accessToken,
ArrayList<String> allChildren, int startingIndex,
int depth, Locale locale, FetchMoreCommentListener fetchMoreCommentListener) {
public static void fetchMoreComment(Retrofit retrofit, @Nullable String accessToken,
ArrayList<String> allChildren, int startingIndex,
int depth, Locale locale, FetchMoreCommentListener fetchMoreCommentListener) {
StringBuilder stringBuilder = new StringBuilder();
for(int i = 0; i < 100; i++) {
if(allChildren.size() <= startingIndex + i) {

View File

@ -14,13 +14,13 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchFlairs {
interface FetchFlairsInSubredditListener {
public class FetchFlairs {
public interface FetchFlairsInSubredditListener {
void fetchSuccessful(ArrayList<Flair> flairs);
void fetchFailed();
}
static void fetchFlairsInSubreddit(Retrofit oauthRetrofit, String accessToken, String subredditName, FetchFlairsInSubredditListener fetchFlairsInSubredditListener) {
public static void fetchFlairsInSubreddit(Retrofit oauthRetrofit, String accessToken, String subredditName, FetchFlairsInSubredditListener fetchFlairsInSubredditListener) {
RedditAPI api = oauthRetrofit.create(RedditAPI.class);
Call<String> flairsCall = api.getFlairs(RedditUtils.getOAuthHeader(accessToken), subredditName);

View File

@ -19,17 +19,17 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchMessages {
public class FetchMessages {
interface FetchMessagesListener {
void fetchSuccess(ArrayList<Message> messages, @Nullable String after);
void fetchFailed();
}
static final String WHERE_INBOX = "inbox";
static final String WHERE_UNREAD = "unread";
static final String WHERE_SENT = "sent";
static final String WHERE_COMMENTS = "comments";
public static final String WHERE_INBOX = "inbox";
public static final String WHERE_UNREAD = "unread";
public static final String WHERE_SENT = "sent";
public static final String WHERE_COMMENTS = "comments";
static void fetchMessagesAsync(Retrofit oauthRetrofit, Locale locale, String accessToken, String where,
String after, FetchMessagesListener fetchMessagesListener) {

View File

@ -8,15 +8,15 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
class FetchMyInfo {
public class FetchMyInfo {
interface FetchUserMyListener {
public interface FetchUserMyListener {
void onFetchMyInfoSuccess(String response);
void onFetchMyInfoFail();
}
static void fetchAccountInfo(final Retrofit retrofit, String accessToken,
final FetchUserMyListener fetchUserMyListener) {
public static void fetchAccountInfo(final Retrofit retrofit, String accessToken,
final FetchUserMyListener fetchUserMyListener) {
RedditAPI api = retrofit.create(RedditAPI.class);
Call<String> userInfo = api.getMyInfo(RedditUtils.getOAuthHeader(accessToken));

View File

@ -9,13 +9,13 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchPost {
interface FetchPostListener {
public class FetchPost {
public interface FetchPostListener {
void fetchPostSuccess(Post post);
void fetchPostFailed();
}
static void fetchPost(Retrofit retrofit, String id, String accessToken, Locale locale, FetchPostListener fetchPostListener) {
public static void fetchPost(Retrofit retrofit, String id, String accessToken, Locale locale, FetchPostListener fetchPostListener) {
Call<String> postCall;
if(accessToken == null) {
postCall = retrofit.create(RedditAPI.class).getPost(id);

View File

@ -10,8 +10,8 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchSubredditData {
interface FetchSubredditDataListener {
public class FetchSubredditData {
public interface FetchSubredditDataListener {
void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers);
void onFetchSubredditDataFail();
}
@ -21,7 +21,7 @@ class FetchSubredditData {
void onFetchSubredditListingDataFail();
}
static void fetchSubredditData(Retrofit retrofit, String subredditName, final FetchSubredditDataListener fetchSubredditDataListener) {
public static void fetchSubredditData(Retrofit retrofit, String subredditName, final FetchSubredditDataListener fetchSubredditDataListener) {
RedditAPI api = retrofit.create(RedditAPI.class);
Call<String> subredditData = api.getSubredditData(subredditName);

View File

@ -12,19 +12,19 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class FetchSubscribedThing {
interface FetchSubscribedThingListener {
public class FetchSubscribedThing {
public interface FetchSubscribedThingListener {
void onFetchSubscribedThingSuccess(ArrayList<SubscribedSubredditData> subscribedSubredditData,
ArrayList<SubscribedUserData> subscribedUserData,
ArrayList<SubredditData> subredditData);
void onFetchSubscribedThingFail();
}
static void fetchSubscribedThing(final Retrofit retrofit, String accessToken, String accountName,
final String lastItem, final ArrayList<SubscribedSubredditData> subscribedSubredditData,
final ArrayList<SubscribedUserData> subscribedUserData,
final ArrayList<SubredditData> subredditData,
final FetchSubscribedThingListener fetchSubscribedThingListener) {
public static void fetchSubscribedThing(final Retrofit retrofit, String accessToken, String accountName,
final String lastItem, final ArrayList<SubscribedSubredditData> subscribedSubredditData,
final ArrayList<SubscribedUserData> subscribedUserData,
final ArrayList<SubredditData> subredditData,
final FetchSubscribedThingListener fetchSubscribedThingListener) {
RedditAPI api = retrofit.create(RedditAPI.class);
Call<String> subredditDataCall = api.getSubscribedThing(lastItem, RedditUtils.getOAuthHeader(accessToken));

View File

@ -3,7 +3,7 @@ package ml.docilealligator.infinityforreddit;
import android.os.Parcel;
import android.os.Parcelable;
class Flair implements Parcelable {
public class Flair implements Parcelable {
private String id;
private String text;
private boolean editable;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -30,6 +30,15 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Adapter.CommentsListingRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.CommentViewModel;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import retrofit2.Retrofit;
@ -38,10 +47,10 @@ import retrofit2.Retrofit;
*/
public class CommentsListingFragment extends Fragment implements FragmentCommunicator {
static final String EXTRA_USERNAME = "EN";
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_ACCOUNT_NAME = "EAN";
static final String EXTRA_ARE_SAVED_COMMENTS = "EISC";
public static final String EXTRA_USERNAME = "EN";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_ACCOUNT_NAME = "EAN";
public static final String EXTRA_ARE_SAVED_COMMENTS = "EISC";
private static final String NULL_ACCESS_TOKEN_STATE = "NATS";
private static final String ACCESS_TOKEN_STATE = "ATS";
@ -181,7 +190,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni
mCommentViewModel.getPaginationNetworkState().observe(this, networkState -> mAdapter.setNetworkState(networkState));
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
mCommentViewModel.changeSortType(sortType);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -23,6 +23,11 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Adapter.FlairBottomSheetRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.FetchFlairs;
import ml.docilealligator.infinityforreddit.Flair;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import retrofit2.Retrofit;
@ -31,12 +36,12 @@ import retrofit2.Retrofit;
*/
public class FlairBottomSheetFragment extends BottomSheetDialogFragment {
interface FlairSelectionCallback {
public interface FlairSelectionCallback {
void flairSelected(Flair flair);
}
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_SUBREDDIT_NAME = "ESN";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_SUBREDDIT_NAME = "ESN";
@BindView(R.id.progress_bar_flair_bottom_sheet_fragment) ProgressBar progressBar;
@BindView(R.id.error_text_view_flair_bottom_sheet_fragment) TextView errorTextView;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -22,6 +22,10 @@ import com.bumptech.glide.RequestManager;
import javax.inject.Inject;
import ml.docilealligator.infinityforreddit.Adapter.FollowedUsersRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubscribedUserDatabase.SubscribedUserViewModel;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -32,7 +36,7 @@ import butterknife.ButterKnife;
*/
public class FollowedUsersListingFragment extends Fragment {
static final String EXTRA_ACCOUNT_NAME = "EAN";
public static final String EXTRA_ACCOUNT_NAME = "EAN";
@BindView(R.id.recycler_view_followed_users_listing_fragment) RecyclerView mRecyclerView;
@BindView(R.id.no_subscriptions_linear_layout_followed_users_listing_fragment) LinearLayout mLinearLayout;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -17,6 +17,10 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Activity.EditCommentActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.R;
/**
@ -24,10 +28,10 @@ import butterknife.ButterKnife;
*/
public class ModifyCommentBottomSheetFragment extends RoundedBottomSheetDialogFragment {
static final String EXTRA_COMMENT_FULLNAME = "ECF";
static final String EXTRA_COMMENT_CONTENT = "ECC";
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_POSITION = "EP";
public static final String EXTRA_COMMENT_FULLNAME = "ECF";
public static final String EXTRA_COMMENT_CONTENT = "ECC";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_POSITION = "EP";
public ModifyCommentBottomSheetFragment() {
// Required empty public constructor

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -45,6 +45,22 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Activity.FilteredThingActivity;
import ml.docilealligator.infinityforreddit.Activity.MainActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.Adapter.PostRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.Event.ChangeNSFWBlurEvent;
import ml.docilealligator.infinityforreddit.Event.ChangeSpoilerBlurEvent;
import ml.docilealligator.infinityforreddit.Event.PostUpdateEventToPostList;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.Post;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.PostViewModel;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SharedPreferencesUtils;
import retrofit2.Retrofit;
@ -53,15 +69,15 @@ import retrofit2.Retrofit;
*/
public class PostFragment extends Fragment implements FragmentCommunicator {
static final String EXTRA_NAME = "EN";
static final String EXTRA_USER_NAME = "EUN";
static final String EXTRA_USER_WHERE = "EUW";
static final String EXTRA_QUERY = "EQ";
static final String EXTRA_POST_TYPE = "EPT";
static final String EXTRA_SORT_TYPE = "EST";
static final String EXTRA_FILTER = "EF";
static final int EXTRA_NO_FILTER = -2;
static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_NAME = "EN";
public static final String EXTRA_USER_NAME = "EUN";
public static final String EXTRA_USER_WHERE = "EUW";
public static final String EXTRA_QUERY = "EQ";
public static final String EXTRA_POST_TYPE = "EPT";
public static final String EXTRA_SORT_TYPE = "EST";
public static final String EXTRA_FILTER = "EF";
public static final int EXTRA_NO_FILTER = -2;
public static final String EXTRA_ACCESS_TOKEN = "EAT";
private static final String IS_IN_LAZY_MODE_STATE = "IILMS";
private static final String RECYCLER_VIEW_POSITION_STATE = "RVPS";
@ -428,7 +444,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
return rootView;
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
mPostViewModel.changeSortType(sortType);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -16,6 +16,7 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.R;
/**
@ -23,14 +24,14 @@ import butterknife.ButterKnife;
*/
public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface PostTypeSelectionCallback {
public interface PostTypeSelectionCallback {
void postTypeSelected(int postType);
}
static final int TYPE_TEXT = 0;
static final int TYPE_LINK = 1;
static final int TYPE_IMAGE = 2;
static final int TYPE_VIDEO = 3;
public static final int TYPE_TEXT = 0;
public static final int TYPE_LINK = 1;
public static final int TYPE_IMAGE = 2;
public static final int TYPE_VIDEO = 3;
@BindView(R.id.text_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout textTypeLinearLayout;
@BindView(R.id.link_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout linkTypeLinearLayout;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -16,6 +16,8 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
/**
@ -23,7 +25,7 @@ import butterknife.ButterKnife;
*/
public class SearchPostSortTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface SearchSortTypeSelectionCallback {
public interface SearchSortTypeSelectionCallback {
void searchSortTypeSelected(String sortType);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -16,6 +16,8 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
/**
@ -23,11 +25,11 @@ import butterknife.ButterKnife;
*/
public class SearchUserAndSubredditSortTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface SearchUserAndSubredditSortTypeSelectionCallback {
public interface SearchUserAndSubredditSortTypeSelectionCallback {
void searchUserAndSubredditSortTypeSelected(String sortType, int fragmentPosition);
}
static final String EXTRA_FRAGMENT_POSITION = "EFP";
public static final String EXTRA_FRAGMENT_POSITION = "EFP";
@BindView(R.id.relevance_type_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment) TextView relevanceTypeTextView;
@BindView(R.id.activity_type_text_view_search_user_and_subreddit_sort_type_bottom_sheet_fragment) TextView activityTypeTextView;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -17,6 +17,8 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
/**
@ -24,11 +26,11 @@ import butterknife.ButterKnife;
*/
public class SortTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface SortTypeSelectionCallback {
public interface SortTypeSelectionCallback {
void sortTypeSelected(String sortType);
}
static final String EXTRA_NO_BEST_TYPE = "ENBT";
public static final String EXTRA_NO_BEST_TYPE = "ENBT";
@BindView(R.id.best_type_text_view_sort_type_bottom_sheet_fragment) TextView bestTypeTextView;
@BindView(R.id.hot_type_text_view_sort_type_bottom_sheet_fragment) TextView hotTypeTextView;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -29,6 +29,16 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Activity.SearchSubredditsResultActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewSubredditDetailActivity;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.Adapter.SubredditListingRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.SubredditListingViewModel;
import retrofit2.Retrofit;
@ -37,10 +47,10 @@ import retrofit2.Retrofit;
*/
public class SubredditListingFragment extends Fragment implements FragmentCommunicator {
static final String EXTRA_QUERY = "EQ";
static final String EXTRA_IS_POSTING = "EIP";
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_ACCOUNT_NAME = "EAN";
public static final String EXTRA_QUERY = "EQ";
public static final String EXTRA_IS_POSTING = "EIP";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_ACCOUNT_NAME = "EAN";
@BindView(R.id.coordinator_layout_subreddit_listing_fragment) CoordinatorLayout mCoordinatorLayout;
@BindView(R.id.recycler_view_subreddit_listing_fragment) RecyclerView mSubredditListingRecyclerView;
@ -167,7 +177,7 @@ public class SubredditListingFragment extends Fragment implements FragmentCommun
}
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
mSubredditListingViewModel.changeSortType(sortType);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -23,9 +23,14 @@ import com.bumptech.glide.RequestManager;
import javax.inject.Inject;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditViewModel;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Activity.SubredditSelectionActivity;
import ml.docilealligator.infinityforreddit.Adapter.SubscribedSubredditsRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.SubscribedSubredditDatabase.SubscribedSubredditViewModel;
/**
@ -33,10 +38,10 @@ import butterknife.ButterKnife;
*/
public class SubscribedSubredditsListingFragment extends Fragment {
static final String EXTRA_ACCOUNT_NAME = "EAT";
static final String EXTRA_ACCOUNT_PROFILE_IMAGE_URL = "EAPIU";
static final String EXTRA_IS_SUBREDDIT_SELECTION = "EISS";
static final String EXTRA_EXTRA_CLEAR_SELECTION = "EECS";
public static final String EXTRA_ACCOUNT_NAME = "EAT";
public static final String EXTRA_ACCOUNT_PROFILE_IMAGE_URL = "EAPIU";
public static final String EXTRA_IS_SUBREDDIT_SELECTION = "EISS";
public static final String EXTRA_EXTRA_CLEAR_SELECTION = "EECS";
@BindView(R.id.recycler_view_subscribed_subreddits_listing_fragment) RecyclerView mRecyclerView;
@BindView(R.id.no_subscriptions_linear_layout_subreddits_listing_fragment) LinearLayout mLinearLayout;

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.content.res.Configuration;
@ -26,6 +26,14 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.NetworkState;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.Adapter.UserListingRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.UserListingViewModel;
import retrofit2.Retrofit;
@ -34,9 +42,9 @@ import retrofit2.Retrofit;
*/
public class UserListingFragment extends Fragment implements FragmentCommunicator {
static final String EXTRA_QUERY = "EQ";
static final String EXTRA_ACCESS_TOKEN = "EAT";
static final String EXTRA_ACCOUNT_NAME = "EAN";
public static final String EXTRA_QUERY = "EQ";
public static final String EXTRA_ACCESS_TOKEN = "EAT";
public static final String EXTRA_ACCOUNT_NAME = "EAN";
@BindView(R.id.coordinator_layout_user_listing_fragment) CoordinatorLayout mCoordinatorLayout;
@BindView(R.id.recycler_view_user_listing_fragment) RecyclerView mUserListingRecyclerView;
@ -146,7 +154,7 @@ public class UserListingFragment extends Fragment implements FragmentCommunicato
}
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
mUserListingViewModel.changeSortType(sortType);
}

View File

@ -1,4 +1,4 @@
package ml.docilealligator.infinityforreddit;
package ml.docilealligator.infinityforreddit.Fragment;
import android.app.Activity;
@ -17,6 +17,8 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.PostDataSource;
import ml.docilealligator.infinityforreddit.R;
/**
@ -24,7 +26,7 @@ import butterknife.ButterKnife;
*/
public class UserThingSortTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface UserThingSortTypeSelectionCallback {
public interface UserThingSortTypeSelectionCallback {
void userThingSortTypeSelected(String sortType);
}

View File

@ -1,6 +1,6 @@
package ml.docilealligator.infinityforreddit;
interface FragmentCommunicator {
public interface FragmentCommunicator {
void refresh();
default void changeNSFW(boolean nsfw) {};
default boolean startLazyMode() {

View File

@ -10,14 +10,14 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class HidePost {
interface HidePostListener {
public class HidePost {
public interface HidePostListener {
void success();
void failed();
}
static void hidePost(Retrofit oauthRetrofit, String accessToken, String fullname,
HidePostListener hidePostListener) {
public static void hidePost(Retrofit oauthRetrofit, String accessToken, String fullname,
HidePostListener hidePostListener) {
Map<String, String> params = new HashMap<>();
params.put(RedditUtils.ID_KEY, fullname);
oauthRetrofit.create(RedditAPI.class).hide(RedditUtils.getOAuthHeader(accessToken), params).enqueue(new Callback<String>() {
@ -37,8 +37,8 @@ class HidePost {
});
}
static void unhidePost(Retrofit oauthRetrofit, String accessToken, String fullname,
HidePostListener hidePostListener) {
public static void unhidePost(Retrofit oauthRetrofit, String accessToken, String fullname,
HidePostListener hidePostListener) {
Map<String, String> params = new HashMap<>();
params.put(RedditUtils.ID_KEY, fullname);
oauthRetrofit.create(RedditAPI.class).unhide(RedditUtils.getOAuthHeader(accessToken), params).enqueue(new Callback<String>() {

View File

@ -5,84 +5,84 @@ package ml.docilealligator.infinityforreddit;
*/
public class JSONUtils {
static final String KIND_KEY = "kind";
static final String DATA_KEY = "data";
static final String AFTER_KEY = "after";
static final String CHILDREN_KEY = "children";
static final String COUNT_KEY = "count";
static final String TITLE_KEY = "title";
static final String NAME_KEY = "name";
static final String SUBREDDIT_NAME_PREFIX_KEY = "subreddit_name_prefixed";
static final String SELFTEXT_KEY = "selftext";
static final String AUTHOR_KEY = "author";
static final String LINK_AUTHOR_KEY = "link_author";
static final String LINK_FLAIR_TEXT_KEY = "link_flair_text";
static final String SCORE_KEY = "score";
static final String LIKES_KEY = "likes";
static final String NSFW_KEY = "over_18";
static final String GILDED_KEY = "gilded";
static final String PERMALINK_KEY = "permalink";
static final String CREATED_UTC_KEY = "created_utc";
static final String PREVIEW_KEY = "preview";
static final String IMAGES_KEY = "images";
static final String WIDTH_KEY = "width";
static final String HEIGHT_KEY = "height";
static final String VARIANTS_KEY = "variants";
static final String GIF_KEY = "gif";
static final String MP4_KEY = "mp4";
static final String SOURCE_KEY = "source";
static final String URL_KEY = "url";
static final String MEDIA_KEY = "media";
static final String REDDIT_VIDEO_KEY = "reddit_video";
static final String HLS_URL_KEY = "hls_url";
static final String IS_VIDEO_KEY = "is_video";
static final String CROSSPOST_PARENT_LIST = "crosspost_parent_list";
static final String REDDIT_VIDEO_PREVIEW_KEY = "reddit_video_preview";
static final String STICKIED_KEY = "stickied";
static final String BODY_KEY = "body";
static final String COLLAPSED_KEY = "collapsed";
static final String IS_SUBMITTER_KEY = "is_submitter";
static final String REPLIES_KEY = "replies";
static final String DEPTH_KEY = "depth";
static final String ID_KEY = "id";
static final String SCORE_HIDDEN_KEY = "score_hidden";
static final String SUBREDDIT_KEY = "subreddit";
static final String BANNER_IMG_KEY = "banner_img";
static final String BANNER_BACKGROUND_IMAGE_KEY = "banner_background_image";
static final String ICON_IMG_KEY = "icon_img";
static final String COMMUNITY_ICON_KEY = "community_icon";
static final String LINK_KARMA_KEY = "link_karma";
static final String COMMENT_KARMA_KEY = "comment_karma";
static final String DISPLAY_NAME = "display_name";
static final String SUBREDDIT_TYPE_KEY = "subreddit_type";
static final String SUBREDDIT_TYPE_VALUE_USER = "user";
static final String SUBSCRIBERS_KEY = "subscribers";
static final String PUBLIC_DESCRIPTION_KEY = "public_description";
static final String ACTIVE_USER_COUNT_KEY = "active_user_count";
static final String IS_GOLD_KEY = "is_gold";
static final String IS_FRIEND_KEY = "is_friend";
static final String JSON_KEY = "json";
static final String PARENT_ID_KEY = "parent_id";
static final String LINK_ID_KEY = "link_id";
static final String LINK_TITLE_KEY = "link_title";
static final String ERRORS_KEY = "errors";
static final String ARGS_KEY = "args";
static final String FIELDS_KEY = "fields";
static final String VALUE_KEY = "value";
static final String TEXT_KEY = "text";
static final String SPOILER_KEY = "spoiler";
static final String RULES_KEY = "rules";
static final String SHORT_NAME_KEY = "short_name";
static final String DESCRIPTION_KEY = "description";
static final String ARCHIVED_KEY = "archived";
static final String LOCKEC_KEY = "locked";
static final String SAVED_KEY = "saved";
static final String TEXT_EDITABLE_KEY = "text_editable";
static final String SUBJECT_KEY = "subject";
static final String CONTEXT_KEY = "context";
static final String DISTINGUISHED_KEY = "distinguished";
static final String WAS_COMMENT_KEY = "was_comment";
static final String NEW_KEY = "new";
static final String NUM_COMMENTS_KEY = "num_comments";
static final String HIDDEN_KEY = "hidden";
public static final String KIND_KEY = "kind";
public static final String DATA_KEY = "data";
public static final String AFTER_KEY = "after";
public static final String CHILDREN_KEY = "children";
public static final String COUNT_KEY = "count";
public static final String TITLE_KEY = "title";
public static final String NAME_KEY = "name";
public static final String SUBREDDIT_NAME_PREFIX_KEY = "subreddit_name_prefixed";
public static final String SELFTEXT_KEY = "selftext";
public static final String AUTHOR_KEY = "author";
public static final String LINK_AUTHOR_KEY = "link_author";
public static final String LINK_FLAIR_TEXT_KEY = "link_flair_text";
public static final String SCORE_KEY = "score";
public static final String LIKES_KEY = "likes";
public static final String NSFW_KEY = "over_18";
public static final String GILDED_KEY = "gilded";
public static final String PERMALINK_KEY = "permalink";
public static final String CREATED_UTC_KEY = "created_utc";
public static final String PREVIEW_KEY = "preview";
public static final String IMAGES_KEY = "images";
public static final String WIDTH_KEY = "width";
public static final String HEIGHT_KEY = "height";
public static final String VARIANTS_KEY = "variants";
public static final String GIF_KEY = "gif";
public static final String MP4_KEY = "mp4";
public static final String SOURCE_KEY = "source";
public static final String URL_KEY = "url";
public static final String MEDIA_KEY = "media";
public static final String REDDIT_VIDEO_KEY = "reddit_video";
public static final String HLS_URL_KEY = "hls_url";
public static final String IS_VIDEO_KEY = "is_video";
public static final String CROSSPOST_PARENT_LIST = "crosspost_parent_list";
public static final String REDDIT_VIDEO_PREVIEW_KEY = "reddit_video_preview";
public static final String STICKIED_KEY = "stickied";
public static final String BODY_KEY = "body";
public static final String COLLAPSED_KEY = "collapsed";
public static final String IS_SUBMITTER_KEY = "is_submitter";
public static final String REPLIES_KEY = "replies";
public static final String DEPTH_KEY = "depth";
public static final String ID_KEY = "id";
public static final String SCORE_HIDDEN_KEY = "score_hidden";
public static final String SUBREDDIT_KEY = "subreddit";
public static final String BANNER_IMG_KEY = "banner_img";
public static final String BANNER_BACKGROUND_IMAGE_KEY = "banner_background_image";
public static final String ICON_IMG_KEY = "icon_img";
public static final String COMMUNITY_ICON_KEY = "community_icon";
public static final String LINK_KARMA_KEY = "link_karma";
public static final String COMMENT_KARMA_KEY = "comment_karma";
public static final String DISPLAY_NAME = "display_name";
public static final String SUBREDDIT_TYPE_KEY = "subreddit_type";
public static final String SUBREDDIT_TYPE_VALUE_USER = "user";
public static final String SUBSCRIBERS_KEY = "subscribers";
public static final String PUBLIC_DESCRIPTION_KEY = "public_description";
public static final String ACTIVE_USER_COUNT_KEY = "active_user_count";
public static final String IS_GOLD_KEY = "is_gold";
public static final String IS_FRIEND_KEY = "is_friend";
public static final String JSON_KEY = "json";
public static final String PARENT_ID_KEY = "parent_id";
public static final String LINK_ID_KEY = "link_id";
public static final String LINK_TITLE_KEY = "link_title";
public static final String ERRORS_KEY = "errors";
public static final String ARGS_KEY = "args";
public static final String FIELDS_KEY = "fields";
public static final String VALUE_KEY = "value";
public static final String TEXT_KEY = "text";
public static final String SPOILER_KEY = "spoiler";
public static final String RULES_KEY = "rules";
public static final String SHORT_NAME_KEY = "short_name";
public static final String DESCRIPTION_KEY = "description";
public static final String ARCHIVED_KEY = "archived";
public static final String LOCKEC_KEY = "locked";
public static final String SAVED_KEY = "saved";
public static final String TEXT_EDITABLE_KEY = "text_editable";
public static final String SUBJECT_KEY = "subject";
public static final String CONTEXT_KEY = "context";
public static final String DISTINGUISHED_KEY = "distinguished";
public static final String WAS_COMMENT_KEY = "was_comment";
public static final String NEW_KEY = "new";
public static final String NUM_COMMENTS_KEY = "num_comments";
public static final String HIDDEN_KEY = "hidden";
}

View File

@ -1,6 +1,6 @@
package ml.docilealligator.infinityforreddit;
class Message {
public class Message {
static final String TYPE_COMMENT = "t1";
static final String TYPE_ACCOUNT = "t2";
static final String TYPE_LINK = "t3";

View File

@ -46,27 +46,27 @@ public class MessageViewModel extends ViewModel {
});
}
LiveData<PagedList<Message>> getMessages() {
public LiveData<PagedList<Message>> getMessages() {
return messages;
}
LiveData<NetworkState> getPaginationNetworkState() {
public LiveData<NetworkState> getPaginationNetworkState() {
return paginationNetworkState;
}
LiveData<NetworkState> getInitialLoadingState() {
public LiveData<NetworkState> getInitialLoadingState() {
return initialLoadingState;
}
LiveData<Boolean> hasMessage() {
public LiveData<Boolean> hasMessage() {
return hasMessageLiveData;
}
void refresh() {
public void refresh() {
messageDataSourceFactory.getMessageDataSource().invalidate();
}
void retryLoadingMore() {
public void retryLoadingMore() {
messageDataSourceFactory.getMessageDataSource().retryLoadingMore();
}

View File

@ -1,6 +1,6 @@
package ml.docilealligator.infinityforreddit;
class NetworkState {
public class NetworkState {
public enum Status{
LOADING,
SUCCESS,

View File

@ -6,14 +6,14 @@ import android.text.Html;
import org.json.JSONException;
import org.json.JSONObject;
class ParseAndSaveAccountInfo {
interface ParseAndSaveAccountInfoListener {
public class ParseAndSaveAccountInfo {
public interface ParseAndSaveAccountInfoListener {
void onParseMyInfoSuccess(String name, String profileImageUrl, String bannerImageUrl, int karma);
void onParseMyInfoFail();
}
static void parseAndSaveAccountInfo(String response, RedditDataRoomDatabase redditDataRoomDatabase,
ParseAndSaveAccountInfoListener parseAndSaveAccountInfoListener) {
public static void parseAndSaveAccountInfo(String response, RedditDataRoomDatabase redditDataRoomDatabase,
ParseAndSaveAccountInfoListener parseAndSaveAccountInfoListener) {
new ParseAndSaveAccountInfoAsyncTask(response, redditDataRoomDatabase, parseAndSaveAccountInfoListener).execute();
}

View File

@ -18,8 +18,8 @@ import static ml.docilealligator.infinityforreddit.CommentData.VOTE_TYPE_DOWNVOT
import static ml.docilealligator.infinityforreddit.CommentData.VOTE_TYPE_NO_VOTE;
import static ml.docilealligator.infinityforreddit.CommentData.VOTE_TYPE_UPVOTE;
class ParseComment {
interface ParseCommentListener {
public class ParseComment {
public interface ParseCommentListener {
void onParseCommentSuccess(ArrayList<CommentData> expandedComments, String parentId,
ArrayList<String> moreChildrenFullnames);
void onParseCommentFailed();
@ -30,8 +30,8 @@ class ParseComment {
void onParseSentCommentFailed(@Nullable String errorMessage);
}
static void parseComment(String response, ArrayList<CommentData> commentData, Locale locale,
ParseCommentListener parseCommentListener) {
public static void parseComment(String response, ArrayList<CommentData> commentData, Locale locale,
ParseCommentListener parseCommentListener) {
try {
JSONArray childrenArray = new JSONArray(response);
String parentId = childrenArray.getJSONObject(0).getJSONObject(JSONUtils.DATA_KEY).getJSONArray(JSONUtils.CHILDREN_KEY)

View File

@ -12,17 +12,19 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Locale;
import ml.docilealligator.infinityforreddit.Fragment.PostFragment;
/**
* Created by alex on 3/21/18.
*/
class ParsePost {
public class ParsePost {
interface ParsePostsListingListener {
void onParsePostsListingSuccess(ArrayList<Post> newPostData, String lastItem);
void onParsePostsListingFail();
}
interface ParsePostListener {
public interface ParsePostListener {
void onParsePostSuccess(Post post);
void onParsePostFail();
}
@ -32,7 +34,7 @@ class ParsePost {
new ParsePostDataAsyncTask(response, locale, nPosts, filter, nsfw, parsePostsListingListener).execute();
}
static void parsePost(String response, Locale locale, ParsePostListener parsePostListener) {
public static void parsePost(String response, Locale locale, ParsePostListener parsePostListener) {
new ParsePostDataAsyncTask(response, locale, true, parsePostListener).execute();
}

View File

@ -7,14 +7,14 @@ import android.os.Parcelable;
* Created by alex on 3/1/18.
*/
class Post implements Parcelable {
static final int NSFW_TYPE = -1;
static final int TEXT_TYPE = 0;
static final int IMAGE_TYPE = 1;
static final int LINK_TYPE = 2;
static final int VIDEO_TYPE = 3;
static final int GIF_VIDEO_TYPE = 4;
static final int NO_PREVIEW_LINK_TYPE = 5;
public class Post implements Parcelable {
public static final int NSFW_TYPE = -1;
public static final int TEXT_TYPE = 0;
public static final int IMAGE_TYPE = 1;
public static final int LINK_TYPE = 2;
public static final int VIDEO_TYPE = 3;
public static final int GIF_VIDEO_TYPE = 4;
public static final int NO_PREVIEW_LINK_TYPE = 5;
private String id;
private String fullName;
@ -49,7 +49,7 @@ class Post implements Parcelable {
private boolean isCrosspost;
private String crosspostParentId;
Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
String postTime, String title, String previewUrl, String permalink, int score, int postType,
int voteType, int gilded, int nComments, String flair, boolean hidden, boolean spoiler,
boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved, boolean isCrosspost) {
@ -79,7 +79,7 @@ class Post implements Parcelable {
this.isCrosspost = isCrosspost;
}
Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
String postTime, String title, String previewUrl, String url, String permalink, int score,
int postType, int voteType, int gilded, int nComments, String flair, boolean hidden,
boolean spoiler, boolean nsfw, boolean stickied, boolean archived, boolean locked,
@ -111,7 +111,7 @@ class Post implements Parcelable {
this.isCrosspost = isCrosspost;
}
Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author,
String postTime, String title, String permalink, int score, int postType, int voteType, int gilded,
int nComments, String flair, boolean hidden, boolean spoiler, boolean nsfw, boolean stickied,
boolean archived, boolean locked, boolean saved, boolean isCrosspost) {
@ -191,43 +191,43 @@ class Post implements Parcelable {
return id;
}
String getFullName() {
public String getFullName() {
return fullName;
}
String getSubredditName() {
public String getSubredditName() {
return subredditName;
}
String getSubredditNamePrefixed() {
public String getSubredditNamePrefixed() {
return subredditNamePrefixed;
}
String getSubredditIconUrl() {
public String getSubredditIconUrl() {
return subredditIconUrl;
}
void setSubredditIconUrl(String subredditIconUrl) {
public void setSubredditIconUrl(String subredditIconUrl) {
this.subredditIconUrl = subredditIconUrl;
}
String getAuthor() {
public String getAuthor() {
return author;
}
String getAuthorNamePrefixed() {
public String getAuthorNamePrefixed() {
return authorNamePrefixed;
}
String getAuthorIconUrl() {
public String getAuthorIconUrl() {
return authorIconUrl;
}
void setAuthorIconUrl(String authorIconUrl) {
public void setAuthorIconUrl(String authorIconUrl) {
this.authorIconUrl = authorIconUrl;
}
String getPostTime() {
public String getPostTime() {
return postTime;
}
@ -239,31 +239,31 @@ class Post implements Parcelable {
return title;
}
void setSelfText(String selfText) {
public void setSelfText(String selfText) {
this.selfText = selfText;
}
String getSelfText() {
public String getSelfText() {
return selfText;
}
String getPreviewUrl() {
public String getPreviewUrl() {
return previewUrl;
}
String getUrl() {
public String getUrl() {
return url;
}
void setVideoUrl(String videoUrl) {
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
String getVideoUrl() {
public String getVideoUrl() {
return videoUrl;
}
String getPermalink() {
public String getPermalink() {
return permalink;
}
@ -271,47 +271,47 @@ class Post implements Parcelable {
return flair;
}
void setFlair(String flair) {
public void setFlair(String flair) {
this.flair = flair;
}
void setScore(int score) {
public void setScore(int score) {
this.score = score;
}
int getScore() {
public int getScore() {
return score;
}
int getPostType() {
public int getPostType() {
return postType;
}
void setVoteType(int voteType) {
public void setVoteType(int voteType) {
this.voteType = voteType;
}
int getVoteType() {
public int getVoteType() {
return voteType;
}
int getGilded() {
public int getGilded() {
return gilded;
}
void setPreviewWidth(int previewWidth) {
public void setPreviewWidth(int previewWidth) {
this.previewWidth = previewWidth;
}
int getPreviewWidth() {
public int getPreviewWidth() {
return previewWidth;
}
void setPreviewHeight(int previewHeight) {
public void setPreviewHeight(int previewHeight) {
this.previewHeight = previewHeight;
}
int getPreviewHeight() {
public int getPreviewHeight() {
return previewHeight;
}
@ -323,27 +323,27 @@ class Post implements Parcelable {
this.nComments = nComments;
}
boolean isHidden() {
public boolean isHidden() {
return hidden;
}
void setHidden(boolean hidden) {
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
boolean isSpoiler() {
public boolean isSpoiler() {
return spoiler;
}
void setSpoiler(boolean spoiler) {
public void setSpoiler(boolean spoiler) {
this.spoiler = spoiler;
}
boolean isNSFW() {
public boolean isNSFW() {
return nsfw;
}
void setNSFW(boolean nsfw) {
public void setNSFW(boolean nsfw) {
this.nsfw = nsfw;
}
@ -352,27 +352,27 @@ class Post implements Parcelable {
return 0;
}
boolean isStickied() {
public boolean isStickied() {
return stickied;
}
boolean isArchived() {
public boolean isArchived() {
return archived;
}
boolean isLocked() {
public boolean isLocked() {
return locked;
}
boolean isSaved() {
public boolean isSaved() {
return saved;
}
void setSaved(boolean saved) {
public void setSaved(boolean saved) {
this.saved = saved;
}
boolean isCrosspost() {
public boolean isCrosspost() {
return isCrosspost;
}

View File

@ -11,29 +11,29 @@ import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
class PostDataSource extends PageKeyedDataSource<String, Post> {
public class PostDataSource extends PageKeyedDataSource<String, Post> {
static final int TYPE_FRONT_PAGE = 0;
static final int TYPE_SUBREDDIT = 1;
static final int TYPE_USER = 2;
static final int TYPE_SEARCH = 3;
public static final int TYPE_FRONT_PAGE = 0;
public static final int TYPE_SUBREDDIT = 1;
public static final int TYPE_USER = 2;
public static final int TYPE_SEARCH = 3;
static final String SORT_TYPE_BEST = "best";
static final String SORT_TYPE_HOT = "hot";
static final String SORT_TYPE_NEW = "new";
static final String SORT_TYPE_RANDOM = "random";
static final String SORT_TYPE_RISING = "rising";
static final String SORT_TYPE_TOP = "top";
static final String SORT_TYPE_CONTROVERSIAL = "controversial";
static final String SORT_TYPE_RELEVANCE = "relevance";
static final String SORT_TYPE_COMMENTS = "comments";
public static final String SORT_TYPE_BEST = "best";
public static final String SORT_TYPE_HOT = "hot";
public static final String SORT_TYPE_NEW = "new";
public static final String SORT_TYPE_RANDOM = "random";
public static final String SORT_TYPE_RISING = "rising";
public static final String SORT_TYPE_TOP = "top";
public static final String SORT_TYPE_CONTROVERSIAL = "controversial";
public static final String SORT_TYPE_RELEVANCE = "relevance";
public static final String SORT_TYPE_COMMENTS = "comments";
static final String USER_WHERE_SUBMITTED = "submitted";
static final String USER_WHERE_UPVOTED = "upvoted";
static final String USER_WHERE_DOWNVOTED = "downvoted";
static final String USER_WHERE_HIDDEN = "hidden";
static final String USER_WHERE_SAVED = "saved";
static final String USER_WHERE_GILDED = "gilded";
public static final String USER_WHERE_SUBMITTED = "submitted";
public static final String USER_WHERE_UPVOTED = "upvoted";
public static final String USER_WHERE_DOWNVOTED = "downvoted";
public static final String USER_WHERE_HIDDEN = "hidden";
public static final String USER_WHERE_SAVED = "saved";
public static final String USER_WHERE_GILDED = "gilded";
private Retrofit retrofit;
private String accessToken;

View File

@ -1,7 +1,5 @@
package ml.docilealligator.infinityforreddit;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.core.util.Pair;
import androidx.lifecycle.LiveData;
@ -60,7 +58,6 @@ public class PostViewModel extends ViewModel {
public PostViewModel(Retrofit retrofit, String accessToken, Locale locale, String subredditName, int postType,
String sortType, int filter, boolean nsfw) {
Log.i("asfdasdf", "viewmodel: " + sortType);
postDataSourceFactory = new PostDataSourceFactory(retrofit, accessToken, locale, subredditName,
postType, sortType, filter, nsfw);
@ -152,35 +149,35 @@ public class PostViewModel extends ViewModel {
});
}
LiveData<PagedList<Post>> getPosts() {
public LiveData<PagedList<Post>> getPosts() {
return posts;
}
LiveData<NetworkState> getPaginationNetworkState() {
public LiveData<NetworkState> getPaginationNetworkState() {
return paginationNetworkState;
}
LiveData<NetworkState> getInitialLoadingState() {
public LiveData<NetworkState> getInitialLoadingState() {
return initialLoadingState;
}
LiveData<Boolean> hasPost() {
public LiveData<Boolean> hasPost() {
return hasPostLiveData;
}
void refresh() {
public void refresh() {
postDataSourceFactory.getPostDataSource().invalidate();
}
void retryLoadingMore() {
public void retryLoadingMore() {
postDataSourceFactory.getPostDataSource().retryLoadingMore();
}
void changeSortType(String sortType) {
public void changeSortType(String sortType) {
sortTypeLiveData.postValue(sortType);
}
void changeNSFW(boolean nsfw) {
public void changeNSFW(boolean nsfw) {
nsfwLiveData.postValue(nsfw);
}
@ -209,7 +206,6 @@ public class PostViewModel extends ViewModel {
public Factory(Retrofit retrofit, String accessToken, Locale locale, String subredditName, int postType,
String sortType, int filter, boolean nsfw) {
Log.i("asfdasdf", "viewmodel factory: " + sortType);
this.retrofit = retrofit;
this.accessToken = accessToken;
this.locale = locale;

View File

@ -26,6 +26,8 @@ import javax.inject.Inject;
import javax.inject.Named;
import ml.docilealligator.infinityforreddit.Account.Account;
import ml.docilealligator.infinityforreddit.Activity.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.Activity.ViewMessageActivity;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;

View File

@ -10,14 +10,14 @@ import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
class ReadMessage {
interface ReadMessageListener {
public class ReadMessage {
public interface ReadMessageListener {
void readSuccess();
void readFailed();
}
static void readMessage(Retrofit oauthRetrofit, String accessToken, String commaSeparatedFullnames,
ReadMessageListener readMessageListener) {
public static void readMessage(Retrofit oauthRetrofit, String accessToken, String commaSeparatedFullnames,
ReadMessageListener readMessageListener) {
Map<String, String> params = new HashMap<>();
params.put(RedditUtils.ID_KEY, commaSeparatedFullnames);
oauthRetrofit.create(RedditAPI.class).readMessage(RedditUtils.getOAuthHeader(accessToken), params)

Some files were not shown because too many files have changed in this diff Show More