From 38bfe2b384d2410388653116fe14b41765608bb5 Mon Sep 17 00:00:00 2001 From: Daktak Date: Fri, 6 Oct 2017 14:30:51 +1100 Subject: [PATCH 1/6] place holder tabs --- .../java/org/afhdownloader/MainActivity.java | 44 ++++++++++++++++++- app/src/main/res/layout/content_main.xml | 17 ++++++- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/afhdownloader/MainActivity.java b/app/src/main/java/org/afhdownloader/MainActivity.java index 2bc3854..9729ae1 100644 --- a/app/src/main/java/org/afhdownloader/MainActivity.java +++ b/app/src/main/java/org/afhdownloader/MainActivity.java @@ -24,9 +24,12 @@ import java.io.*; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; import java.util.Collections; import java.util.List; +import android.widget.TabHost; +import android.widget.TabHost.TabSpec; /** * daktak @@ -56,7 +59,42 @@ protected void onCreate(Bundle savedInstanceState) { PreferenceManager.setDefaultValues(this, R.xml.settings, false); - String[] names = new String[] {getString(R.string.loading)}; + String[] names = new String[] {getString(R.string.loading)};/* + TabHost myTabHost = (TabHost)this.findViewById(R.id.th_set_menu_tabhost); + myTabHost.setup(); + + for(int i=0; i<5; i++ ) +{ + final TabSpec x=tabHost2.newTabSpec("x"); + View row = inflater.inflate(R.layout.indicator1,null); + final TextView indicator1 =(TextView) row.findViewById(R.id.textView_indicator1); + indicator1.setText(indicator_list[i]); + // indicator1.setShadowLayer(1, 0, 1, 0xFF013201); + + x.setIndicator(row); + + x.setContent(new TabContentFactory() { + public View createTabContent(String arg) { + return gallery2; + } + }); + + tabHost2.addTab(x); + + ls1 = new ListView(Main_screen.this); + TabSpec ts1 = myTabHost.newTabSpec("TAB_TAG_1"); + ts1.setIndicator("Tab1"); + ts1.setContent(new TabHost.TabContentFactory(){ + public View createTabContent(String tag) + { + ArrayAdapter adapter = new ArrayAdapter(Main_screen.this,android.R.layout.simple_list_item_1,new String[]{"item1","item2","item3"}); + ls1.setAdapter(adapter); + return ls1; + } + }); + myTabHost.addTab(ts1); + +}*/ ListView mainListView = (ListView) findViewById( R.id.listView ); ListAdapter listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, names); // Set the ArrayAdapter as the ListView's adapter. @@ -138,11 +176,13 @@ public void run(Context context) { context.startService(service); } + //get for a specific int public String buildPath(Context context) { SharedPreferences mySharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String base = mySharedPreferences.getString("prefBase",getString(R.string.base_val)).trim(); String flid = mySharedPreferences.getString("prefFlid",getString(R.string.flid_val)).trim(); - //String url_ext = mySharedPreferences.getString("prefUrlext",getString(R.string.urlext_val)).trim(); + //if instring , + //List flida = Arrays.asList(flid.split(",")); String url_ext = "?w=files&flid="; return base+"/"+url_ext+flid; diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 4c7dd14..8d3ffbe 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -7,10 +7,25 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:layout="@layout/fragment_main"> + + + + - + + From 47c25025e161063d60aed9445ea1b898d13aea46 Mon Sep 17 00:00:00 2001 From: naofum Date: Fri, 13 Oct 2017 22:48:12 +0900 Subject: [PATCH 2/6] japanese translation --- app/src/main/res/values-ja/strings.xml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/src/main/res/values-ja/strings.xml diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml new file mode 100644 index 0000000..2c86cdb --- /dev/null +++ b/app/src/main/res/values-ja/strings.xml @@ -0,0 +1,42 @@ + + AFH Downloader + 設定 + 再起動して回復 + Flid + androidfilehost flid 値 + 設定 + 詳細設定 + ベース Url + + セレクター + JSoup 選択ステートメント + ディレクトリー + ダウンロード先ディレクトリー + 外部ブラウザー + ダウンロードに外部ブラウザーを使用します + ロード中… + WIFI のみ + WIFI 接続時のみダウンロードします + ファイルのダウンロードは外部ストレージの書き込みアクセス許可が必要です。 + 既存のダウンロードを判断するため外部ストレージの読み取りアクセス許可が必要です。 + 日次ダウンロード + + + + + + 起動後にスケジュールされた日次のダウンロードを行う + 自動起動 + 選択 + URL 拡張 + + ミラー URL + + HTTP ミラー POST データ + + MD5 インジケーター + はい + いいえ + 削除 + + From 51e5192ad8c0af67d53267b9f0497f524017c7ed Mon Sep 17 00:00:00 2001 From: daktak Date: Thu, 19 Oct 2017 10:09:13 +1100 Subject: [PATCH 3/6] Try with user agent --- app/src/main/java/org/afhdownloader/Download.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/afhdownloader/Download.java b/app/src/main/java/org/afhdownloader/Download.java index 5acfc8e..c40811c 100644 --- a/app/src/main/java/org/afhdownloader/Download.java +++ b/app/src/main/java/org/afhdownloader/Download.java @@ -165,6 +165,8 @@ public ArrayList getDLUrl(String url){ HttpURLConnection httpcon = (HttpURLConnection) ((new URL(mUrl).openConnection())); httpcon.setDoOutput(true); httpcon.setRequestMethod("POST"); + httpcon.setsetRequestProperty("User-Agent","Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"); + httpcon.setsetRequestProperty("X-MOD-SBB-CTYPE","xhr"); httpcon.connect(); //Write From 35a7c362a587b1b5b109a1ebba1342058e3b16a0 Mon Sep 17 00:00:00 2001 From: Daktak Date: Thu, 19 Oct 2017 10:14:18 +1100 Subject: [PATCH 4/6] fix for setRequest --- app/src/main/java/org/afhdownloader/Download.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/afhdownloader/Download.java b/app/src/main/java/org/afhdownloader/Download.java index c40811c..2b15a0c 100644 --- a/app/src/main/java/org/afhdownloader/Download.java +++ b/app/src/main/java/org/afhdownloader/Download.java @@ -165,8 +165,8 @@ public ArrayList getDLUrl(String url){ HttpURLConnection httpcon = (HttpURLConnection) ((new URL(mUrl).openConnection())); httpcon.setDoOutput(true); httpcon.setRequestMethod("POST"); - httpcon.setsetRequestProperty("User-Agent","Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"); - httpcon.setsetRequestProperty("X-MOD-SBB-CTYPE","xhr"); + httpcon.setRequestProperty("User-Agent","Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"); + httpcon.setRequestProperty("X-MOD-SBB-CTYPE","xhr"); httpcon.connect(); //Write From 78238f3f14615eeac6510b45740cbcaee3ca2dc4 Mon Sep 17 00:00:00 2001 From: Daktak Date: Thu, 19 Oct 2017 10:19:45 +1100 Subject: [PATCH 5/6] Version bump --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1ad0a03..f303d18 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "org.afhdownloader" minSdkVersion 16 targetSdkVersion 24 - versionCode 9 - versionName "0.4.4" + versionCode 10 + versionName "0.4.5" } buildTypes { release { From 743c85c7c918cccb5093403fabc67abecc264135 Mon Sep 17 00:00:00 2001 From: Daktak Date: Thu, 19 Oct 2017 10:22:26 +1100 Subject: [PATCH 6/6] remove tab --- app/src/main/res/layout/content_main.xml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 8d3ffbe..2659d39 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -7,25 +7,8 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:layout="@layout/fragment_main"> - - - - - - -