removed presence from last seen
This commit is contained in:
parent
246776067a
commit
fc656c5571
|
@ -162,7 +162,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:text="@string/last_seen"
|
android:text="@string/never_seen"
|
||||||
android:textColor="#e5e5e5"
|
android:textColor="#e5e5e5"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -236,6 +236,9 @@
|
||||||
<string name="hours">hours</string>
|
<string name="hours">hours</string>
|
||||||
<string name="mins">mins</string>
|
<string name="mins">mins</string>
|
||||||
<string name="missing_public_keys">Missing public key announcements</string>
|
<string name="missing_public_keys">Missing public key announcements</string>
|
||||||
<string name="last_seen">last seen %1$s ago on %2$s</string>
|
<string name="last_seen_now">last seen %d ago</string>
|
||||||
|
<string name="last_seen_mins">last seen %d minutes ago</string>
|
||||||
|
<string name="last_seen_hours">last seen %d hours ago</string>
|
||||||
|
<string name="last_seen_days">last seen %d days ago</string>
|
||||||
<string name="never_seen">never seen</string>
|
<string name="never_seen">never seen</string>
|
||||||
</resources>
|
</resources>
|
|
@ -666,13 +666,7 @@ public class ConversationFragment extends Fragment {
|
||||||
}
|
}
|
||||||
if (activity.showLastseen()) {
|
if (activity.showLastseen()) {
|
||||||
Contact contact = conversation.getContact();
|
Contact contact = conversation.getContact();
|
||||||
if ((contact.lastseen.presence != null)&&(contact.lastseen.time != 0)) {
|
lastSeenText.setText(UIHelper.lastseen(getActivity(), contact.lastseen.time));
|
||||||
lastSeenText.setText(getString(R.string.last_seen,
|
|
||||||
UIHelper.lastseen(getActivity(), contact.lastseen.time),
|
|
||||||
contact.lastseen.presence));
|
|
||||||
} else {
|
|
||||||
lastSeenText.setText(R.string.never_seen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.messageList.clear();
|
this.messageList.clear();
|
||||||
this.messageList.addAll(this.conversation.getMessages());
|
this.messageList.addAll(this.conversation.getMessages());
|
||||||
|
|
|
@ -73,15 +73,18 @@ public class UIHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String lastseen(Context context, long time) {
|
public static String lastseen(Context context, long time) {
|
||||||
|
if (time==0) {
|
||||||
|
return context.getString(R.string.never_seen);
|
||||||
|
}
|
||||||
long difference = (System.currentTimeMillis() - time) / 1000;
|
long difference = (System.currentTimeMillis() - time) / 1000;
|
||||||
if (difference < 60) {
|
if (difference < 60) {
|
||||||
return context.getString(R.string.just_now);
|
return context.getString(R.string.just_now);
|
||||||
} else if (difference < 60 * 60) {
|
} else if (difference < 60 * 90) {
|
||||||
return difference / 60 + " " + context.getString(R.string.mins);
|
return context.getString(R.string.last_seen_mins,difference/60);
|
||||||
} else if (difference < 60 * 60 * 24) {
|
} else if (difference < 60 * 60 * 36) {
|
||||||
return difference / (60 * 60)+ " " + context.getString(R.string.hours);
|
return context.getString(R.string.last_seen_hours,difference/(60*60));
|
||||||
} else {
|
} else {
|
||||||
return "days";
|
return context.getString(R.string.last_seen_days,difference/(60*60*24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue