Skip to content

Commit

Permalink
v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
iMeiji committed May 26, 2017
1 parent 2498c49 commit 4a64244
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
以下所有 API 均由 `今日头条` 提供, 本人采取非正常手段获取. 本程序仅供学习交流, 不可用于任何商业用途

## Features
- 首页四大模块: 新闻 / 图片 / 视频 / 头条号
- 首页五大模块: 新闻 / 图片 / 视频 / 头条号 / 问答
- 实现首页的布局和数据的显示
- 实现自定义新闻栏目顺序
- 新闻详情页面支持日夜两种主题
Expand Down Expand Up @@ -153,8 +153,9 @@ WebView无图模式(beta)
- 本地新闻
- 订阅号要分类 新闻 / 图片 / 视频
- 视频离线缓存
- 更新 API
- 更新视频 API
- 模拟登陆头条账号
- 栏目位置调换后不 recreate

## License
```
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ def releaseTime() {

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.meiji.toutiao"
minSdkVersion 16
targetSdkVersion 25
versionCode 2
versionName "1.2.4"
versionName "1.2.5"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
Expand Down Expand Up @@ -72,7 +72,7 @@ dependencies {
compile 'org.jsoup:jsoup:1.10.1'
compile 'com.github.chrisbanes.photoview:library:1.2.4'
compile 'de.psdev.licensesdialog:licensesdialog:1.8.2'
compile 'fm.jiecao:jiecaovideoplayer:5.5.2'
compile 'fm.jiecao:jiecaovideoplayer:5.5.4'

// retrofit 2
compile 'com.squareup.retrofit2:retrofit:2.2.0'
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/meiji/toutiao/api/IMobileNewsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ Observable<MultiNewsArticleBean> getNewsArticle2(

/**
* 获取新闻评论
* http://is.snssdk.com/article/v53/tab_comments/?group_id=6314103921648926977&offset=0
* 按热度排序
* http://is.snssdk.com/article/v53/tab_comments/?group_id=6314103921648926977&offset=0&tab_index=0
* 按时间排序
* http://is.snssdk.com/article/v53/tab_comments/?group_id=6314103921648926977&offset=0&tab_index=1
*
* @param groupId 新闻ID
* @param offset 偏移量
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public NewsChannelDao() {
public void addInitData() {
String categoryId[] = InitApp.AppContext.getResources().getStringArray(R.array.mobile_news_id);
String categoryName[] = InitApp.AppContext.getResources().getStringArray(R.array.mobile_news_name);
for (int i = 0; i < 6; i++) {
for (int i = 0; i < 8; i++) {
add(categoryId[i], categoryName[i], 1, i);
}
for (int i = 6; i < categoryId.length; i++) {
for (int i = 8; i < categoryId.length; i++) {
add(categoryId[i], categoryName[i], 0, i);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void initData() {
}
adapter = new BasePagerAdapter(getChildFragmentManager(), fragmentList, categoryName);
view_pager.setAdapter(adapter);
view_pager.setOffscreenPageLimit(channelList.size());
view_pager.setOffscreenPageLimit(15);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public boolean test(@NonNull MultiNewsArticleDataBean multiNewsArticleDataBean)
|| multiNewsArticleDataBean.getSource().contains("话题")) {
return false;
}
// 过滤头条问答新闻
if (multiNewsArticleDataBean.getMedia_info() == null) {
return false;
}
} catch (NullPointerException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -138,7 +142,6 @@ public void onError(@NonNull Throwable e) {
}
}
});

}

@Override
Expand All @@ -151,7 +154,6 @@ public void doSetAdapter(List<MultiNewsArticleDataBean> dataBeen) {
dataList.addAll(dataBeen);
view.onSetAdapter(dataList);
view.onHideLoading();
Log.d(TAG, "doSetAdapter: " + dataList.size());
}

@Override
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/res/layout/fragment_wenda_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,15 @@
<WebView
android:id="@+id/webview_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/White"/>
android:layout_height="wrap_content"/>

<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true"
android:scrollbarFadeDuration="1"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
android:scrollbars="vertical"/>
</LinearLayout>

</android.support.v4.widget.NestedScrollView>
Expand Down

0 comments on commit 4a64244

Please sign in to comment.