aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-02-19 09:05:55 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-02-19 09:05:55 +0000
commit2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe (patch)
treea39813d33c5b0bcfde1cdf81fb84135b1a7f41a2 /app
parent9f8713979411a27caee062b77f893617029b3d67 (diff)
downloadinfinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar.gz
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar.bz2
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar.lz
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar.xz
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.tar.zst
infinity-for-reddit-2a077afa43ae4b3c4e6cba787f24a8ea70b6c2fe.zip
Remove code comments.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java263
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/AccountRecyclerViewAdapter.java134
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java1
-rw-r--r--app/src/main/res/layout/activity_main.xml219
5 files changed, 9 insertions, 616 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
index 4148993f..a551d995 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
@@ -40,8 +40,6 @@ import androidx.work.NetworkType;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.RequestManager;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.bottomappbar.BottomAppBar;
@@ -134,40 +132,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
Toolbar toolbar;
@BindView(R.id.nav_drawer_recycler_view_main_activity)
RecyclerView navDrawerRecyclerView;
- /*@BindView(R.id.nested_scroll_view_main_activity)
- NestedScrollView nestedScrollView;
- @BindView(R.id.all_drawer_items_linear_layout_main_activity)
- LinearLayout allDrawerItemsLinearLayout;
- @BindView(R.id.account_label_main_activity)
- TextView accountLabelTextView;
- @BindView(R.id.profile_text_view_main_activity)
- TextView profileTextView;
- @BindView(R.id.subscriptions_text_view_main_activity)
- TextView subscriptionTextView;
- @BindView(R.id.multi_reddits_text_view_main_activity)
- TextView multiRedditsTextView;
- @BindView(R.id.inbox_text_view_main_activity)
- TextView inboxTextView;
- @BindView(R.id.post_label_main_activity)
- TextView postLabelTextView;
- @BindView(R.id.upvoted_text_view_main_activity)
- TextView upvotedTextView;
- @BindView(R.id.downvoted_text_view_main_activity)
- TextView downvotedTextView;
- @BindView(R.id.hidden_text_view_main_activity)
- TextView hiddenTextView;
- @BindView(R.id.saved_text_view_main_activity)
- TextView savedTextView;
- @BindView(R.id.gilded_text_view_main_activity)
- TextView gildedTextView;
- @BindView(R.id.divider_main_activity)
- View divider;
- @BindView(R.id.night_mode_toggle_text_view_main_activity)
- TextView nightModeToggleTextView;
- @BindView(R.id.settings_text_view_main_activity)
- TextView settingsTextView;
- @BindView(R.id.account_recycler_view_main_activity)
- RecyclerView accountRecyclerView;*/
@BindView(R.id.tab_layout_main_activity)
TabLayout tabLayout;
@BindView(R.id.bottom_navigation_main_activity)
@@ -194,12 +158,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Inject
SharedPreferences mSharedPreferences;
private SectionsPagerAdapter sectionsPagerAdapter;
- /*private TextView mAccountNameTextView;
- private TextView mKarmaTextView;
- private GifImageView mProfileImageView;
- private ImageView mBannerImageView;
- private ImageView mDropIconImageView;*/
- private RequestManager glide;
private AppBarLayout.LayoutParams params;
private PostTypeBottomSheetFragment postTypeBottomSheetFragment;
private SortTypeBottomSheetFragment bestSortTypeBottomSheetFragment;
@@ -291,7 +249,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
int navBarHeight = resources.getDimensionPixelSize(navBarResourceId);
linearLayoutBottomAppBar.setPadding(0,
(int) (6 * resources.getDisplayMetrics().density), 0, navBarHeight);
- //nestedScrollView.setPadding(0, 0, 0, navBarHeight);
navDrawerRecyclerView.setPadding(0, 0, 0, navBarHeight);
}
}
@@ -637,50 +594,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
loadSubscriptions();
- glide = Glide.with(this);
-
- /*AccountRecyclerViewAdapter adapter = new AccountRecyclerViewAdapter(this, glide, mAccountName,
- new AccountRecyclerViewAdapter.ItemSelectedListener() {
- @Override
- public void accountSelected(Account account) {
- new SwitchAccountAsyncTask(mRedditDataRoomDatabase, account.getUsername(), newAccount -> {
- Intent intent = new Intent(MainActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }).execute();
- }
-
- @Override
- public void addAccountSelected() {
- Intent intent = new Intent(MainActivity.this, LoginActivity.class);
- startActivityForResult(intent, LOGIN_ACTIVITY_REQUEST_CODE);
- }
-
- @Override
- public void anonymousSelected() {
- new SwitchToAnonymousAccountAsyncTask(mRedditDataRoomDatabase, false,
- () -> {
- Intent intent = new Intent(MainActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }).execute();
- }
-
- @Override
- public void logoutSelected() {
- new SwitchToAnonymousAccountAsyncTask(mRedditDataRoomDatabase, true,
- () -> {
- Intent intent = new Intent(MainActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }).execute();
- }
- });*/
-
- /*accountRecyclerView.setLayoutManager(new LinearLayoutManager(this));
- accountRecyclerView.setNestedScrollingEnabled(false);
- accountRecyclerView.setAdapter(adapter);*/
-
subscribedSubredditViewModel = new ViewModelProvider(this,
new SubscribedSubredditViewModel.Factory(getApplication(), mRedditDataRoomDatabase, mAccountName))
.get(SubscribedSubredditViewModel.class);
@@ -700,42 +613,9 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
}
}
- /*View header = findViewById(R.id.nav_header_main_activity);
- mAccountNameTextView = header.findViewById(R.id.name_text_view_nav_header_main);
- mKarmaTextView = header.findViewById(R.id.karma_text_view_nav_header_main);
- mProfileImageView = header.findViewById(R.id.profile_image_view_nav_header_main);
- mBannerImageView = header.findViewById(R.id.banner_image_view_nav_header_main);
- mDropIconImageView = header.findViewById(R.id.account_switcher_image_view_nav_header_main);
-
- if (mDrawerOnAccountSwitch) {
- mDropIconImageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_baseline_arrow_drop_up_24px));
- accountRecyclerView.setVisibility(View.VISIBLE);
- allDrawerItemsLinearLayout.setVisibility(View.GONE);
- } else {
- mDropIconImageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_baseline_arrow_drop_down_24px));
- accountRecyclerView.setVisibility(View.GONE);
- allDrawerItemsLinearLayout.setVisibility(View.VISIBLE);
- }
-
- header.setOnClickListener(view -> {
- if (mDrawerOnAccountSwitch) {
- mDrawerOnAccountSwitch = false;
- mDropIconImageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_baseline_arrow_drop_down_24px));
- accountRecyclerView.setVisibility(View.GONE);
- allDrawerItemsLinearLayout.setVisibility(View.VISIBLE);
- } else {
- mDrawerOnAccountSwitch = true;
- mDropIconImageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_baseline_arrow_drop_up_24px));
- accountRecyclerView.setVisibility(View.VISIBLE);
- allDrawerItemsLinearLayout.setVisibility(View.GONE);
- }
- });*/
-
loadUserData();
if (mAccessToken != null) {
- /*mKarmaTextView.setText(getString(R.string.karma_info, mKarma));
- mAccountNameTextView.setText(mAccountName);*/
if (mMessageFullname != null) {
ReadMessage.readMessage(mOauthRetrofit, mAccessToken, mMessageFullname, new ReadMessage.ReadMessageListener() {
@Override
@@ -749,131 +629,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
}
});
}
- } else {
- /*mKarmaTextView.setText(R.string.press_here_to_login);
- mAccountNameTextView.setText(R.string.anonymous_account);
- accountLabelTextView.setVisibility(View.GONE);
- profileTextView.setVisibility(View.GONE);
- subscriptionTextView.setVisibility(View.GONE);
- multiRedditsTextView.setVisibility(View.GONE);
- inboxTextView.setVisibility(View.GONE);
- postLabelTextView.setVisibility(View.GONE);
- upvotedTextView.setVisibility(View.GONE);
- downvotedTextView.setVisibility(View.GONE);
- hiddenTextView.setVisibility(View.GONE);
- savedTextView.setVisibility(View.GONE);
- gildedTextView.setVisibility(View.GONE);
- divider.setVisibility(View.GONE);*/
- }
-
- /*if (mProfileImageUrl != null && !mProfileImageUrl.equals("")) {
- glide.load(mProfileImageUrl)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(144, 0)))
- .error(glide.load(R.drawable.subreddit_default_icon)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(144, 0))))
- .into(mProfileImageView);
- } else {
- glide.load(R.drawable.subreddit_default_icon)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(144, 0)))
- .into(mProfileImageView);
- }
-
- if (mBannerImageUrl != null && !mBannerImageUrl.equals("")) {
- glide.load(mBannerImageUrl).into(mBannerImageView);
- }*/
-
- /*profileTextView.setOnClickListener(view -> {
- Intent intent = new Intent(this, ViewUserDetailActivity.class);
- intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, mAccountName);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- subscriptionTextView.setOnClickListener(view -> {
- Intent intent = new Intent(this, SubscribedThingListingActivity.class);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- multiRedditsTextView.setOnClickListener(view -> {
- Intent intent = new Intent(this, MultiRedditListingActivity.class);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- inboxTextView.setOnClickListener(view -> {
- Intent intent = new Intent(this, ViewMessageActivity.class);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- upvotedTextView.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, AccountPostsActivity.class);
- intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- downvotedTextView.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, AccountPostsActivity.class);
- intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_DOWNVOTED);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- hiddenTextView.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, AccountPostsActivity.class);
- intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_HIDDEN);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- savedTextView.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, AccountSavedThingActivity.class);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- gildedTextView.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, AccountPostsActivity.class);
- intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_GILDED);
- startActivity(intent);
- drawer.closeDrawers();
- });
-
- if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
- nightModeToggleTextView.setText(R.string.dark_theme);
- nightModeToggleTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_dark_theme_24dp, 0, 0, 0);
- } else {
- nightModeToggleTextView.setText(R.string.light_theme);
- nightModeToggleTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_light_theme_24dp, 0, 0, 0);
}
-
- nightModeToggleTextView.setOnClickListener(view -> {
- if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) {
- mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "1").apply();
- nightModeToggleTextView.setText(R.string.dark_theme);
- nightModeToggleTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_dark_theme_24dp, 0, 0, 0);
- AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
- if(mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
- getTheme().applyStyle(R.style.Theme_Default_AmoledDark, true);
- } else {
- getTheme().applyStyle(R.style.Theme_Default_NormalDark, true);
- }
- } else {
- mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "0").apply();
- nightModeToggleTextView.setText(R.string.light_theme);
- nightModeToggleTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_light_theme_24dp, 0, 0, 0);
- AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
- getTheme().applyStyle(R.style.Theme_Default, true);
- }
- });
-
- settingsTextView.setOnClickListener(view -> {
- drawer.closeDrawers();
- Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
- startActivity(intent);
- });*/
}
private void loadSubscriptions() {
@@ -911,29 +667,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
ParseAndSaveAccountInfo.parseAndSaveAccountInfo(response, mRedditDataRoomDatabase, new ParseAndSaveAccountInfo.ParseAndSaveAccountInfoListener() {
@Override
public void onParseMyInfoSuccess(String name, String profileImageUrl, String bannerImageUrl, int karma) {
- /*mAccountNameTextView.setText(name);
- if (profileImageUrl != null && !profileImageUrl.equals("")) {
- glide.load(profileImageUrl)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .error(glide.load(R.drawable.subreddit_default_icon)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0))))
- .into(mProfileImageView);
- } else {
- glide.load(R.drawable.subreddit_default_icon)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(mProfileImageView);
- }
- if (bannerImageUrl != null && !bannerImageUrl.equals("")) {
- glide.load(bannerImageUrl).into(mBannerImageView);
- }*/
-
mAccountName = name;
mProfileImageUrl = profileImageUrl;
mBannerImageUrl = bannerImageUrl;
mKarma = karma;
-
- //mKarmaTextView.setText(getString(R.string.karma_info, karma));
-
mFetchUserInfoSuccess = true;
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/AccountRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/AccountRecyclerViewAdapter.java
deleted file mode 100644
index 2476a1b6..00000000
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/AccountRecyclerViewAdapter.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package ml.docilealligator.infinityforreddit.Adapter;
-
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-import androidx.annotation.NonNull;
-import androidx.core.content.ContextCompat;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.bumptech.glide.RequestManager;
-import com.bumptech.glide.request.RequestOptions;
-
-import java.util.List;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
-import ml.docilealligator.infinityforreddit.Account.Account;
-import ml.docilealligator.infinityforreddit.R;
-import pl.droidsonroids.gif.GifImageView;
-
-public class AccountRecyclerViewAdapter extends RecyclerView.Adapter<AccountRecyclerViewAdapter.AccountViewHolder> {
-
- private List<Account> mAccounts;
- private String mCurrentAccountName;
- private Context mContext;
- private RequestManager mGlide;
- private ItemSelectedListener mItemSelectedListener;
- public AccountRecyclerViewAdapter(Context context, RequestManager glide, String currentAccountName, ItemSelectedListener itemSelectedListener) {
- mContext = context;
- mGlide = glide;
- mCurrentAccountName = currentAccountName;
- mItemSelectedListener = itemSelectedListener;
- }
-
- @NonNull
- @Override
- public AccountViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
- return new AccountViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_nav_drawer_account, parent, false));
- }
-
- @Override
- public void onBindViewHolder(@NonNull AccountViewHolder holder, int position) {
- if (mAccounts == null) {
- mGlide.load(R.drawable.subreddit_default_icon)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(holder.profileImageGifImageView);
- holder.usernameTextView.setText(R.string.add_account);
- holder.itemView.setOnClickListener(view -> mItemSelectedListener.addAccountSelected());
- } else {
- if (position < mAccounts.size()) {
- mGlide.load(mAccounts.get(position).getProfileImageUrl())
- .error(mGlide.load(R.drawable.subreddit_default_icon))
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(holder.profileImageGifImageView);
- holder.usernameTextView.setText(mAccounts.get(position).getUsername());
- holder.itemView.setOnClickListener(view -> {
- mCurrentAccountName = mAccounts.get(position).getUsername();
- mItemSelectedListener.accountSelected(mAccounts.get(position));
- });
- } else if (position == mAccounts.size()) {
- holder.profileImageGifImageView.setColorFilter(ContextCompat.getColor(mContext, R.color.primaryTextColor), android.graphics.PorterDuff.Mode.SRC_IN);
- mGlide.load(R.drawable.ic_outline_add_circle_outline_24dp)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(holder.profileImageGifImageView);
- holder.usernameTextView.setText(R.string.add_account);
- holder.itemView.setOnClickListener(view -> mItemSelectedListener.addAccountSelected());
- } else if (position == mAccounts.size() + 1) {
- holder.profileImageGifImageView.setColorFilter(ContextCompat.getColor(mContext, R.color.primaryTextColor), android.graphics.PorterDuff.Mode.SRC_IN);
- mGlide.load(R.drawable.ic_anonymous_24dp)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(holder.profileImageGifImageView);
- holder.usernameTextView.setText(R.string.anonymous_account);
- holder.itemView.setOnClickListener(view -> mItemSelectedListener.anonymousSelected());
- } else {
- holder.profileImageGifImageView.setColorFilter(ContextCompat.getColor(mContext, R.color.primaryTextColor), android.graphics.PorterDuff.Mode.SRC_IN);
- mGlide.load(R.drawable.ic_log_out_24dp)
- .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))
- .into(holder.profileImageGifImageView);
- holder.usernameTextView.setText(R.string.log_out);
- holder.itemView.setOnClickListener(view -> mItemSelectedListener.logoutSelected());
- }
- }
- }
-
- @Override
- public int getItemCount() {
- if (mAccounts == null) {
- return 1;
- } else {
- if (mCurrentAccountName == null) {
- return mAccounts.size() + 1;
- } else {
- return mAccounts.size() + 3;
- }
- }
- }
-
- @Override
- public void onViewRecycled(@NonNull AccountViewHolder holder) {
- mGlide.clear(holder.profileImageGifImageView);
- holder.profileImageGifImageView.clearColorFilter();
- }
-
- public void changeAccountsDataset(List<Account> accounts) {
- mAccounts = accounts;
- notifyDataSetChanged();
- }
-
- public interface ItemSelectedListener {
- void accountSelected(Account account);
-
- void addAccountSelected();
-
- void anonymousSelected();
-
- void logoutSelected();
- }
-
- class AccountViewHolder extends RecyclerView.ViewHolder {
- @BindView(R.id.profile_image_item_account)
- GifImageView profileImageGifImageView;
- @BindView(R.id.username_text_view_item_account)
- TextView usernameTextView;
-
- AccountViewHolder(@NonNull View itemView) {
- super(itemView);
- ButterKnife.bind(this, itemView);
- }
- }
-}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java
index d852efbf..59b29e67 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java
@@ -359,6 +359,14 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re
}
}
+ @Override
+ public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
+ super.onViewRecycled(holder);
+ if (holder instanceof SubscribedThingViewHolder) {
+ glide.clear(((SubscribedThingViewHolder) holder).iconGifImageView);
+ }
+ }
+
public void setSubscribedSubreddits(List<SubscribedSubredditData> subscribedSubreddits) {
this.subscribedSubreddits = (ArrayList<SubscribedSubredditData>) subscribedSubreddits;
notifyDataSetChanged();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
index 1a2b4ea5..d87a6617 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
@@ -1425,6 +1425,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
@Override
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
+ super.onViewRecycled(holder);
if (holder instanceof PostViewHolder) {
mGlide.clear(((PostViewHolder) holder).imageView);
mGlide.clear(((PostViewHolder) holder).iconGifImageView);
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index a47d4fc8..cb1ca05f 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -27,225 +27,6 @@
android:scrollbars="vertical"
android:clipToPadding="false" />
- <!--<androidx.core.widget.NestedScrollView
- android:id="@+id/nested_scroll_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scrollbars="vertical"
- android:clipToPadding="false">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <include
- android:id="@+id/nav_header_main_activity"
- layout="@layout/nav_header_main" />
-
- <LinearLayout
- android:id="@+id/all_drawer_items_linear_layout_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/account_label_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:text="@string/label_account"
- android:textSize="?attr/font_default" />
-
- <TextView
- android:id="@+id/profile_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_account_circle_24dp"
- android:drawablePadding="32dp"
- android:text="@string/profile"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/subscriptions_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_subscritptions_bottom_app_bar_24dp"
- android:drawablePadding="32dp"
- android:text="@string/subscriptions"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/multi_reddits_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_multi_reddit_24dp"
- android:drawablePadding="32dp"
- android:text="@string/multi_reddit"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/inbox_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_inbox_24dp"
- android:drawablePadding="32dp"
- android:text="@string/inbox"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/post_label_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:text="@string/label_post"
- android:textSize="?attr/font_default" />
-
- <TextView
- android:id="@+id/upvoted_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_arrow_upward_black_24dp"
- android:drawablePadding="32dp"
- android:text="@string/upvoted"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/downvoted_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_arrow_downward_black_24dp"
- android:drawablePadding="32dp"
- android:text="@string/downvoted"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/hidden_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_outline_lock_24dp"
- android:drawablePadding="32dp"
- android:text="@string/hidden"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/saved_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_outline_bookmarks_24dp"
- android:drawablePadding="32dp"
- android:text="@string/saved"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/gilded_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_star_border_24dp"
- android:drawablePadding="32dp"
- android:text="@string/gilded"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <View
- android:id="@+id/divider_main_activity"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@color/dividerColor" />
-
- <TextView
- android:id="@+id/night_mode_toggle_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawablePadding="32dp"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- <TextView
- android:id="@+id/settings_text_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:drawableStart="@drawable/ic_settings_24dp"
- android:drawablePadding="32dp"
- android:text="@string/settings"
- android:textColor="@color/primaryTextColor"
- android:textSize="?attr/font_default"
- android:background="?attr/selectableItemBackground"
- android:clickable="true"
- android:focusable="true" />
-
- </LinearLayout>
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/account_recycler_view_main_activity"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
-
- </LinearLayout>
-
- </androidx.core.widget.NestedScrollView>-->
-
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout>