From d6f1a360d20553481b68fc5a43d3f438ce195b6c Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 3 Jan 2021 16:05:47 +0100 Subject: [PATCH] Release notes --- app/build.gradle | 4 +-- .../fedilab/fedilabtube/PeertubeActivity.java | 34 +++++++++++++------ .../drawer/OwnAccountsAdapter.java | 7 +++- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e95e354..2a0cf72 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { minSdkVersion 21 targetSdkVersion 30 - versionCode 33 - versionName "1.10.2" + versionCode 34 + versionName "1.11.0" multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index fa3b6a0..98e9060 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -375,6 +375,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd binding.peertubeReblog.setVisibility(View.VISIBLE); binding.peertubeFavorite.setVisibility(View.VISIBLE); binding.peertubeBookmark.setVisibility(View.VISIBLE); + } else { + binding.peertubePlaylist.setVisibility(View.VISIBLE); } binding.peertubeDescriptionMore.setOnClickListener(v -> { @@ -721,7 +723,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd if (autoFullscreen && autoPlay) { openFullscreenDialog(); } - binding.peertubePlaylist.setVisibility(View.VISIBLE); + TimelineVM feedsViewModel = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class); if (!isRemote) { feedsViewModel.getVideo(sepiaSearch ? peertubeInstance : null, videoUuid, isMyVideo).observe(PeertubeActivity.this, this::manageVIewVideo); @@ -1222,21 +1224,33 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd initResolution(); binding.peertubeReblog.setOnClickListener(v -> { - MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); - RetrofitMastodonAPI.actionType type = status.isReblogged() ? RetrofitMastodonAPI.actionType.UNBOOST : RetrofitMastodonAPI.actionType.BOOST; - mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + if (status != null) { + MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); + RetrofitMastodonAPI.actionType type = status.isReblogged() ? RetrofitMastodonAPI.actionType.UNBOOST : RetrofitMastodonAPI.actionType.BOOST; + mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + } else { + Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show(); + } }); binding.peertubeFavorite.setOnClickListener(v -> { - MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); - RetrofitMastodonAPI.actionType type = status.isFavourited() ? RetrofitMastodonAPI.actionType.UNFAVOURITE : RetrofitMastodonAPI.actionType.FAVOURITE; - mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + if (status != null) { + MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); + RetrofitMastodonAPI.actionType type = status.isFavourited() ? RetrofitMastodonAPI.actionType.UNFAVOURITE : RetrofitMastodonAPI.actionType.FAVOURITE; + mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + } else { + Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show(); + } }); binding.peertubeBookmark.setOnClickListener(v -> { - MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); - RetrofitMastodonAPI.actionType type = status.isBookmarked() ? RetrofitMastodonAPI.actionType.UNBOOKMARK : RetrofitMastodonAPI.actionType.BOOKMARK; - mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + if (status != null) { + MastodonPostActionsVM mastodonPostActionsVM = new ViewModelProvider(PeertubeActivity.this).get(MastodonPostActionsVM.class); + RetrofitMastodonAPI.actionType type = status.isBookmarked() ? RetrofitMastodonAPI.actionType.UNBOOKMARK : RetrofitMastodonAPI.actionType.BOOKMARK; + mastodonPostActionsVM.post(type, status).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon); + } else { + Toasty.error(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_LONG).show(); + } }); binding.peertubeLikeCount.setOnClickListener(v -> { diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/OwnAccountsAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/OwnAccountsAdapter.java index 2e6d284..00c52bc 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/OwnAccountsAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/OwnAccountsAdapter.java @@ -79,7 +79,12 @@ public class OwnAccountsAdapter extends ArrayAdapter { holder.account_un.setText(String.format("@%s", account.getAcct())); //Profile picture - Helper.loadGiF(holder.account_pp.getContext(), "https://" + account.getHost() + account.getAvatar().getPath(), holder.account_pp); + if (account.getAvatar() != null && account.getAvatar().getPath().startsWith("http")) { + Helper.loadGiF(holder.account_pp.getContext(), account.getAvatar().getPath(), holder.account_pp); + } else { + Helper.loadGiF(holder.account_pp.getContext(), "https://" + account.getHost() + account.getAvatar().getPath(), holder.account_pp); + } + return convertView; }