Fix some elements
This commit is contained in:
parent
b089ae93e1
commit
93eaec8544
|
@ -94,7 +94,9 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||||
final PeertubeAdapter.ViewHolder holder = (PeertubeAdapter.ViewHolder) viewHolder;
|
final PeertubeAdapter.ViewHolder holder = (PeertubeAdapter.ViewHolder) viewHolder;
|
||||||
final VideoData.Video video = videos.get(position);
|
final VideoData.Video video = videos.get(position);
|
||||||
|
|
||||||
|
if( video == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, "");
|
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, "");
|
||||||
|
|
||||||
|
|
|
@ -353,8 +353,10 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
if (Helper.isLoggedIn(context)) {
|
if (Helper.isLoggedIn(context)) {
|
||||||
List<String> uids = new ArrayList<>();
|
List<String> uids = new ArrayList<>();
|
||||||
for (VideoData.Video video : apiResponse.getPeertubes()) {
|
for (VideoData.Video video : apiResponse.getPeertubes()) {
|
||||||
|
if( video != null) {
|
||||||
uids.add(video.getChannel().getName() + "@" + video.getChannel().getHost());
|
uids.add(video.getChannel().getName() + "@" + video.getChannel().getHost());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (uids.size() > 0 && !DisplayVideosFragment.this.isDetached()) {
|
if (uids.size() > 0 && !DisplayVideosFragment.this.isDetached()) {
|
||||||
try {
|
try {
|
||||||
RelationshipVM viewModel = new ViewModelProvider(this).get(RelationshipVM.class);
|
RelationshipVM viewModel = new ViewModelProvider(this).get(RelationshipVM.class);
|
||||||
|
@ -365,8 +367,10 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
|
|
||||||
List<String> videoIds = new ArrayList<>();
|
List<String> videoIds = new ArrayList<>();
|
||||||
for (VideoData.Video video : apiResponse.getPeertubes()) {
|
for (VideoData.Video video : apiResponse.getPeertubes()) {
|
||||||
|
if( video != null) {
|
||||||
videoIds.add(video.getId());
|
videoIds.add(video.getId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (videoIds.size() > 0 && !DisplayVideosFragment.this.isDetached()) {
|
if (videoIds.size() > 0 && !DisplayVideosFragment.this.isDetached()) {
|
||||||
try {
|
try {
|
||||||
PlaylistsVM viewModel = new ViewModelProvider(this).get(PlaylistsVM.class);
|
PlaylistsVM viewModel = new ViewModelProvider(this).get(PlaylistsVM.class);
|
||||||
|
@ -387,8 +391,10 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||||
}
|
}
|
||||||
playlists.putAll(apiResponse.getVideoExistPlaylist());
|
playlists.putAll(apiResponse.getVideoExistPlaylist());
|
||||||
for (VideoData.Video video : peertubes) {
|
for (VideoData.Video video : peertubes) {
|
||||||
|
if( video != null) {
|
||||||
video.setPlaylistExists(playlists.get(video.getId()));
|
video.setPlaylistExists(playlists.get(video.getId()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,19 +19,7 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:divider="?android:dividerHorizontal"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:showDividers="end">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -40,7 +28,8 @@
|
||||||
android:id="@+id/peertube_notif_pp"
|
android:id="@+id/peertube_notif_pp"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="top" />
|
android:layout_gravity="top"
|
||||||
|
android:contentDescription="@string/profile_picture" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -67,9 +56,6 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/container_trans"
|
android:id="@+id/container_trans"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue