This commit is contained in:
Thomas 2022-09-08 08:49:42 +02:00
parent 9ce6c56771
commit b60780bcb0
2 changed files with 69 additions and 89 deletions

View File

@ -55,7 +55,6 @@
<activity <activity
android:exported="true" android:exported="true"
android:name=".activities.LoginActivity" android:name=".activities.LoginActivity"
android:noHistory="true"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateAlwaysHidden"> android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter> <intent-filter>
@ -76,47 +75,37 @@
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.DraftActivity" android:name=".activities.DraftActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".imageeditor.EditImageActivity" android:name=".imageeditor.EditImageActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.ComposeActivity" android:name=".activities.ComposeActivity"
android:noHistory="true"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/compose" /> android:label="@string/compose" />
<activity <activity
android:name=".activities.StatusInfoActivity" android:name=".activities.StatusInfoActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.FollowRequestActivity" android:name=".activities.FollowRequestActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.WebviewActivity" android:name=".activities.WebviewActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.ProfileActivity" android:name=".activities.ProfileActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/account" /> android:label="@string/account" />
<activity <activity
android:name=".activities.AdminAccountActivity" android:name=".activities.AdminAccountActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/account" /> android:label="@string/account" />
<activity <activity
android:name=".activities.ScheduledActivity" android:name=".activities.ScheduledActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/scheduled" /> android:label="@string/scheduled" />
<activity <activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:noHistory="true"
android:theme="@style/Base.Theme.AppCompat" /> android:theme="@style/Base.Theme.AppCompat" />
<service <service
@ -125,123 +114,102 @@
<activity <activity
android:name=".activities.SearchResultTabActivity" android:name=".activities.SearchResultTabActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppThemeBar" android:theme="@style/AppThemeBar"
android:label="@string/search" /> android:label="@string/search" />
<activity <activity
android:name=".activities.TrendsActivity" android:name=".activities.TrendsActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/trending" android:label="@string/trending"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.ReorderTimelinesActivity" android:name=".activities.ReorderTimelinesActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/reorder_timelines" android:label="@string/reorder_timelines"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.AboutActivity" android:name=".activities.AboutActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/action_about" android:label="@string/action_about"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.PartnerShipActivity" android:name=".activities.PartnerShipActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/action_about" android:label="@string/action_about"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.ActionActivity" android:name=".activities.ActionActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/interactions" android:label="@string/interactions"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.AdminActionActivity" android:name=".activities.AdminActionActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/administration" android:label="@string/administration"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.MastodonListActivity" android:name=".activities.MastodonListActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/action_lists" android:label="@string/action_lists"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/settings" android:label="@string/settings"
android:theme="@style/AppThemeBar" /> android:theme="@style/AppThemeBar" />
<activity <activity
android:name=".activities.InstanceActivity" android:name=".activities.InstanceActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/action_about_instance" android:label="@string/action_about_instance"
android:theme="@style/DialogDark" /> android:theme="@style/DialogDark" />
<activity <activity
android:name=".activities.InstanceProfileActivity" android:name=".activities.InstanceProfileActivity"
android:noHistory="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/DialogDark" /> android:theme="@style/DialogDark" />
<activity <activity
android:name=".activities.ProxyActivity" android:name=".activities.ProxyActivity"
android:noHistory="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/DialogDark" /> android:theme="@style/DialogDark" />
<activity <activity
android:name=".activities.HashTagActivity" android:name=".activities.HashTagActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.AnnouncementActivity" android:name=".activities.AnnouncementActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".activities.MediaActivity" android:name=".activities.MediaActivity"
android:noHistory="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/TransparentDark" /> android:theme="@style/TransparentDark" />
<activity <activity
android:name=".activities.InstanceHealthActivity" android:name=".activities.InstanceHealthActivity"
android:noHistory="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/DialogDark" /> android:theme="@style/DialogDark" />
<activity <activity
android:name=".activities.ReportActivity" android:name=".activities.ReportActivity"
android:noHistory="true"
android:theme="@style/AppThemeBarDark" android:theme="@style/AppThemeBarDark"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".activities.CustomSharingActivity" android:name=".activities.CustomSharingActivity"
android:noHistory="true"
android:label="@string/settings_title_custom_sharing" android:label="@string/settings_title_custom_sharing"
android:windowSoftInputMode="stateVisible" android:windowSoftInputMode="stateVisible"
android:theme="@style/AppThemeBarDark" /> android:theme="@style/AppThemeBarDark" />
<activity <activity
android:name=".activities.FilterActivity" android:name=".activities.FilterActivity"
android:noHistory="true"
android:label="@string/filters" android:label="@string/filters"
android:theme="@style/AppThemeBarDark" android:theme="@style/AppThemeBarDark"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".activities.EditProfileActivity" android:name=".activities.EditProfileActivity"
android:noHistory="true"
android:label="@string/edit_profile" android:label="@string/edit_profile"
android:theme="@style/AppThemeBarDark" android:theme="@style/AppThemeBarDark"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".activities.CacheActivity" android:name=".activities.CacheActivity"
android:noHistory="true"
android:label="@string/action_cache" android:label="@string/action_cache"
android:theme="@style/AppThemeBarDark" /> android:theme="@style/AppThemeBarDark" />

