Add 'Blocked users' to advanced settings as it is no preferred way to block users from here or to unblock some. The preferred way is to use the 'Block user' option in the profile of the user to block.

This commit is contained in:
B. Petersen
2017-07-26 20:18:12 +02:00
parent ac6c497721
commit abcf3600a6
2 changed files with 12 additions and 16 deletions
@@ -26,12 +26,8 @@
package com.b44t.ui;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@@ -53,7 +49,6 @@ import com.b44t.ui.Cells.TextCheckCell;
import com.b44t.ui.Cells.TextDetailSettingsCell;
import com.b44t.ui.Cells.TextSettingsCell;
import com.b44t.ui.Components.LayoutHelper;
import com.b44t.ui.Components.NumberPicker;
public class SettingsActivity extends BaseFragment {
@@ -61,7 +56,7 @@ public class SettingsActivity extends BaseFragment {
// the list
private int profileRow, nameAndStatusRow;
private int notificationRow, backgroundRow, advRow, settingsShadowRow;
private int readReceiptsRow, blockedRow, passcodeRow;
private int readReceiptsRow, passcodeRow;
private int aboutHeaderRow, aboutRow, inviteRow, helpRow, aboutShadowRow;
private int rowCount;
@@ -89,7 +84,6 @@ public class SettingsActivity extends BaseFragment {
notificationRow = rowCount++;
backgroundRow = rowCount++;
passcodeRow = rowCount++;
blockedRow = rowCount++;
readReceiptsRow = rowCount++;
advRow = rowCount++;
settingsShadowRow = rowCount++;
@@ -141,9 +135,6 @@ public class SettingsActivity extends BaseFragment {
if (i == nameAndStatusRow) {
presentFragment(new SettingsNameActivity());
}
else if (i == blockedRow) {
presentFragment(new BlockedUsersActivity());
}
else if (i == passcodeRow) {
if (UserConfig.passcodeHash.length() > 0) {
presentFragment(new PasscodeActivity(PasscodeActivity.SCREEN2_ENTER_CODE2));
@@ -213,7 +204,7 @@ public class SettingsActivity extends BaseFragment {
@Override
public boolean isEnabled(int i) {
return i == nameAndStatusRow ||
i == blockedRow || i==passcodeRow || i==readReceiptsRow || i == notificationRow || i == backgroundRow || i == advRow ||
i==passcodeRow || i==readReceiptsRow || i == notificationRow || i == backgroundRow || i == advRow ||
i == aboutRow || i == inviteRow || i == helpRow;
}
@@ -258,11 +249,7 @@ public class SettingsActivity extends BaseFragment {
view.setBackgroundColor(0xffffffff);
}
TextSettingsCell textCell = (TextSettingsCell) view;
if (i == blockedRow) {
String cntStr = String.format("%d", MrMailbox.getBlockedCount());
textCell.setTextAndValue(ApplicationLoader.applicationContext.getString(R.string.BlockedContacts), cntStr, true);
}
else if (i == passcodeRow) {
if (i == passcodeRow) {
String val = UserConfig.passcodeHash.length() > 0? mContext.getString(R.string.Enabled) : mContext.getString(R.string.Disabled);
textCell.setTextAndValue(mContext.getString(R.string.Passcode), val, true);
}
@@ -62,6 +62,7 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
// the list
private int directShareRow, cacheRow, raiseToSpeakRow, sendByEnterRow, autoplayGifsRow, textSizeRow, showUnknownSendersRow, finalShadowRow;
private int blockedRow;
private int accountSettingsRow;
private int e2eEncryptionRow;
private int manageKeysRow;
@@ -102,6 +103,7 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
sendByEnterRow = rowCount++;
raiseToSpeakRow = rowCount++; // outgoing message
cacheRow = -1;// for now, the - non-functional - page is reachable by the "storage settings" in the "android App Settings" only
blockedRow = rowCount++;
e2eEncryptionRow = rowCount++;
manageKeysRow = rowCount++;
backupRow = -1; //rowCount++; -- disabled for now
@@ -177,6 +179,9 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
} else if (i == cacheRow) {
presentFragment(new CacheControlActivity());
}
else if (i == blockedRow) {
presentFragment(new BlockedUsersActivity());
}
else if( i==showUnknownSendersRow) {
int oldval = MrMailbox.getConfigInt("show_deaddrop", 0);
if( oldval == 1 ) {
@@ -444,6 +449,10 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
if (i == cacheRow) {
textCell.setText(mContext.getString(R.string.CacheSettings), true);
}
else if (i == blockedRow) {
String cntStr = String.format("%d", MrMailbox.getBlockedCount());
textCell.setTextAndValue(ApplicationLoader.applicationContext.getString(R.string.BlockedContacts), cntStr, true);
}
else if( i==manageKeysRow ) {
textCell.setText(mContext.getString(R.string.E2EManagePrivateKeys), true);
}