-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
206cf42
commit c5031fa
Showing
37 changed files
with
643 additions
and
62 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
-4 Bytes
(100%)
SwipebackLayout/build/intermediates/bundles/debug/classes.jar
Binary file not shown.
Binary file modified
BIN
-4 Bytes
(100%)
SwipebackLayout/build/intermediates/bundles/release/classes.jar
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...mediates/classes/debug/me/imid/swipebacklayout/lib/SwipeBackLayout$ViewDragCallback.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ayout/build/intermediates/classes/debug/me/imid/swipebacklayout/lib/SwipeBackLayout.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...diates/classes/release/me/imid/swipebacklayout/lib/SwipeBackLayout$ViewDragCallback.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...out/build/intermediates/classes/release/me/imid/swipebacklayout/lib/SwipeBackLayout.class
Binary file not shown.
Binary file modified
BIN
-12 Bytes
(100%)
SwipebackLayout/build/outputs/aar/SwipebackLayout-debug.aar
Binary file not shown.
Binary file modified
BIN
-11 Bytes
(100%)
SwipebackLayout/build/outputs/aar/SwipebackLayout-release.aar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/com/aishang5wpj/juhenews/FileUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.aishang5wpj.juhenews; | ||
|
||
import android.test.AndroidTestCase; | ||
|
||
import com.aishang5wpj.juhenews.utils.FileUtils; | ||
|
||
/** | ||
* Created by wpj on 16/5/17上午11:42. | ||
*/ | ||
public class FileUtilsTest extends AndroidTestCase { | ||
|
||
@Override | ||
public void testAndroidTestCaseSetupProperly() { | ||
super.testAndroidTestCaseSetupProperly(); | ||
|
||
String result = FileUtils.readAssertsFile(mContext, "channel.json"); | ||
assertNotNull(result); | ||
result = FileUtils.readAssertsFile(mContext, "test/test.json"); | ||
assertNotNull(result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"showapi_res_code": 0, | ||
"showapi_res_error": "", | ||
"showapi_res_body": { | ||
"channelList": [ | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001cd", | ||
"name": "国内焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001ce", | ||
"name": "国际焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001cf", | ||
"name": "军事焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d0", | ||
"name": "财经焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d1", | ||
"name": "互联网焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d2", | ||
"name": "房产焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d3", | ||
"name": "汽车焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d4", | ||
"name": "体育焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d5", | ||
"name": "娱乐焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d6", | ||
"name": "游戏焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d7", | ||
"name": "教育焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d8", | ||
"name": "女人焦点" | ||
}, | ||
{ | ||
"channelId": "5572a108b3cdc86cf39001d9", | ||
"name": "科技焦点" | ||
}, | ||
{ | ||
"channelId": "5572a109b3cdc86cf39001da", | ||
"name": "社会焦点" | ||
} | ||
], | ||
"ret_code": 0, | ||
"totalNum": 44 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this is a test file. |
71 changes: 71 additions & 0 deletions
71
app/src/main/java/com/aishang5wpj/juhenews/bean/NewsBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.aishang5wpj.juhenews.bean; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by wpj on 16/5/17上午10:27. | ||
*/ | ||
public class NewsBean { | ||
|
||
public String showapi_res_code = ""; | ||
public String showapi_res_error = ""; | ||
public Body showapi_res_body; | ||
|
||
public NewsBean() { | ||
showapi_res_body = new Body(); | ||
} | ||
|
||
public class Body { | ||
public String ret_code = ""; | ||
public Page pagebean; | ||
|
||
public Body() { | ||
pagebean = new Page(); | ||
} | ||
} | ||
|
||
public class Page { | ||
public String allNum = ""; | ||
public String allPages = ""; | ||
public String currentPage = ""; | ||
public String maxResult = ""; | ||
public List<News> contentlist; | ||
|
||
public Page() { | ||
contentlist = new ArrayList<>(1); | ||
} | ||
} | ||
|
||
public class News { | ||
public String channelId = ""; | ||
public String channelName = ""; | ||
public String content = ""; | ||
public String desc = ""; | ||
public String html = ""; | ||
public List<Image> imageurls; | ||
public String link = ""; | ||
public String nid = ""; | ||
public String pubDate = "";//发表时间 | ||
public String sentiment_display = ""; | ||
public String source = "";//新闻来源 | ||
public String title = "";// | ||
|
||
public News() { | ||
imageurls = new ArrayList<>(1); | ||
} | ||
|
||
public String getImageUrl() { | ||
if (null == imageurls || imageurls.size() <= 0) { | ||
return ""; | ||
} | ||
return imageurls.get(0).url; | ||
} | ||
} | ||
|
||
public class Image { | ||
public String height = ""; | ||
public String url = ""; | ||
public String width = ""; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/aishang5wpj/juhenews/bean/NewsChannelBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.aishang5wpj.juhenews.bean; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by wpj on 16/5/17下午1:16. | ||
*/ | ||
public class NewsChannelBean { | ||
public String showapi_res_code = ""; | ||
public String showapi_res_error = ""; | ||
public Body showapi_res_body; | ||
|
||
public NewsChannelBean() { | ||
showapi_res_body = new Body(); | ||
} | ||
|
||
public class Body { | ||
public String ret_code = ""; | ||
public String totalNum = ""; | ||
public List<Channel> channelList; | ||
|
||
public Body() { | ||
channelList = new ArrayList<>(1); | ||
} | ||
} | ||
|
||
public class Channel implements Serializable { | ||
public String channelId = ""; | ||
public String name = ""; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/aishang5wpj/juhenews/main/news/INewsChannelView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.aishang5wpj.juhenews.main.news; | ||
|
||
import android.content.Context; | ||
|
||
import com.aishang5wpj.juhenews.bean.NewsChannelBean; | ||
|
||
/** | ||
* Created by wpj on 16/5/17下午1:30. | ||
*/ | ||
public interface INewsChannelView { | ||
|
||
void onLoadChannelCompleted(NewsChannelBean channelBean); | ||
|
||
void runOnUiThread(Runnable runnable); | ||
|
||
Context getContext(); | ||
} |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/aishang5wpj/juhenews/main/news/INewsModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.aishang5wpj.juhenews.main.news; | ||
|
||
import com.aishang5wpj.juhenews.bean.NewsBean; | ||
import com.aishang5wpj.juhenews.bean.NewsChannelBean; | ||
|
||
/** | ||
* Created by wpj on 16/5/17上午10:08. | ||
*/ | ||
public interface INewsModel { | ||
|
||
void loadChannel(OnLoadChannelListener listener); | ||
|
||
void loadNews(NewsChannelBean.Channel channel, int page, OnLoadNewsListener listener); | ||
|
||
interface OnLoadChannelListener { | ||
void onLoadCompleted(NewsChannelBean channelBean); | ||
} | ||
|
||
interface OnLoadNewsListener { | ||
void onLoadCompleted(NewsBean newsBean); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/aishang5wpj/juhenews/main/news/INewsPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.aishang5wpj.juhenews.main.news; | ||
|
||
import com.aishang5wpj.juhenews.bean.NewsChannelBean; | ||
|
||
/** | ||
* Created by wpj on 16/5/17上午10:05. | ||
*/ | ||
public interface INewsPresenter { | ||
|
||
void loadNews(NewsChannelBean.Channel channel, int page); | ||
|
||
void loadChannel(); | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/aishang5wpj/juhenews/main/news/INewsView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.aishang5wpj.juhenews.main.news; | ||
|
||
import com.aishang5wpj.juhenews.bean.NewsBean; | ||
|
||
/** | ||
* Created by wpj on 16/5/17上午10:09. | ||
*/ | ||
public interface INewsView { | ||
void showProgress(); | ||
|
||
void hideProgress(); | ||
|
||
void onNewsLoad(NewsBean newsBean); | ||
|
||
void runOnUiThread(Runnable runnable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.