Skip to content

Commit

Permalink
修复下载相关的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
80945540 committed Nov 14, 2016
1 parent bef9d9f commit 54c7a1c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 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.

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* API接口
* 因为使用RxCache作为缓存策略 所以这里不需要写缓存信息
*/
public interface MovieService {
public interface BookService {

//获取书库分类信息
@GET("freebook/typeconfigs.json")
@GET("api/getTypeConfigList")
Observable<List<BookTypeDto>> getBookTypes();

//获得首页banner以及书籍数据
@GET("freebook/home.json")
@GET("api/getHomeInfo")
Observable<HomeDto> getHomeInfo();

//获得搜索标签
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.lance.freebook.Data.HttpData;

import com.lance.freebook.Data.APi.CacheProviders;
import com.lance.freebook.Data.APi.MovieService;
import com.lance.freebook.Data.APi.BookService;
import com.lance.freebook.Data.Retrofit.RetrofitUtils;
import com.lance.freebook.MVP.Entity.BookTypeDto;
import com.lance.freebook.MVP.Entity.HomeDto;
Expand Down Expand Up @@ -33,7 +33,7 @@ public class HttpData extends RetrofitUtils {
private static final CacheProviders providers = new RxCache.Builder()
.persistence(cacheDirectory)
.using(CacheProviders.class);
protected static final MovieService service = getRetrofit().create(MovieService.class);
protected static final BookService service = getRetrofit().create(BookService.class);

//在访问HttpMethods时创建单例
private static class SingletonHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected void completed(BaseDownloadTask task) {
TasksManager.getImpl()
.updateViewHolder(item.getId(), helper);

task.start();
item.setId(task.start());
}


Expand Down
26 changes: 18 additions & 8 deletions app/src/main/java/com/lance/freebook/MVP/Entity/BannerDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
public class BannerDto {

/**
* imageUrl : http://img1.youzy.cn/content2/thumbs/p00393573.jpeg
* bannerTitle : banner测试
* Url :
* id : 1
* imageUrl : http://odog3v89f.bkt.clouddn.com/banner/banner1.png
* bannerTitle : 游离在正邪边缘的人:残袍
* bookid : 29286
*/

private int id;
private String imageUrl;
private String bannerTitle;
private String Url;
private int bookid;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getImageUrl() {
return imageUrl;
Expand All @@ -31,11 +41,11 @@ public void setBannerTitle(String bannerTitle) {
this.bannerTitle = bannerTitle;
}

public String getUrl() {
return Url;
public int getBookid() {
return bookid;
}

public void setUrl(String Url) {
this.Url = Url;
public void setBookid(int bookid) {
this.bookid = bookid;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void onMyyes() {
}
TasksManager.getImpl().removeTask(mQuickAdapter.getItem(position).getId());
mQuickAdapter.remove(position);
RefreshView();
myDialogDownload.dismiss();
}

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/lance/freebook/common/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* 本类存放项目所需常量
*/
public class Constant {
public static String API_SERVER="http://odog3v89f.bkt.clouddn.com";
public static String API_SEARCH="http://m.txt99.cc/search/result/searchtype/complex/searchkey/{Key}/page/1";
public static String API_SERVER="http://112.74.93.67";


public static final String EMPTY_TITLE_BOOKS="这个分类还没书籍";
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 54c7a1c

Please sign in to comment.