aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java72
-rw-r--r--src/main/res/layout/activity_edit_account.xml606
-rw-r--r--src/main/res/menu/editaccount.xml6
-rw-r--r--src/main/res/values/strings.xml2
4 files changed, 397 insertions, 289 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 7447ac96e..f8ad82c59 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -99,6 +99,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
private final AtomicBoolean redirectInProgress = new AtomicBoolean(false);
private Jid jidToEdit;
private boolean mInitMode = false;
+ private boolean mExisting = false;
private Boolean mForceRegister = null;
private boolean mUsernameMode = Config.DOMAIN_LOCK != null;
private boolean mShowOptions = false;
@@ -535,11 +536,19 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.binding.saveButton.setEnabled(true);
if (!mInitMode) {
if (mAccount != null && mAccount.isOnlineAndConnected()) {
+ this.binding.yourStatusBox.setVisibility(View.VISIBLE);
this.binding.saveButton.setText(R.string.save);
if (!accountInfoEdited) {
this.binding.saveButton.setEnabled(false);
}
+ if (!mUsernameMode && Jid.of(mAccount.getJid()).getDomain().toLowerCase().equals("pix-art.de")) {
+ this.binding.showPrivacyPolicy.setVisibility(View.VISIBLE);
+ this.binding.showTermsOfUse.setVisibility(View.VISIBLE);
+ }
} else {
+ this.binding.yourStatusBox.setVisibility(View.GONE);
+ this.binding.showPrivacyPolicy.setVisibility(View.GONE);
+ this.binding.showTermsOfUse.setVisibility(View.GONE);
XmppConnection connection = mAccount == null ? null : mAccount.getXmppConnection();
URL url = connection != null && mAccount.getStatus() == Account.State.PAYMENT_REQUIRED ? connection.getRedirectionUrl() : null;
if (url != null) {
@@ -621,6 +630,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.binding.saveButton.setOnClickListener(this.mSaveButtonClickListener);
this.binding.cancelButton.setOnClickListener(this.mCancelButtonClickListener);
this.binding.actionEditYourName.setOnClickListener(this::onEditYourNameClicked);
+ this.binding.actionEditYourStatus.setOnClickListener(this::onEditYourStatusClicked);
if (savedInstanceState != null && savedInstanceState.getBoolean("showMoreTable")) {
changeMoreTableVisibility(true);
}
@@ -656,6 +666,10 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}, true);
}
+ private void onEditYourStatusClicked(View view) {
+ changePresence();
+ }
+
private void refreshAvatar() {
AvatarWorkerTask.loadAvatar(mAccount, binding.avater, R.dimen.avatar_on_details_screen_size);
}
@@ -671,7 +685,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
final MenuItem showPassword = menu.findItem(R.id.action_show_password);
final MenuItem renewCertificate = menu.findItem(R.id.action_renew_certificate);
final MenuItem mamPrefs = menu.findItem(R.id.action_mam_prefs);
- final MenuItem changePresence = menu.findItem(R.id.action_change_presence);
final MenuItem actionShare = menu.findItem(R.id.action_share);
final MenuItem shareBarcode = menu.findItem(R.id.action_share_barcode);
final MenuItem shareQRCode = menu.findItem(R.id.action_show_qr_code);
@@ -690,7 +703,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
announcePGP.setVisible(true);
forgotPassword.setVisible(true);
mamPrefs.setVisible(mAccount.getXmppConnection().getFeatures().mam());
- changePresence.setVisible(!mInitMode);
} else {
announcePGP.setVisible(false);
forgotPassword.setVisible(false);
@@ -699,7 +711,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
showMoreInfo.setVisible(false);
changePassword.setVisible(false);
mamPrefs.setVisible(false);
- changePresence.setVisible(false);
actionShare.setVisible(false);
shareBarcode.setVisible(false);
shareQRCode.setVisible(false);
@@ -754,13 +765,18 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.mForceRegister = intent.hasExtra(EXTRA_FORCE_REGISTER) ? intent.getBooleanExtra(EXTRA_FORCE_REGISTER, false) : null;
Log.d(Config.LOGTAG, "force register=" + mForceRegister);
this.mInitMode = init || this.jidToEdit == null;
+ this.mExisting = existing;
this.messageFingerprint = intent.getStringExtra("fingerprint");
+ if (mExisting) {
+ this.binding.accountRegisterNew.setVisibility(View.GONE);
+ }
if (!mInitMode) {
this.binding.accountRegisterNew.setVisibility(View.GONE);
setTitle(getString(R.string.account_details));
configureActionBar(getSupportActionBar(), !openedFromNotification);
} else {
this.binding.yourNameBox.setVisibility(View.GONE);
+ this.binding.yourStatusBox.setVisibility(View.GONE);
this.binding.avater.setVisibility(View.GONE);
configureActionBar(getSupportActionBar(), !(init && Config.MAGIC_CREATE_DOMAIN == null));
if (mForceRegister != null) {
@@ -797,6 +813,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
public void onSaveInstanceState(final Bundle savedInstanceState) {
if (mAccount != null) {
savedInstanceState.putString("account", mAccount.getJid().asBareJid().toString());
+ savedInstanceState.putBoolean("existing", mExisting);
savedInstanceState.putBoolean("initMode", mInitMode);
savedInstanceState.putBoolean("showMoreTable", binding.serverInfoMore.getVisibility() == View.VISIBLE);
}
@@ -912,9 +929,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
case R.id.action_renew_certificate:
renewCertificate();
break;
- case R.id.action_change_presence:
- changePresence();
- break;
case R.id.action_show_password:
showPassword();
break;
@@ -994,7 +1008,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
boolean manualStatus = sharedPreferences.getBoolean(SettingsActivity.MANUALLY_CHANGE_PRESENCE, getResources().getBoolean(R.bool.manually_change_presence));
AlertDialog.Builder builder = new AlertDialog.Builder(this);
final DialogPresenceBinding binding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.dialog_presence, null, false);
- String current = mAccount.getPresenceStatusMessage();
+ final String current = mAccount.getPresenceStatusMessage();
if (current != null && !current.trim().isEmpty()) {
binding.statusMessage.append(current);
}
@@ -1017,6 +1031,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} else {
xmppConnectionService.changeStatus(mAccount, template, null);
}
+ updatePresenceStatus(getPresenceStatus(getAvailabilityRadioButton(binding)), binding.statusMessage.getText().toString().trim());
});
builder.create().show();
}
@@ -1076,6 +1091,22 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
}
+ private String getPresenceStatus(Presence.Status status) {
+ if (status == null) {
+ return getString(R.string.presence_online);
+ }
+ switch (status) {
+ case DND:
+ return getString(R.string.presence_dnd);
+ case XA:
+ return getString(R.string.presence_xa);
+ case AWAY:
+ return getString(R.string.presence_away);
+ default:
+ return getString(R.string.presence_online);
+ }
+ }
+
@Override
public void alias(String alias) {
if (alias != null) {
@@ -1110,7 +1141,9 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
final String displayName = mAccount.getDisplayName();
updateDisplayName(displayName);
-
+ final String presenceStatus = getPresenceStatus(mAccount.getPresenceStatus());
+ final String presenceStatusMessage = mAccount.getPresenceStatusMessage();
+ updatePresenceStatus(presenceStatus, presenceStatusMessage);
final boolean tooglePassword = mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY);
final boolean editPassword = !mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || (!mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && QuickConversationsService.isConversations()) || mAccount.getLastErrorStatus() == Account.State.UNAUTHORIZED;
this.binding.accountPasswordLayout.setPasswordVisibilityToggleEnabled(tooglePassword);
@@ -1121,7 +1154,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
if (!mInitMode) {
binding.avater.setVisibility(View.VISIBLE);
- AvatarWorkerTask.loadAvatar(mAccount, binding.avater, R.dimen.avatar_big);
+ AvatarWorkerTask.loadAvatar(mAccount, binding.avater, R.dimen.avatar_on_details_screen_size);
this.binding.accountJid.setEnabled(false);
} else {
binding.avater.setVisibility(View.GONE);
@@ -1137,18 +1170,24 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.binding.accountRegisterNew.setVisibility(View.GONE);
} else if (this.mAccount.isOptionSet(Account.OPTION_REGISTER) && mForceRegister == null) {
this.binding.accountRegisterNew.setVisibility(View.VISIBLE);
+ } else if (mExisting) {
+ this.binding.accountRegisterNew.setVisibility(View.GONE);
} else {
- this.binding.accountRegisterNew.setVisibility(mInitMode ? View.VISIBLE : View.GONE);
+ if (mInitMode) {
+ this.binding.accountRegisterNew.setVisibility(View.VISIBLE);
+ } else {
+ this.binding.accountRegisterNew.setVisibility(View.GONE);
+ }
}
this.binding.yourNameBox.setVisibility(mInitMode ? View.GONE : View.VISIBLE);
+ this.binding.yourStatusBox.setVisibility(mInitMode ? View.GONE : View.VISIBLE);
if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) {
Features features = this.mAccount.getXmppConnection().getFeatures();
this.binding.stats.setVisibility(View.VISIBLE);
boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().available(mAccount) && isOptimizingBattery();
boolean showDataSaverWarning = isAffectedByDataSaver();
showOsOptimizationWarning(showBatteryWarning, showDataSaverWarning);
- this.binding.sessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection()
- .getLastSessionEstablished()));
+ this.binding.sessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection().getLastSessionEstablished()));
if (features.rosterVersioning()) {
this.binding.serverInfoRosterVersion.setText(R.string.server_info_available);
} else {
@@ -1322,6 +1361,15 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
}
+ private void updatePresenceStatus(String presenceStatus, String presenceStatusMessage) {
+ String status = presenceStatus;
+ if (!TextUtils.isEmpty(presenceStatusMessage)) {
+ status = presenceStatus + ": " + presenceStatusMessage;
+ }
+ this.binding.yourStatus.setText(status);
+ this.binding.yourStatus.setTextAppearance(this, R.style.TextAppearance_Conversations_Body1);
+ }
+
private void removeErrorsOnAllBut(TextInputLayout exception) {
if (this.binding.accountJidLayout != exception) {
this.binding.accountJidLayout.setErrorEnabled(false);
diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml
index bb28dd52e..f8965ee81 100644
--- a/src/main/res/layout/activity_edit_account.xml
+++ b/src/main/res/layout/activity_edit_account.xml
@@ -44,112 +44,13 @@
android:layout_height="wrap_content"
android:padding="@dimen/card_padding_regular">
- <RelativeLayout
- android:id="@+id/your_name_box"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_marginBottom="@dimen/activity_vertical_margin"
- android:visibility="gone">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_toStartOf="@+id/action_edit_your_name"
- android:layout_toLeftOf="@+id/action_edit_your_name"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/your_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/no_name_set_instructions"
- android:textAppearance="@style/TextAppearance.Conversations.Body1.Tertiary" />
-
- <TextView
- android:id="@+id/your_name_desc"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/your_name"
- android:textAppearance="@style/TextAppearance.Conversations.Caption" />
- </LinearLayout>
-
- <ImageButton
- android:id="@+id/action_edit_your_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:alpha="?attr/icon_alpha"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:padding="@dimen/image_button_padding"
- android:src="?attr/icon_edit_body"
- android:visibility="visible" />
- </RelativeLayout>
-
- <com.makeramen.roundedimageview.RoundedImageView
- android:id="@+id/avater"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/your_name_box"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="@dimen/avatar_item_distance"
- android:adjustViewBounds="true"
- android:contentDescription="@string/account_image_description"
- android:maxWidth="384dp"
- android:maxHeight="384dp"
- android:padding="1dp"
- app:riv_corner_radius="@dimen/rounded_image_border" />
-
<LinearLayout
android:id="@+id/jid_password_box"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_below="@+id/avater"
+ android:layout_below="@+id/nick_avatar_box"
android:orientation="vertical">
- <android.support.design.widget.TextInputLayout
- android:id="@+id/account_jid_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/account_settings_jabber_id"
- app:errorTextAppearance="@style/TextAppearance.Conversations.Design.Error"
- app:hintTextAppearance="@style/TextAppearance.Conversations.Design.Hint">
-
- <AutoCompleteTextView
- android:id="@+id/account_jid"
- style="@style/Widget.Conversations.EditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:imeOptions="actionNext"
- android:inputType="textEmailAddress"
- android:textColor="?attr/edit_text_color" />
- </android.support.design.widget.TextInputLayout>
-
- <android.support.design.widget.TextInputLayout
- android:id="@+id/account_password_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:errorTextAppearance="@style/TextAppearance.Conversations.Design.Error"
- app:hintTextAppearance="@style/TextAppearance.Conversations.Design.Hint"
- app:passwordToggleDrawable="@drawable/visibility_toggle_drawable"
- app:passwordToggleEnabled="true"
- app:passwordToggleTint="?android:textColorSecondary">
-
- <de.pixart.messenger.ui.widget.TextInputEditText
- android:id="@+id/account_password"
- style="@style/Widget.Conversations.EditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/password"
- android:inputType="textPassword"
- android:textColor="?attr/edit_text_color" />
- </android.support.design.widget.TextInputLayout>
-
<LinearLayout
android:id="@+id/name_port"
android:layout_width="fill_parent"
@@ -206,13 +107,43 @@
</LinearLayout>
</LinearLayout>
- <CheckBox
- android:id="@+id/account_register_new"
- style="@style/Widget.Conversations.CheckBox"
- android:layout_width="wrap_content"
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/account_jid_layout"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:text="@string/register_account" />
+ android:hint="@string/account_settings_jabber_id"
+ app:errorTextAppearance="@style/TextAppearance.Conversations.Design.Error"
+ app:hintTextAppearance="@style/TextAppearance.Conversations.Design.Hint">
+
+ <AutoCompleteTextView
+ android:id="@+id/account_jid"
+ style="@style/Widget.Conversations.EditText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:inputType="textEmailAddress"
+ android:textColor="?attr/edit_text_color" />
+ </android.support.design.widget.TextInputLayout>
+
+ <android.support.design.widget.TextInputLayout
+ android:id="@+id/account_password_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:errorTextAppearance="@style/TextAppearance.Conversations.Design.Error"
+ app:hintTextAppearance="@style/TextAppearance.Conversations.Design.Hint"
+ app:passwordToggleDrawable="@drawable/visibility_toggle_drawable"
+ app:passwordToggleEnabled="true"
+ app:passwordToggleTint="?android:textColorSecondary">
+
+ <de.pixart.messenger.ui.widget.TextInputEditText
+ android:id="@+id/account_password"
+ style="@style/Widget.Conversations.EditText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/password"
+ android:inputType="textPassword"
+ android:textColor="?attr/edit_text_color" />
+ </android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
@@ -241,6 +172,139 @@
android:text="@string/show_termsofuse"
android:visibility="gone" />
</LinearLayout>
+
+ <RelativeLayout
+ android:id="@+id/nick_avatar_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_marginBottom="@dimen/activity_vertical_margin"
+ android:orientation="horizontal">
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toEndOf="@+id/avater"
+ android:layout_toRightOf="@+id/avater"
+ android:orientation="vertical">
+
+ <RelativeLayout
+ android:id="@+id/your_name_box"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone">
+
+ <ImageButton
+ android:id="@+id/action_edit_your_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:alpha="?attr/icon_alpha"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_edit_body"
+ android:visibility="visible" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_toStartOf="@+id/action_edit_your_name"
+ android:layout_toLeftOf="@+id/action_edit_your_name"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/your_name_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/your_name"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption" />
+
+ <TextView
+ android:id="@+id/your_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/no_name_set_instructions"
+ android:textAppearance="@style/TextAppearance.Conversations.Body1.Tertiary" />
+ </LinearLayout>
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/your_status_box"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/your_name_box"
+ android:visibility="gone">
+
+ <ImageButton
+ android:id="@+id/action_edit_your_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:alpha="?attr/icon_alpha"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_edit_body"
+ android:visibility="visible" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_toStartOf="@+id/action_edit_your_status"
+ android:layout_toLeftOf="@+id/action_edit_your_status"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/your_status_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/your_status"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption" />
+
+ <TextView
+ android:id="@+id/your_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text=""
+ android:textAppearance="@style/TextAppearance.Conversations.Body1.Tertiary" />
+ </LinearLayout>
+ </RelativeLayout>
+ </RelativeLayout>
+
+ <com.makeramen.roundedimageview.RoundedImageView
+ android:id="@+id/avater"
+ android:layout_width="@dimen/avatar_on_details_screen_size"
+ android:layout_height="@dimen/avatar_on_details_screen_size"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerHorizontal="false"
+ android:layout_margin="6dp"
+ android:layout_marginBottom="@dimen/avatar_item_distance"
+ android:adjustViewBounds="true"
+ android:contentDescription="@string/account_image_description"
+ android:maxWidth="@dimen/avatar_on_details_screen_size"
+ android:maxHeight="@dimen/avatar_on_details_screen_size"
+ android:visibility="gone"
+ app:riv_corner_radius="@dimen/rounded_image_border" />
+ </RelativeLayout>
+
+ <CheckBox
+ android:id="@+id/account_register_new"
+ style="@style/Widget.Conversations.CheckBox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/jid_password_box"
+ android:layout_marginTop="8dp"
+ android:text="@string/register_account" />
</RelativeLayout>
</android.support.v7.widget.CardView>
@@ -327,36 +391,161 @@
android:orientation="vertical"
android:padding="@dimen/card_padding_regular">
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:shrinkColumns="0"
- android:stretchColumns="1">
+ <RelativeLayout
+ android:id="@+id/pgp_fingerprint_box"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginTop="32dp">
- <TableRow
- android:layout_width="fill_parent"
+ <ImageButton
+ android:id="@+id/action_delete_pgp"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- tools:ignore="UselessParent">
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:alpha="1.0"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_remove"
+ android:visibility="visible" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_toStartOf="@+id/action_delete_pgp"
+ android:layout_toLeftOf="@+id/action_delete_pgp"
+ android:orientation="vertical">
<TextView
+ android:id="@+id/pgp_fingerprint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:ellipsize="end"
- android:singleLine="true"
- android:text="@string/server_info_session_established"
- android:textAppearance="@style/TextAppearance.Conversations.Body1" />
+ android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
<TextView
- android:id="@+id/session_est"
+ android:id="@+id/pgp_fingerprint_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:paddingStart="4dp"
- android:paddingLeft="4dp"
- android:textAppearance="@style/TextAppearance.Conversations.Body1" />
- </TableRow>
+ android:text="@string/openpgp_key_id"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption" />
+ </LinearLayout>
+ </RelativeLayout>
- </TableLayout>
+ <RelativeLayout
+ android:id="@+id/otr_fingerprint_box"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginTop="24dp">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_toStartOf="@+id/key_actions"
+ android:layout_toLeftOf="@+id/key_actions"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/otr_fingerprint"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
+
+ <TextView
+ android:id="@+id/otr_fingerprint_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/otr_fingerprint"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/key_actions"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:orientation="horizontal">
+
+ <ImageButton
+ android:id="@+id/action_copy_to_clipboard"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/copy_otr_clipboard_description"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_copy"
+ android:visibility="visible" />
+ </LinearLayout>
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/axolotl_fingerprint_box"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginTop="24dp">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_toStartOf="@+id/axolotl_actions"
+ android:layout_toLeftOf="@+id/axolotl_actions"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/axolotl_fingerprint"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
+
+ <TextView
+ android:id="@+id/own_fingerprint_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/axolotl_actions"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:orientation="horizontal">
+
+ <ImageButton
+ android:id="@+id/action_copy_axolotl_to_clipboard"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/copy_omemo_clipboard_description"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_copy"
+ android:visibility="visible" />
+
+ <ImageButton
+ android:id="@+id/action_regenerate_omemo_key"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/regenerate_omemo_key"
+ android:padding="@dimen/image_button_padding"
+ android:src="?attr/icon_refresh"
+ android:visibility="gone" />
+ </LinearLayout>
+ </RelativeLayout>
<TableLayout
android:id="@+id/server_info_more"
@@ -590,165 +779,40 @@
</TableRow>
</TableLayout>
- <View
+ <TableLayout
android:layout_width="match_parent"
- android:layout_height="8dp" />
-
- <RelativeLayout
- android:id="@+id/pgp_fingerprint_box"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginTop="32dp">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_toStartOf="@+id/action_delete_pgp"
- android:layout_toLeftOf="@+id/action_delete_pgp"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/pgp_fingerprint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
-
- <TextView
- android:id="@+id/pgp_fingerprint_desc"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/openpgp_key_id"
- android:textAppearance="@style/TextAppearance.Conversations.Caption" />
- </LinearLayout>
-
- <ImageButton
- android:id="@+id/action_delete_pgp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:alpha="1.0"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:padding="@dimen/image_button_padding"
- android:src="?attr/icon_remove"
- android:visibility="visible" />
- </RelativeLayout>
-
- <RelativeLayout
- android:id="@+id/otr_fingerprint_box"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginTop="24dp">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_toStartOf="@+id/key_actions"
- android:layout_toLeftOf="@+id/key_actions"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/otr_fingerprint"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
-
- <TextView
- android:id="@+id/otr_fingerprint_desc"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/otr_fingerprint"
- android:textAppearance="@style/TextAppearance.Conversations.Caption" />
-
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/key_actions"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:orientation="horizontal">
-
- <ImageButton
- android:id="@+id/action_copy_to_clipboard"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:contentDescription="@string/copy_otr_clipboard_description"
- android:padding="@dimen/image_button_padding"
- android:src="?attr/icon_copy"
- android:visibility="visible" />
- </LinearLayout>
- </RelativeLayout>
-
- <RelativeLayout
- android:id="@+id/axolotl_fingerprint_box"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginTop="24dp">
+ android:layout_height="wrap_content"
+ android:shrinkColumns="0"
+ android:stretchColumns="1">
- <LinearLayout
- android:layout_width="wrap_content"
+ <TableRow
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_toStartOf="@+id/axolotl_actions"
- android:layout_toLeftOf="@+id/axolotl_actions"
- android:orientation="vertical">
+ tools:ignore="UselessParent">
<TextView
- android:id="@+id/axolotl_fingerprint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Conversations.Fingerprint" />
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:text="@string/server_info_session_established"
+ android:textAppearance="@style/TextAppearance.Conversations.Body1" />
<TextView
- android:id="@+id/own_fingerprint_desc"
+ android:id="@+id/session_est"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Conversations.Caption" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/axolotl_actions"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:orientation="horizontal">
+ android:layout_gravity="end"
+ android:paddingStart="4dp"
+ android:paddingLeft="4dp"
+ android:textAppearance="@style/TextAppearance.Conversations.Body1" />
+ </TableRow>
- <ImageButton
- android:id="@+id/action_copy_axolotl_to_clipboard"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:contentDescription="@string/copy_omemo_clipboard_description"
- android:padding="@dimen/image_button_padding"
- android:src="?attr/icon_copy"
- android:visibility="visible" />
+ </TableLayout>
- <ImageButton
- android:id="@+id/action_regenerate_omemo_key"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:contentDescription="@string/regenerate_omemo_key"
- android:padding="@dimen/image_button_padding"
- android:src="?attr/icon_refresh"
- android:visibility="gone" />
- </LinearLayout>
- </RelativeLayout>
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="8dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
diff --git a/src/main/res/menu/editaccount.xml b/src/main/res/menu/editaccount.xml
index 90356c266..a31d6f032 100644
--- a/src/main/res/menu/editaccount.xml
+++ b/src/main/res/menu/editaccount.xml
@@ -2,12 +2,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
- android:id="@+id/action_change_presence"
- android:icon="@drawable/ic_new_releases_white_24dp"
- android:title="@string/edit_status_message"
- app:showAsAction="ifRoom" />
-
- <item
android:id="@+id/action_share"
android:icon="@drawable/ic_share_white_24dp"
android:title="@string/share_uri_with"
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index a4f1b2655..fa3ebe495 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -936,4 +936,6 @@
<string name="unable_to_perform_this_action">Unable to perform this action</string>
<string name="waiting_for_transfer">Waiting for transfer</string>
<string name="x_has_written">%s has written:</string>
+ <string name="no_status_set_instructions">You have not set a presence status message</string>
+ <string name="your_status">Your status</string>
</resources>