Compare commits

..

9 Commits

Author SHA1 Message Date
sk
c77b5dfac2 bump version 2022-12-17 23:28:56 +01:00
sk
673ea40238 hide material you theme for older versions 2022-12-17 23:22:51 +01:00
sk
f7ced7f253 Merge branch 'feature/animate-buttons' 2022-12-17 23:19:42 +01:00
sk
6152ec9d0d tweak scaling while animating buttons 2022-12-17 23:19:36 +01:00
sk
7ed8bb259d Merge branch 'feature/animate-buttons' 2022-12-17 23:12:16 +01:00
sk
06882d5bea change button animations 2022-12-17 23:07:36 +01:00
sk
f460456502 add missing night variant for red 2022-12-17 22:30:15 +01:00
sk
6ef9f2ff15 update changelog 2022-12-17 22:08:39 +01:00
sk
062af9937f update changelog 2022-12-17 21:59:22 +01:00
6 changed files with 39 additions and 34 deletions

View File

@@ -9,8 +9,8 @@ android {
applicationId "org.joinmastodon.android.sk" applicationId "org.joinmastodon.android.sk"
minSdk 23 minSdk 23
targetSdk 33 targetSdk 33
versionCode 60 versionCode 61
versionName "1.1.5+fork.60" versionName "1.1.5+fork.61"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW" resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW"
} }

View File

@@ -699,6 +699,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
button=findViewById(R.id.color_picker_button); button=findViewById(R.id.color_picker_button);
popupMenu=new PopupMenu(getActivity(), button, Gravity.CENTER_HORIZONTAL); popupMenu=new PopupMenu(getActivity(), button, Gravity.CENTER_HORIZONTAL);
popupMenu.inflate(R.menu.color_picker); popupMenu.inflate(R.menu.color_picker);
popupMenu.getMenu().findItem(R.id.m3_color).setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S);
popupMenu.setOnMenuItemClickListener(SettingsFragment.this::onColorPreferenceClick); popupMenu.setOnMenuItemClickListener(SettingsFragment.this::onColorPreferenceClick);
button.setOnTouchListener(popupMenu.getDragToOpenListener()); button.setOnTouchListener(popupMenu.getDragToOpenListener());
button.setOnClickListener(v->popupMenu.show()); button.setOnClickListener(v->popupMenu.show());

View File

