diff --git a/mastodon/build.gradle b/mastodon/build.gradle index ce9f1c7d5..8dd79492f 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -9,7 +9,7 @@ android { applicationId "org.joinmastodon.android" minSdk 23 targetSdk 33 - versionCode 48 + versionCode 49 versionName "1.1.5" 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" diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java index 129e95fb4..92eb026ad 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java @@ -248,6 +248,6 @@ public class AccountActivationFragment extends ToolbarFragment{ Bundle args=new Bundle(); args.putString("account", accountID); // Nav.goClearingStack(getActivity(), HomeFragment.class, args); - Nav.goClearingStack(getActivity(), OnboardingProfileSetupFragment.class, args); + Nav.goClearingStack(getActivity(), OnboardingFollowSuggestionsFragment.class, args); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingFollowSuggestionsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingFollowSuggestionsFragment.java index f1ca5c4f7..c4198fedd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingFollowSuggestionsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingFollowSuggestionsFragment.java @@ -191,6 +191,13 @@ public class OnboardingFollowSuggestionsFragment extends BaseRecyclerFragment(){ @Override public void onSuccess(Relationship result){ + relationships.put(id, result); + for(int i=0;iNav.finish(this), 500); - } - - @Override - protected boolean canGoBack(){ - return true; - } - - @Override - public void onToolbarNavigationClick(){ - Bundle args=new Bundle(); - args.putString("account", accountID); - Nav.goClearingStack(getActivity(), HomeFragment.class, args); + Nav.go(getActivity(), OnboardingProfileSetupFragment.class, args); } private class SuggestionsAdapter extends UsableRecyclerView.Adapter implements ImageLoaderRecyclerAdapter{ diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingProfileSetupFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingProfileSetupFragment.java index a5f1e83c8..4814fd990 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingProfileSetupFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/OnboardingProfileSetupFragment.java @@ -151,8 +151,7 @@ public class OnboardingProfileSetupFragment extends ToolbarFragment implements R AccountSessionManager.getInstance().updateAccountInfo(accountID, result); Bundle args=new Bundle(); args.putString("account", accountID); - Nav.go(getActivity(), OnboardingFollowSuggestionsFragment.class, args); - getActivity().getWindow().getDecorView().postDelayed(()->Nav.finish(OnboardingProfileSetupFragment.this), 500); + Nav.goClearingStack(getActivity(), HomeFragment.class, args); } @Override @@ -182,6 +181,11 @@ public class OnboardingProfileSetupFragment extends ToolbarFragment implements R profileFieldsLayout.startDragging(view); return true; }); + view.findViewById(R.id.delete).setOnClickListener(v->{ + profileFieldsLayout.removeView(view); + if(addRow.getVisibility()==View.GONE) + addRow.setVisibility(View.VISIBLE); + }); return view; } @@ -222,16 +226,4 @@ public class OnboardingProfileSetupFragment extends ToolbarFragment implements R img.setForeground(null); ViewImageLoader.load(img, null, new UrlImageLoaderRequest(uri, size, size)); } - - @Override - protected boolean canGoBack(){ - return true; - } - - @Override - public void onToolbarNavigationClick(){ - Bundle args=new Bundle(); - args.putString("account", accountID); - Nav.goClearingStack(getActivity(), HomeFragment.class, args); - } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index bfe120914..47a736aa5 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -470,12 +470,6 @@ public class UiUtils{ TypedArray ta=button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.background}); button.setBackground(ta.getDrawable(0)); ta.recycle(); - ta=button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.textColor}); - if(relationship.blocking) - button.setTextColor(button.getResources().getColorStateList(R.color.error_600)); - else - button.setTextColor(ta.getColorStateList(0)); - ta.recycle(); } public static void performAccountAction(Activity activity, Account account, String accountID, Relationship relationship, Button button, Consumer progressCallback, Consumer resultCallback){ diff --git a/mastodon/src/main/res/drawable/bg_m3_outlined_text_field_nopad.xml b/mastodon/src/main/res/drawable/bg_m3_outlined_text_field_nopad.xml new file mode 100644 index 000000000..bd14050ed --- /dev/null +++ b/mastodon/src/main/res/drawable/bg_m3_outlined_text_field_nopad.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_delete_24px.xml b/mastodon/src/main/res/drawable/ic_delete_24px.xml new file mode 100644 index 000000000..93999e25a --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_delete_24px.xml @@ -0,0 +1,9 @@ + + + diff --git a/mastodon/src/main/res/layout/onboarding_profile_field.xml b/mastodon/src/main/res/layout/onboarding_profile_field.xml index c84595fd3..7465d8155 100644 --- a/mastodon/src/main/res/layout/onboarding_profile_field.xml +++ b/mastodon/src/main/res/layout/onboarding_profile_field.xml @@ -2,32 +2,43 @@ + + 24dp + +