From 93eaec8544f66fe78eb647e446eb9614645c1095 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 10 Oct 2020 11:49:18 +0200 Subject: [PATCH] Fix some elements --- .../fedilabtube/drawer/PeertubeAdapter.java | 4 +- .../fragment/DisplayVideosFragment.java | 12 +++- .../layout/drawer_peertube_notification.xml | 66 ++++++++----------- 3 files changed, 38 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java index ed122f7..033ed51 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java @@ -94,7 +94,9 @@ public class PeertubeAdapter extends RecyclerView.Adapter uids = new ArrayList<>(); for (VideoData.Video video : apiResponse.getPeertubes()) { - uids.add(video.getChannel().getName() + "@" + video.getChannel().getHost()); + if( video != null) { + uids.add(video.getChannel().getName() + "@" + video.getChannel().getHost()); + } } if (uids.size() > 0 && !DisplayVideosFragment.this.isDetached()) { try { @@ -365,7 +367,9 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta List videoIds = new ArrayList<>(); for (VideoData.Video video : apiResponse.getPeertubes()) { - videoIds.add(video.getId()); + if( video != null) { + videoIds.add(video.getId()); + } } if (videoIds.size() > 0 && !DisplayVideosFragment.this.isDetached()) { try { @@ -387,7 +391,9 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta } playlists.putAll(apiResponse.getVideoExistPlaylist()); for (VideoData.Video video : peertubes) { - video.setPlaylistExists(playlists.get(video.getId())); + if( video != null) { + video.setPlaylistExists(playlists.get(video.getId())); + } } } diff --git a/app/src/main/res/layout/drawer_peertube_notification.xml b/app/src/main/res/layout/drawer_peertube_notification.xml index d2d0262..aadbbae 100644 --- a/app/src/main/res/layout/drawer_peertube_notification.xml +++ b/app/src/main/res/layout/drawer_peertube_notification.xml @@ -19,55 +19,41 @@ android:layout_height="wrap_content"> + android:orientation="horizontal"> + + + android:layout_marginBottom="10dp" + android:layout_weight="1" + android:orientation="vertical"> - - - + android:layout_gravity="center_vertical" + android:gravity="end" + android:textAlignment="viewEnd" /> - - - - + - -