Skip to content

Commit 96154e8

Browse files
Change sample app design
1 parent b1e5c46 commit 96154e8

File tree

8 files changed

+61
-39
lines changed

8 files changed

+61
-39
lines changed

AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
android:name="at.huber.sampleDownload.SampleDownloadActivity"
2020
android:excludeFromRecents="true"
2121
android:taskAffinity=""
22-
android:theme="@android:style/Theme.Holo.Light.Dialog">
22+
android:theme="@style/AppTheme">
2323

2424
<intent-filter>
2525
<action android:name="android.intent.action.SEND" />

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ calling ytFiles.get(itag). One ytFile contains the url and its appropriate meta
3333
For further infos have a look at the supplied sample YoutubeDownloader app. It uses the "Share" function in the official YouTube
3434
app to download YouTube videos. It doesn't have a launcher entry though so don't be irritated.
3535

36-
To try the app have a look at: [youtubeDownloader.apk](https://github.com/HaarigerHarald/android-youtubeExtractor/raw/master/bin/youtubeDownloader.apk)
36+
To try the app have a look at: [youtubeDownloader.apk](https://github.com/HaarigerHarald/android-youtubeExtractor/raw/master/bin/youtubeSampleDL.apk)
3737

3838
<img src='https://github.com/HaarigerHarald/android-youtubeExtractor/raw/master/Screenshot_2015-02-11-19-29-13.png' width='250' alt='youtubeDownloader Screenshot 1'>
3939

bin/youtubeDownloader.apk

-23 KB
Binary file not shown.

bin/youtubeSampleDL.apk

23.2 KB
Binary file not shown.
Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
1-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
5-
android:paddingBottom="16dp"
6-
android:paddingLeft="16dp"
7-
android:paddingRight="16dp"
8-
android:paddingTop="16dp"
9-
tools:context="at.huber.sampleDownload.SampleDownloadActivity" >
10-
<LinearLayout
11-
android:id="@+id/main_layout"
12-
android:orientation="vertical"
13-
android:layout_width="match_parent"
14-
android:layout_height="wrap_content">
5+
android:orientation="vertical"
6+
tools:context="at.huber.sampleDownload.SampleDownloadActivity">
157

16-
<ProgressBar
17-
android:id="@+id/prgrBar"
18-
android:layout_width="wrap_content"
19-
android:layout_height="wrap_content"
20-
android:layout_gravity="center" />
21-
22-
</LinearLayout>
8+
<TextView
9+
android:layout_width="wrap_content"
10+
android:layout_height="wrap_content"
11+
android:layout_marginLeft="23dp"
12+
android:layout_marginRight="23dp"
13+
android:layout_marginTop="20dp"
14+
android:text="@string/app_name"
15+
android:textSize="20sp"
16+
android:textColor="@android:color/black"
17+
android:textAppearance="@android:style/TextAppearance.WindowTitle"/>
18+
19+
<ScrollView
20+
android:layout_width="match_parent"
21+
android:layout_height="match_parent"
22+
android:paddingBottom="16dp"
23+
android:paddingLeft="16dp"
24+
android:paddingRight="16dp"
25+
android:layout_marginTop="16dp" >
2326

24-
</ScrollView>
27+
<LinearLayout
28+
android:id="@+id/main_layout"
29+
android:layout_width="match_parent"
30+
android:layout_height="wrap_content"
31+
android:orientation="vertical"
32+
android:gravity="center" >
33+
34+
<ProgressBar
35+
android:id="@+id/prgrBar"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:layout_gravity="center" />
39+
40+
</LinearLayout>
41+
42+
</ScrollView>
43+
</LinearLayout>

res/values-v21/styles.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
2+
3+
<style name="AppTheme" parent="@android:style/Theme.Material.Light.Dialog" >
4+
<item name="android:textAllCaps">false</item>
5+
<item name="android:windowNoTitle">true</item>
6+
<item name="android:windowMinWidthMinor">85%</item>
7+
<item name="android:windowMinWidthMajor">55%</item>
8+
</style>
9+
10+
</resources>

res/values/styles.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
2+
3+
<style name="AppTheme" parent="@android:style/Theme.Holo.Light.Dialog" >
4+
<item name="android:windowNoTitle">true</item>
5+
<item name="android:windowMinWidthMinor">85%</item>
6+
<item name="android:windowMinWidthMajor">55%</item>
7+
</style>
8+
9+
</resources>

src/at/huber/sampleDownload/SampleDownloadActivity.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.app.DownloadManager;
55
import android.content.Context;
66
import android.content.Intent;
7-
import android.graphics.Color;
87
import android.net.Uri;
98
import android.os.Bundle;
109
import android.os.Environment;
@@ -14,7 +13,6 @@
1413
import android.widget.Button;
1514
import android.widget.LinearLayout;
1615
import android.widget.ProgressBar;
17-
import android.widget.TextView;
1816
import android.widget.Toast;
1917
import at.huber.youtubeExtractor.YouTubeUriExtractor;
2018
import at.huber.youtubeExtractor.YtFile;
@@ -31,7 +29,6 @@ protected void onCreate(Bundle savedInstanceState) {
3129
super.onCreate(savedInstanceState);
3230

3331
setContentView(R.layout.activity_sample_download);
34-
colorTitle(Color.parseColor("#E62117"));
3532
mainLayout=(LinearLayout) findViewById(R.id.main_layout);
3633
mainProgressBar=(ProgressBar) findViewById(R.id.prgrBar);
3734

@@ -104,7 +101,7 @@ public void onClick(View v) {
104101
}else{
105102
filename=videoTitle + "." + ytfile.getMeta().getExt();
106103
}
107-
filename=filename.replaceAll("\\\\|>|<|\"|\\||\\*|\\?|%|:|#", "");
104+
filename=filename.replaceAll("\\\\|>|<|\"|\\||\\*|\\?|%|:|#|/", "");
108105
downloadFromUrl(ytfile.getUrl(), videoTitle, filename);
109106
finish();
110107
}
@@ -126,17 +123,4 @@ private void downloadFromUrl(String youtubeDlUrl, String downloadTitle, String f
126123
manager.enqueue(request);
127124
}
128125

129-
private void colorTitle(int color) {
130-
try{
131-
int dividerId=getResources().getIdentifier("android:id/titleDivider", null, null);
132-
View divider=findViewById(dividerId);
133-
divider.setBackgroundColor(color);
134-
int textViewId=getResources().getIdentifier("android:id/title", null, null);
135-
TextView tv=(TextView) findViewById(textViewId);
136-
tv.setTextColor(color);
137-
}catch (NullPointerException npe){
138-
// Ignore something has changed
139-
}
140-
}
141-
142126
}

0 commit comments

Comments
 (0)