diff --git a/app/build.gradle b/app/build.gradle index dd0c08aa..5a2a44ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 21 targetSdk 32 - versionCode 434 - versionName "3.8.1" + versionCode 435 + versionName "3.9.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } flavorDimensions "default" diff --git a/app/src/main/assets/release_notes/notes.json b/app/src/main/assets/release_notes/notes.json index a3a280d2..c797eb91 100644 --- a/app/src/main/assets/release_notes/notes.json +++ b/app/src/main/assets/release_notes/notes.json @@ -1,4 +1,9 @@ [ + { + "version": "3.9.0", + "code": "435", + "note": "Added:\n- Migrate to Material Design 3\n- 5 Themes (Light, Dark, Solarized Light/Dark, Black)\n- Automatically switch between Light/Dark\n- Light and Dark theme can be defined for time-based switch\n- Android 12+: Dynamic color\n\nFixed:\n- Jumps in timelines\n" + }, { "version": "3.8.1", "code": "434", diff --git a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java index 401e235b..28ac84b0 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -47,6 +47,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; +import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityOptionsCompat; import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; @@ -148,8 +149,7 @@ public class ProfileActivity extends BaseActivity { mention_str = b.getString(Helper.ARG_MENTION, null); checkRemotely = b.getBoolean(Helper.ARG_CHECK_REMOTELY, false); } - postponeEnterTransition(); - + ActivityCompat.postponeEnterTransition(ProfileActivity.this); //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); @@ -270,18 +270,19 @@ public class ProfileActivity extends BaseActivity { @Override public void onResourceReady(@NonNull final Drawable resource, Transition transition) { binding.profilePicture.setImageDrawable(resource); - startPostponedEnterTransition(); + ActivityCompat.startPostponedEnterTransition(ProfileActivity.this); } @Override public void onLoadFailed(@Nullable Drawable errorDrawable) { binding.profilePicture.setImageResource(R.drawable.ic_person); - startPostponedEnterTransition(); + ActivityCompat.startPostponedEnterTransition(ProfileActivity.this); } @Override public void onLoadCleared(@Nullable Drawable placeholder) { - + binding.profilePicture.setImageResource(R.drawable.ic_person); + ActivityCompat.startPostponedEnterTransition(ProfileActivity.this); } } ); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java index 3dea6890..78ed4255 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/NotificationAdapter.java @@ -164,16 +164,16 @@ public class NotificationAdapter extends RecyclerView.Adapter accountsVM.rejectFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id) .observe((LifecycleOwner) context, relationShip -> { - if (notificationList.size() > position) { - notificationList.remove(position); - notifyItemRemoved(position); + if (notificationList.size() > holderFollow.getBindingAdapterPosition()) { + notificationList.remove(holderFollow.getBindingAdapterPosition()); + notifyItemRemoved(holderFollow.getBindingAdapterPosition()); } })); holderFollow.binding.acceptButton.setOnClickListener(v -> accountsVM.acceptFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id) .observe((LifecycleOwner) context, relationShip -> { - if (notificationList.size() > position) { - notificationList.remove(position); - notifyItemRemoved(position); + if (notificationList.size() > holderFollow.getBindingAdapterPosition()) { + notificationList.remove(holderFollow.getBindingAdapterPosition()); + notifyItemRemoved(holderFollow.getBindingAdapterPosition()); } })); holderFollow.binding.avatar.setOnClickListener(v -> { diff --git a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AccountsVM.java b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AccountsVM.java index f56a120b..1d640b2b 100644 --- a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AccountsVM.java +++ b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AccountsVM.java @@ -1191,6 +1191,7 @@ public class AccountsVM extends AndroidViewModel { if (acceptFollowResponse.isSuccessful()) { relationShip = acceptFollowResponse.body(); } + new StatusCache(getApplication().getApplicationContext()).deleteStatus(instance, id); } catch (Exception e) { e.printStackTrace(); } @@ -1221,6 +1222,7 @@ public class AccountsVM extends AndroidViewModel { if (rejectFollowResponse.isSuccessful()) { relationShip = rejectFollowResponse.body(); } + new StatusCache(getApplication().getApplicationContext()).deleteStatus(instance, id); } catch (Exception e) { e.printStackTrace(); } diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml index 9979a096..523b390d 100644 --- a/app/src/main/res/layout/activity_profile.xml +++ b/app/src/main/res/layout/activity_profile.xml @@ -77,7 +77,6 @@ android:id="@+id/account_pp" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_margin="3dp" android:contentDescription="@string/profile_picture" android:scaleType="centerCrop" android:transitionName="@string/activity_porfile_pp" diff --git a/app/src/main/res/layout/drawer_conversation.xml b/app/src/main/res/layout/drawer_conversation.xml index 968ebf87..41e0f0d3 100644 --- a/app/src/main/res/layout/drawer_conversation.xml +++ b/app/src/main/res/layout/drawer_conversation.xml @@ -18,10 +18,11 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" + android:layout_marginHorizontal="@dimen/card_margin" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="12dp" + android:layout_marginTop="6dp" app:cardElevation="5dp" app:strokeWidth="0dp"> diff --git a/app/src/main/res/layout/drawer_follow.xml b/app/src/main/res/layout/drawer_follow.xml index 9277677e..22d6f8bf 100644 --- a/app/src/main/res/layout/drawer_follow.xml +++ b/app/src/main/res/layout/drawer_follow.xml @@ -19,9 +19,9 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="6dp" + android:layout_marginHorizontal="@dimen/card_margin" app:cardElevation="5dp" - + android:layout_marginTop="@dimen/card_margin" app:strokeWidth="0dp">