Skip to content

Commit

Permalink
修復台灣蘋果日報娛樂新聞
Browse files Browse the repository at this point in the history
修復ETToday圖片不能顯示的問題
移除香港雅虎新聞(因網站新聞列表為的台灣內容)
  • Loading branch information
ccjeng committed May 4, 2017
1 parent 055bc52 commit 1d0e67f
Show file tree
Hide file tree
Showing 14 changed files with 483 additions and 363 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

720 changes: 423 additions & 297 deletions .idea/workspace.xml

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@
<orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
<orderEntry type="library" exported="" name="mopub-sdk-native-video-4.12.0" level="project" />
<orderEntry type="library" exported="" name="fragmentation-0.10.3" level="project" />
<orderEntry type="library" exported="" name="firebase-core-10.2.1" level="project" />
<orderEntry type="library" exported="" name="exoplayer-r2.0.3" level="project" />
<orderEntry type="library" exported="" name="play-services-tagmanager-v4-impl-10.2.1" level="project" />
<orderEntry type="library" exported="" name="mopub-sdk-4.12.0" level="project" />
<orderEntry type="library" exported="" name="play-services-tagmanager-v4-impl-10.2.4" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-10.2.4" level="project" />
<orderEntry type="library" exported="" name="transition-25.3.1" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.10.2" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-10.2.1" level="project" />
<orderEntry type="library" exported="" name="firebase-core-10.2.4" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-24.0.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="multidex-instrumentation-1.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-analytics-impl-10.2.4" level="project" />
<orderEntry type="library" exported="" name="audience-network-sdk-4.20.0" level="project" />
<orderEntry type="library" exported="" name="firebase-common-10.2.4" level="project" />
<orderEntry type="library" exported="" name="fastadapter-1.6.0" level="project" />
<orderEntry type="library" exported="" name="play-services-analytics-impl-10.2.1" level="project" />
<orderEntry type="library" exported="" name="rxjava-1.2.0" level="project" />
<orderEntry type="library" exported="" name="firebase-common-10.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-10.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-10.2.4" level="project" />
<orderEntry type="library" exported="" name="support-v4-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-25.3.1" level="project" />
<orderEntry type="library" exported="" name="materialish-progress-1.7" level="project" />
Expand All @@ -125,31 +125,31 @@
<orderEntry type="library" exported="" name="iconics-core-2.7.1" level="project" />
<orderEntry type="library" exported="" name="okio-1.9.0" level="project" />
<orderEntry type="library" exported="" name="fragmentation-swipeback-0.7.9" level="project" />
<orderEntry type="library" exported="" name="firebase-analytics-10.2.1" level="project" />
<orderEntry type="library" exported="" name="vpadn-sdk-obf463-22216102-1612221555-54fff67" level="project" />
<orderEntry type="library" exported="" name="play-services-base-10.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-10.2.1" level="project" />
<orderEntry type="library" exported="" name="firebase-analytics-10.2.4" level="project" />
<orderEntry type="library" exported="" name="play-services-base-10.2.4" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-10.2.4" level="project" />
<orderEntry type="library" exported="" name="design-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-25.3.1" level="project" />
<orderEntry type="library" exported="" name="community-material-typeface-1.5.54.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-10.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-10.2.1" level="project" />
<orderEntry type="library" exported="" name="firebase-iid-10.2.1" level="project" />
<orderEntry type="library" exported="" name="firebase-iid-10.2.4" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-10.2.4" level="project" />
<orderEntry type="library" exported="" name="glide-3.7.0" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-25.3.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-25.3.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-10.2.4" level="project" />
<orderEntry type="library" exported="" name="mopub-sdk-interstitial-4.12.0" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-10.2.1" level="project" />
<orderEntry type="library" exported="" name="mopub-sdk-banner-4.12.0" level="project" />
<orderEntry type="library" exported="" name="mopub-volley-1.1.0" level="project" />
<orderEntry type="library" exported="" name="firebase-analytics-impl-10.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-10.2.4" level="project" />
<orderEntry type="library" exported="" name="firebase-analytics-impl-10.2.4" level="project" />
<orderEntry type="library" exported="" name="mopub-sdk-native-static-4.12.0" level="project" />
<orderEntry type="library" exported="" name="vpadn-sdk-obf464-21407102-1704121104-cdcc646" level="project" />
<orderEntry type="library" exported="" name="rxandroid-1.2.1" level="project" />
<orderEntry type="library" exported="" name="aboutlibraries-5.7.1" level="project" />
<orderEntry type="library" exported="" name="play-services-analytics-10.2.4" level="project" />
<orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="okhttp-3.4.1" level="project" />
<orderEntry type="library" exported="" name="play-services-analytics-10.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-25.3.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-25.3.1" level="project" />
Expand Down
15 changes: 8 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.ccjeng.news"
minSdkVersion 16
targetSdkVersion 23
versionCode 43
versionName '1.8.5.041617SN'
versionCode 44
versionName '1.8.6.050417SN'
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
Expand All @@ -33,16 +33,17 @@ android {
}

dependencies {

//compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.google.android.gms:play-services-analytics:10.2.4'
compile 'com.google.android.gms:play-services-ads:10.2.4'
//for FAN, don't move
compile 'com.google.firebase:firebase-core:10.2.1'
releaseCompile 'com.google.firebase:firebase-crash:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.4'
releaseCompile 'com.google.firebase:firebase-crash:10.2.4'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.mikepenz:iconics-core:2.7.1@aar'
compile 'com.mikepenz:community-material-typeface:1.5.54.1@aar'
Expand All @@ -61,7 +62,7 @@ dependencies {
compile 'com.facebook.android:audience-network-sdk:4.20.0'
compile 'io.reactivex:rxjava:1.2.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile files('src/main/libs/vpadn-sdk-obf463-22216102-1612221555-54fff67.jar')
compile files('src/main/libs/vpadn-sdk-obf464-21407102-1704121104-cdcc646.jar')
}

apply plugin: 'com.google.gms.google-services'
12 changes: 3 additions & 9 deletions app/src/main/java/com/ccjeng/news/parser/tw/AppleDaily.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,9 @@ public String parseHtml(final String link, String content) throws IOException {

try {

if (link.contains("entertainment")) {
title = doc.select("h1").text();
time = doc.select("p.lastupdate").first().text();
body = doc.select("div.nmi-article > p").html() + doc.select("div.nmi-article > center").html();
} else {
title = doc.select("h1#h1").text();
time = doc.select("time").first().text();
body = doc.select("div.articulum").html();
}
title = doc.select("h1#h1").text();
time = doc.select("time").first().text();
body = doc.select("div.articulum").html();

} catch (Exception e) {
e.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/ccjeng/news/parser/tw/ETToday.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Boolean isEmptyContent() {
protected String cleaner(String rs) {

rs = rs.replace("<div class=\"test-keyword\"> ", "<!--");
rs = rs.replace("\"//static.ettoday.net","\"http://static.ettoday.net");

Whitelist wlist = new Whitelist();

Expand Down
36 changes: 18 additions & 18 deletions app/src/main/java/com/ccjeng/news/utils/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,27 @@ public String[] getCategory(String tab, int position) {
category = context.getResources().getStringArray(R.array.newscatsHKOrientalDaily);
break;
case 3:
category = context.getResources().getStringArray(R.array.newscatsHKYahoo);
break;
case 4:
//category = context.getResources().getStringArray(R.array.newscatsHKYahoo);
//break;
//case 4:
category = context.getResources().getStringArray(R.array.newscatsHKEJ);
break;
case 5:
case 4:
category = context.getResources().getStringArray(R.array.newscatsHKMetro);
break;
case 6:
case 5:
category = context.getResources().getStringArray(R.array.newscatsHKam730);
break;
case 7:
case 6:
category = context.getResources().getStringArray(R.array.newscatsHKheadline);
break;
case 8:
case 7:
category = context.getResources().getStringArray(R.array.newscatsETNet);
break;
case 9:
case 8:
category = context.getResources().getStringArray(R.array.newscatsTheStandNews);
break;
case 10:
case 9:
category = context.getResources().getStringArray(R.array.newscatsInMediaHK);
break;
}
Expand Down Expand Up @@ -206,27 +206,27 @@ public String[] getFeedURL(String tab, int position) {
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKOrientalDaily);
break;
case 3:
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKYahoo);
break;
case 4:
//feedURL = context.getResources().getStringArray(R.array.newsfeedsHKYahoo);
//break;
//case 4:
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKEJ);
break;
case 5:
case 4:
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKMetro);
break;
case 6:
case 5:
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKam730);
break;
case 7:
case 6:
feedURL = context.getResources().getStringArray(R.array.newsfeedsHKheadline);
break;
case 8:
case 7:
feedURL = context.getResources().getStringArray(R.array.newsfeedsETNet);
break;
case 9:
case 8:
feedURL = context.getResources().getStringArray(R.array.newsfeedsTheStandNews);
break;
case 10:
case 9:
feedURL = context.getResources().getStringArray(R.array.newsfeedsInMediaHK);
break;
}
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/java/com/ccjeng/news/utils/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ public static String checkNewsViewURL(String url) {

}

//force change TW appledaily entertainment url to mobile version.
if (url.contains("www.appledaily.com.tw") && url.contains("entertainment")) {

url = url.replace("www.appledaily.com.tw","m.ent.appledaily.com.tw");
url = url.replace("/appledaily/","/section/");
Log.d(TAG, "New URL =" + url);
}

return url;

}
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion app/src/main/res/values-zh-rCN/update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
tools:ignore="MissingTranslation">

<string-array name="updates">
<item>v1.8.5\n改善右滑关闭稳定性
<item>v1.8.6\n修复台湾苹果日报娱乐新闻
\n修复ETToday图片不能显示的问题
\n移除香港雅虎新闻(因网站新闻列表为的台湾内容)
</item>
</string-array>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/news_hk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<item>香港蘋果日報</item>
<item>香港蘋果日報 即時新聞</item>
<item>東方日報</item>
<item>雅虎新聞</item>
<!-- <item>雅虎新聞</item>-->
<item>信報</item>
<item>香港電台新聞頻道</item>
<item>AM730</item>
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/values/newscats_tw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,15 @@
<item>http://news.ltn.com.tw/rss/supplement.xml</item>
</string-array>
<string-array name="newsCatsTheNewsLens">
<item>新聞</item>
<item>評論</item>
<item>臺灣</item>
<item>香港</item>
<item>東南亞</item>
<item>國際</item>
</string-array>
<string-array name="newsFeedsTheNewsLens">
<string-array name="newsFeedsTheNewsLens">
<item>http://feeds.feedburner.com/thenewslens</item>
<item>http://feeds.feedburner.com/thenewslens/review</item>
<item>http://feeds.feedburner.com/thenewslens/hk</item>
<item>https://feeds.feedburner.com/TheNewsLensasean</item>
<item>https://feeds.feedburner.com/TheNewsLens/international</item>
</string-array>
</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
tools:ignore="MissingTranslation">

<string-array name="updates">
<item>v1.8.5\n改善右滑關閉穩定性
<item>v1.8.6\n修復台灣蘋果日報娛樂新聞
\n修復ETToday圖片不能顯示的問題
\n移除香港雅虎新聞(因網站新聞列表為的台灣內容)
</item>
</string-array>
</resources>

0 comments on commit 1d0e67f

Please sign in to comment.