11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and
10 | distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright
13 | owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all other entities
16 | that control, are controlled by, or are under common control with that entity.
17 | For the purposes of this definition, "control" means (i) the power, direct or
18 | indirect, to cause the direction or management of such entity, whether by
19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 | outstanding shares, or (iii) beneficial ownership of such entity.
21 |
22 | "You" (or "Your") shall mean an individual or Legal Entity exercising
23 | permissions granted by this License.
24 |
25 | "Source" form shall mean the preferred form for making modifications, including
26 | but not limited to software source code, documentation source, and configuration
27 | files.
28 |
29 | "Object" form shall mean any form resulting from mechanical transformation or
30 | translation of a Source form, including but not limited to compiled object code,
31 | generated documentation, and conversions to other media types.
32 |
33 | "Work" shall mean the work of authorship, whether in Source or Object form, made
34 | available under the License, as indicated by a copyright notice that is included
35 | in or attached to the work (an example is provided in the Appendix below).
36 |
37 | "Derivative Works" shall mean any work, whether in Source or Object form, that
38 | is based on (or derived from) the Work and for which the editorial revisions,
39 | annotations, elaborations, or other modifications represent, as a whole, an
40 | original work of authorship. For the purposes of this License, Derivative Works
41 | shall not include works that remain separable from, or merely link (or bind by
42 | name) to the interfaces of, the Work and Derivative Works thereof.
43 |
44 | "Contribution" shall mean any work of authorship, including the original version
45 | of the Work and any modifications or additions to that Work or Derivative Works
46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
47 | by the copyright owner or by an individual or Legal Entity authorized to submit
48 | on behalf of the copyright owner. For the purposes of this definition,
49 | "submitted" means any form of electronic, verbal, or written communication sent
50 | to the Licensor or its representatives, including but not limited to
51 | communication on electronic mailing lists, source code control systems, and
52 | issue tracking systems that are managed by, or on behalf of, the Licensor for
53 | the purpose of discussing and improving the Work, but excluding communication
54 | that is conspicuously marked or otherwise designated in writing by the copyright
55 | owner as "Not a Contribution."
56 |
57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58 | of whom a Contribution has been received by Licensor and subsequently
59 | incorporated within the Work.
60 |
61 | 2. Grant of Copyright License.
62 |
63 | Subject to the terms and conditions of this License, each Contributor hereby
64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65 | irrevocable copyright license to reproduce, prepare Derivative Works of,
66 | publicly display, publicly perform, sublicense, and distribute the Work and such
67 | Derivative Works in Source or Object form.
68 |
69 | 3. Grant of Patent License.
70 |
71 | Subject to the terms and conditions of this License, each Contributor hereby
72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73 | irrevocable (except as stated in this section) patent license to make, have
74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75 | such license applies only to those patent claims licensable by such Contributor
76 | that are necessarily infringed by their Contribution(s) alone or by combination
77 | of their Contribution(s) with the Work to which such Contribution(s) was
78 | submitted. If You institute patent litigation against any entity (including a
79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80 | Contribution incorporated within the Work constitutes direct or contributory
81 | patent infringement, then any patent licenses granted to You under this License
82 | for that Work shall terminate as of the date such litigation is filed.
83 |
84 | 4. Redistribution.
85 |
86 | You may reproduce and distribute copies of the Work or Derivative Works thereof
87 | in any medium, with or without modifications, and in Source or Object form,
88 | provided that You meet the following conditions:
89 |
90 | You must give any other recipients of the Work or Derivative Works a copy of
91 | this License; and
92 | You must cause any modified files to carry prominent notices stating that You
93 | changed the files; and
94 | You must retain, in the Source form of any Derivative Works that You distribute,
95 | all copyright, patent, trademark, and attribution notices from the Source form
96 | of the Work, excluding those notices that do not pertain to any part of the
97 | Derivative Works; and
98 | If the Work includes a "NOTICE" text file as part of its distribution, then any
99 | Derivative Works that You distribute must include a readable copy of the
100 | attribution notices contained within such NOTICE file, excluding those notices
101 | that do not pertain to any part of the Derivative Works, in at least one of the
102 | following places: within a NOTICE text file distributed as part of the
103 | Derivative Works; within the Source form or documentation, if provided along
104 | with the Derivative Works; or, within a display generated by the Derivative
105 | Works, if and wherever such third-party notices normally appear. The contents of
106 | the NOTICE file are for informational purposes only and do not modify the
107 | License. You may add Your own attribution notices within Derivative Works that
108 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
109 | provided that such additional attribution notices cannot be construed as
110 | modifying the License.
111 | You may add Your own copyright statement to Your modifications and may provide
112 | additional or different license terms and conditions for use, reproduction, or
113 | distribution of Your modifications, or for any such Derivative Works as a whole,
114 | provided Your use, reproduction, and distribution of the Work otherwise complies
115 | with the conditions stated in this License.
116 |
117 | 5. Submission of Contributions.
118 |
119 | Unless You explicitly state otherwise, any Contribution intentionally submitted
120 | for inclusion in the Work by You to the Licensor shall be under the terms and
121 | conditions of this License, without any additional terms or conditions.
122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
123 | any separate license agreement you may have executed with Licensor regarding
124 | such Contributions.
125 |
126 | 6. Trademarks.
127 |
128 | This License does not grant permission to use the trade names, trademarks,
129 | service marks, or product names of the Licensor, except as required for
130 | reasonable and customary use in describing the origin of the Work and
131 | reproducing the content of the NOTICE file.
132 |
133 | 7. Disclaimer of Warranty.
134 |
135 | Unless required by applicable law or agreed to in writing, Licensor provides the
136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138 | including, without limitation, any warranties or conditions of TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140 | solely responsible for determining the appropriateness of using or
141 | redistributing the Work and assume any risks associated with Your exercise of
142 | permissions under this License.
143 |
144 | 8. Limitation of Liability.
145 |
146 | In no event and under no legal theory, whether in tort (including negligence),
147 | contract, or otherwise, unless required by applicable law (such as deliberate
148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
149 | liable to You for damages, including any direct, indirect, special, incidental,
150 | or consequential damages of any character arising as a result of this License or
151 | out of the use or inability to use the Work (including but not limited to
152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153 | any and all other commercial damages or losses), even if such Contributor has
154 | been advised of the possibility of such damages.
155 |
156 | 9. Accepting Warranty or Additional Liability.
157 |
158 | While redistributing the Work or Derivative Works thereof, You may choose to
159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160 | other liability obligations and/or rights consistent with this License. However,
161 | in accepting such obligations, You may act only on Your own behalf and on Your
162 | sole responsibility, not on behalf of any other Contributor, and only if You
163 | agree to indemnify, defend, and hold each Contributor harmless for any liability
164 | incurred by, or claims asserted against, such Contributor by reason of your
165 | accepting any such warranty or additional liability.
166 |
167 | END OF TERMS AND CONDITIONS
168 |
169 | APPENDIX: How to apply the Apache License to your work
170 |
171 | To apply the Apache License to your work, attach the following boilerplate
172 | notice, with the fields enclosed by brackets "{}" replaced with your own
173 | identifying information. (Don't include the brackets!) The text should be
174 | enclosed in the appropriate comment syntax for the file format. We also
175 | recommend that a file or class name and description of purpose be included on
176 | the same "printed page" as the copyright notice for easier identification within
177 | third-party archives.
178 |
179 | Copyright 2016 JDD
180 |
181 | Licensed under the Apache License, Version 2.0 (the "License");
182 | you may not use this file except in compliance with the License.
183 | You may obtain a copy of the License at
184 |
185 | http://www.apache.org/licenses/LICENSE-2.0
186 |
187 | Unless required by applicable law or agreed to in writing, software
188 | distributed under the License is distributed on an "AS IS" BASIS,
189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190 | See the License for the specific language governing permissions and
191 | limitations under the License.
192 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #RxJoke
2 |
3 | ----------
4 |
5 | RxJoke是一个基于Rxjava,Retrofit,Dagger2和Mvp设计的一款App。
6 |
7 | [More info!](http://www.jianshu.com/p/9430eca553a5 "More info")
8 |
9 | ##项目结构
10 | * MVP框架。
11 | * dagger2来完成依赖注入。
12 | * retrofit2+rxjava实现restful的http请求。
13 |
14 | ##第三方类库
15 | * retrofit2
16 | * dagger2
17 | * butterknife
18 | * rxjava+rxandroid
19 | * leakcanary
20 | * glide
21 | * mvp
22 | * android support design
23 |
24 | ##截图
25 |
26 |
27 |
28 |
29 |
30 |
31 | ## License
32 |
33 | Copyright 2016 JDD
34 |
35 | Licensed under the Apache License, Version 2.0 (the "License");
36 | you may not use this file except in compliance with the License.
37 | You may obtain a copy of the License at
38 |
39 | http://www.apache.org/licenses/LICENSE-2.0
40 |
41 | Unless required by applicable law or agreed to in writing, software
42 | distributed under the License is distributed on an "AS IS" BASIS,
43 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44 | See the License for the specific language governing permissions and
45 | limitations under the License.
46 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.2"
6 |
7 | defaultConfig {
8 | applicationId "rx.dong.com.rxjoke"
9 | minSdkVersion 15
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.2.0'
26 | compile 'com.jakewharton:butterknife:7.0.1'
27 | compile 'com.orhanobut:logger:1.10'
28 | compile 'com.android.support:recyclerview-v7:23.2.0'
29 | //leakcanary
30 | debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
31 | // or 1.4-beta1
32 | releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
33 | // or 1.4-beta1
34 | testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
35 | // or 1.4-beta1
36 | //retrofit2
37 | compile 'com.squareup.retrofit2:retrofit:2.0.1'
38 | compile 'com.squareup.retrofit2:adapter-rxjava:2.0.1'
39 | compile 'com.squareup.retrofit2:converter-gson:2.0.1'
40 | compile 'com.google.code.gson:gson:2.6.2'
41 | //rxjava
42 | compile 'io.reactivex:rxjava:1.1.2'
43 | compile 'io.reactivex:rxandroid:1.1.0'
44 | //okhttp
45 | compile 'com.squareup.okhttp3:okhttp:3.2.0'
46 | compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Tools\Installed\AndroidSDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/rx/dong/com/rxjoke/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/BaseApp.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke;
2 |
3 | import android.app.Application;
4 |
5 | import com.squareup.leakcanary.LeakCanary;
6 |
7 | /**
8 | * Created by JDD on 2016/4/8.
9 | */
10 | public class BaseApp extends Application {
11 | @Override
12 | public void onCreate() {
13 | super.onCreate();
14 | LeakCanary.install(this);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/api/JokeApi.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.api;
2 |
3 | import retrofit2.Call;
4 | import retrofit2.http.GET;
5 | import retrofit2.http.Header;
6 | import retrofit2.http.Headers;
7 | import retrofit2.http.Query;
8 | import rx.Observable;
9 | import rx.dong.com.rxjoke.model.JokeEntity;
10 |
11 | /**
12 | * Created by JDD on 2016/4/8.
13 | */
14 | public interface JokeApi {
15 |
16 | @Headers("apikey:83ec99fff780989a5376a1bc595ed5ff")
17 | @GET("showapi_joke/joke_text")
18 | Observable getJoke(@Query("page") int page);
19 |
20 | @GET("showapi_joke/joke_text")
21 | Call callJoke(@Header("apikey") String apikey, @Query("page") int page);
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/api/RxService.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.api;
2 |
3 | import okhttp3.OkHttpClient;
4 | import okhttp3.logging.HttpLoggingInterceptor;
5 | import retrofit2.Retrofit;
6 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
7 | import retrofit2.converter.gson.GsonConverterFactory;
8 |
9 | /**
10 | * Created by SkyEyesStion on 2016/2/26.
11 | */
12 | public class RxService {
13 | private static final String BASETESTURL = "http://apis.baidu.com/showapi_open_bus/";
14 | private static OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor
15 | (new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)).build();
16 | private static Retrofit retrofit = new Retrofit.Builder()
17 | .baseUrl(BASETESTURL)
18 | .client(okHttpClient)
19 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
20 | .addConverterFactory(GsonConverterFactory.create())
21 | .build();
22 |
23 | private RxService() {
24 | //construct
25 |
26 | }
27 |
28 | public static T createApi(Class clazz) {
29 |
30 | return retrofit.create(clazz);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/common/AutoLoadRecylerView.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.common;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.widget.LinearLayoutManager;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.util.AttributeSet;
8 |
9 | /**
10 | * Created by JDD on 2016/4/8.
11 | */
12 | public class AutoLoadRecylerView extends RecyclerView {
13 | private loadMoreListener loadMoreListener;
14 | private AutoLoadScroller autoLoadScroller;
15 | private boolean isLoading = false;
16 |
17 | public interface loadMoreListener {
18 | void onLoadMore();
19 | }
20 |
21 | public AutoLoadRecylerView(Context context) {
22 | this(context, null);
23 | }
24 |
25 |
26 | public AutoLoadRecylerView(Context context, @Nullable AttributeSet attrs) {
27 | super(context, attrs);
28 | autoLoadScroller = new AutoLoadScroller();
29 | addOnScrollListener(autoLoadScroller);
30 | }
31 |
32 |
33 | public void setLoadMoreListener(AutoLoadRecylerView.loadMoreListener loadMoreListener) {
34 | this.loadMoreListener = loadMoreListener;
35 | }
36 |
37 | public boolean isLoading() {
38 | return isLoading;
39 | }
40 |
41 | public void setLoading(boolean loading) {
42 | isLoading = loading;
43 | }
44 |
45 | public void removeAutoScroller() {
46 | removeOnScrollListener(autoLoadScroller);
47 | }
48 |
49 | private class AutoLoadScroller extends OnScrollListener {
50 | @Override
51 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
52 | super.onScrolled(recyclerView, dx, dy);
53 | if (getLayoutManager() instanceof LinearLayoutManager) {
54 | int lastVisiblePos = ((LinearLayoutManager) getLayoutManager()).findLastVisibleItemPosition();
55 | int itemCount = getAdapter().getItemCount();
56 | if (loadMoreListener != null && !isLoading && lastVisiblePos > itemCount - 2 && dy > 0) {
57 | loadMoreListener.onLoadMore();
58 | isLoading = true;
59 | }
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/common/DividerItemDecoration.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.common;
2 |
3 |
4 | import android.content.Context;
5 | import android.graphics.Canvas;
6 | import android.graphics.Rect;
7 | import android.graphics.drawable.Drawable;
8 | import android.os.Build;
9 | import android.support.v7.widget.LinearLayoutManager;
10 | import android.support.v7.widget.RecyclerView;
11 | import android.view.View;
12 |
13 | import rx.dong.com.rxjoke.R;
14 |
15 |
16 | /**
17 | * 用于RecyclerView分割线
18 | *
19 | * @author lsxiao
20 | * @date 2015-11-05 00:27
21 | */
22 | public class DividerItemDecoration extends RecyclerView.ItemDecoration {
23 |
24 | public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
25 |
26 | public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
27 |
28 | private Drawable mDivider;
29 |
30 | private int mOrientation;
31 |
32 | public DividerItemDecoration(Context context, int orientation) {
33 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
34 | mDivider = context.getDrawable(R.drawable.list_divider);
35 | } else
36 | mDivider = context.getResources().getDrawable(R.drawable.list_divider);
37 | setOrientation(orientation);
38 | }
39 |
40 | public void setOrientation(int orientation) {
41 | if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
42 | throw new IllegalArgumentException("invalid orientation");
43 | }
44 | mOrientation = orientation;
45 | }
46 |
47 | @Override
48 | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
49 | if (mOrientation == VERTICAL_LIST) {
50 | drawVertical(c, parent);
51 | } else {
52 | drawHorizontal(c, parent);
53 | }
54 | }
55 |
56 | public void drawVertical(Canvas c, RecyclerView parent) {
57 | final int left = parent.getPaddingLeft();
58 | final int right = parent.getWidth() - parent.getPaddingRight();
59 |
60 | final int childCount = parent.getChildCount();
61 | for (int i = 0; i < childCount; i++) {
62 | final View child = parent.getChildAt(i);
63 | final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
64 | .getLayoutParams();
65 | final int top = child.getBottom() + params.bottomMargin;
66 | final int bottom = top + mDivider.getIntrinsicHeight();
67 | mDivider.setBounds(left, top, right, bottom);
68 | mDivider.draw(c);
69 | }
70 | }
71 |
72 | public void drawHorizontal(Canvas c, RecyclerView parent) {
73 | final int top = parent.getPaddingTop();
74 | final int bottom = parent.getHeight() - parent.getPaddingBottom();
75 |
76 | final int childCount = parent.getChildCount();
77 | for (int i = 0; i < childCount; i++) {
78 | final View child = parent.getChildAt(i);
79 | final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
80 | .getLayoutParams();
81 | final int left = child.getRight() + params.rightMargin;
82 | final int right = left + mDivider.getIntrinsicHeight();
83 | mDivider.setBounds(left, top, right, bottom);
84 | mDivider.draw(c);
85 | }
86 | }
87 |
88 | @Override
89 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State
90 | state) {
91 | if (mOrientation == VERTICAL_LIST) {
92 | outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
93 | } else {
94 | outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/model/ContentlistEntity.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.model;
2 |
3 | /**
4 | * Created by JDD on 2016/4/23 0023.
5 | */
6 | public class ContentlistEntity {
7 | private String ct;
8 | private String text;
9 | private String title;
10 | private int type;
11 |
12 | public String getCt() {
13 | return ct;
14 | }
15 |
16 | public void setCt(String ct) {
17 | this.ct = ct;
18 | }
19 |
20 | public String getText() {
21 | return text;
22 | }
23 |
24 | public void setText(String text) {
25 | this.text = text;
26 | }
27 |
28 | public String getTitle() {
29 | return title;
30 | }
31 |
32 | public void setTitle(String title) {
33 | this.title = title;
34 | }
35 |
36 | public int getType() {
37 | return type;
38 | }
39 |
40 | public void setType(int type) {
41 | this.type = type;
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/rx/dong/com/rxjoke/model/JokeEntity.java:
--------------------------------------------------------------------------------
1 | package rx.dong.com.rxjoke.model;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * Created by JDD on 2016/4/7.
7 | */
8 | public class JokeEntity {
9 | /**
10 | * showapi_res_code : 0
11 | * showapi_res_error :
12 | * showapi_res_body : {"allNum":21320,"allPages":1066,"contentlist":[{"ct":"2016-04-08
13 | * 14:00:00.676","text":"今天在卫生间拉翔,进行中媳妇进来洗澡,我拉完翔就贱贱的伸出魔爪去摸咪咪,<\/p>