diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 9 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPrivateMessagesActivity.java | 19 |
2 files changed, 14 insertions, 14 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a5f7d9c7..d92c8ba0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,16 +24,15 @@ android:usesCleartextTraffic="true" tools:replace="android:label"> - <activity android:name=".Activity.ViewPrivateMessagesActivity" - android:parentActivityName=".Activity.MainActivity" - android:theme="@style/AppTheme.Slidable" - android:windowSoftInputMode="adjustResize" /> - <service android:name=".Service.DownloadRedditVideoService" android:enabled="true" android:exported="false" /> + <activity android:name=".Activity.ViewPrivateMessagesActivity" + android:parentActivityName=".Activity.MainActivity" + android:theme="@style/AppTheme.Slidable" + android:windowSoftInputMode="adjustResize" /> <activity android:name=".Activity.ViewImgurMediaActivity" android:configChanges="orientation|screenSize|layoutDirection" diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPrivateMessagesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPrivateMessagesActivity.java index aecc78ab..c42ab803 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPrivateMessagesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPrivateMessagesActivity.java @@ -93,8 +93,8 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit private String mAccessToken; private String mAccountName; private String mUserAvatar; - private ArrayList<ProvideUserAvatarCallback> provideUserAvatarCallbacks; - private LoadUserDataAsyncTask loadUserDataAsyncTask; + private ArrayList<ProvideUserAvatarCallback> mProvideUserAvatarCallbacks; + private LoadUserDataAsyncTask mLoadUserDataAsyncTask; @Override protected void onCreate(Bundle savedInstanceState) { @@ -127,7 +127,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit setSupportActionBar(mToolbar); setToolbarGoToTop(mToolbar); - provideUserAvatarCallbacks = new ArrayList<>(); + mProvideUserAvatarCallbacks = new ArrayList<>(); if (savedInstanceState != null) { mNullAccessToken = savedInstanceState.getBoolean(NULL_ACCESS_TOKEN_STATE); @@ -160,6 +160,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit private void bindView() { mAdapter = new PrivateMessagesDetailRecyclerViewAdapter(this, privateMessage, mAccountName, mCustomThemeWrapper); mLinearLayoutManager = new LinearLayoutManager(this); + mLinearLayoutManager.setStackFromEnd(true); mRecyclerView.setLayoutManager(mLinearLayoutManager); mRecyclerView.setAdapter(mAdapter); goToBottom(); @@ -229,16 +230,16 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit public void fetchUserAvatar(String username, ProvideUserAvatarCallback provideUserAvatarCallback) { if (mUserAvatar == null) { - provideUserAvatarCallbacks.add(provideUserAvatarCallback); - if (loadUserDataAsyncTask == null) { - loadUserDataAsyncTask = new LoadUserDataAsyncTask(mRedditDataRoomDatabase.userDao(), username, mRetrofit, iconImageUrl -> { + mProvideUserAvatarCallbacks.add(provideUserAvatarCallback); + if (mLoadUserDataAsyncTask == null) { + mLoadUserDataAsyncTask = new LoadUserDataAsyncTask(mRedditDataRoomDatabase.userDao(), username, mRetrofit, iconImageUrl -> { mUserAvatar = iconImageUrl; - for (ProvideUserAvatarCallback provideUserAvatarCallbackInArrayList : provideUserAvatarCallbacks) { + for (ProvideUserAvatarCallback provideUserAvatarCallbackInArrayList : mProvideUserAvatarCallbacks) { provideUserAvatarCallbackInArrayList.fetchAvatarSuccess(iconImageUrl); } - provideUserAvatarCallbacks.clear(); + mProvideUserAvatarCallbacks.clear(); }); - loadUserDataAsyncTask.execute(); + mLoadUserDataAsyncTask.execute(); } } else { provideUserAvatarCallback.fetchAvatarSuccess(mUserAvatar); |