Release 3.9.0

This commit is contained in:
Thomas 2022-11-30 18:15:32 +01:00
parent 9959904853
commit e1e5284a47
9 changed files with 34 additions and 17 deletions

View file

@ -13,8 +13,8 @@ android {
defaultConfig { defaultConfig {
minSdk 21 minSdk 21
targetSdk 32 targetSdk 32
versionCode 434 versionCode 435
versionName "3.8.1" versionName "3.9.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
flavorDimensions "default" flavorDimensions "default"

View file

@ -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", "version": "3.8.1",
"code": "434", "code": "434",

View file

@ -47,6 +47,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.core.app.ActivityCompat;
import androidx.core.app.ActivityOptionsCompat; import androidx.core.app.ActivityOptionsCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
@ -148,8 +149,7 @@ public class ProfileActivity extends BaseActivity {
mention_str = b.getString(Helper.ARG_MENTION, null); mention_str = b.getString(Helper.ARG_MENTION, null);
checkRemotely = b.getBoolean(Helper.ARG_CHECK_REMOTELY, false); checkRemotely = b.getBoolean(Helper.ARG_CHECK_REMOTELY, false);
} }
postponeEnterTransition(); ActivityCompat.postponeEnterTransition(ProfileActivity.this);
//Remove title //Remove title
if (actionBar != null) { if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowTitleEnabled(false);
@ -270,18 +270,19 @@ public class ProfileActivity extends BaseActivity {
@Override @Override
public void onResourceReady(@NonNull final Drawable resource, Transition<? super Drawable> transition) { public void onResourceReady(@NonNull final Drawable resource, Transition<? super Drawable> transition) {
binding.profilePicture.setImageDrawable(resource); binding.profilePicture.setImageDrawable(resource);
startPostponedEnterTransition(); ActivityCompat.startPostponedEnterTransition(ProfileActivity.this);
} }
@Override @Override
public void onLoadFailed(@Nullable Drawable errorDrawable) { public void onLoadFailed(@Nullable Drawable errorDrawable) {
binding.profilePicture.setImageResource(R.drawable.ic_person); binding.profilePicture.setImageResource(R.drawable.ic_person);
startPostponedEnterTransition(); ActivityCompat.startPostponedEnterTransition(ProfileActivity.this);
} }
@Override @Override
public void onLoadCleared(@Nullable Drawable placeholder) { public void onLoadCleared(@Nullable Drawable placeholder) {
binding.profilePicture.setImageResource(R.drawable.ic_person);
ActivityCompat.startPostponedEnterTransition(ProfileActivity.this);
} }
} }
); );

View file

@ -164,16 +164,16 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class); AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
holderFollow.binding.rejectButton.setOnClickListener(v -> accountsVM.rejectFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id) holderFollow.binding.rejectButton.setOnClickListener(v -> accountsVM.rejectFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id)
.observe((LifecycleOwner) context, relationShip -> { .observe((LifecycleOwner) context, relationShip -> {
if (notificationList.size() > position) { if (notificationList.size() > holderFollow.getBindingAdapterPosition()) {
notificationList.remove(position); notificationList.remove(holderFollow.getBindingAdapterPosition());
notifyItemRemoved(position); notifyItemRemoved(holderFollow.getBindingAdapterPosition());
} }
})); }));
holderFollow.binding.acceptButton.setOnClickListener(v -> accountsVM.acceptFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id) holderFollow.binding.acceptButton.setOnClickListener(v -> accountsVM.acceptFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, notification.account.id)
.observe((LifecycleOwner) context, relationShip -> { .observe((LifecycleOwner) context, relationShip -> {
if (notificationList.size() > position) { if (notificationList.size() > holderFollow.getBindingAdapterPosition()) {
notificationList.remove(position); notificationList.remove(holderFollow.getBindingAdapterPosition());
notifyItemRemoved(position); notifyItemRemoved(holderFollow.getBindingAdapterPosition());
} }
})); }));
holderFollow.binding.avatar.setOnClickListener(v -> { holderFollow.binding.avatar.setOnClickListener(v -> {

View file

@ -1191,6 +1191,7 @@ public class AccountsVM extends AndroidViewModel {
if (acceptFollowResponse.isSuccessful()) { if (acceptFollowResponse.isSuccessful()) {
relationShip = acceptFollowResponse.body(); relationShip = acceptFollowResponse.body();
} }
new StatusCache(getApplication().getApplicationContext()).deleteStatus(instance, id);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -1221,6 +1222,7 @@ public class AccountsVM extends AndroidViewModel {
if (rejectFollowResponse.isSuccessful()) { if (rejectFollowResponse.isSuccessful()) {
relationShip = rejectFollowResponse.body(); relationShip = rejectFollowResponse.body();
} }
new StatusCache(getApplication().getApplicationContext()).deleteStatus(instance, id);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -77,7 +77,6 @@
android:id="@+id/account_pp" android:id="@+id/account_pp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="3dp"
android:contentDescription="@string/profile_picture" android:contentDescription="@string/profile_picture"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:transitionName="@string/activity_porfile_pp" android:transitionName="@string/activity_porfile_pp"

View file

@ -18,10 +18,11 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container" android:id="@+id/container"
android:layout_marginHorizontal="@dimen/card_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="12dp" android:layout_marginTop="6dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:strokeWidth="0dp"> app:strokeWidth="0dp">

View file

@ -19,9 +19,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="6dp" android:layout_marginHorizontal="@dimen/card_margin"
app:cardElevation="5dp" app:cardElevation="5dp"
android:layout_marginTop="@dimen/card_margin"
app:strokeWidth="0dp"> app:strokeWidth="0dp">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat

View file

@ -0,0 +1,9 @@
Added:
- Migrate to Material Design 3
- 5 Themes (Light, Dark, Solarized Light/Dark, Black)
- Automatically switch between Light/Dark
- Light and Dark theme can be defined for time-based switch
- Android 12+: Dynamic color
Fixed:
- Jumps in timelines