2017-01-20 19:09:10 +11:00
|
|
|
/* Copyright 2017 Andrew Dawson
|
|
|
|
*
|
2017-04-10 10:12:31 +10:00
|
|
|
* This file is a part of Tusky.
|
2017-01-20 19:09:10 +11:00
|
|
|
*
|
2017-04-10 10:12:31 +10:00
|
|
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
2017-01-20 19:09:10 +11:00
|
|
|
*
|
|
|
|
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
2017-04-10 10:12:31 +10:00
|
|
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
|
|
* Public License for more details.
|
2017-01-20 19:09:10 +11:00
|
|
|
*
|
2017-04-10 10:12:31 +10:00
|
|
|
* You should have received a copy of the GNU General Public License along with Tusky; if not,
|
|
|
|
* see <http://www.gnu.org/licenses>. */
|
2017-01-20 19:09:10 +11:00
|
|
|
|
2017-05-05 08:55:34 +10:00
|
|
|
package com.keylesspalace.tusky.adapter;
|
2017-01-08 09:24:02 +11:00
|
|
|
|
|
|
|
import android.content.Context;
|
2017-07-14 15:06:32 +10:00
|
|
|
import android.graphics.Color;
|
|
|
|
import android.graphics.PorterDuff;
|
2017-03-08 06:42:01 +11:00
|
|
|
import android.graphics.Typeface;
|
2017-12-01 06:12:09 +11:00
|
|
|
import android.graphics.drawable.Drawable;
|
2018-12-18 01:25:35 +11:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
import androidx.core.text.BidiFormatter;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
import android.text.InputFilter;
|
2017-03-08 06:42:01 +11:00
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.text.Spanned;
|
2017-11-08 07:31:44 +11:00
|
|
|
import android.text.TextUtils;
|
2017-04-05 06:36:42 +10:00
|
|
|
import android.text.style.StyleSpan;
|
2017-01-08 09:24:02 +11:00
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
2017-11-08 07:31:44 +11:00
|
|
|
import android.widget.CompoundButton;
|
2017-01-23 16:19:30 +11:00
|
|
|
import android.widget.ImageView;
|
2017-01-08 09:24:02 +11:00
|
|
|
import android.widget.TextView;
|
2017-11-08 07:31:44 +11:00
|
|
|
import android.widget.ToggleButton;
|
2017-01-08 09:24:02 +11:00
|
|
|
|
2017-05-05 08:55:34 +10:00
|
|
|
import com.keylesspalace.tusky.R;
|
2018-07-01 23:57:26 +10:00
|
|
|
import com.keylesspalace.tusky.entity.Account;
|
2018-04-14 06:37:21 +10:00
|
|
|
import com.keylesspalace.tusky.entity.Emoji;
|
2017-03-09 10:27:37 +11:00
|
|
|
import com.keylesspalace.tusky.entity.Notification;
|
2017-12-01 06:12:09 +11:00
|
|
|
import com.keylesspalace.tusky.interfaces.LinkListener;
|
2017-05-05 08:55:34 +10:00
|
|
|
import com.keylesspalace.tusky.interfaces.StatusActionListener;
|
2017-12-01 06:12:09 +11:00
|
|
|
import com.keylesspalace.tusky.util.CustomEmojiHelper;
|
|
|
|
import com.keylesspalace.tusky.util.DateUtils;
|
|
|
|
import com.keylesspalace.tusky.util.LinkHelper;
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
import com.keylesspalace.tusky.util.SmartLengthInputFilter;
|
2017-07-13 05:54:52 +10:00
|
|
|
import com.keylesspalace.tusky.viewdata.NotificationViewData;
|
|
|
|
import com.keylesspalace.tusky.viewdata.StatusViewData;
|
2017-03-08 06:42:01 +11:00
|
|
|
import com.squareup.picasso.Picasso;
|
2017-02-27 12:14:13 +11:00
|
|
|
|
2018-08-17 00:10:21 +10:00
|
|
|
import java.text.SimpleDateFormat;
|
2017-01-08 09:24:02 +11:00
|
|
|
import java.util.ArrayList;
|
2017-12-01 06:12:09 +11:00
|
|
|
import java.util.Date;
|
2017-01-08 09:24:02 +11:00
|
|
|
import java.util.List;
|
2018-08-17 00:10:21 +10:00
|
|
|
import java.util.Locale;
|
2017-01-08 09:24:02 +11:00
|
|
|
|
2017-07-14 11:31:31 +10:00
|
|
|
public class NotificationsAdapter extends RecyclerView.Adapter {
|
2017-01-23 16:19:30 +11:00
|
|
|
private static final int VIEW_TYPE_MENTION = 0;
|
2018-09-01 05:52:09 +10:00
|
|
|
private static final int VIEW_TYPE_STATUS_NOTIFICATION = 1;
|
|
|
|
private static final int VIEW_TYPE_FOLLOW = 2;
|
|
|
|
private static final int VIEW_TYPE_PLACEHOLDER = 3;
|
2017-01-23 16:19:30 +11:00
|
|
|
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
private static final InputFilter[] COLLAPSE_INPUT_FILTER = new InputFilter[] { SmartLengthInputFilter.INSTANCE };
|
|
|
|
private static final InputFilter[] NO_INPUT_FILTER = new InputFilter[0];
|
|
|
|
|
2017-07-13 05:54:52 +10:00
|
|
|
private List<NotificationViewData> notifications;
|
2017-01-23 16:19:30 +11:00
|
|
|
private StatusActionListener statusListener;
|
2017-03-21 07:34:23 +11:00
|
|
|
private NotificationActionListener notificationActionListener;
|
2017-06-26 19:15:47 +10:00
|
|
|
private boolean mediaPreviewEnabled;
|
2018-08-17 12:53:38 +10:00
|
|
|
private boolean useAbsoluteTime;
|
2018-05-25 03:00:17 +10:00
|
|
|
private BidiFormatter bidiFormatter;
|
2017-01-23 16:19:30 +11:00
|
|
|
|
2017-05-05 08:55:34 +10:00
|
|
|
public NotificationsAdapter(StatusActionListener statusListener,
|
2017-07-13 05:54:52 +10:00
|
|
|
NotificationActionListener notificationActionListener) {
|
2017-01-23 16:19:30 +11:00
|
|
|
super();
|
|
|
|
notifications = new ArrayList<>();
|
|
|
|
this.statusListener = statusListener;
|
2017-03-21 07:34:23 +11:00
|
|
|
this.notificationActionListener = notificationActionListener;
|
2017-06-26 19:15:47 +10:00
|
|
|
mediaPreviewEnabled = true;
|
2018-08-17 12:53:38 +10:00
|
|
|
useAbsoluteTime = false;
|
2018-05-25 03:00:17 +10:00
|
|
|
bidiFormatter = BidiFormatter.getInstance();
|
2017-04-16 03:25:39 +10:00
|
|
|
}
|
|
|
|
|
2018-03-30 18:56:09 +11:00
|
|
|
@NonNull
|
2017-01-08 09:24:02 +11:00
|
|
|
@Override
|
2018-03-30 18:56:09 +11:00
|
|
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
2017-01-23 16:19:30 +11:00
|
|
|
switch (viewType) {
|
|
|
|
default:
|
|
|
|
case VIEW_TYPE_MENTION: {
|
|
|
|
View view = LayoutInflater.from(parent.getContext())
|
|
|
|
.inflate(R.layout.item_status, parent, false);
|
2018-08-17 12:53:38 +10:00
|
|
|
return new StatusViewHolder(view, useAbsoluteTime);
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
case VIEW_TYPE_STATUS_NOTIFICATION: {
|
|
|
|
View view = LayoutInflater.from(parent.getContext())
|
|
|
|
.inflate(R.layout.item_status_notification, parent, false);
|
2018-08-17 12:53:38 +10:00
|
|
|
return new StatusNotificationViewHolder(view, useAbsoluteTime);
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
case VIEW_TYPE_FOLLOW: {
|
|
|
|
View view = LayoutInflater.from(parent.getContext())
|
|
|
|
.inflate(R.layout.item_follow, parent, false);
|
|
|
|
return new FollowViewHolder(view);
|
|
|
|
}
|
2017-11-04 08:17:31 +11:00
|
|
|
case VIEW_TYPE_PLACEHOLDER: {
|
|
|
|
View view = LayoutInflater.from(parent.getContext())
|
|
|
|
.inflate(R.layout.item_status_placeholder, parent, false);
|
|
|
|
return new PlaceholderViewHolder(view);
|
|
|
|
}
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-03-30 18:56:09 +11:00
|
|
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
2017-01-23 16:19:30 +11:00
|
|
|
if (position < notifications.size()) {
|
2017-07-13 05:54:52 +10:00
|
|
|
NotificationViewData notification = notifications.get(position);
|
2017-11-06 03:11:00 +11:00
|
|
|
if (notification instanceof NotificationViewData.Placeholder) {
|
|
|
|
NotificationViewData.Placeholder placeholder = ((NotificationViewData.Placeholder) notification);
|
|
|
|
PlaceholderViewHolder holder = (PlaceholderViewHolder) viewHolder;
|
2018-08-23 05:18:56 +10:00
|
|
|
holder.setup(statusListener, placeholder.isLoading());
|
2017-11-06 03:11:00 +11:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
NotificationViewData.Concrete concreteNotificaton =
|
|
|
|
(NotificationViewData.Concrete) notification;
|
|
|
|
Notification.Type type = concreteNotificaton.getType();
|
2017-01-23 16:19:30 +11:00
|
|
|
switch (type) {
|
|
|
|
case MENTION: {
|
|
|
|
StatusViewHolder holder = (StatusViewHolder) viewHolder;
|
2017-11-07 02:19:15 +11:00
|
|
|
StatusViewData.Concrete status = concreteNotificaton.getStatusViewData();
|
2017-07-13 05:54:52 +10:00
|
|
|
holder.setupWithStatus(status,
|
|
|
|
statusListener, mediaPreviewEnabled);
|
2017-01-23 16:19:30 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FAVOURITE:
|
|
|
|
case REBLOG: {
|
|
|
|
StatusNotificationViewHolder holder = (StatusNotificationViewHolder) viewHolder;
|
2017-12-01 06:12:09 +11:00
|
|
|
StatusViewData.Concrete statusViewData = concreteNotificaton.getStatusViewData();
|
2018-03-02 07:10:10 +11:00
|
|
|
|
2018-08-17 12:53:38 +10:00
|
|
|
if (statusViewData == null) {
|
2018-03-02 07:10:10 +11:00
|
|
|
holder.showNotificationContent(false);
|
|
|
|
} else {
|
|
|
|
holder.showNotificationContent(true);
|
|
|
|
|
2018-06-24 17:53:23 +10:00
|
|
|
holder.setDisplayName(statusViewData.getUserFullName(), statusViewData.getAccountEmojis());
|
2018-03-02 07:10:10 +11:00
|
|
|
holder.setUsername(statusViewData.getNickname());
|
|
|
|
holder.setCreatedAt(statusViewData.getCreatedAt());
|
|
|
|
|
|
|
|
holder.setAvatars(concreteNotificaton.getStatusViewData().getAvatar(),
|
2018-03-03 23:24:03 +11:00
|
|
|
concreteNotificaton.getAccount().getAvatar());
|
2018-03-02 07:10:10 +11:00
|
|
|
}
|
2017-12-01 06:12:09 +11:00
|
|
|
|
2018-05-25 03:00:17 +10:00
|
|
|
holder.setMessage(concreteNotificaton, statusListener, bidiFormatter);
|
2017-11-08 06:36:19 +11:00
|
|
|
holder.setupButtons(notificationActionListener,
|
2018-03-03 23:24:03 +11:00
|
|
|
concreteNotificaton.getAccount().getId(),
|
2017-11-08 06:36:19 +11:00
|
|
|
concreteNotificaton.getId());
|
2017-01-23 16:19:30 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FOLLOW: {
|
|
|
|
FollowViewHolder holder = (FollowViewHolder) viewHolder;
|
2018-07-01 23:57:26 +10:00
|
|
|
holder.setMessage(concreteNotificaton.getAccount(), bidiFormatter);
|
2018-03-03 23:24:03 +11:00
|
|
|
holder.setupButtons(notificationActionListener, concreteNotificaton.getAccount().getId());
|
2017-11-04 08:17:31 +11:00
|
|
|
break;
|
|
|
|
}
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
}
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getItemCount() {
|
2018-08-23 05:18:56 +10:00
|
|
|
return notifications.size();
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
@Override
|
|
|
|
public int getItemViewType(int position) {
|
2018-09-01 05:52:09 +10:00
|
|
|
NotificationViewData notification = notifications.get(position);
|
|
|
|
if (notification instanceof NotificationViewData.Concrete) {
|
|
|
|
NotificationViewData.Concrete concrete = ((NotificationViewData.Concrete) notification);
|
|
|
|
switch (concrete.getType()) {
|
|
|
|
default:
|
|
|
|
case MENTION: {
|
|
|
|
return VIEW_TYPE_MENTION;
|
|
|
|
}
|
|
|
|
case FAVOURITE:
|
|
|
|
case REBLOG: {
|
|
|
|
return VIEW_TYPE_STATUS_NOTIFICATION;
|
|
|
|
}
|
|
|
|
case FOLLOW: {
|
|
|
|
return VIEW_TYPE_FOLLOW;
|
2017-11-04 08:17:31 +11:00
|
|
|
}
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
2018-09-01 05:52:09 +10:00
|
|
|
} else if (notification instanceof NotificationViewData.Placeholder) {
|
|
|
|
return VIEW_TYPE_PLACEHOLDER;
|
|
|
|
} else {
|
|
|
|
throw new AssertionError("Unknown notification type");
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
2018-09-01 05:52:09 +10:00
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
|
2017-07-13 05:54:52 +10:00
|
|
|
public void update(@Nullable List<NotificationViewData> newNotifications) {
|
2017-03-20 18:03:03 +11:00
|
|
|
if (newNotifications == null || newNotifications.isEmpty()) {
|
|
|
|
return;
|
|
|
|
}
|
2017-07-13 05:54:52 +10:00
|
|
|
notifications.clear();
|
|
|
|
notifications.addAll(newNotifications);
|
2017-01-08 09:24:02 +11:00
|
|
|
notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
|
2017-07-13 05:54:52 +10:00
|
|
|
public void updateItemWithNotify(int position, NotificationViewData notification,
|
|
|
|
boolean notifyAdapter) {
|
|
|
|
notifications.set(position, notification);
|
2017-12-02 08:13:47 +11:00
|
|
|
if (notifyAdapter) notifyItemChanged(position);
|
2017-06-30 16:31:58 +10:00
|
|
|
}
|
|
|
|
|
2017-07-14 11:31:31 +10:00
|
|
|
public void addItems(List<NotificationViewData> newNotifications) {
|
2017-07-13 05:54:52 +10:00
|
|
|
notifications.addAll(newNotifications);
|
|
|
|
notifyItemRangeInserted(notifications.size(), newNotifications.size());
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
|
2018-08-23 05:18:56 +10:00
|
|
|
public void removeItemAndNotify(int position) {
|
|
|
|
notifications.remove(position);
|
|
|
|
notifyItemRemoved(position);
|
|
|
|
}
|
|
|
|
|
2017-06-26 19:15:47 +10:00
|
|
|
public void clear() {
|
|
|
|
notifications.clear();
|
|
|
|
notifyDataSetChanged();
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
|
2017-06-26 19:15:47 +10:00
|
|
|
public void setMediaPreviewEnabled(boolean enabled) {
|
|
|
|
mediaPreviewEnabled = enabled;
|
|
|
|
}
|
|
|
|
|
2018-08-25 03:47:27 +10:00
|
|
|
public boolean isMediaPreviewEnabled() {
|
|
|
|
return mediaPreviewEnabled;
|
|
|
|
}
|
|
|
|
|
2018-08-17 12:53:38 +10:00
|
|
|
public void setUseAbsoluteTime(boolean useAbsoluteTime) {
|
|
|
|
this.useAbsoluteTime = useAbsoluteTime;
|
|
|
|
}
|
|
|
|
|
2017-05-05 08:55:34 +10:00
|
|
|
public interface NotificationActionListener {
|
2017-03-03 11:25:35 +11:00
|
|
|
void onViewAccount(String id);
|
2017-11-08 06:36:19 +11:00
|
|
|
|
|
|
|
void onViewStatusForNotificationId(String notificationId);
|
2017-12-01 06:12:09 +11:00
|
|
|
|
|
|
|
void onExpandedChange(boolean expanded, int position);
|
|
|
|
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
/**
|
|
|
|
* Called when the status {@link android.widget.ToggleButton} responsible for collapsing long
|
|
|
|
* status content is interacted with.
|
|
|
|
*
|
|
|
|
* @param isCollapsed Whether the status content is shown in a collapsed state or fully.
|
|
|
|
* @param position The position of the status in the list.
|
|
|
|
*/
|
|
|
|
void onNotificationContentCollapsedChange(boolean isCollapsed, int position);
|
2017-02-27 12:14:13 +11:00
|
|
|
}
|
|
|
|
|
2017-02-23 06:13:51 +11:00
|
|
|
private static class FollowViewHolder extends RecyclerView.ViewHolder {
|
2017-01-08 09:24:02 +11:00
|
|
|
private TextView message;
|
2017-02-27 12:14:13 +11:00
|
|
|
private TextView usernameView;
|
|
|
|
private TextView displayNameView;
|
2017-03-08 06:42:01 +11:00
|
|
|
private ImageView avatar;
|
2017-01-08 09:24:02 +11:00
|
|
|
|
2017-02-23 06:13:51 +11:00
|
|
|
FollowViewHolder(View itemView) {
|
2017-01-08 09:24:02 +11:00
|
|
|
super(itemView);
|
2017-10-18 09:20:26 +11:00
|
|
|
message = itemView.findViewById(R.id.notification_text);
|
|
|
|
usernameView = itemView.findViewById(R.id.notification_username);
|
|
|
|
displayNameView = itemView.findViewById(R.id.notification_display_name);
|
|
|
|
avatar = itemView.findViewById(R.id.notification_avatar);
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
|
2018-07-01 23:57:26 +10:00
|
|
|
void setMessage(Account account, BidiFormatter bidiFormatter) {
|
2017-01-08 09:24:02 +11:00
|
|
|
Context context = message.getContext();
|
2017-02-27 12:14:13 +11:00
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
String format = context.getString(R.string.notification_follow_format);
|
2018-07-01 23:57:26 +10:00
|
|
|
String wrappedDisplayName = bidiFormatter.unicodeWrap(account.getName());
|
2018-05-25 03:00:17 +10:00
|
|
|
String wholeMessage = String.format(format, wrappedDisplayName);
|
2018-07-01 23:57:26 +10:00
|
|
|
CharSequence emojifiedMessage = CustomEmojiHelper.emojifyString(wholeMessage, account.getEmojis(), message);
|
|
|
|
message.setText(emojifiedMessage);
|
2017-02-27 12:14:13 +11:00
|
|
|
|
2018-09-29 01:15:01 +10:00
|
|
|
String username = context.getString(R.string.status_username_format, account.getUsername());
|
2018-07-01 23:57:26 +10:00
|
|
|
usernameView.setText(username);
|
2017-02-27 12:14:13 +11:00
|
|
|
|
2018-07-01 23:57:26 +10:00
|
|
|
CharSequence emojifiedDisplayName = CustomEmojiHelper.emojifyString(wrappedDisplayName, account.getEmojis(), usernameView);
|
2017-02-27 12:14:13 +11:00
|
|
|
|
2018-07-01 23:57:26 +10:00
|
|
|
displayNameView.setText(emojifiedDisplayName);
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(account.getAvatar())) {
|
2018-01-16 03:06:21 +11:00
|
|
|
avatar.setImageResource(R.drawable.avatar_default);
|
|
|
|
} else {
|
|
|
|
Picasso.with(context)
|
2018-07-01 23:57:26 +10:00
|
|
|
.load(account.getAvatar())
|
2018-01-16 03:06:21 +11:00
|
|
|
.fit()
|
|
|
|
.placeholder(R.drawable.avatar_default)
|
|
|
|
.into(avatar);
|
|
|
|
}
|
2017-02-27 12:14:13 +11:00
|
|
|
}
|
|
|
|
|
2017-03-21 07:34:23 +11:00
|
|
|
void setupButtons(final NotificationActionListener listener, final String accountId) {
|
2017-12-02 22:22:52 +11:00
|
|
|
avatar.setOnClickListener(v -> listener.onViewAccount(accountId));
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-08 06:36:19 +11:00
|
|
|
private static class StatusNotificationViewHolder extends RecyclerView.ViewHolder
|
2017-11-08 07:31:44 +11:00
|
|
|
implements View.OnClickListener, ToggleButton.OnCheckedChangeListener {
|
2017-11-08 06:36:19 +11:00
|
|
|
private final TextView message;
|
2018-03-02 07:10:10 +11:00
|
|
|
private final View statusNameBar;
|
2017-12-01 06:12:09 +11:00
|
|
|
private final TextView displayName;
|
|
|
|
private final TextView username;
|
|
|
|
private final TextView timestampInfo;
|
2017-11-08 06:36:19 +11:00
|
|
|
private final TextView statusContent;
|
|
|
|
private final ImageView statusAvatar;
|
|
|
|
private final ImageView notificationAvatar;
|
2017-11-08 07:31:44 +11:00
|
|
|
private final TextView contentWarningDescriptionTextView;
|
|
|
|
private final ToggleButton contentWarningButton;
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
private final ToggleButton contentCollapseButton; // TODO: This code SHOULD be based on StatusBaseViewHolder
|
2017-11-08 06:36:19 +11:00
|
|
|
|
|
|
|
private String accountId;
|
|
|
|
private String notificationId;
|
2017-12-01 06:12:09 +11:00
|
|
|
private NotificationActionListener notificationActionListener;
|
2017-11-08 07:31:44 +11:00
|
|
|
private StatusViewData.Concrete statusViewData;
|
2017-01-23 16:19:30 +11:00
|
|
|
|
2018-08-17 12:53:38 +10:00
|
|
|
private boolean useAbsoluteTime;
|
2018-08-20 23:51:30 +10:00
|
|
|
private SimpleDateFormat shortSdf;
|
|
|
|
private SimpleDateFormat longSdf;
|
2018-08-17 12:53:38 +10:00
|
|
|
|
|
|
|
StatusNotificationViewHolder(View itemView, boolean useAbsoluteTime) {
|
2017-01-23 16:19:30 +11:00
|
|
|
super(itemView);
|
2017-12-01 06:12:09 +11:00
|
|
|
message = itemView.findViewById(R.id.notification_top_text);
|
2018-03-02 07:10:10 +11:00
|
|
|
statusNameBar = itemView.findViewById(R.id.status_name_bar);
|
2017-12-01 06:12:09 +11:00
|
|
|
displayName = itemView.findViewById(R.id.status_display_name);
|
|
|
|
username = itemView.findViewById(R.id.status_username);
|
|
|
|
timestampInfo = itemView.findViewById(R.id.status_timestamp_info);
|
2017-10-18 09:20:26 +11:00
|
|
|
statusContent = itemView.findViewById(R.id.notification_content);
|
|
|
|
statusAvatar = itemView.findViewById(R.id.notification_status_avatar);
|
|
|
|
notificationAvatar = itemView.findViewById(R.id.notification_notification_avatar);
|
2017-11-08 07:31:44 +11:00
|
|
|
contentWarningDescriptionTextView = itemView.findViewById(R.id.notification_content_warning_description);
|
|
|
|
contentWarningButton = itemView.findViewById(R.id.notification_content_warning_button);
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
contentCollapseButton = itemView.findViewById(R.id.button_toggle_notification_content);
|
2017-11-08 06:36:19 +11:00
|
|
|
|
2017-07-14 15:06:32 +10:00
|
|
|
int darkerFilter = Color.rgb(123, 123, 123);
|
|
|
|
statusAvatar.setColorFilter(darkerFilter, PorterDuff.Mode.MULTIPLY);
|
|
|
|
notificationAvatar.setColorFilter(darkerFilter, PorterDuff.Mode.MULTIPLY);
|
2017-11-08 06:36:19 +11:00
|
|
|
|
2018-09-29 01:15:01 +10:00
|
|
|
itemView.setOnClickListener(this);
|
2017-12-01 06:12:09 +11:00
|
|
|
message.setOnClickListener(this);
|
|
|
|
statusContent.setOnClickListener(this);
|
2017-11-08 07:31:44 +11:00
|
|
|
contentWarningButton.setOnCheckedChangeListener(this);
|
2018-08-17 12:53:38 +10:00
|
|
|
|
|
|
|
this.useAbsoluteTime = useAbsoluteTime;
|
2018-08-20 23:51:30 +10:00
|
|
|
shortSdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
|
|
|
longSdf = new SimpleDateFormat("MM/dd HH:mm:ss", Locale.getDefault());
|
2017-01-23 16:19:30 +11:00
|
|
|
}
|
|
|
|
|
2018-03-02 07:10:10 +11:00
|
|
|
private void showNotificationContent(boolean show) {
|
|
|
|
statusNameBar.setVisibility(show ? View.VISIBLE : View.GONE);
|
2018-03-16 05:15:12 +11:00
|
|
|
contentWarningDescriptionTextView.setVisibility(show ? View.VISIBLE : View.GONE);
|
|
|
|
contentWarningButton.setVisibility(show ? View.VISIBLE : View.GONE);
|
2018-03-02 07:10:10 +11:00
|
|
|
statusContent.setVisibility(show ? View.VISIBLE : View.GONE);
|
|
|
|
statusAvatar.setVisibility(show ? View.VISIBLE : View.GONE);
|
|
|
|
notificationAvatar.setVisibility(show ? View.VISIBLE : View.GONE);
|
|
|
|
}
|
|
|
|
|
2018-06-24 17:53:23 +10:00
|
|
|
private void setDisplayName(String name, List<Emoji> emojis) {
|
|
|
|
CharSequence emojifiedName = CustomEmojiHelper.emojifyString(name, emojis, displayName);
|
|
|
|
displayName.setText(emojifiedName);
|
2017-12-01 06:12:09 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
private void setUsername(String name) {
|
|
|
|
Context context = username.getContext();
|
|
|
|
String format = context.getString(R.string.status_username_format);
|
|
|
|
String usernameText = String.format(format, name);
|
|
|
|
username.setText(usernameText);
|
|
|
|
}
|
|
|
|
|
2018-08-17 00:10:21 +10:00
|
|
|
protected void setCreatedAt(@Nullable Date createdAt) {
|
2018-08-17 12:53:38 +10:00
|
|
|
if (useAbsoluteTime) {
|
2018-08-20 18:47:19 +10:00
|
|
|
String time;
|
2018-08-17 00:10:21 +10:00
|
|
|
if (createdAt != null) {
|
2018-08-20 23:51:30 +10:00
|
|
|
if (System.currentTimeMillis() - createdAt.getTime() > 86400000L) {
|
|
|
|
time = longSdf.format(createdAt);
|
|
|
|
} else {
|
|
|
|
time = shortSdf.format(createdAt);
|
2018-08-17 00:10:21 +10:00
|
|
|
}
|
2018-08-20 20:29:58 +10:00
|
|
|
} else {
|
|
|
|
time = "??:??:??";
|
2018-08-17 00:10:21 +10:00
|
|
|
}
|
2018-08-20 20:29:58 +10:00
|
|
|
timestampInfo.setText(time);
|
2017-12-01 06:12:09 +11:00
|
|
|
} else {
|
2018-08-17 00:10:21 +10:00
|
|
|
// This is the visible timestampInfo.
|
|
|
|
String readout;
|
|
|
|
/* This one is for screen-readers. Frequently, they would mispronounce timestamps like "17m"
|
|
|
|
* as 17 meters instead of minutes. */
|
|
|
|
CharSequence readoutAloud;
|
|
|
|
if (createdAt != null) {
|
|
|
|
long then = createdAt.getTime();
|
|
|
|
long now = new Date().getTime();
|
|
|
|
readout = DateUtils.getRelativeTimeSpanString(timestampInfo.getContext(), then, now);
|
|
|
|
readoutAloud = android.text.format.DateUtils.getRelativeTimeSpanString(then, now,
|
|
|
|
android.text.format.DateUtils.SECOND_IN_MILLIS,
|
|
|
|
android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE);
|
|
|
|
} else {
|
|
|
|
// unknown minutes~
|
|
|
|
readout = "?m";
|
|
|
|
readoutAloud = "? minutes";
|
|
|
|
}
|
|
|
|
timestampInfo.setText(readout);
|
|
|
|
timestampInfo.setContentDescription(readoutAloud);
|
2017-12-01 06:12:09 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-25 03:00:17 +10:00
|
|
|
void setMessage(NotificationViewData.Concrete notificationViewData, LinkListener listener, BidiFormatter bidiFormatter) {
|
2017-12-01 06:12:09 +11:00
|
|
|
this.statusViewData = notificationViewData.getStatusViewData();
|
|
|
|
|
2018-05-25 03:00:17 +10:00
|
|
|
String displayName = bidiFormatter.unicodeWrap(notificationViewData.getAccount().getName());
|
2017-12-01 06:12:09 +11:00
|
|
|
Notification.Type type = notificationViewData.getType();
|
2017-11-08 07:31:44 +11:00
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
Context context = message.getContext();
|
|
|
|
String format;
|
2017-12-01 06:12:09 +11:00
|
|
|
Drawable icon;
|
2017-01-08 09:24:02 +11:00
|
|
|
switch (type) {
|
2017-01-23 16:19:30 +11:00
|
|
|
default:
|
2017-01-08 09:24:02 +11:00
|
|
|
case FAVOURITE: {
|
2017-12-01 06:12:09 +11:00
|
|
|
icon = ContextCompat.getDrawable(context, R.drawable.ic_star_24dp);
|
|
|
|
if (icon != null) {
|
|
|
|
icon.setColorFilter(ContextCompat.getColor(context,
|
2018-12-18 01:25:35 +11:00
|
|
|
R.color.tusky_orange), PorterDuff.Mode.SRC_ATOP);
|
2017-12-01 06:12:09 +11:00
|
|
|
}
|
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
format = context.getString(R.string.notification_favourite_format);
|
2017-01-08 09:24:02 +11:00
|
|
|
break;
|
|
|
|
}
|
2017-01-23 16:19:30 +11:00
|
|
|
case REBLOG: {
|
2017-12-01 06:12:09 +11:00
|
|
|
icon = ContextCompat.getDrawable(context, R.drawable.ic_repeat_24dp);
|
2018-08-17 12:53:38 +10:00
|
|
|
if (icon != null) {
|
2017-12-01 06:12:09 +11:00
|
|
|
icon.setColorFilter(ContextCompat.getColor(context,
|
2018-12-18 01:25:35 +11:00
|
|
|
R.color.tusky_blue), PorterDuff.Mode.SRC_ATOP);
|
2017-12-01 06:12:09 +11:00
|
|
|
}
|
|
|
|
|
2017-01-23 16:19:30 +11:00
|
|
|
format = context.getString(R.string.notification_reblog_format);
|
2017-01-08 09:24:02 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-12-01 06:12:09 +11:00
|
|
|
message.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
|
2017-01-23 16:19:30 +11:00
|
|
|
String wholeMessage = String.format(format, displayName);
|
2017-03-08 06:42:01 +11:00
|
|
|
final SpannableStringBuilder str = new SpannableStringBuilder(wholeMessage);
|
2017-04-05 06:36:42 +10:00
|
|
|
str.setSpan(new StyleSpan(Typeface.BOLD), 0, displayName.length(),
|
2017-03-08 14:11:03 +11:00
|
|
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
2018-07-01 22:44:38 +10:00
|
|
|
CharSequence emojifiedText = CustomEmojiHelper.emojifyText(str, notificationViewData.getAccount().getEmojis(), message);
|
|
|
|
message.setText(emojifiedText);
|
2017-11-08 07:31:44 +11:00
|
|
|
|
2018-03-02 07:10:10 +11:00
|
|
|
if (statusViewData != null) {
|
|
|
|
boolean hasSpoiler = !TextUtils.isEmpty(statusViewData.getSpoilerText());
|
2018-03-16 05:15:12 +11:00
|
|
|
contentWarningDescriptionTextView.setVisibility(hasSpoiler ? View.VISIBLE : View.GONE);
|
|
|
|
contentWarningButton.setVisibility(hasSpoiler ? View.VISIBLE : View.GONE);
|
2018-03-02 07:10:10 +11:00
|
|
|
setupContentAndSpoiler(notificationViewData, listener);
|
|
|
|
}
|
|
|
|
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
2017-03-21 07:34:23 +11:00
|
|
|
|
2017-11-08 06:36:19 +11:00
|
|
|
void setupButtons(final NotificationActionListener listener, final String accountId,
|
|
|
|
final String notificationId) {
|
2017-12-01 06:12:09 +11:00
|
|
|
this.notificationActionListener = listener;
|
2017-11-08 06:36:19 +11:00
|
|
|
this.accountId = accountId;
|
|
|
|
this.notificationId = notificationId;
|
2017-03-21 07:34:23 +11:00
|
|
|
}
|
2017-07-14 15:06:32 +10:00
|
|
|
|
|
|
|
void setAvatars(@Nullable String statusAvatarUrl, @Nullable String notificationAvatarUrl) {
|
|
|
|
Context context = statusAvatar.getContext();
|
|
|
|
|
2018-01-16 03:06:21 +11:00
|
|
|
if (TextUtils.isEmpty(statusAvatarUrl)) {
|
2017-07-14 15:06:32 +10:00
|
|
|
statusAvatar.setImageResource(R.drawable.avatar_default);
|
|
|
|
} else {
|
|
|
|
Picasso.with(context)
|
|
|
|
.load(statusAvatarUrl)
|
|
|
|
.placeholder(R.drawable.avatar_default)
|
|
|
|
.into(statusAvatar);
|
|
|
|
}
|
|
|
|
|
2018-01-16 03:06:21 +11:00
|
|
|
if (TextUtils.isEmpty(notificationAvatarUrl)) {
|
2017-12-01 06:12:09 +11:00
|
|
|
notificationAvatar.setImageResource(R.drawable.avatar_default);
|
2017-07-14 15:06:32 +10:00
|
|
|
} else {
|
|
|
|
Picasso.with(context)
|
|
|
|
.load(notificationAvatarUrl)
|
2017-12-01 06:12:09 +11:00
|
|
|
.placeholder(R.drawable.avatar_default)
|
2017-07-14 15:06:32 +10:00
|
|
|
.fit()
|
|
|
|
.into(notificationAvatar);
|
|
|
|
}
|
|
|
|
}
|
2017-11-08 06:36:19 +11:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
switch (v.getId()) {
|
|
|
|
case R.id.notification_container:
|
2017-12-01 06:12:09 +11:00
|
|
|
case R.id.notification_content:
|
2018-08-17 12:53:38 +10:00
|
|
|
if (notificationActionListener != null)
|
|
|
|
notificationActionListener.onViewStatusForNotificationId(notificationId);
|
2017-11-08 06:36:19 +11:00
|
|
|
break;
|
2017-12-01 06:12:09 +11:00
|
|
|
case R.id.notification_top_text:
|
2018-08-17 12:53:38 +10:00
|
|
|
if (notificationActionListener != null)
|
|
|
|
notificationActionListener.onViewAccount(accountId);
|
2017-11-08 06:36:19 +11:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-11-08 07:31:44 +11:00
|
|
|
|
2017-12-01 06:12:09 +11:00
|
|
|
private void setupContentAndSpoiler(NotificationViewData.Concrete notificationViewData, final LinkListener listener) {
|
|
|
|
|
|
|
|
boolean shouldShowContentIfSpoiler = notificationViewData.isExpanded();
|
2017-11-08 07:31:44 +11:00
|
|
|
boolean hasSpoiler = !TextUtils.isEmpty(statusViewData.getSpoilerText());
|
|
|
|
if (!shouldShowContentIfSpoiler && hasSpoiler) {
|
2017-12-01 06:12:09 +11:00
|
|
|
statusContent.setVisibility(View.GONE);
|
2017-11-08 07:31:44 +11:00
|
|
|
} else {
|
2017-12-01 06:12:09 +11:00
|
|
|
statusContent.setVisibility(View.VISIBLE);
|
2017-11-08 07:31:44 +11:00
|
|
|
}
|
2017-12-01 06:12:09 +11:00
|
|
|
|
|
|
|
Spanned content = statusViewData.getContent();
|
2018-06-24 17:53:23 +10:00
|
|
|
List<Emoji> emojis = statusViewData.getStatusEmojis();
|
2017-12-01 06:12:09 +11:00
|
|
|
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
if (statusViewData.isCollapsible() && (notificationViewData.isExpanded() || !hasSpoiler)) {
|
|
|
|
contentCollapseButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
|
|
int position = getAdapterPosition();
|
|
|
|
if (position != RecyclerView.NO_POSITION && notificationActionListener != null) {
|
|
|
|
notificationActionListener.onNotificationContentCollapsedChange(isChecked, position);
|
|
|
|
}
|
|
|
|
});
|
2017-12-01 06:12:09 +11:00
|
|
|
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
contentCollapseButton.setVisibility(View.VISIBLE);
|
|
|
|
if (statusViewData.isCollapsed()) {
|
|
|
|
contentCollapseButton.setChecked(true);
|
|
|
|
statusContent.setFilters(COLLAPSE_INPUT_FILTER);
|
|
|
|
} else {
|
|
|
|
contentCollapseButton.setChecked(false);
|
|
|
|
statusContent.setFilters(NO_INPUT_FILTER);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
contentCollapseButton.setVisibility(View.GONE);
|
|
|
|
statusContent.setFilters(NO_INPUT_FILTER);
|
|
|
|
}
|
2017-12-01 06:12:09 +11:00
|
|
|
|
Add support for collapsible statuses when they exceed 500 characters (#825)
* Update Gradle plugin to work with Android Studio 3.3 Canary
Android Studio 3.1.4 Stable doesn't render layout previews in this project
for whatever reason. Switching to the latest 3.3 Canary release fixes the
issue without affecting Gradle scripts but requires the new Android Gradle
plugin to match the new Android Studio release.
This commit will be reverted once development on the feature is done.
* Update gradle build script to allow installing debug builds alongside store version
This will allow developers, testers, etc to work on Tusky will not having to worry
about overwriting, uninstalling, fiddling with a preinstalled application which would
mean having to login again every time the development cycle starts/finishes and
manually reinstalling the app.
* Add UI changes to support collapsing statuses
The button uses subtle styling to not be distracting like the CW button on the timeline
The button is toggleable, full width to match the status textbox hitbox width and also
is shorter to not be too intrusive between the status text and images, or the post below
* Update status data model to store whether the message has been collapsed
* Update status action listener to notify of collapsed state changing
Provide stubs in all implementing classes and mark as TODO the stubs that
require a proper implementation for the feature to work.
* Add implementation code to handle status collapse/expand in timeline
Code has not been added elsewhere to simplify testing.
Once the code will be considered stable it will be also included in other
status action listener implementers.
* Add preferences so that users can toggle the collapsing of long posts
This is currently limited to a simple toggle, it would be nice to implement
a more advanced UI to offer the user more control over the feature.
* Update Gradle plugin to work with latest Android Studio 3.3 Canary 8
Just like the other commit, this will be reverted once the feature is working.
I simply don't want to deal with what changes in my installation of Android
Studio 3.1.4 Stable which breaks the layout preview rendering.
* Update data models and utils for statuses to better handle collapsing
I forgot that data isn't available from the API and can't really be built
from scratch using existing data due to preferences.
A new, extra boolean should fix the issue.
* Fix search breaking due to newly introduced variables in utils classes
* Fix timeline breaking due to newly introduced variables in utils classes
* Fix item status text for collapsed toggle being shown in the wrong state
* Update timeline fragment to refresh the list when collapsed settings change
* Add support for status content collapse in timeline viewholder
* Fix view holder truncating posts using temporary debug settings at 50 chars
* Add toggle support to notification layout as well
* Add support for collapsed statuses to search results
* Add support for expandable content to notifications too
* Update codebase with some suggested changes by @charlang
* Update more code with more suggestions and move null-safety into view data
* Update even more code with even more suggested code changes
* Revert a0a41ca and 0ee004d (Android Studio 3.1 to Android Studio 3.3 updates)
* Add an input filter utility class to reuse code for trimming statuses
* Update UI of statuses to show a taller collapsible button
* Update notification fragment logging to simplify null checks
* Add smartness to SmartLengthInputFilter such as word trimming and runway
* Fix posts with show more button even if bad ratio didn't collapse
* Fix thread view showing button but not collapsing by implementing the feature
* Fix spannable losing spans when collapsed and restore length to 500 characters
* Remove debug build suffix as per request
* Fix all the merging happened in f66d689, 623cad2 and 7056ba5
* Fix notification button spanning full width rather than content width
* Add a way to access a singleton to smart filter and use clearer code
* Update view holders using smart input filters to use more singletons
* Fix code style lacking spaces before boolean checks in ifs and others
* Remove all code related to collapsibility preferences, strings included
* Update style to match content warning toggle button
* Update strings to give cleaner differentiation between CW and collapse
* Update smart filter code to use fully qualified names to avoid confusion
2018-09-20 03:51:20 +10:00
|
|
|
Spanned emojifiedText = CustomEmojiHelper.emojifyText(content, emojis, statusContent);
|
|
|
|
LinkHelper.setClickableText(statusContent, emojifiedText, statusViewData.getMentions(), listener);
|
2017-12-01 06:12:09 +11:00
|
|
|
|
|
|
|
Spanned emojifiedContentWarning =
|
2018-06-24 17:53:23 +10:00
|
|
|
CustomEmojiHelper.emojifyString(statusViewData.getSpoilerText(), statusViewData.getStatusEmojis(), contentWarningDescriptionTextView);
|
2017-12-01 06:12:09 +11:00
|
|
|
contentWarningDescriptionTextView.setText(emojifiedContentWarning);
|
2017-11-08 07:31:44 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
2017-12-01 06:12:09 +11:00
|
|
|
if (getAdapterPosition() != RecyclerView.NO_POSITION) {
|
|
|
|
notificationActionListener.onExpandedChange(isChecked, getAdapterPosition());
|
|
|
|
}
|
2018-09-29 01:15:01 +10:00
|
|
|
statusContent.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
2017-11-08 07:31:44 +11:00
|
|
|
}
|
2017-01-08 09:24:02 +11:00
|
|
|
}
|
|
|
|
}
|