View File

@ -665,7 +665,7 @@ public class ProfileActivity extends BaseActivity {
int itemId = item.getItemId(); int itemId = item.getItemId();
String[] splitAcct = account.acct.split("@"); String[] splitAcct = account.acct.split("@");
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ProfileActivity.this); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ProfileActivity.this);
AlertDialog.Builder builderInner; AlertDialog.Builder builderInner = null;
final boolean isOwner = account.id.compareToIgnoreCase(BaseMainActivity.currentUserID) == 0; final boolean isOwner = account.id.compareToIgnoreCase(BaseMainActivity.currentUserID) == 0;
final String[] stringArrayConf; final String[] stringArrayConf;
if (isOwner) { if (isOwner) {
@ -882,6 +882,8 @@ public class ProfileActivity extends BaseActivity {
startActivity(intent); startActivity(intent);
return true; return true;
} else if (itemId == R.id.action_mute) { } else if (itemId == R.id.action_mute) {
if (relationship != null) {
if (relationship.muting) { if (relationship.muting) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(stringArrayConf[4]); builderInner.setTitle(stringArrayConf[4]);
@ -891,6 +893,10 @@ public class ProfileActivity extends BaseActivity {
builderInner.setTitle(stringArrayConf[0]); builderInner.setTitle(stringArrayConf[0]);
doActionAccount = action.MUTE; doActionAccount = action.MUTE;
} }
} else {
doActionAccount = action.NOTHING;
}
} else if (itemId == R.id.action_report) { } else if (itemId == R.id.action_report) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
builderInner.setTitle(R.string.report_account); builderInner.setTitle(R.string.report_account);
@ -913,6 +919,7 @@ public class ProfileActivity extends BaseActivity {
return true; return true;
} else if (itemId == R.id.action_block) { } else if (itemId == R.id.action_block) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
if (relationship != null) {
if (relationship.blocking) { if (relationship.blocking) {
builderInner.setTitle(stringArrayConf[5]); builderInner.setTitle(stringArrayConf[5]);
doActionAccount = action.UNBLOCK; doActionAccount = action.UNBLOCK;
@ -920,6 +927,9 @@ public class ProfileActivity extends BaseActivity {
builderInner.setTitle(stringArrayConf[1]); builderInner.setTitle(stringArrayConf[1]);
doActionAccount = action.BLOCK; doActionAccount = action.BLOCK;
} }
} else {
doActionAccount = action.NOTHING;
}
} else if (itemId == R.id.action_block_instance) { } else if (itemId == R.id.action_block_instance) {
builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle());
doActionAccount = action.BLOCK_DOMAIN; doActionAccount = action.BLOCK_DOMAIN;
@ -928,6 +938,7 @@ public class ProfileActivity extends BaseActivity {
} else { } else {
return true; return true;
} }
if (doAction != action.NOTHING && builderInner != null) {
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
String target; String target;
@ -972,6 +983,7 @@ public class ProfileActivity extends BaseActivity {
dialog.dismiss(); dialog.dismiss();
}); });
builderInner.show(); builderInner.show();
}
return true; return true;
} }