aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-11-02 14:39:08 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-11-02 14:39:08 +0000
commit8716eefb47ebab3a75d184041a92e27aeae0eab2 (patch)
tree108dc62375bfa5a7ecd246edd9348c3127a988f7 /app/src/main/java/ml
parent3a8c6b0a286cf73eafa580366a6af58697b3cb55 (diff)
downloadinfinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar.gz
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar.bz2
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar.lz
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar.xz
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.tar.zst
infinity-for-reddit-8716eefb47ebab3a75d184041a92e27aeae0eab2.zip
Minor changes in EditProfileActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditProfileActivity.java29
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/user/FetchUserData.java2
2 files changed, 18 insertions, 13 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditProfileActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditProfileActivity.java
index fadef9b8..f267e9f4 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditProfileActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditProfileActivity.java
@@ -14,13 +14,14 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider;
-import butterknife.BindView;
-import butterknife.ButterKnife;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
@@ -28,6 +29,15 @@ import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.r0adkll.slidr.Slidr;
import com.r0adkll.slidr.model.SlidrInterface;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
@@ -40,26 +50,21 @@ import ml.docilealligator.infinityforreddit.services.EditProfileService;
import ml.docilealligator.infinityforreddit.user.UserViewModel;
import ml.docilealligator.infinityforreddit.utils.EditProfileUtils;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
import retrofit2.Retrofit;
-import javax.inject.Inject;
-import javax.inject.Named;
-
public class EditProfileActivity extends BaseActivity {
private static final int PICK_IMAGE_BANNER_REQUEST_CODE = 0x401;
private static final int PICK_IMAGE_AVATAR_REQUEST_CODE = 0x402;
@BindView(R.id.root_layout_view_edit_profile_activity)
- LinearLayout root;
+ CoordinatorLayout root;
@BindView(R.id.content_view_edit_profile_activity)
LinearLayout content;
- @BindView(R.id.toolbar_view_edit_profile_activity)
- Toolbar toolbar;
@BindView(R.id.appbar_layout_view_edit_profile_activity)
AppBarLayout appBarLayout;
+ @BindView(R.id.toolbar_view_edit_profile_activity)
+ Toolbar toolbar;
@BindView(R.id.image_view_banner_edit_profile_activity)
ImageView bannerImageView;
@BindView(R.id.image_view_avatar_edit_profile_activity)
@@ -322,8 +327,8 @@ public class EditProfileActivity extends BaseActivity {
}
@Override
- protected void applyCustomTheme() { //
- applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
+ protected void applyCustomTheme() {
+ applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
root.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
changeColorTextView(content, mCustomThemeWrapper.getPrimaryTextColor());
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/user/FetchUserData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/user/FetchUserData.java
index 3c5280a7..fc3da19d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/user/FetchUserData.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/user/FetchUserData.java
@@ -26,7 +26,7 @@ public class FetchUserData {
} else {
userInfo = api.getUserDataOauth(APIUtils.getOAuthHeader(accessToken), userName);
}
- userInfo.enqueue(new Callback<String>() {
+ userInfo.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull Call<String> call, @NonNull retrofit2.Response<String> response) {
if (response.isSuccessful()) {