aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-09-20 16:43:51 +0200
committerGitHub <noreply@github.com>2016-09-20 16:43:51 +0200
commitde7c0c5121ac4436b9172d35bfe44a45865c25be (patch)
tree192ee8d187f29d57bfd97b4069ac3bfc89613990 /src
parent5790d4c4ab6faa0ea390ca92833bbc3315d813e0 (diff)
parent9aaa5b78f4264c607ee4a1e0c7b94085cd022e79 (diff)
Merge pull request #2028 from Mishiranu/feature-more-tables
Fix "Server info" table layout
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java20
-rw-r--r--src/main/res/layout/activity_edit_account.xml52
-rw-r--r--src/main/res/layout/activity_muc_details.xml6
-rw-r--r--src/main/res/values-ru/strings.xml16
4 files changed, 73 insertions, 21 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 83364ca2..cc178179 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -519,6 +519,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
this.mSaveButton.setOnClickListener(this.mSaveButtonClickListener);
this.mCancelButton.setOnClickListener(this.mCancelButtonClickListener);
this.mMoreTable = (TableLayout) findViewById(R.id.server_info_more);
+ if (savedInstanceState != null && savedInstanceState.getBoolean("showMoreTable")) {
+ changeMoreTableVisibility(true);
+ }
final OnCheckedChangeListener OnCheckedShowConfirmPassword = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView,
@@ -585,6 +588,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
}
@Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more);
+ if (showMoreInfo.isVisible()) {
+ showMoreInfo.setChecked(mMoreTable.getVisibility() == View.VISIBLE);
+ }
+ return super.onPrepareOptionsMenu(menu);
+ }
+
+ @Override
protected void onStart() {
super.onStart();
final int theme = findTheme();
@@ -628,6 +640,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
if (mAccount != null) {
savedInstanceState.putString("account", mAccount.getJid().toBareJid().toString());
savedInstanceState.putBoolean("initMode", mInitMode);
+ savedInstanceState.putBoolean("showMoreTable", mMoreTable.getVisibility() == View.VISIBLE);
}
super.onSaveInstanceState(savedInstanceState);
}
@@ -695,8 +708,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
startActivity(showBlocklistIntent);
break;
case R.id.action_server_info_show_more:
- mMoreTable.setVisibility(item.isChecked() ? View.GONE : View.VISIBLE);
- item.setChecked(!item.isChecked());
+ changeMoreTableVisibility(!item.isChecked());
break;
case R.id.action_change_password_on_server:
gotoChangePassword(null);
@@ -720,6 +732,10 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
return super.onOptionsItemSelected(item);
}
+ private void changeMoreTableVisibility(boolean visible) {
+ mMoreTable.setVisibility(visible ? View.VISIBLE : View.GONE);
+ }
+
private void gotoChangePassword(String newPassword) {
final Intent changePasswordIntent = new Intent(this, ChangePasswordActivity.class);
changePasswordIntent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().toString());
diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml
index 555f18ff..64393b25 100644
--- a/src/main/res/layout/activity_edit_account.xml
+++ b/src/main/res/layout/activity_edit_account.xml
@@ -221,6 +221,7 @@
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:shrinkColumns="0"
android:stretchColumns="1">
<TableRow
@@ -233,13 +234,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_session_established"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/session_est"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -250,6 +254,7 @@
android:id="@+id/server_info_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:shrinkColumns="0"
android:stretchColumns="1"
android:visibility="gone">
@@ -262,13 +267,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_pep"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_pep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -283,13 +291,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_blocking"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_blocking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -304,13 +315,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_stream_management"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_sm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -325,13 +339,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_roster_version"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_roster_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -346,13 +363,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_carbon_messages"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_carbons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -367,13 +387,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_mam"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_mam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -388,13 +411,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_csi"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_csi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
@@ -409,13 +435,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_push"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_push"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
</TableRow>
@@ -428,13 +457,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_http_upload"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody"/>
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end"/>
<TextView
android:id="@+id/server_info_http_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody"/>
</TableRow>
diff --git a/src/main/res/layout/activity_muc_details.xml b/src/main/res/layout/activity_muc_details.xml
index 7ff91e15..f4e45598 100644
--- a/src/main/res/layout/activity_muc_details.xml
+++ b/src/main/res/layout/activity_muc_details.xml
@@ -141,6 +141,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/muc_info_more"
+ android:shrinkColumns="0"
android:stretchColumns="1"
android:visibility="gone">
@@ -153,13 +154,16 @@
android:layout_height="wrap_content"
android:text="@string/server_info_mam"
android:textColor="?attr/color_text_primary"
- android:textSize="?attr/TextSizeBody" />
+ android:textSize="?attr/TextSizeBody"
+ android:singleLine="true"
+ android:ellipsize="end" />
<TextView
android:id="@+id/muc_info_mam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
+ android:paddingLeft="4dp"
android:textColor="?attr/color_text_primary"
android:textSize="?attr/TextSizeBody" />
</TableRow>
diff --git a/src/main/res/values-ru/strings.xml b/src/main/res/values-ru/strings.xml
index 5d25af21..83e2f84b 100644
--- a/src/main/res/values-ru/strings.xml
+++ b/src/main/res/values-ru/strings.xml
@@ -191,17 +191,17 @@
<string name="muc_details_conference">Конференция</string>
<string name="muc_details_other_members">Другие участники</string>
<string name="server_info_show_more">Информация о сервере</string>
- <string name="server_info_mam">XEP-0313: Сохранение сообщений в архив</string>
- <string name="server_info_carbon_messages">Дублирование сообщений</string>
- <string name="server_info_csi">XEP-0352: Индикатор Состояния Клиента</string>
- <string name="server_info_blocking">XEP-0191: Команда Блокирования</string>
- <string name="server_info_roster_version">XEP-0237: Управление версиями списков</string>
+ <string name="server_info_mam">XEP-0313: Архив сообщений</string>
+ <string name="server_info_carbon_messages">XEP-0280: Дублиров. сообщений</string>
+ <string name="server_info_csi">XEP-0352: Состояние клиента</string>
+ <string name="server_info_blocking">XEP-0191: Команда блокирования</string>
+ <string name="server_info_roster_version">XEP-0237: Версии списков</string>
<string name="server_info_stream_management">XEP-0198: Управление потоками</string>
<string name="server_info_pep">XEP-0163: PEP (Аватары / OMEMO)</string>
- <string name="server_info_http_upload">XEP-0363: Загрузка файлов по HTTP</string>
+ <string name="server_info_http_upload">XEP-0363: Загрузка по HTTP</string>
<string name="server_info_push">XEP-0357: Push уведомления</string>
- <string name="server_info_available">доступен</string>
- <string name="server_info_unavailable">недоступен</string>
+ <string name="server_info_available">доступно</string>
+ <string name="server_info_unavailable">недоступно</string>
<string name="missing_public_keys">Отсутствие анонсирования открытых ключей</string>
<string name="last_seen_now">Присутствие: только что</string>
<string name="last_seen_min">Присутствие: 1 минуту назад</string>