profile: show tab containing 'status' for device chat (#2039)

the device chat's status contains some useful information
since https://github.com/deltachat/deltachat-core-rust/pull/2613 -
unfortunately, the whole tab was hidden on android.

ios and desktop should be fine in this regard.
This commit is contained in:
bjoern 2021-08-20 22:56:28 +02:00 committed by GitHub
parent 34513086b4
commit 5b937b5653
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View file

@ -223,7 +223,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
}
}
if(!isGlobalProfile() && !isSelfProfile() && !chatIsDeviceTalk && !chatIsMailingList) {
if(!isGlobalProfile() && !isSelfProfile() && !chatIsMailingList) {
tabs.add(TAB_SETTINGS);
}
tabs.add(TAB_GALLERY);
@ -329,7 +329,9 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
int tabId = tabs.get(position);
switch(tabId) {
case TAB_SETTINGS:
if(isContactProfile()) {
if (chatIsDeviceTalk) {
return getString(R.string.profile);
} else if(isContactProfile()) {
return getString(R.string.tab_contact);
}
else if (chatIsMailingList) {

View file

@ -291,19 +291,26 @@ public class ProfileSettingsAdapter extends RecyclerView.Adapter
}
}
else if (sharedChats!=null && dcContact!=null) {
boolean chatIsDeviceTalk = dcChat != null && dcChat.isDeviceTalk();
itemDataContact = dcContact;
if (!chatIsDeviceTalk) {
itemData.add(new ItemData(ItemData.TYPE_PRIMARY_SETTING, SETTING_NEW_CHAT, context.getString(R.string.send_message)));
}
itemDataStatusText = dcContact.getStatus();
if (!itemDataStatusText.isEmpty()) {
itemData.add(new ItemData(ItemData.TYPE_STATUS, 0, itemDataStatusText));
}
itemDataSharedChats = sharedChats;
if (!chatIsDeviceTalk) {
int sharedChatsCnt = sharedChats.getCnt();
for (int i = 0; i < sharedChatsCnt; i++) {
itemData.add(new ItemData(ItemData.TYPE_SHARED_CHAT, 0, i));
}
}
}
notifyDataSetChanged();
}