@@ -49,7 +49,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
public static class Holder extends StatusDisplayItem.Holder<FooterStatusDisplayItem>{ public static class Holder extends StatusDisplayItem.Holder<FooterStatusDisplayItem>{
private final TextView reply, boost, favorite, bookmark; private final TextView reply, boost, favorite, bookmark;
private final ImageView share; private final ImageView share;
private static final AnimationSet scaleDown, scaleUp; private static final Animation opacityOut, opacityIn;
private final View.AccessibilityDelegate buttonAccessibilityDelegate=new View.AccessibilityDelegate(){ private final View.AccessibilityDelegate buttonAccessibilityDelegate=new View.AccessibilityDelegate(){
@Override @Override
@@ -61,24 +61,13 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
}; };
static { static {
// 20dp to center in middle of icon, because: (icon width = 24dp) / 2 + (paddingStart = 8dp) opacityOut = new AlphaAnimation(1, 0.5f);
Animation scaleDownAnim = new ScaleAnimation(1, 0.85f, 1, 0.85f, Animation.ABSOLUTE, V.dp(20), Animation.RELATIVE_TO_SELF, 0.5f); opacityOut.setDuration(200);
Animation scaleUpAnim = new ScaleAnimation(0.85f, 1, 0.85f, 1, Animation.ABSOLUTE, V.dp(20), Animation.RELATIVE_TO_SELF, 0.5f); opacityOut.setInterpolator(CubicBezierInterpolator.DEFAULT);
Animation opacityOutAnim = new AlphaAnimation(1, 0.75f); opacityOut.setFillAfter(true);
Animation opacityInAnim = new AlphaAnimation(0.75f, 1); opacityIn = new AlphaAnimation(0.5f, 1);
opacityIn.setDuration(150);
scaleDown = new AnimationSet(true); opacityIn.setInterpolator(CubicBezierInterpolator.DEFAULT);
scaleDown.setDuration(350);
scaleDown.setInterpolator(CubicBezierInterpolator.DEFAULT);
scaleDown.setFillAfter(true);
scaleDown.addAnimation(scaleDownAnim);
scaleDown.addAnimation(opacityOutAnim);
scaleUp = new AnimationSet(true);
scaleUp.setDuration(100);
scaleUp.setInterpolator(CubicBezierInterpolator.DEFAULT);
scaleUp.addAnimation(scaleUpAnim);
scaleUp.addAnimation(opacityInAnim);
} }
public Holder(Activity activity, ViewGroup parent){ public Holder(Activity activity, ViewGroup parent){
@@ -139,7 +128,6 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
} }
private void onReplyClick(View v){ private void onReplyClick(View v){
v.startAnimation(scaleUp);
Bundle args=new Bundle(); Bundle args=new Bundle();
args.putString("account", item.accountID); args.putString("account", item.accountID);
args.putParcelable("replyTo", Parcels.wrap(item.status)); args.putParcelable("replyTo", Parcels.wrap(item.status));
@@ -147,37 +135,45 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
} }
private boolean onButtonTouch(View v, MotionEvent event){ private boolean onButtonTouch(View v, MotionEvent event){
if (event.getAction() == MotionEvent.ACTION_UP) v.performClick(); int action = event.getAction();
else if (event.getAction() == MotionEvent.ACTION_DOWN) v.startAnimation(scaleDown); // 20dp to center in middle of icon, because: (icon width = 24dp) / 2 + (paddingStart = 8dp)
else if (event.getAction() == MotionEvent.ACTION_CANCEL) v.startAnimation(scaleUp); v.setPivotX(V.dp(20));
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
v.animate().scaleX(1).scaleY(1).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(100).start();
if (action == MotionEvent.ACTION_UP) v.performClick();
} else if (action == MotionEvent.ACTION_DOWN) {
v.animate().scaleX(0.85f).scaleY(0.85f).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(50).start();
}
return true; return true;
} }
private void onBoostClick(View v){ private void onBoostClick(View v){
v.startAnimation(opacityOut);
boost.setSelected(!item.status.reblogged);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(item.status, !item.status.reblogged, r->{ AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(item.status, !item.status.reblogged, r->{
v.startAnimation(scaleUp); v.startAnimation(opacityIn);
boost.setSelected(item.status.reblogged);
bindButton(boost, r.reblogsCount); bindButton(boost, r.reblogsCount);
}); });
} }
private void onFavoriteClick(View v){ private void onFavoriteClick(View v){
v.startAnimation(opacityOut);
favorite.setSelected(!item.status.favourited);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(item.status, !item.status.favourited, r->{ AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(item.status, !item.status.favourited, r->{
v.startAnimation(scaleUp); v.startAnimation(opacityIn);
favorite.setSelected(r.favourited);
bindButton(favorite, r.favouritesCount); bindButton(favorite, r.favouritesCount);
}); });
} }
private void onBookmarkClick(View v){ private void onBookmarkClick(View v){
v.startAnimation(opacityOut);
bookmark.setSelected(item.status.bookmarked);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(item.status, !item.status.bookmarked, r->{ AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(item.status, !item.status.bookmarked, r->{
v.startAnimation(scaleUp); v.startAnimation(opacityIn);
bookmark.setSelected(item.status.bookmarked);
}); });
} }
private void onShareClick(View v){ private void onShareClick(View v){
v.startAnimation(scaleUp);
Intent intent=new Intent(Intent.ACTION_SEND); Intent intent=new Intent(Intent.ACTION_SEND);
intent.setType("text/plain"); intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, item.status.url); intent.putExtra(Intent.EXTRA_TEXT, item.status.url);

View File

@@ -18,6 +18,9 @@
<style name="Theme.Mastodon.AutoLightDark.Yellow" parent="Theme.Mastodon.Dark.Yellow"/> <style name="Theme.Mastodon.AutoLightDark.Yellow" parent="Theme.Mastodon.Dark.Yellow"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Yellow" parent="Theme.Mastodon.Dark.TrueBlack.Yellow"/> <style name="Theme.Mastodon.AutoLightDark.TrueBlack.Yellow" parent="Theme.Mastodon.Dark.TrueBlack.Yellow"/>
<style name="Theme.Mastodon.AutoLightDark.Red" parent="Theme.Mastodon.Dark.Red"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Red" parent="Theme.Mastodon.Dark.Red"/>
<style name="Theme.Mastodon.AutoLightDark.Material3" parent="Theme.Mastodon.Dark.Material3"/> <style name="Theme.Mastodon.AutoLightDark.Material3" parent="Theme.Mastodon.Dark.Material3"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Material3" parent="Theme.Mastodon.Dark.TrueBlack.Material3"/> <style name="Theme.Mastodon.AutoLightDark.TrueBlack.Material3" parent="Theme.Mastodon.Dark.TrueBlack.Material3"/>
</resources> </resources>

View File

@@ -0,0 +1,5 @@
- Neue Farbschemata: Material You und Rot
- Neue dunkle Grautöne für alle Schemata
- Boost-Symbol nun besser auseinanderhaltbar
- Animationen für Interaktions-Buttons
- Fehlerbehebungen (Absturz bei manchen Posts, "Listen mit", Standard-Sprache für neue Beiträge)

View File

@@ -1,5 +1,5 @@
- Material You color theme - New color themes: Material You and Red
- Replace dark gray tones for all themes - New dark gray tones for all themes
- More distinct filled boost icon - More distinct filled boost icon
- Animations for interaction buttons - Animations for interaction buttons
- Bugfixes (Crash on some posts, "Lists with", default posting language) - Bugfixes (Crash on some posts, "Lists with", default posting language)