Fix some weird behavior when clicking links in statuses (#2304)
* Fix some weird behavior when clicking links in statuses * open browser when user clicks a status link again
This commit is contained in:
parent
bf05c8a5d5
commit
8f5fb5b35c
5 changed files with 97 additions and 70 deletions
|
|
@ -60,6 +60,7 @@ import com.keylesspalace.tusky.network.FilterModel;
|
|||
import com.keylesspalace.tusky.network.MastodonApi;
|
||||
import com.keylesspalace.tusky.settings.PrefKeys;
|
||||
import com.keylesspalace.tusky.util.CardViewMode;
|
||||
import com.keylesspalace.tusky.util.LinkHelper;
|
||||
import com.keylesspalace.tusky.util.ListStatusAccessibilityDelegate;
|
||||
import com.keylesspalace.tusky.util.PairedList;
|
||||
import com.keylesspalace.tusky.util.StatusDisplayOptions;
|
||||
|
|
@ -319,6 +320,22 @@ public final class ViewThreadFragment extends SFragment implements
|
|||
super.viewThread(status.getActionableId(), status.getActionableStatus().getUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewUrl(String url) {
|
||||
Status status = null;
|
||||
if (!statuses.isEmpty()) {
|
||||
status = statuses.get(statusIndex);
|
||||
}
|
||||
if (status != null && status.getUrl().equals(url)) {
|
||||
// already viewing the status with this url
|
||||
// probably just a preview federated and the user is clicking again to view more -> open the browser
|
||||
// this can happen with some friendica statuses
|
||||
LinkHelper.openLink(url, requireContext());
|
||||
return;
|
||||
}
|
||||
super.onViewUrl(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpenReblog(int position) {
|
||||
// there should be no reblogs in the thread but let's implement it to be sure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue