From eb7ed786055a45401dc2f688fc0fbcec5da0f89e Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Fri, 13 Jun 2014 11:50:47 +0200 Subject: [PATCH] moved last seen to contact details --- res/layout/activity_contact_details.xml | 11 +++++++++- res/layout/fragment_conversation.xml | 20 ------------------- res/xml/preferences.xml | 5 ----- .../ui/ContactDetailsActivity.java | 4 ++++ .../ui/ConversationActivity.java | 10 ---------- .../ui/ConversationFragment.java | 15 -------------- 6 files changed, 14 insertions(+), 51 deletions(-) diff --git a/res/layout/activity_contact_details.xml b/res/layout/activity_contact_details.xml index ce172fd95..5eecfa877 100644 --- a/res/layout/activity_contact_details.xml +++ b/res/layout/activity_contact_details.xml @@ -17,7 +17,8 @@ android:text="@string/action_contact_details" /> + diff --git a/res/layout/fragment_conversation.xml b/res/layout/fragment_conversation.xml index a81b70317..703a525e9 100644 --- a/res/layout/fragment_conversation.xml +++ b/res/layout/fragment_conversation.xml @@ -147,24 +147,4 @@ - - - - - \ No newline at end of file diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index be9a2be70..40039cd5c 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -72,11 +72,6 @@ android:title="@string/pref_conference_name" android:summary="@string/pref_conference_name_summary" android:defaultValue="true"/> - diff --git a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java index 154533db7..d89c35f1e 100644 --- a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -48,6 +48,7 @@ public class ContactDetailsActivity extends XmppActivity { private TextView accountJidTv; private TextView status; private TextView askAgain; + private TextView lastseen; private CheckBox send; private CheckBox receive; private QuickContactBadge badge; @@ -111,6 +112,7 @@ public class ContactDetailsActivity extends XmppActivity { contactJidTv = (TextView) findViewById(R.id.details_contactjid); accountJidTv = (TextView) findViewById(R.id.details_account); status = (TextView) findViewById(R.id.details_contactstatus); + lastseen = (TextView) findViewById(R.id.details_lastseen); send = (CheckBox) findViewById(R.id.details_send_presence); receive = (CheckBox) findViewById(R.id.details_receive_presence); askAgain = (TextView) findViewById(R.id.ask_again); @@ -202,6 +204,8 @@ public class ContactDetailsActivity extends XmppActivity { receive.setChecked(false); } } + + lastseen.setText(UIHelper.lastseen(getApplicationContext(),contact.lastseen.time)); switch (contact.getMostAvailableStatus()) { case Presences.CHAT: diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 06efff4b9..d0982e8e8 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -269,11 +269,6 @@ public class ConversationActivity extends XmppActivity { getActionBar().setTitle(R.string.app_name); invalidateOptionsMenu(); hideKeyboard(); - ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager() - .findFragmentByTag("conversation"); - if (selectedFragment != null) { - selectedFragment.lastSeen.setVisibility(View.GONE); - } } @Override @@ -293,11 +288,6 @@ public class ConversationActivity extends XmppActivity { getConversationList(), null, false); listView.invalidateViews(); } - ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager() - .findFragmentByTag("conversation"); - if ((selectedFragment != null) && (showLastseen())) { - selectedFragment.lastSeen.setVisibility(View.VISIBLE); - } } } diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index 1939ae727..9d4f60086 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -107,9 +107,7 @@ public class ConversationFragment extends Fragment { private LinearLayout pgpInfo; private LinearLayout mucError; - public LinearLayout lastSeen; private TextView mucErrorText; - private TextView lastSeenText; private OnClickListener clickToMuc = new OnClickListener() { @Override @@ -163,8 +161,6 @@ public class ConversationFragment extends Fragment { mucError = (LinearLayout) view.findViewById(R.id.muc_error); mucError.setOnClickListener(clickToMuc); mucErrorText = (TextView) view.findViewById(R.id.muc_error_msg); - lastSeen = (LinearLayout) view.findViewById(R.id.last_seen); - lastSeenText = (TextView) view.findViewById(R.id.last_seen_text); messagesView = (ListView) view.findViewById(R.id.messages_view); messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL); @@ -607,11 +603,6 @@ public class ConversationFragment extends Fragment { activity.getActionBar().setTitle( conversation.getName(useSubject)); activity.invalidateOptionsMenu(); - if (activity.showLastseen()) { - lastSeen.setVisibility(View.VISIBLE); - } - } else { - lastSeen.setVisibility(View.GONE); } } if (conversation.getMode() == Conversation.MODE_MULTI) { @@ -687,11 +678,6 @@ public class ConversationFragment extends Fragment { break; } } - if (activity.showLastseen()) { - Contact contact = conversation.getContact(); - lastSeenText.setText(UIHelper.lastseen(getActivity(), - contact.lastseen.time)); - } for(Message message : this.conversation.getMessages()) { if (!this.messageList.contains(message)) { this.messageList.add(message); @@ -899,7 +885,6 @@ public class ConversationFragment extends Fragment { public void onPresenceSelected(boolean success, String presence) { if (success) { - Log.d("xmppService","selected presence "+presence); message.setPresence(presence); xmppService.sendMessage(message); messageSent();