Merge remote-tracking branch 'upstream/master' into upstream-release

This commit is contained in:
sk 2022-12-22 01:32:45 +01:00
commit aafb08d7b3
4 changed files with 17 additions and 3 deletions

View File

@ -211,7 +211,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
else else
charLimit=500; charLimit=500;
loadDefaultStatusVisibility(savedInstanceState); if (editingStatus == null) loadDefaultStatusVisibility(savedInstanceState);
} }
@Override @Override

View File

@ -281,7 +281,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
username+="@"+AccountSessionManager.getInstance().getAccount(accountID).domain; username+="@"+AccountSessionManager.getInstance().getAccount(accountID).domain;
} }
getActivity().getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, "@"+username)); getActivity().getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, "@"+username));
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.TIRAMISU){ // Android 13+ SystemUI shows its own thing when you put things into the clipboard if(Build.VERSION.SDK_INT<Build.VERSION_CODES.TIRAMISU || UiUtils.isMIUI()){ // Android 13+ SystemUI shows its own thing when you put things into the clipboard
Toast.makeText(getActivity(), R.string.text_copied, Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.text_copied, Toast.LENGTH_SHORT).show();
} }
return true; return true;

View File

@ -155,7 +155,7 @@ public class SignupFragment extends ToolbarFragment{
} }
private void onButtonClick(){ private void onButtonClick(){
if(!password.getText().equals(passwordConfirm.getText())){ if(!password.getText().toString().equals(passwordConfirm.getText().toString())){
passwordConfirm.setError(getString(R.string.signup_passwords_dont_match)); passwordConfirm.setError(getString(R.string.signup_passwords_dont_match));
passwordConfirmWrap.setErrorState(); passwordConfirmWrap.setErrorState();
return; return;

View File

@ -23,6 +23,7 @@ import android.os.Looper;
import android.provider.OpenableColumns; import android.provider.OpenableColumns;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -587,4 +588,17 @@ public class UiUtils{
} }
launchWebBrowser(context, url); launchWebBrowser(context, url);
} }
private static String getSystemProperty(String key){
try{
Class<?> props=Class.forName("android.os.SystemProperties");
Method get=props.getMethod("get", String.class);
return (String)get.invoke(null, key);
}catch(Exception ignore){}
return null;
}
public static boolean isMIUI(){
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code"));
}
} }