ClassCastException fix.
This commit is contained in:
parent
77179a7fd8
commit
5f456cff7a
|
@ -2,22 +2,23 @@ package org.schabi.newpipe.info_list.holder;
|
|||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
|
||||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
import org.schabi.newpipe.info_list.InfoItemBuilder;
|
||||
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
||||
import org.schabi.newpipe.util.PicassoHelper;
|
||||
import org.schabi.newpipe.util.Localization;
|
||||
import org.schabi.newpipe.util.PicassoHelper;
|
||||
|
||||
public class ChannelMiniInfoItemHolder extends InfoItemHolder {
|
||||
private final ImageView itemThumbnailView;
|
||||
private final ShapeableImageView itemThumbnailView;
|
||||
private final TextView itemTitleView;
|
||||
private final TextView itemAdditionalDetailView;
|
||||
private final TextView itemChannelDescriptionView;
|
||||
|
@ -89,6 +90,7 @@ public class ChannelMiniInfoItemHolder extends InfoItemHolder {
|
|||
|
||||
/**
|
||||
* Returns max number of allowed lines for the description field.
|
||||
*
|
||||
* @param content additional detail content (video / sub count)
|
||||
* @return max line count
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.text.style.URLSpan;
|
|||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -17,6 +16,8 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.error.ErrorUtil;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
|
@ -54,15 +55,18 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
|
|||
private final float ellipsisWidthPx;
|
||||
|
||||
private final RelativeLayout itemRoot;
|
||||
private final ImageView itemThumbnailView;
|
||||
private final ShapeableImageView itemThumbnailView;
|
||||
private final TextView itemContentView;
|
||||
private final TextView itemLikesCountView;
|
||||
private final TextView itemPublishedTime;
|
||||
|
||||
private final CompositeDisposable disposables = new CompositeDisposable();
|
||||
@Nullable private Description commentText;
|
||||
@Nullable private StreamingService streamService;
|
||||
@Nullable private String streamUrl;
|
||||
@Nullable
|
||||
private Description commentText;
|
||||
@Nullable
|
||||
private StreamingService streamService;
|
||||
@Nullable
|
||||
private String streamUrl;
|
||||
|
||||
CommentsMiniInfoItemHolder(final InfoItemBuilder infoItemBuilder, final int layoutId,
|
||||
final ViewGroup parent) {
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
package org.schabi.newpipe.info_list.holder;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem;
|
||||
import org.schabi.newpipe.info_list.InfoItemBuilder;
|
||||
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
||||
import org.schabi.newpipe.util.PicassoHelper;
|
||||
import org.schabi.newpipe.util.Localization;
|
||||
import org.schabi.newpipe.util.PicassoHelper;
|
||||
|
||||
public class PlaylistMiniInfoItemHolder extends InfoItemHolder {
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
private final TextView itemStreamCountView;
|
||||
public final TextView itemTitleView;
|
||||
public final TextView itemUploaderView;
|
||||
|
|
|
@ -2,11 +2,12 @@ package org.schabi.newpipe.info_list.holder;
|
|||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.stream.model.StreamStateEntity;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
|
@ -23,7 +24,7 @@ import org.schabi.newpipe.views.AnimatedProgressBar;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class StreamMiniInfoItemHolder extends InfoItemHolder {
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
public final TextView itemVideoTitleView;
|
||||
public final TextView itemUploaderView;
|
||||
public final TextView itemDurationView;
|
||||
|
|
|
@ -3,11 +3,12 @@ package org.schabi.newpipe.local.holder;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.LocalItem;
|
||||
import org.schabi.newpipe.database.playlist.PlaylistStreamEntry;
|
||||
|
@ -24,7 +25,7 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class LocalPlaylistStreamItemHolder extends LocalItemHolder {
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
public final TextView itemVideoTitleView;
|
||||
private final TextView itemAdditionalDetailsView;
|
||||
public final TextView itemDurationView;
|
||||
|
|
|
@ -2,12 +2,13 @@ package org.schabi.newpipe.local.holder;
|
|||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.LocalItem;
|
||||
import org.schabi.newpipe.database.stream.StreamStatisticsEntry;
|
||||
|
@ -44,7 +45,7 @@ import java.util.concurrent.TimeUnit;
|
|||
*/
|
||||
|
||||
public class LocalStatisticStreamItemHolder extends LocalItemHolder {
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
public final TextView itemVideoTitleView;
|
||||
public final TextView itemUploaderView;
|
||||
public final TextView itemDurationView;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package org.schabi.newpipe.local.holder;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.LocalItem;
|
||||
import org.schabi.newpipe.local.LocalItemBuilder;
|
||||
|
@ -12,7 +13,7 @@ import org.schabi.newpipe.local.history.HistoryRecordManager;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public abstract class PlaylistItemHolder extends LocalItemHolder {
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
final TextView itemStreamCountView;
|
||||
public final TextView itemTitleView;
|
||||
public final TextView itemUploaderView;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.schabi.newpipe.local.subscription.item
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.google.android.material.imageview.ShapeableImageView
|
||||
import com.xwray.groupie.GroupieViewHolder
|
||||
import com.xwray.groupie.Item
|
||||
import org.schabi.newpipe.R
|
||||
|
@ -29,9 +29,12 @@ class ChannelItem(
|
|||
|
||||
override fun bind(viewHolder: GroupieViewHolder, position: Int) {
|
||||
val itemTitleView = viewHolder.root.findViewById<TextView>(R.id.itemTitleView)
|
||||
val itemAdditionalDetails = viewHolder.root.findViewById<TextView>(R.id.itemAdditionalDetails)
|
||||
val itemChannelDescriptionView = viewHolder.root.findViewById<TextView>(R.id.itemChannelDescriptionView)
|
||||
val itemThumbnailView = viewHolder.root.findViewById<ImageView>(R.id.itemThumbnailView)
|
||||
val itemAdditionalDetails =
|
||||
viewHolder.root.findViewById<TextView>(R.id.itemAdditionalDetails)
|
||||
val itemChannelDescriptionView =
|
||||
viewHolder.root.findViewById<TextView>(R.id.itemChannelDescriptionView)
|
||||
val itemThumbnailView =
|
||||
viewHolder.root.findViewById<ShapeableImageView>(R.id.itemThumbnailView)
|
||||
|
||||
itemTitleView.text = infoItem.name
|
||||
itemAdditionalDetails.text = getDetailLine(viewHolder.root.context)
|
||||
|
@ -55,7 +58,8 @@ class ChannelItem(
|
|||
}
|
||||
|
||||
if (itemVersion == ItemVersion.NORMAL && infoItem.streamCount >= 0) {
|
||||
val formattedVideoAmount = Localization.localizeStreamCount(context, infoItem.streamCount)
|
||||
val formattedVideoAmount =
|
||||
Localization.localizeStreamCount(context, infoItem.streamCount)
|
||||
details = Localization.concatenateStrings(details, formattedVideoAmount)
|
||||
}
|
||||
return details
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
|
||||
/**
|
||||
|
@ -37,7 +39,7 @@ public class PlayQueueItemHolder extends RecyclerView.ViewHolder {
|
|||
public final TextView itemDurationView;
|
||||
final TextView itemAdditionalDetailsView;
|
||||
|
||||
public final ImageView itemThumbnailView;
|
||||
public final ShapeableImageView itemThumbnailView;
|
||||
final ImageView itemHandle;
|
||||
|
||||
public final View itemRoot;
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.os.Bundle;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -15,6 +14,8 @@ import androidx.fragment.app.DialogFragment;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.subscription.SubscriptionEntity;
|
||||
import org.schabi.newpipe.error.ErrorUtil;
|
||||
|
@ -200,7 +201,7 @@ public class SelectChannelFragment extends DialogFragment {
|
|||
|
||||
public class SelectChannelItemHolder extends RecyclerView.ViewHolder {
|
||||
public final View view;
|
||||
final ImageView thumbnailView;
|
||||
final ShapeableImageView thumbnailView;
|
||||
final TextView titleView;
|
||||
SelectChannelItemHolder(final View v) {
|
||||
super(v);
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.os.Bundle;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -14,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.error.ErrorUtil;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
|
@ -151,7 +152,7 @@ public class SelectKioskFragment extends DialogFragment {
|
|||
|
||||
public class SelectKioskItemHolder extends RecyclerView.ViewHolder {
|
||||
public final View view;
|
||||
final ImageView thumbnailView;
|
||||
final ShapeableImageView thumbnailView;
|
||||
final TextView titleView;
|
||||
|
||||
SelectKioskItemHolder(final View v) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.os.Bundle;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -13,6 +12,8 @@ import androidx.fragment.app.DialogFragment;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
|
||||
import org.schabi.newpipe.NewPipeDatabase;
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.database.AppDatabase;
|
||||
|
@ -178,7 +179,7 @@ public class SelectPlaylistFragment extends DialogFragment {
|
|||
|
||||
public class SelectPlaylistItemHolder extends RecyclerView.ViewHolder {
|
||||
public final View view;
|
||||
final ImageView thumbnailView;
|
||||
final ShapeableImageView thumbnailView;
|
||||
final TextView titleView;
|
||||
|
||||
SelectPlaylistItemHolder(final View v) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/channel_item_description_to_details_margin"
|
||||
android:layout_toRightOf="@+id/itemThumbnailView"
|
||||
android:layout_toRightOf="@id/itemThumbnailView"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textSize="@dimen/comment_item_content_text_size"
|
||||
tools:text="Channel description, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" />
|
||||
|
@ -37,7 +37,7 @@
|
|||
android:layout_width="@dimen/video_item_detail_like_image_width"
|
||||
android:layout_height="@dimen/video_item_detail_like_image_height"
|
||||
android:layout_below="@id/itemCommentContentView"
|
||||
android:layout_toRightOf="@+id/itemThumbnailView"
|
||||
android:layout_toRightOf="@id/itemThumbnailView"
|
||||
android:contentDescription="@string/detail_likes_img_view_description"
|
||||
android:src="@drawable/ic_thumb_up" />
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="@dimen/video_item_grid_thumbnail_image_width"
|
||||
android:layout_height="@dimen/video_item_grid_thumbnail_image_height"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="@dimen/video_item_search_thumbnail_image_width"
|
||||
android:layout_height="@dimen/video_item_search_thumbnail_image_height"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="50dp"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="@dimen/video_item_grid_thumbnail_image_width"
|
||||
android:layout_height="@dimen/video_item_grid_thumbnail_image_height"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="98dp"
|
||||
android:layout_height="55dp"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="@dimen/video_item_grid_thumbnail_image_width"
|
||||
android:layout_height="@dimen/video_item_grid_thumbnail_image_height"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:focusable="true"
|
||||
android:padding="@dimen/video_item_search_padding">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="98dp"
|
||||
android:layout_height="55dp"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="@dimen/play_queue_thumbnail_width"
|
||||
android:layout_height="@dimen/play_queue_thumbnail_height"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/itemThumbnailView"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="42dp"
|
||||
|
|
Loading…
Reference in New Issue