├── .github
└── workflows
│ └── android.yml
├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── dictionaries
│ └── liuhuiliang.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
└── runConfigurations.xml
├── README.md
├── app
├── .gitignore
├── app-release.apk
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── demo
│ │ └── redbook
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── demo
│ │ │ ├── adapter
│ │ │ └── note
│ │ │ │ ├── CommentDelegate.java
│ │ │ │ ├── ContentDelegate.java
│ │ │ │ ├── HeadDelegate.java
│ │ │ │ └── HomeAdapter.java
│ │ │ ├── app
│ │ │ └── App.java
│ │ │ ├── data
│ │ │ └── RedBookData.java
│ │ │ ├── model
│ │ │ ├── CommentModel.java
│ │ │ ├── HomeModel.java
│ │ │ ├── NoteModel.java
│ │ │ ├── PictureModel.java
│ │ │ ├── SizeModel.java
│ │ │ └── UserModel.java
│ │ │ ├── redbook
│ │ │ └── MainActivity.java
│ │ │ └── utils
│ │ │ ├── PictureSize.java
│ │ │ └── StatusBarUtils.java
│ └── res
│ │ ├── drawable-hdpi
│ │ └── ic_note_bg.9.png
│ │ ├── drawable-xxhdpi
│ │ ├── common_head_btn_back.png
│ │ ├── ic_default_head.png
│ │ ├── ic_like_count_def.png
│ │ ├── note_icon_comment.png
│ │ ├── note_icon_fav_normal.png
│ │ └── note_icon_like_normal.png
│ │ ├── drawable
│ │ └── sp_round.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── item_note_comment.xml
│ │ ├── item_note_head.xml
│ │ └── item_note_notes.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── demo
│ └── redbook
│ └── ExampleUnitTest.java
├── build.gradle
├── checkstyle.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── redbook.gif
└── settings.gradle
/.github/workflows/android.yml:
--------------------------------------------------------------------------------
1 | name: Android CI
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: set up JDK 1.8
17 | uses: actions/setup-java@v1
18 | with:
19 | java-version: 1.8
20 | - name: Build with Gradle
21 | run: ./gradlew build
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/dictionaries/liuhuiliang.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Abstraction issuesJava
39 |
40 |
41 | Android
42 |
43 |
44 | Android > Lint > Accessibility
45 |
46 |
47 | Android > Lint > Correctness
48 |
49 |
50 | Android > Lint > Correctness > Messages
51 |
52 |
53 | Android > Lint > Internationalization
54 |
55 |
56 | Android > Lint > Performance
57 |
58 |
59 | Android > Lint > Security
60 |
61 |
62 | Android > Lint > Usability
63 |
64 |
65 | Android > Lint > Usability > Icons
66 |
67 |
68 | Assignment issuesGroovy
69 |
70 |
71 | Assignment issuesJava
72 |
73 |
74 | Bitwise operation issuesJava
75 |
76 |
77 | C/C++
78 |
79 |
80 | Class structureJava
81 |
82 |
83 | Code style issuesJava
84 |
85 |
86 | Control FlowGroovy
87 |
88 |
89 | Control flow issuesJava
90 |
91 |
92 | Data flow analysisC/C++
93 |
94 |
95 | GPath inspectionsGroovy
96 |
97 |
98 | General
99 |
100 |
101 | GeneralC/C++
102 |
103 |
104 | GeneralJava
105 |
106 |
107 | Groovy
108 |
109 |
110 | HTML
111 |
112 |
113 | Initialization issuesJava
114 |
115 |
116 | Internationalization issuesJava
117 |
118 |
119 | J2ME issuesJava
120 |
121 |
122 | JUnit issuesJava
123 |
124 |
125 | Java
126 |
127 |
128 | Java language level issuesJava
129 |
130 |
131 | Java language level migration aidsJava
132 |
133 |
134 | Javadoc issuesJava
135 |
136 |
137 | Logging issuesJava
138 |
139 |
140 | Memory issuesJava
141 |
142 |
143 | Naming ConventionsGroovy
144 |
145 |
146 | Naming conventionsJava
147 |
148 |
149 | Numeric issuesJava
150 |
151 |
152 | Performance issuesJava
153 |
154 |
155 | Portability issuesJava
156 |
157 |
158 | Potentially confusing code constructsGroovy
159 |
160 |
161 | Probable bugsGroovy
162 |
163 |
164 | Probable bugsJava
165 |
166 |
167 | Properties Files
168 |
169 |
170 | RELAX NG
171 |
172 |
173 | Security issuesJava
174 |
175 |
176 | TestNGJava
177 |
178 |
179 | Threading issuesJava
180 |
181 |
182 | Visibility issuesJava
183 |
184 |
185 |
186 |
187 | Android
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 | 1.8
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RedBook
2 | like red book note detail
3 | >仿小红书,笔记详情
4 | 
5 |
6 | 更多介绍:
7 | http://www.jianshu.com/p/38d784d7aac1
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BelongsH/RedBook/30add3536ddc279623b55a1f487c5d9725c622d4/app/app-release.apk
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "24.0.0"
6 | defaultConfig {
7 | applicationId "com.demo.redbook"
8 | minSdkVersion 14
9 | targetSdkVersion 23
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | dexOptions {
21 | maxProcessCount 6
22 | javaMaxHeapSize "3g"
23 | }
24 | }
25 |
26 | def supportLibVersion = '23.2.1'
27 |
28 | dependencies {
29 | compile fileTree(dir: 'libs', include: ['*.jar'])
30 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
31 | exclude group: 'com.android.support', module: 'support-annotations'
32 | })
33 |
34 | testCompile 'junit:junit:4.12'
35 |
36 | //----------------------------------supportLibray----------------------------------
37 | compile "com.android.support:design:${supportLibVersion}"
38 | compile "com.android.support:palette-v7:${supportLibVersion}"
39 | compile "com.android.support:gridlayout-v7:${supportLibVersion}"
40 |
41 | compile 'com.squareup.okhttp3:okhttp:3.4.1'
42 | compile "com.squareup.retrofit2:converter-gson:2.1.0"
43 | compile 'com.jakewharton:butterknife:7.0.1'
44 | compile 'com.hannesdorfmann:adapterdelegates3:3.0.0'
45 | compile 'com.squareup.picasso:picasso:2.5.2'
46 | compile 'com.nianxin:utils:1.0.0'
47 | compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'
48 | compile 'com.github.bumptech.glide:glide:3.7.0'
49 | compile 'jp.wasabeef:glide-transformations:2.0.1'
50 |
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/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 /Users/liuhuiliang/Library/Android/sdk/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/com/demo/redbook/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.demo.redbook;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.demo.redbook", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/demo/adapter/note/CommentDelegate.java:
--------------------------------------------------------------------------------
1 | package com.demo.adapter.note;
2 |
3 | import android.support.annotation.NonNull;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.support.v7.widget.StaggeredGridLayoutManager;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import com.bumptech.glide.Glide;
13 | import com.bumptech.glide.load.engine.DiskCacheStrategy;
14 | import com.demo.model.CommentModel;
15 | import com.demo.model.HomeModel;
16 | import com.demo.redbook.R;
17 | import com.hannesdorfmann.adapterdelegates3.AdapterDelegate;
18 |
19 | import java.util.List;
20 |
21 | import butterknife.Bind;
22 | import butterknife.ButterKnife;
23 | import jp.wasabeef.glide.transformations.CropCircleTransformation;
24 |
25 | /**
26 | * Created by liuhuiliang on 16/10/21.
27 | */
28 |
29 | public class CommentDelegate extends AdapterDelegate> {
30 | @Override
31 | protected boolean isForViewType(@NonNull List items, int position) {
32 | return items.get(position) instanceof CommentModel;
33 | }
34 |
35 | @NonNull
36 | @Override
37 | protected RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent) {
38 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_note_comment, parent, false);
39 | StaggeredGridLayoutManager.LayoutParams layoutParams = new StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
40 | layoutParams.setFullSpan(true);
41 | view.setLayoutParams(layoutParams);
42 | return new ViewHolder(view);
43 | }
44 |
45 | @Override
46 | protected void onBindViewHolder(@NonNull List items, int position, @NonNull RecyclerView.ViewHolder holder, @NonNull List