Merge pull request #114 from chschtsch/cardview

Design update & refactoring
This commit is contained in:
Christian Schabesberger 2015-12-14 20:24:22 +01:00
commit 5a05ffcbdd
22 changed files with 414 additions and 313 deletions

View File

@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 23
versionCode 7
versionName "0.6.1"
versionCode 8
versionName "0.6.2"
}
buildTypes {
release {
@ -31,6 +31,8 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7'
}

View File

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="org.schabi.newpipe" >
<uses-permission android:name= "android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
@ -15,7 +15,7 @@
tools:ignore="AllowBackup">
<activity
android:name=".VideoItemListActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -245,7 +245,6 @@ public class VideoItemDetailFragment extends Fragment {
String.format(
res.getString(R.string.viewCountText), localisedViewCount));
thumbsUpView.setText(nf.format(info.like_count));
thumbsDownView.setText(nf.format(info.dislike_count));
@ -359,8 +358,7 @@ public class VideoItemDetailFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceBundle) {
super.onActivityCreated(savedInstanceBundle);
Activity a = getActivity();
playVideoButton =
(FloatingActionButton) a.findViewById(R.id.playVideoButton);
playVideoButton = (FloatingActionButton) a.findViewById(R.id.playVideoButton);
thumbnailWindowLayout = a.findViewById(R.id.detailVideoThumbnailWindowLayout);
Button backgroundButton = (Button)
a.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton);
@ -435,7 +433,6 @@ public class VideoItemDetailFragment extends Fragment {
newWindowLayoutParams.height = bottom - top;
thumbnailWindowLayout.setLayoutParams(newWindowLayoutParams);
//noinspection SuspiciousNameCombination
initialThumbnailPos.set(top, left);
@ -444,6 +441,8 @@ public class VideoItemDetailFragment extends Fragment {
}
}
/**Returns the java.util.Locale object which corresponds to the locale set in NewPipe's preferences.
* Currently not affected by the device's locale.*/
private Locale getPreferredLocale() {

View File

@ -33,7 +33,6 @@ import java.util.Vector;
*/
class VideoListAdapter extends BaseAdapter {
private final Context context;
private final VideoInfoItemViewCreator viewCreator;
private Vector<VideoPreviewInfo> videoList = new Vector<>();
@ -43,6 +42,8 @@ class VideoListAdapter extends BaseAdapter {
public VideoListAdapter(Context context, VideoItemListFragment videoListFragment) {
viewCreator = new VideoInfoItemViewCreator(LayoutInflater.from(context));
this.listView = videoListFragment.getListView();
this.listView.setDivider(null);
this.listView.setDividerHeight(0);
this.context = context;
}

View File

@ -26,6 +26,7 @@ import org.schabi.newpipe.services.youtube.YoutubeService;
/**Provides access to the video streaming services supported by NewPipe.
* Currently only Youtube until the API becomes more stable.*/
@SuppressWarnings("ALL")
public class ServiceList {
private static final String TAG = ServiceList.class.toString();

View File

@ -23,6 +23,7 @@ package org.schabi.newpipe.services;
import org.schabi.newpipe.VideoInfo;
/**Scrapes information from a video streaming service (eg, YouTube).*/
@SuppressWarnings("ALL")
public abstract class VideoExtractor {
protected final String pageUrl;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 870 B

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 783 B

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -10,187 +10,163 @@
android:layout_height="match_parent"
android:id="@+id/videoitem_detail">
<ImageView android:id="@+id/detailThumbnailView"
android:contentDescription="@string/detailThumbnailViewDescription"
android:layout_width="match_parent"
<ProgressBar android:id="@+id/detailProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/>
android:layout_centerInParent="true"
android:indeterminate="true"/>
<ScrollView
android:id="@+id/detailMainContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
android:visibility="invisible">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/detailVideoThumbnailWindowLayout"
<RelativeLayout android:id="@+id/detailVideoInfo"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="?attr/selectableItemBackground">
android:layout_height="wrap_content">
<ProgressBar android:id="@+id/detailProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:indeterminateTint="@color/primaryColorDarkYoutube"
android:indeterminateTintMode="src_in"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/playVideoButton"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:backgroundTint="@color/primaryColorYoutube"
android:src="@drawable/ic_play_arrow_black"
android:layout_margin="20dp"/>
<Button
android:id="@+id/detailVideoThumbnailWindowBackgroundButton"
<ImageView android:id="@+id/detailThumbnailView"
android:contentDescription="@string/detailThumbnailViewDescription"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailTextContentLayout"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:layout_below="@id/detailVideoThumbnailWindowLayout"
android:background="@color/background_gray">
<TextView android:id="@+id/detailVideoTitleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/video_item_detail_thumbnail_image_height"
android:scaleType="centerInside"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:paddingBottom="3dp"
android:textSize="@dimen/text_video_title_size"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<ImageView android:id="@+id/detailUploaderThumbnailView"
android:contentDescription="@string/detailUploaderThumbnailViewDescription"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentStart="true"
android:src="@drawable/buddy" />
<TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploaderThumbnailView"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:textSize="@dimen/text_video_uploader_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailViewCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="3dp"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentEnd="true"
android:textSize="@dimen/text_video_views_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailThumbsDownCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_alignParentEnd="true"
android:textSize="@dimen/text_video_like_size"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView android:id="@+id/detailThumbsDownImgView"
android:contentDescription="@string/detailThumbsDownImgViewDescription"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_below="@id/detailViewCountView"
android:layout_toStartOf="@id/detailThumbsDownCountView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:src="@drawable/thumbs_down" />
<TextView android:id="@+id/detailThumbsUpCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_toStartOf="@id/detailThumbsDownImgView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:textSize="@dimen/text_video_like_size"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<ImageView android:id="@+id/detailThumbsUpImgView"
android:contentDescription="@string/detailThumbsUpImgViewDescription"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_below="@id/detailViewCountView"
android:layout_toStartOf="@id/detailThumbsUpCountView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailUploadDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploaderView"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_upload_date_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailDescriptionView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploadDateView"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_description_size"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:background="@color/dark_image_background"
android:src="@drawable/dummy_thumbnail"/>
<RelativeLayout
android:id="@+id/detailNextVideoRootLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_below="@id/detailDescriptionView" >
android:layout_below="@id/detailThumbnailView"
android:padding="@dimen/video_item_detail_info_text_padding" >
<TextView android:id="@+id/detailNextVideoTitle"
<TextView android:id="@+id/detailVideoTitleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_upload_date_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:text="@string/nextVideoTitle"
/>
android:textStyle="bold"
android:paddingBottom="3dp"
android:textSize="@dimen/video_item_detail_title_text_size"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<ImageView android:id="@+id/detailUploaderThumbnailView"
android:contentDescription="@string/detailUploaderThumbnailViewDescription"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/buddy" />
<TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploaderThumbnailView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:textSize="@dimen/video_item_detail_uploader_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailViewCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textSize="@dimen/video_item_detail_views_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailThumbsDownCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView android:id="@+id/detailThumbsDownImgView"
android:contentDescription="@string/detailThumbsDownImgViewDescription"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsDownCountView"
android:layout_toStartOf="@id/detailThumbsDownCountView"
android:layout_marginLeft="@dimen/video_item_detail_like_margin"
android:src="@drawable/thumbs_down" />
<TextView android:id="@+id/detailThumbsUpCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsDownImgView"
android:layout_toStartOf="@id/detailThumbsDownImgView"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<ImageView android:id="@+id/detailThumbsUpImgView"
android:contentDescription="@string/detailThumbsUpImgViewDescription"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsUpCountView"
android:layout_toStartOf="@id/detailThumbsUpCountView"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailUploadDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploaderView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/video_item_detail_upload_date_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailDescriptionView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailUploadDateView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailNextVideoRootLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/video_item_detail_info_text_padding"
android:layout_below="@id/detailVideoInfo" >
<TextView android:id="@+id/detailNextVideoTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/nextVideoTitle"
android:textAllCaps="true" />
<RelativeLayout android:id="@+id/detailNextVidButtonAndContentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailNextVideoTitle">
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailNextVideoTitle"/>
android:layout_height="wrap_content"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_width="match_parent"
@ -199,15 +175,24 @@
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<Button android:id="@+id/detailShowSimilarButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_below="@id/detailNextVideoRootLayout"
android:layout_below="@id/detailNextVidButtonAndContentLayout"
android:textSize="@dimen/video_item_detail_similar_text_size"
android:text="@string/showSimilarVideosButtonText"/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/playVideoButton"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/primaryColorYoutube"
android:src="@drawable/ic_play_arrow_black"
android:layout_margin="@dimen/video_item_detail_play_fab_margin"/>
</RelativeLayout>

View File

@ -10,6 +10,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".VideoItemListActivity"
tools:layout="@android:layout/list_content"/>
tools:layout="@android:layout/list_content" />
</LinearLayout>

View File

@ -35,7 +35,7 @@
<RelativeLayout
android:id="@+id/detailVideoThumbnailWindowLayout"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_height="@dimen/video_item_detail_thumbnail_image_height"
android:background="?attr/selectableItemBackground">
<ProgressBar android:id="@+id/detailProgressBar"
@ -48,12 +48,11 @@
android:id="@+id/playVideoButton"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:backgroundTint="@color/primaryColorYoutube"
android:src="@drawable/ic_play_arrow_black"
android:layout_margin="20dp"/>
android:layout_margin="@dimen/video_item_detail_play_fab_margin"/>
<Button
android:id="@+id/detailVideoThumbnailWindowBackgroundButton"
@ -67,10 +66,7 @@
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:padding="@dimen/video_item_detail_info_text_padding"
android:layout_below="@id/detailVideoThumbnailWindowLayout"
android:background="@color/background_gray">
@ -80,14 +76,13 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:paddingBottom="3dp"
android:textSize="@dimen/text_video_title_size"
android:textSize="@dimen/video_item_detail_title_text_size"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<ImageView android:id="@+id/detailUploaderThumbnailView"
android:contentDescription="@string/detailUploaderThumbnailViewDescription"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
@ -100,17 +95,16 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:textSize="@dimen/text_video_uploader_size"
android:textSize="@dimen/video_item_detail_uploader_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailViewCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="3dp"
android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textSize="@dimen/text_video_views_size"
android:textSize="@dimen/video_item_detail_views_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailThumbsDownCountView"
@ -119,20 +113,17 @@
android:layout_below="@id/detailViewCountView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textSize="@dimen/text_video_like_size"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView android:id="@+id/detailThumbsDownImgView"
android:contentDescription="@string/detailThumbsDownImgViewDescription"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsDownCountView"
android:layout_toStartOf="@id/detailThumbsDownCountView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:layout_marginLeft="@dimen/video_item_detail_like_margin"
android:src="@drawable/thumbs_down" />
<TextView android:id="@+id/detailThumbsUpCountView"
@ -141,20 +132,16 @@
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsDownImgView"
android:layout_toStartOf="@id/detailThumbsDownImgView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:textSize="@dimen/text_video_like_size"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<ImageView android:id="@+id/detailThumbsUpImgView"
android:contentDescription="@string/detailThumbsUpImgViewDescription"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsUpCountView"
android:layout_toStartOf="@id/detailThumbsUpImgView"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:layout_toStartOf="@id/detailThumbsUpCountView"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailUploadDateView"
@ -163,7 +150,7 @@
android:layout_below="@id/detailUploaderView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_upload_date_size"
android:textSize="@dimen/video_item_detail_upload_date_text_size"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/detailDescriptionView"
@ -172,51 +159,49 @@
android:layout_below="@id/detailUploadDateView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_description_size"
android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RelativeLayout
android:id="@+id/detailNextVideoRootLayout"
<RelativeLayout android:id="@+id/detailNextVideoRootLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:padding="@dimen/video_item_detail_info_text_padding"
android:layout_below="@id/detailDescriptionView" >
<TextView android:id="@+id/detailNextVideoTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="@dimen/text_video_upload_date_size"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:text="@string/nextVideoTitle"
/>
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:textAllCaps="true" />
<RelativeLayout android:id="@+id/detailNextVidButtonAndContentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailNextVideoTitle"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_below="@id/detailNextVideoTitle">
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<Button android:id="@+id/detailShowSimilarButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
android:layout_height="wrap_content"
android:layout_below="@id/detailNextVidButtonAndContentLayout"
android:textSize="@dimen/video_item_detail_similar_text_size"
android:text="@string/showSimilarVideosButtonText"/>
</RelativeLayout>
<Button android:id="@+id/detailShowSimilarButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_below="@id/detailNextVideoRootLayout"
android:text="@string/showSimilarVideosButtonText"/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>

View File

@ -1,67 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="92dp"
android:padding="6dp">
android:layout_height="wrap_content"
android:paddingTop="@dimen/video_item_search_card_vertical_margin"
android:paddingBottom="@dimen/video_item_search_card_vertical_margin"
android:paddingLeft="@dimen/video_item_search_card_horizontal_margin"
android:paddingRight="@dimen/video_item_search_card_horizontal_margin"
>
<ImageView android:id="@+id/itemThumbnailView"
android:contentDescription="@string/itemThumbnailViewDescription"
android:layout_width="142dp"
android:layout_height="80dp"
android:layout_marginEnd="6dp"
android:layout_marginRight="6dp"
android:scaleType="centerCrop"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/itemVideoTitleView"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_toRightOf="@id/itemThumbnailView"
android:layout_toEndOf="@id/itemThumbnailView"
android:layout_alignParentTop="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/text_search_title_size"/>
<TextView android:id="@+id/itemUploaderView"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_toRightOf="@id/itemThumbnailView"
android:layout_toEndOf="@id/itemThumbnailView"
android:layout_below="@id/itemVideoTitleView"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/text_search_uploader_size"/>
<TextView android:id="@+id/itemUploadDateView"
android:layout_width="wrap_content"
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/itemThumbnailView"
android:layout_toEndOf="@id/itemThumbnailView"
android:layout_below="@id/itemUploaderView"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/text_search_uploadtime_size"
/>
card_view:cardCornerRadius="@dimen/video_item_search_card_radius">
<TextView android:id="@+id/itemDurationView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_alignRight="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_marginRight="2dp"
android:layout_marginEnd="2dp"
android:layout_marginBottom="2dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/text_search_duration_size"
android:background="@color/durationBackground"
android:textColor="@color/durationText"/>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/video_item_search_card_padding">
</RelativeLayout>
<RelativeLayout android:id="@+id/itemThumbnailViewContainer"
android:layout_marginRight="@dimen/video_item_search_image_right_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView android:id="@+id/itemThumbnailView"
android:contentDescription="@string/itemThumbnailViewDescription"
android:layout_width="@dimen/video_item_search_thumbnail_image_width"
android:layout_height="@dimen/video_item_search_thumbnail_image_height"
android:scaleType="centerCrop"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/itemDurationView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/itemThumbnailView"
android:layout_alignRight="@id/itemThumbnailView"
android:layout_alignEnd="@id/itemThumbnailView"
android:layout_marginRight="@dimen/video_item_search_duration_margin"
android:layout_marginEnd="@dimen/video_item_search_duration_margin"
android:layout_marginBottom="@dimen/video_item_search_duration_margin"
android:paddingTop="@dimen/video_item_search_duration_vertical_padding"
android:paddingBottom="@dimen/video_item_search_duration_vertical_padding"
android:paddingRight="@dimen/video_item_search_duration_horizontal_padding"
android:paddingLeft="@dimen/video_item_search_duration_horizontal_padding"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_duration_text_size"
android:background="@color/durationBackground"
android:textColor="@color/durationText"/>
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="@dimen/video_item_search_thumbnail_image_height"
android:layout_toRightOf="@id/itemThumbnailViewContainer">
<TextView android:id="@+id/itemVideoTitleView"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/video_item_search_title_text_size"/>
<TextView android:id="@+id/itemUploaderView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_uploader_text_size"/>
<TextView android:id="@+id/itemUploadDateView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"/>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Video Item Search View Dimensions-->
<!-- Text Size -->
<dimen name="video_item_search_title_text_size">22sp</dimen>
<dimen name="video_item_search_duration_text_size">16sp</dimen>
<dimen name="video_item_search_uploader_text_size">18sp</dimen>
<dimen name="video_item_search_upload_date_text_size">18sp</dimen>
<!-- Elements Size -->
<dimen name="video_item_search_thumbnail_image_width">210dp</dimen>
<dimen name="video_item_search_thumbnail_image_height">130dp</dimen>
<!-- Paddings & Margins -->
<dimen name="video_item_search_card_vertical_margin">3dp</dimen>
<dimen name="video_item_search_card_horizontal_margin">10dp</dimen>
<dimen name="video_item_search_card_padding">10dp</dimen>
<dimen name="video_item_search_image_right_margin">10dp</dimen>
<dimen name="video_item_search_duration_vertical_padding">1sp</dimen>
<dimen name="video_item_search_duration_horizontal_padding">7sp</dimen>
<dimen name="video_item_search_duration_margin">5sp</dimen>
<!-- Miscellaneous -->
<dimen name="video_item_search_card_radius">4dp</dimen>
<!-- Video Item Detail View Dimensions-->
<!-- Text Size -->
<dimen name="video_item_detail_title_text_size">24sp</dimen>
<dimen name="video_item_detail_views_text_size">18sp</dimen>
<dimen name="video_item_detail_likes_text_size">16sp</dimen>
<dimen name="video_item_detail_uploader_text_size">18sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">18sp</dimen>
<dimen name="video_item_detail_description_text_size">18sp</dimen>
<dimen name="video_item_detail_next_text_size">20sp</dimen>
<dimen name="video_item_detail_similar_text_size">20sp</dimen>
<!-- Elements Size -->
<dimen name="video_item_detail_thumbnail_image_height">240dp</dimen>
<dimen name="video_item_detail_uploader_image_size">100dp</dimen>
<dimen name="video_item_detail_like_image_height">20sp</dimen>
<dimen name="video_item_detail_like_image_width">20sp</dimen>
<!-- Paddings & Margins -->
<dimen name="video_item_detail_info_text_padding">10sp</dimen>
<dimen name="video_item_detail_like_margin">10sp</dimen>
<dimen name="video_item_detail_play_fab_margin">20dp</dimen>
</resources>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="viewCountText">%1$s просмотров</string>
<string name="uploadDateText">Опубликовано: %1$s</string>
<string name="uploadDateText">Опубликовано %1$s</string>
<string name="noPlayerFound">Ни одного потокового проигрывателя не было найдено. Установить?</string>
<string name="installStreamPlayer">Установить</string>
<string name="cancel">Отмена</string>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Video Item Detail View Dimensions-->
<!-- Text Size -->
<dimen name="video_item_detail_title_text_size">20sp</dimen>
<dimen name="video_item_detail_views_text_size">16sp</dimen>
<dimen name="video_item_detail_likes_text_size">14sp</dimen>
<dimen name="video_item_detail_uploader_text_size">16sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">16sp</dimen>
<dimen name="video_item_detail_description_text_size">16sp</dimen>
<dimen name="video_item_detail_next_text_size">18sp</dimen>
<dimen name="video_item_detail_similar_text_size">18sp</dimen>
<!-- Elements Size -->
<dimen name="video_item_detail_thumbnail_image_height">300dp</dimen>
<dimen name="video_item_detail_uploader_image_size">100dp</dimen>
<dimen name="video_item_detail_like_image_height">18sp</dimen>
<dimen name="video_item_detail_like_image_width">18sp</dimen>
<!-- Paddings & Margins -->
<dimen name="video_item_detail_info_text_padding">10sp</dimen>
<dimen name="video_item_detail_like_margin">10sp</dimen>
<dimen name="video_item_detail_play_fab_margin">20dp</dimen>
</resources>

View File

@ -31,7 +31,7 @@
<style name="VideoPlayerActionBarTheme" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse" >
<item name="android:displayOptions">showHome</item>
<item name="displayOptions">showHome</item>
<item name="android:background">@color/black_overlay</item>
<item name="background">@color/black_overlay</item>
<item name="android:background">@color/dark_overlay</item>
<item name="background">@color/dark_overlay</item>
</style>
</resources>

View File

@ -2,9 +2,10 @@
<resources>
<color name="primaryColorYoutube">#cd322e</color>
<color name="primaryColorDarkYoutube">#bc211d</color>
<color name="accentColorYoutube">#000000</color>
<color name="durationBackground">#aa000000</color>
<color name="durationText">#eeffffff</color>
<color name="black_overlay">#66000000</color>
<color name="accentColorYoutube">#000</color>
<color name="durationBackground">#a000</color>
<color name="durationText">#efff</color>
<color name="dark_overlay">#6000</color>
<color name="dark_image_background">#222</color>
<color name="background_gray">#EEEEEE</color>
</resources>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Video Item Search View Dimensions-->
<!-- Text Size -->
<dimen name="video_item_search_title_text_size">14sp</dimen>
<dimen name="video_item_search_duration_text_size">11sp</dimen>
<dimen name="video_item_search_uploader_text_size">12sp</dimen>
<dimen name="video_item_search_upload_date_text_size">12sp</dimen>
<!-- Elements Size -->
<dimen name="video_item_search_thumbnail_image_width">140dp</dimen>
<dimen name="video_item_search_thumbnail_image_height">85dp</dimen>
<!-- Paddings & Margins -->
<dimen name="video_item_search_card_vertical_margin">2dp</dimen>
<dimen name="video_item_search_card_horizontal_margin">6dp</dimen>
<dimen name="video_item_search_card_padding">6dp</dimen>
<dimen name="video_item_search_image_right_margin">6dp</dimen>
<dimen name="video_item_search_duration_vertical_padding">1sp</dimen>
<dimen name="video_item_search_duration_horizontal_padding">5sp</dimen>
<dimen name="video_item_search_duration_margin">2sp</dimen>
<!-- Miscellaneous -->
<dimen name="video_item_search_card_radius">4dp</dimen>
<!-- Video Item Detail View Dimensions-->
<!-- Text Size -->
<dimen name="video_item_detail_title_text_size">18sp</dimen>
<dimen name="video_item_detail_views_text_size">14sp</dimen>
<dimen name="video_item_detail_likes_text_size">12sp</dimen>
<dimen name="video_item_detail_uploader_text_size">14sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">14sp</dimen>
<dimen name="video_item_detail_description_text_size">14sp</dimen>
<dimen name="video_item_detail_next_text_size">16sp</dimen>
<dimen name="video_item_detail_similar_text_size">16sp</dimen>
<!-- Elements Size -->
<dimen name="video_item_detail_thumbnail_image_height">200dp</dimen>
<dimen name="video_item_detail_uploader_image_size">80dp</dimen>
<dimen name="video_item_detail_like_image_height">18sp</dimen>
<dimen name="video_item_detail_like_image_width">18sp</dimen>
<!-- Paddings & Margins -->
<dimen name="video_item_detail_info_text_padding">6sp</dimen>
<dimen name="video_item_detail_like_margin">6sp</dimen>
<dimen name="video_item_detail_play_fab_margin">20dp</dimen>
</resources>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="text_search_title_size">14sp</dimen>
<dimen name="text_search_duration_size">11sp</dimen>
<dimen name="text_search_uploader_size">12sp</dimen>
<dimen name="text_search_uploadtime_size">12sp</dimen>
<dimen name="text_video_title_size">18sp</dimen>
<dimen name="text_video_views_size">14sp</dimen>
<dimen name="text_video_like_size">12sp</dimen>
<dimen name="text_video_uploader_size">14sp</dimen>
<dimen name="text_video_upload_date_size">14sp</dimen>
<dimen name="text_video_description_size">14sp</dimen>
</resources>

View File

@ -55,6 +55,6 @@
<string name="itemThumbnailViewDescription">Video preview thumbnail</string>
<string name="detailThumbnailViewDescription">Video preview thumbnail</string>
<string name="detailUploaderThumbnailViewDescription">Uploader thumbnail</string>
<string name="detailThumbsDownImgViewDescription">Unlikes</string>
<string name="detailThumbsDownImgViewDescription">Dislikes</string>
<string name="detailThumbsUpImgViewDescription">Likes</string>
</resources>

View File

@ -29,7 +29,7 @@
<style name="VideoPlayerActionBarTheme" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse" >
<item name="android:displayOptions">showHome</item>
<item name="displayOptions">showHome</item>
<item name="android:background">@color/black_overlay</item>
<item name="background">@color/black_overlay</item>
<item name="android:background">@color/dark_overlay</item>
<item name="background">@color/dark_overlay</item>
</style>
</resources>

BIN
assets/thumbs_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB