Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Commit

Permalink
fix movie bugs and update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
7449 committed Jun 27, 2017
1 parent fb6eae0 commit eb2dd50
Show file tree
Hide file tree
Showing 23 changed files with 56 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,24 @@ public void onNetWorkComplete() {
@Override
public void onNetWorkSuccess(M data) {
if (view != null) {
if (data instanceof List && view instanceof BaseListView && ((List) data).isEmpty()) {
((BaseListView) view).noMore();
if (data instanceof List) {
if (view instanceof BaseListView) {
if (((List) data).isEmpty()) {
KLog.i("data isEmpty == true, view instanceof BaseListView");
((BaseListView) view).noMore();
} else {
KLog.i("view instanceof BaseListView,Success");
view.netWorkSuccess(data);
}
return;
}
if (((List) data).isEmpty()) {
KLog.i("data isEmpty == true, view instanceof BaseView");
view.netWorkError();
} else {
KLog.i("view instanceof BaseView,Success");
view.netWorkSuccess(data);
}
} else {
view.netWorkSuccess(data);
}
Expand Down
14 changes: 14 additions & 0 deletions commonLibrary/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="fiction_card_view_margin">6dp</dimen>
<dimen name="fiction_padding">5dp</dimen>
<dimen name="fiction_margin">5dp</dimen>
<dimen name="fiction_detail_margin">5dp</dimen>
<dimen name="fiction_image_width">100dp</dimen>
<dimen name="fiction_image_height">100dp</dimen>


<dimen name="image_detail_margin">3dp</dimen>

<dimen name="item_dytt_new_card">3dp</dimen>
</resources>
2 changes: 2 additions & 0 deletions commonLibrary/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<string name="data_empty">没有数据了</string>
<string name="empty_view_tips">没有数据,点击重试</string>
<string name="net_error">网络错误,点击重试</string>
<string name="mark_title">记录</string>
<string name="mark_null">没有搜索记录</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ public void onClick(View v) {
if (!TextUtils.isEmpty(nextUrl)) {
startNetWork(nextUrl, type);
} else {
UIUtils.toast(UIUtils.getString(R.string.on_empty));
UIUtils.toast(UIUtils.getString(R.string.data_empty));
}
break;
case R.id.btn_on:
if (!TextUtils.isEmpty(onUrl)) {
startNetWork(onUrl, type);
} else {
UIUtils.toast(UIUtils.getString(R.string.on_empty));
UIUtils.toast(UIUtils.getString(R.string.data_empty));
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public void switchMark() {
.initXData(fictionMarkAll)
.setLayoutId(R.layout.item_mark)
.onXBind(this)
.setOnItemClickListener((view, position, info) -> SearchActivity.getInstance(String.valueOf(info.getFictionName())))
.setOnItemClickListener((view, position, info) -> {
markDialog.dismiss();
SearchActivity.getInstance(String.valueOf(info.getFictionName()));
})
, null)
.show();
}
Expand Down
10 changes: 5 additions & 5 deletions fiction/src/main/res/layout/activity_fiction_list_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_rootView"
android:layout_marginLeft="@dimen/margin"
android:layout_marginRight="@dimen/margin" />
android:layout_marginLeft="@dimen/fiction_margin"
android:layout_marginRight="@dimen/fiction_margin" />

<FrameLayout
android:id="@+id/btn_rootView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/margin"
android:layout_margin="@dimen/fiction_margin"
android:visibility="gone">

<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="@dimen/margin">
android:layout_margin="@dimen/fiction_margin">

<Button
android:id="@+id/btn_next"
Expand All @@ -62,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="@dimen/margin">
android:layout_margin="@dimen/fiction_margin">

<Button
android:id="@+id/btn_on"
Expand Down
6 changes: 3 additions & 3 deletions fiction/src/main/res/layout/item_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_view_margin">
android:layout_margin="@dimen/fiction_card_view_margin">

<RelativeLayout
android:layout_width="match_parent"
Expand All @@ -21,7 +21,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/search_iv_img"
android:padding="@dimen/padding"
android:padding="@dimen/fiction_padding"
android:textColor="@color/colorAccent" />

<TextView
Expand All @@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/search_tv_title"
android:layout_toRightOf="@+id/search_iv_img"
android:padding="@dimen/padding" />
android:padding="@dimen/fiction_padding" />
</RelativeLayout>


Expand Down
9 changes: 0 additions & 9 deletions fiction/src/main/res/values/dimens.xml

This file was deleted.

3 changes: 0 additions & 3 deletions fiction/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
<string name="on_page">上一页</string>
<string name="search_title">搜索</string>
<string name="title_81">81中文网</string>
<string name="on_empty">没有了</string>
<string name="title_bi_qu_ge">笔趣阁</string>
<string name="title_ksw">零点看书</string>
<string name="search_dialog_hint">请输入小说名</string>
<string name="mark_title">记录</string>
<string name="mark_null">没有搜索记录</string>
</resources>
4 changes: 0 additions & 4 deletions image/src/main/res/values/dimens.xml

This file was deleted.

1 change: 0 additions & 1 deletion image/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
<string name="kk_title">7kk</string>
<string name="search_title">搜索</string>
<string name="search_dialog_hint">请输入关键词</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
markDialog = new MaterialDialog
.Builder(this)
.title(R.string.search_content)
.title(R.string.mark_title)
.adapter(
adapter
.initXData(fictionMarkAll)
.setLayoutId(R.layout.item_mark)
.onXBind(this)
.setOnItemClickListener((view, position, info) -> mPresenter.startSearch(String.valueOf(info.getSearchContent())))
.setOnItemClickListener((view, position, info) -> {
markDialog.dismiss();
mPresenter.startSearch(String.valueOf(info.getSearchContent()));
}
)
, null)
.show();
}
Expand Down
10 changes: 0 additions & 10 deletions magnetic/src/main/res/drawable/ic_bookmark.xml

This file was deleted.

10 changes: 0 additions & 10 deletions magnetic/src/main/res/drawable/ic_delete.xml

This file was deleted.

23 changes: 0 additions & 23 deletions magnetic/src/main/res/layout/item_mark.xml

This file was deleted.

2 changes: 1 addition & 1 deletion magnetic/src/main/res/menu/search_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<item
android:id="@+id/mark"
android:icon="@drawable/ic_bookmark"
android:title="@string/search_content"
android:title="@string/mark_title"
app:showAsAction="ifRoom" />
<item
android:id="@+id/search"
Expand Down
2 changes: 0 additions & 2 deletions magnetic/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
<string name="copy">只复制</string>
<string name="xl_null">没有安装迅雷</string>
<string name="copy_success">磁力已经粘贴到复制板</string>
<string name="search_content">搜索记录</string>
<string name="mark_null">没有搜索记录</string>
</resources>
2 changes: 1 addition & 1 deletion movie/src/main/java/com/movie/manager/ApiConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public interface ApiConfig {

String DYTT_URL = "http://www.dytt8.net/index.htm";
String DYTT_URL = "http://www.dytt8.net/index2.htm";
String DY_2018_URL = "http://www.dy2018.com/";
String DYTT_XL = "http://www.ygdy8.net/html/gndy/index.html";
String XIAO_PIAN_URL = "http://www.xiaopian.com/html/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public void onRefresh() {
public void netWorkSuccess(List<MovieModel> data) {
if (mStatusView != null) {
mAdapter.removeAll();
data.remove(0);
mAdapter.addAllData(data);
}
}
Expand Down
4 changes: 0 additions & 4 deletions movie/src/main/res/values/dimens.xml

This file was deleted.

0 comments on commit eb2dd50

Please sign in to comment.