mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 17:59:39 +02:00
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:
parent
34513086b4
commit
5b937b5653
2 changed files with 15 additions and 6 deletions
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue