Merge pull request #80 from chschtsch/master

Update layout (initially suggested by @darkon5) + miscellaneous fixes
This commit is contained in:
Christian Schabesberger 2015-11-10 19:28:53 +01:00
commit 799faecc5b
16 changed files with 59 additions and 44 deletions

View File

@ -1,3 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="the-scrabi" />
</component>

View File

@ -3,10 +3,9 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="LOCAL" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.4" /> <option name="gradleJvm" value="1.7" />
<option name="gradleJvm" value="1.8" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

View File

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" /> <ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="" />
</component> </component>
</project> </project>

View File

@ -92,12 +92,12 @@
</content> </content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="rhino-1.7.7" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.0" level="project" /> <orderEntry type="library" exported="" name="recyclerview-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="design-23.1.0" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.8.3" level="project" /> <orderEntry type="library" exported="" name="jsoup-1.8.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" /> <orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" name="rhino-1.7.7" level="project" />
<orderEntry type="library" exported="" name="design-23.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
</component> </component>
</module> </module>

View File

@ -51,7 +51,7 @@ public class VideoInfoItemViewCreator {
} }
if(info.thumbnail == null) { if(info.thumbnail == null) {
holder.itemThumbnailView.setImageResource(R.drawable.dummi_thumbnail); holder.itemThumbnailView.setImageResource(R.drawable.dummy_thumbnail);
} else { } else {
holder.itemThumbnailView.setImageBitmap(info.thumbnail); holder.itemThumbnailView.setImageBitmap(info.thumbnail);
} }

View File

@ -288,8 +288,8 @@ public class YoutubeExtractor implements Extractor {
videoInfo.upload_date = doc.select("strong[class=\"watch-time-text\"").first() videoInfo.upload_date = doc.select("strong[class=\"watch-time-text\"").first()
.text(); .text();
// Try to only use date not the text around it // Extracting the date itself from header
videoInfo.upload_date = matchGroup1("([0-9.]*$)", videoInfo.upload_date); videoInfo.upload_date = matchGroup1("([A-Za-z]{3}\\s[\\d]{1,2},\\s[\\d]{4}$)", videoInfo.upload_date);
// description // description
videoInfo.description = doc.select("p[id=\"eow-description\"]").first() videoInfo.description = doc.select("p[id=\"eow-description\"]").first()
@ -320,6 +320,9 @@ public class YoutubeExtractor implements Extractor {
// view count // view count
videoInfo.view_count = doc.select("div[class=\"watch-view-count\"]").first().text(); videoInfo.view_count = doc.select("div[class=\"watch-view-count\"]").first().text();
// Extracting the number of views from header
videoInfo.view_count = matchGroup1("([0-9,]*$)", videoInfo.view_count);
// next video // next video
videoInfo.nextVideo = extractVideoInfoItem(doc.select("div[class=\"watch-sidebar-section\"]").first() videoInfo.nextVideo = extractVideoInfoItem(doc.select("div[class=\"watch-sidebar-section\"]").first()
.select("li").first()); .select("li").first());
@ -383,7 +386,7 @@ public class YoutubeExtractor implements Extractor {
format = MediaFormat.M4A.id; format = MediaFormat.M4A.id;
} }
audioStreams.add(new VideoInfo.AudioStream(parser.getText(), audioStreams.add(new VideoInfo.AudioStream(parser.getText(),
format, currentBandwidth, currentSamplingRate)); format, currentBandwidth, currentSamplingRate));
} }
case XmlPullParser.END_TAG: case XmlPullParser.END_TAG:
if(tagName.equals("AdaptationSet")) { if(tagName.equals("AdaptationSet")) {

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -33,7 +33,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/dummi_thumbnail"/> android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/detailVideoTitleView" <TextView android:id="@+id/detailVideoTitleView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -53,7 +53,7 @@
android:paddingRight="5dp" android:paddingRight="5dp"
android:layout_below="@id/detailVideoTitleView" android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:src="@drawable/budy" /> android:src="@drawable/buddy" />
<TextView android:id="@+id/detailUploaderView" <TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -33,7 +33,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/dummi_thumbnail"/> android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/detailVideoTitleView" <TextView android:id="@+id/detailVideoTitleView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -53,7 +53,7 @@
android:paddingRight="5dp" android:paddingRight="5dp"
android:layout_below="@id/detailVideoTitleView" android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:src="@drawable/budy" /> android:src="@drawable/buddy" />
<TextView android:id="@+id/detailUploaderView" <TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -33,7 +33,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/dummi_thumbnail"/> android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/detailVideoTitleView" <TextView android:id="@+id/detailVideoTitleView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -42,19 +42,21 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:paddingLeft="6dp" android:paddingLeft="6dp"
android:paddingRight="6dp" android:paddingRight="6dp"
android:paddingBottom="20dp" android:paddingBottom="0dp"
android:paddingTop="3dp"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Bla blabla !!!"/> android:text="Video title placeholder"/>
<ImageView android:id="@+id/detailUploaderThumbnailView" <ImageView android:id="@+id/detailUploaderThumbnailView"
android:layout_width="85dp" android:layout_width="85dp"
android:layout_height="100dp" android:layout_height="100dp"
android:paddingTop="25dp" android:paddingTop="0dp"
android:paddingLeft="2dp" android:paddingLeft="2dp"
android:paddingRight="2dp" android:paddingRight="2dp"
android:layout_below="@id/detailVideoTitleView" android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:src="@drawable/budy" /> android:src="@drawable/buddy" />
<TextView android:id="@+id/detailUploaderView" <TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -63,19 +65,22 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:paddingLeft="6dp" android:paddingLeft="6dp"
android:paddingRight="6dp" android:paddingRight="6dp"
android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold"
android:text="Herr von Gurken" /> android:textSize="@dimen/text_video_uploader_size"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="username" />
<TextView android:id="@+id/detailViewCountView" <TextView android:id="@+id/detailViewCountView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="25dp" android:paddingTop="6dp"
android:layout_below="@id/detailVideoTitleView" android:layout_below="@id/detailVideoTitleView"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:paddingRight="16dp" android:paddingRight="16dp"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:textSize="@dimen/text_video_visits_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="drölf views" /> android:text="81,754 views" />
<TextView android:id="@+id/detailThumbsDownCountView" <TextView android:id="@+id/detailThumbsDownCountView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -84,8 +89,9 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:paddingRight="16dp" android:paddingRight="16dp"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:textSize="@dimen/text_video_like_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="-5.000" /> android:text="100" />
<ImageView android:id="@+id/detailThumbsDownImgView" <ImageView android:id="@+id/detailThumbsDownImgView"
android:layout_width="40dp" android:layout_width="40dp"
@ -99,8 +105,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView" android:layout_below="@id/detailViewCountView"
android:layout_toLeftOf="@id/detailThumbsDownImgView" android:layout_toLeftOf="@id/detailThumbsDownImgView"
android:textSize="@dimen/text_video_like_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="" /> android:text="20" />
<ImageView android:id="@+id/detailThumbsUpImgView" <ImageView android:id="@+id/detailThumbsUpImgView"
android:layout_width="40dp" android:layout_width="40dp"
@ -116,17 +123,20 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:paddingLeft="6dp" android:paddingLeft="6dp"
android:paddingRight="6dp" android:paddingRight="6dp"
android:paddingTop="20dp" android:paddingTop="0dp"
android:textSize="@dimen/text_video_uploadtime_size"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploaded at: 45.64.1285" /> android:text="Published on Jan 01 1975" />
<TextView android:id="@+id/detailDescriptionView" <TextView android:id="@+id/detailDescriptionView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/detailUploadDateView" android:layout_below="@id/detailUploadDateView"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:paddingTop="3dp"
android:paddingLeft="6dp" android:paddingLeft="6dp"
android:paddingRight="6dp" android:paddingRight="6dp"
android:textSize="@dimen/text_video_description_size"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmodtempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. " android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmodtempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. "
/> />
@ -204,10 +214,10 @@
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/playVideoButton" android:id="@+id/playVideoButton"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_alignParentRight="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:backgroundTint="@color/primaryColorYoutube" app:backgroundTint="@color/primaryColorYoutube"
android:src="@drawable/ic_play_arrow_black" android:src="@drawable/ic_play_arrow_black"
android:layout_margin="16dip"/> android:layout_margin="20dp"/>
</RelativeLayout> </RelativeLayout>

View File

@ -12,7 +12,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:src="@drawable/dummi_thumbnail"/> android:src="@drawable/dummy_thumbnail"/>
<TextView android:id="@+id/itemVideoTitleView" <TextView android:id="@+id/itemVideoTitleView"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="primaryColorYoutube">#dd0000</color> <color name="primaryColorYoutube">#cd322e</color>
<color name="primaryColorDarkYoutube">#bb0000</color> <color name="primaryColorDarkYoutube">#bc211d</color>
<color name="accentColorYoutube">#000000</color> <color name="accentColorYoutube">#000000</color>
<color name="black_overlay">#66000000</color> <color name="black_overlay">#66000000</color>
</resources> </resources>

View File

@ -4,4 +4,10 @@
<dimen name="text_search_duration_size">11sp</dimen> <dimen name="text_search_duration_size">11sp</dimen>
<dimen name="text_search_uploader_size">12sp</dimen> <dimen name="text_search_uploader_size">12sp</dimen>
<dimen name="text_search_uploadtime_size">12sp</dimen> <dimen name="text_search_uploadtime_size">12sp</dimen>
<dimen name="text_video_title_size">14sp</dimen>
<dimen name="text_video_visits_size">14sp</dimen>
<dimen name="text_video_like_size">12sp</dimen>
<dimen name="text_video_uploader_size">14sp</dimen>
<dimen name="text_video_uploadtime_size">14sp</dimen>
<dimen name="text_video_description_size">14sp</dimen>
</resources> </resources>

View File

@ -4,7 +4,7 @@
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="nothingFound">Nothing found</string> <string name="nothingFound">Nothing found</string>
<string name="viewSufix">views</string> <string name="viewSufix">views</string>
<string name="uploadDatePrefix">Uploaded at: </string> <string name="uploadDatePrefix">Published on </string>
<string name="noPlayerFound">No StreamPlayer found. You may want to install one.</string> <string name="noPlayerFound">No StreamPlayer found. You may want to install one.</string>
<string name="installStreamPlayer">Install one</string> <string name="installStreamPlayer">Install one</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
@ -45,9 +45,9 @@
<item>Video</item> <item>Video</item>
<item>Audio</item> <item>Audio</item>
</string-array> </string-array>
<string name="nextVideoTitle">Next Video</string> <string name="nextVideoTitle">Next video</string>
<string name="showNextAndSimilarTitle">Show next and similar Videos.</string> <string name="showNextAndSimilarTitle">Show next and similar videos</string>
<string name="urlNotSupportedText">Url not Supported.</string> <string name="urlNotSupportedText">URL not supported.</string>
<string name="showSimilarVideosButtonText">Similar Videos</string> <string name="showSimilarVideosButtonText">Similar videos</string>
<string name="searchLanguageTitle">Video Search Language</string> <string name="searchLanguageTitle">Preferable content language</string>
</resources> </resources>