From ae2b0cc76bd40fb3eb73239dff6786bcc0901008 Mon Sep 17 00:00:00 2001 From: Coffeemakr <> Date: Sun, 18 Jun 2017 15:43:11 +0200 Subject: [PATCH] Format code and remove unused methods --- .../fragments/detail/VideoDetailFragment.java | 4 - .../newpipe/info_list/InfoItemBuilder.java | 5 + .../newpipe/info_list/InfoListAdapter.java | 28 +- .../main/res/layout/fragment_video_detail.xml | 413 +++++++++--------- 4 files changed, 213 insertions(+), 237 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 5f9abbc4a..3a5320156 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -19,8 +19,6 @@ import android.support.v4.content.ContextCompat; import android.support.v4.view.animation.FastOutSlowInInterpolator; import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.text.Html; import android.text.Spanned; import android.text.TextUtils; @@ -56,11 +54,9 @@ import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.stream_info.AudioStream; import org.schabi.newpipe.extractor.stream_info.StreamInfo; -import org.schabi.newpipe.extractor.stream_info.StreamInfoItem; import org.schabi.newpipe.extractor.stream_info.VideoStream; import org.schabi.newpipe.fragments.BaseFragment; import org.schabi.newpipe.info_list.InfoItemBuilder; -import org.schabi.newpipe.info_list.InfoListAdapter; import org.schabi.newpipe.player.MainVideoPlayer; import org.schabi.newpipe.player.PlayVideoActivity; import org.schabi.newpipe.player.PopupVideoPlayer; diff --git a/app/src/main/java/org/schabi/newpipe/info_list/InfoItemBuilder.java b/app/src/main/java/org/schabi/newpipe/info_list/InfoItemBuilder.java index 8b07bf583..1bed5f22d 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/InfoItemBuilder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/InfoItemBuilder.java @@ -57,10 +57,14 @@ public class InfoItemBuilder { } private ImageLoader imageLoader = ImageLoader.getInstance(); + + /** Base display options */ private static final DisplayImageOptions DISPLAY_IMAGE_OPTIONS = new DisplayImageOptions.Builder() .cacheInMemory(true) .build(); + + /** Display options for stream thumbnails */ private static final DisplayImageOptions DISPLAY_STREAM_THUMBNAIL_OPTIONS = new DisplayImageOptions.Builder() .cloneFrom(DISPLAY_IMAGE_OPTIONS) @@ -69,6 +73,7 @@ public class InfoItemBuilder { .showImageOnLoading(R.drawable.dummy_thumbnail) .build(); + /** Display options for channel thumbnails */ private static final DisplayImageOptions DISPLAY_CHANNEL_THUMBNAIL_OPTIONS = new DisplayImageOptions.Builder() .cloneFrom(DISPLAY_IMAGE_OPTIONS) diff --git a/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java b/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java index eb5ead13c..fe3c5ea99 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/InfoListAdapter.java @@ -38,7 +38,7 @@ public class InfoListAdapter extends RecyclerView.Adapter infoItemList; private boolean showFooter = false; private View header = null; private View footer = null; @@ -58,7 +58,7 @@ public class InfoListAdapter extends RecyclerView.Adapter(); } public void setOnStreamInfoItemSelectedListener @@ -79,14 +79,6 @@ public class InfoListAdapter extends RecyclerView.Adapter { - @Override - protected void removeRange(int fromIndex, int toIndex) { - super.removeRange(fromIndex, toIndex); - } - } } diff --git a/app/src/main/res/layout/fragment_video_detail.xml b/app/src/main/res/layout/fragment_video_detail.xml index c47ef376f..e10413ad5 100644 --- a/app/src/main/res/layout/fragment_video_detail.xml +++ b/app/src/main/res/layout/fragment_video_detail.xml @@ -1,6 +1,5 @@ - + tools:visibility="visible" /> @@ -57,9 +56,9 @@ android:id="@+id/detail_content_root_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" + android:background="?android:windowBackground" android:gravity="center_horizontal" - android:background="?android:windowBackground"> + android:orientation="vertical"> + tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero." /> + tools:ignore="ContentDescription,RtlHardcoded" /> - - + + + + + android:layout_height="55dp" + android:layout_marginLeft="12dp" + android:layout_marginRight="12dp" + android:layout_marginTop="6dp" + android:baselineAligned="false" + android:orientation="horizontal"> - - + + + + + + + + + + + + + + + + + + android:layout_alignParentRight="true" + android:layout_alignParentTop="true" + android:layout_gravity="center_vertical" + android:background="?attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:contentDescription="@string/open_in_popup_mode" + android:drawableTop="?attr/popup" + android:gravity="center" + android:paddingBottom="6dp" + android:paddingTop="6dp" + android:text="@string/controls_popup_title" + android:textSize="12sp" /> - + + + + + - + - - - - - - - - - - - - - - - - - - - + android:layout_marginLeft="15dp" + android:textAppearance="?android:attr/textAppearanceLarge" + android:textSize="@dimen/video_item_detail_uploader_text_size" + android:textStyle="bold" + tools:ignore="RtlHardcoded" + tools:text="Uploader" /> - - - - - - - - - - - + android:layout_height="match_parent" + tools:visibility="gone"/> + --> + + + + + + tools:visibility="visible"> + tools:text="Upload date" /> + tools:text="Description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum." /> + android:background="?attr/separatorColor" /> @@ -352,7 +351,7 @@ android:textAllCaps="true" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/video_item_detail_next_text_size" - tools:ignore="RtlHardcoded"/> + tools:ignore="RtlHardcoded" /> + tools:minHeight="50dp" /> + tools:ignore="ContentDescription" /> @@ -388,7 +387,7 @@ android:layout_marginTop="15dp" android:indeterminate="true" android:visibility="gone" - tools:visibility="visible"/> + tools:visibility="visible" /> + tools:visibility="visible" />