added confirm dialog

This commit is contained in:
nuclearfog 2019-10-14 11:06:29 +02:00
parent 31b53ac89a
commit 901684a54f
No known key found for this signature in database
GPG Key ID: ED35E22099354A64
3 changed files with 20 additions and 5 deletions

View File

@ -238,11 +238,6 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
}
break;
case R.id.profile_mute:
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.ACTION_MUTE);
profileAsync.execute(userId);
break;
case R.id.profile_settings:
Intent editProfile = new Intent(this, ProfileEdit.class);
startActivityForResult(editProfile, REQUEST_PROFILE_CHANGED);
@ -266,6 +261,24 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
}
break;
case R.id.profile_mute:
if (properties != null) {
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.ACTION_MUTE);
if (properties.isMuted()) {
profileAsync.execute(userId);
} else {
new Builder(this).setMessage(R.string.confirm_mute)
.setNegativeButton(R.string.no_confirm, null)
.setPositiveButton(R.string.yes_confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
profileAsync.execute(userId);
}
}).show();
}
}
break;
case R.id.profile_block:
if (properties != null) {
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.ACTION_BLOCK);

View File

@ -118,4 +118,5 @@
<string name="failed_open_link">Fehler beim Öffnen des links!</string>
<string name="image_download_fail">Bild konnte nicht geladen werden!</string>
<string name="error_cant_send_to_user">Direktnachricht konnte nicht an diesen Nutzer gesendet werden!</string>
<string name="confirm_mute">User stummschalten?</string>
</resources>

View File

@ -119,4 +119,5 @@
<string name="image_download_fail">Image could not be loaded!</string>
<string name="error_cant_send_to_user">Cannot send directmessage to this user!</string>
<string name="information_link" translatable="false">https://github.com/nuclearfog/Shitter</string>
<string name="confirm_mute">mute user?</string>
</resources>