Organize settings activity.

This commit is contained in:
B. Petersen
2016-10-19 00:57:00 +02:00
parent 6557ef65e8
commit 14a44ad0ab
7 changed files with 28 additions and 16 deletions
@@ -219,29 +219,35 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
numberRow = rowCount++; // EDIT BY MR -- these are the account settings
settingsSectionRow = rowCount++;
settingsSectionRow2 = rowCount++;
notificationRow = rowCount++;
privacyRow = rowCount++;
notificationRow = rowCount++;
backgroundRow = rowCount++;
languageRow = rowCount++;
enableAnimationsRow = rowCount++;
languageRow = rowCount++;
mediaDownloadSection = rowCount++;
mediaDownloadSection2 = rowCount++;
mobileDownloadRow = rowCount++;
wifiDownloadRow = rowCount++;
roamingDownloadRow = rowCount++;
autoplayGifsRow = rowCount++;
mobileDownloadRow = -1;//rowCount++;
wifiDownloadRow = -1;//rowCount++;
roamingDownloadRow = -1;//rowCount++;
saveToGalleryRow = rowCount++;
cacheRow = rowCount++;
messagesSectionRow = rowCount++;
messagesSectionRow2 = rowCount++;
sendByEnterRow = rowCount++; // outgoing message
raiseToSpeakRow = rowCount++;
textSizeRow = rowCount++; // incoming messages
customTabsRow = rowCount++;
stickersRow = -1; // EDIT BY MR --was: rowCount++;
if (Build.VERSION.SDK_INT >= 23) {
directShareRow = rowCount++;
}
textSizeRow = rowCount++;
stickersRow = -1; // EDIT BY MR --was: rowCount++;
cacheRow = rowCount++;
raiseToSpeakRow = rowCount++;
sendByEnterRow = rowCount++;
else {
directShareRow = -1;
}
supportSectionRow = rowCount++;
supportSectionRow2 = rowCount++;
askQuestionRow = -1; // EDIT BY MR -- rowCount++;
@@ -1318,7 +1324,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
int size = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
textCell.setTextAndValue(LocaleController.getString("TextSize", R.string.TextSize), String.format("%d", size), true);
} else if (i == languageRow) {
textCell.setTextAndValue(LocaleController.getString("Language", R.string.Language), LocaleController.getCurrentLanguageName(), true);
textCell.setTextAndValue(LocaleController.getString("Language", R.string.Language), LocaleController.getCurrentLanguageName(), false);
} else if (i == contactsSortRow) {
/* EDIT BY MR
String value;
@@ -1372,11 +1378,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
if (i == enableAnimationsRow) {
textCell.setTextAndCheck(LocaleController.getString("EnableAnimations", R.string.EnableAnimations), preferences.getBoolean("view_animations", true), false);
textCell.setTextAndCheck(LocaleController.getString("EnableAnimations", R.string.EnableAnimations), preferences.getBoolean("view_animations", true), true);
} else if (i == sendByEnterRow) {
textCell.setTextAndCheck(LocaleController.getString("SendByEnter", R.string.SendByEnter), preferences.getBoolean("send_by_enter", false), false);
textCell.setTextAndCheck(LocaleController.getString("SendByEnter", R.string.SendByEnter), preferences.getBoolean("send_by_enter", false), true);
} else if (i == saveToGalleryRow) {
textCell.setTextAndCheck(LocaleController.getString("SaveToGallerySettings", R.string.SaveToGallerySettings), MediaController.getInstance().canSaveToGallery(), false);
textCell.setTextAndCheck(LocaleController.getString("SaveToGallerySettings", R.string.SaveToGallerySettings), MediaController.getInstance().canSaveToGallery(), true);
} else if (i == autoplayGifsRow) {
textCell.setTextAndCheck(LocaleController.getString("AutoplayGifs", R.string.AutoplayGifs), MediaController.getInstance().canAutoplayGifs(), true);
} else if (i == raiseToSpeakRow) {
@@ -1384,7 +1390,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
} else if (i == customTabsRow) {
textCell.setTextAndValueAndCheck(LocaleController.getString("ChromeCustomTabs", R.string.ChromeCustomTabs), LocaleController.getString("ChromeCustomTabsInfo", R.string.ChromeCustomTabsInfo), MediaController.getInstance().canCustomTabs(), false, true);
} else if (i == directShareRow) {
textCell.setTextAndValueAndCheck(LocaleController.getString("DirectShare", R.string.DirectShare), LocaleController.getString("DirectShareInfo", R.string.DirectShareInfo), MediaController.getInstance().canDirectShare(), false, true);
textCell.setTextAndValueAndCheck(LocaleController.getString("DirectShare", R.string.DirectShare), LocaleController.getString("DirectShareInfo", R.string.DirectShareInfo), MediaController.getInstance().canDirectShare(), false, false);
}
} else if (type == 4) {
if (view == null) {
@@ -1397,7 +1403,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
} else if (i == messagesSectionRow2) {
((HeaderCell) view).setText(LocaleController.getString("MessagesSettings", R.string.MessagesSettings));
} else if (i == mediaDownloadSection2) {
((HeaderCell) view).setText(LocaleController.getString("AutomaticMediaDownload", R.string.AutomaticMediaDownload));
((HeaderCell) view).setText(LocaleController.getString("Media", R.string.Media));
} else if (i == numberSectionRow) {
((HeaderCell) view).setText(LocaleController.getString("MyAccount", R.string.MyAccount)); // EDIT BY MR
}
@@ -979,4 +979,5 @@
<string name="Stranger">Unbekannte Absender</string>
<string name="Strangers">Unbekannte Benutzer</string>
<string name="StrangersExplain">Nachrichten von unbekannten Benutzern anzeigen</string>
<string name="Media">Medien</string>
</resources>
@@ -946,4 +946,5 @@
<string name="formatterDay12H">h:mm a</string>
<string name="formatDateAtTime">%1$s a las %2$s</string>
<string name="NewChat">Nuevo chat</string>
<string name="Media">Multimedia</string>
</resources>
@@ -946,4 +946,5 @@
<string name="formatterDay12H">h:mm a</string>
<string name="formatDateAtTime">%1$s alle %2$s</string>
<string name="NewChat">Nuova chat</string>
<string name="Media">Media</string>
</resources>
@@ -946,4 +946,5 @@
<string name="formatterDay12H">h:mm a</string>
<string name="formatDateAtTime">%1$s om %2$s</string>
<string name="NewChat">Nieuwe chat</string>
<string name="Media">Media</string>
</resources>
@@ -946,4 +946,5 @@
<string name="formatterDay12H">h:mm a</string>
<string name="formatDateAtTime">%1$s às %2$s</string>
<string name="NewChat">Novo Chat</string>
<string name="Media">Mídias</string>
</resources>
@@ -979,4 +979,5 @@
<string name="Stranger">Unknown senders</string>
<string name="Strangers">Unknown users</string>
<string name="StrangersExplain">Show messages from unknown useres</string>
<string name="Media">Media</string>
</resources>