Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit 2929391

Browse files
committed
收藏列表支持标签分类了
1 parent ec4f5dc commit 2929391

File tree

71 files changed

+1273
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1273
-274
lines changed

.idea/modules.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ android {
1616
abiFilters "x86"
1717
abiFilters "armeabi-v7a"
1818
}
19+
javaCompileOptions {
20+
annotationProcessorOptions {
21+
arguments = [moduleName: project.getName()]
22+
}
23+
}
1924
}
2025
dexOptions {
2126
javaMaxHeapSize "2g"
@@ -33,6 +38,7 @@ android {
3338
debug {
3439
minifyEnabled false
3540
debuggable true
41+
applicationIdSuffix '.debug'
3642
signingConfig signingConfigs.release
3743
}
3844
release {
@@ -45,11 +51,24 @@ android {
4551

4652
dependencies {
4753
implementation fileTree(dir: 'libs', include: ['*.jar'])
54+
annotationProcessor rootProject.ext.annotationProcessors.butterknife
55+
annotationProcessor rootProject.ext.annotationProcessors.arouter
4856
implementation rootProject.ext.dependencies.appcompat
57+
implementation rootProject.ext.dependencies.butterknife
58+
implementation(rootProject.ext.dependencies.raeSwift, {
59+
exclude group: 'com.android.support'
60+
})
61+
implementation project(':module-resource')
62+
implementation project(':module-basic')
63+
implementation project(':module-widget')
64+
implementation project(':module-sdk')
65+
implementation project(':module-middleware')
66+
4967
// 模块化
5068
if (!IsModule.toBoolean()) {
51-
implementation project(':module-resource')
52-
implementation project(':module-env')
69+
implementation project(':module-user')
5370
implementation project(':module-home')
71+
implementation project(':module-moment')
72+
implementation project(':module-blog')
5473
}
5574
}

app/src/debug/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">博客园测试版</string>
3+
</resources>

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,12 @@
55
android:allowBackup="true"
66
android:label="@string/app_name"
77
android:supportsRtl="true"
8-
android:theme="@style/AppTheme" />
8+
android:theme="@style/AppTheme">
9+
<!--主界面-->
10+
<activity
11+
android:name=".MainActivity"
12+
android:launchMode="singleTop">
13+
14+
</activity>
15+
</application>
916
</manifest>

module-home/src/main/java/com/rae/cnblogs/home/MainActivity.java renamed to app/src/main/java/com/rae/cnblogs/MainActivity.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.rae.cnblogs.home;
1+
package com.rae.cnblogs;
22

33
import android.Manifest;
44
import android.content.DialogInterface;
@@ -10,13 +10,15 @@
1010
import android.support.v4.app.ActivityCompat;
1111
import android.support.v4.app.Fragment;
1212
import android.support.v4.view.ViewPager;
13+
import android.util.Log;
1314
import android.view.View;
15+
import android.webkit.CookieManager;
1416
import android.widget.ImageView;
1517
import android.widget.TextView;
1618

1719
import com.alibaba.android.arouter.facade.annotation.Route;
18-
import com.rae.cnblogs.AppRoute;
1920
import com.rae.cnblogs.basic.BasicActivity;
21+
import com.rae.cnblogs.blog.CnblogsService;
2022
import com.rae.cnblogs.dialog.DefaultDialogFragment;
2123
import com.rae.cnblogs.dialog.VersionDialogFragment;
2224
import com.rae.cnblogs.home.main.MainContract;
@@ -43,8 +45,24 @@ protected void onCreate(Bundle savedInstanceState) {
4345
super.onCreate(savedInstanceState);
4446
setContentView(R.layout.activity_main);
4547
mPresenter = new MainPresenterImpl(this);
48+
// 测试登录
49+
debugLogin();
4650
initTab();
4751
requestPermissions();
52+
// 启动服务
53+
startService(new Intent(this, CnblogsService.class));
54+
55+
}
56+
57+
protected void debugLogin() {
58+
String url = "cnblogs.com";
59+
String cookie = "257609FA8BD9AB43F07A4B4110DEA5561685E8827D2536EB50CB07E6BD72A852B65E7121C7282323F9689202135E707D72184476D358B429FD5F32F00103BE9C02414571D796E42637836235120D40B4D03C3CC6";
60+
String netCoreCookie = "CfDJ8FHXRRtkJWRFtU30nh_M9mAcOtlDEoxNOvReESDtP-LGb9f1uAbknAYX_5g3d2Y-mOtPlu_vqplSTz3mRrRqcUrNE9QYYCP7cqzVzbnLztUF38wiIP6XaW10kl0QvUi_xEdaOv62KWeqYeZMAwtkOqw4H4ark-KBNhDzGAPDG3L0_5ymM3XA8f8RBjbNG5ZDE7bAwIQq3GtI4oX_4rl5uoS2Xw8n36ESUB4tQJ0kdOJf8GeKYdOWoZznhRwmrRiUl_VtGOVryQYV3-8hys11UEodQTYM1MLAL8QhJLp6ZKOAI3UMLQfcHMfKNL7_bZhd5w";
61+
CookieManager cookieManager = CookieManager.getInstance();
62+
cookieManager.removeAllCookie();
63+
cookieManager.setCookie(url, ".CNBlogsCookie=" + cookie + "; domain=.cnblogs.com; path=/; HttpOnly");
64+
cookieManager.setCookie(url, ".Cnblogs.AspNetCore.Cookies=" + netCoreCookie + "; domain=.cnblogs.com; path=/; HttpOnly");
65+
cookieManager.flush();
4866
}
4967

5068
@Override
@@ -57,9 +75,9 @@ private void initTab() {
5775
RaeFragmentAdapter adapter = new RaeFragmentAdapter(getSupportFragmentManager());
5876

5977
// 初始化TAB
60-
// addTab(adapter, R.string.tab_home, R.drawable.tab_home, HomeFragment.newInstance());
61-
// addTab(adapter, R.string.tab_sns, R.drawable.tab_news, AppRoute.newMomentFragment());
62-
// addTab(adapter, R.string.tab_discover, R.drawable.tab_library, DiscoverFragment.newInstance());
78+
addTab(adapter, R.string.tab_home, R.drawable.tab_home, AppRoute.newHomeFragment());
79+
addTab(adapter, R.string.tab_sns, R.drawable.tab_news, AppRoute.newMomentFragment());
80+
addTab(adapter, R.string.tab_discover, R.drawable.tab_library, AppRoute.newMomentFragment());
6381
addTab(adapter, R.string.tab_mine, R.drawable.tab_mine, AppRoute.newMineFragment());
6482

6583
mViewPager.setOffscreenPageLimit(adapter.getCount());
@@ -70,7 +88,12 @@ private void initTab() {
7088
mViewPager.addOnPageChangeListener(new RaeTabLayout.TabLayoutOnPageChangeListener(mTabLayout));
7189
}
7290

73-
private void addTab(RaeFragmentAdapter adapter, int resId, int iconId, @NonNull Fragment fragment) {
91+
private void addTab(RaeFragmentAdapter adapter, int resId, int iconId, Fragment fragment) {
92+
if (fragment == null) {
93+
Log.e("rae", "初始化首页TAB的Fragment为空!" + getString(resId));
94+
return;
95+
}
96+
7497
RaeTabLayout.Tab tab = mTabLayout.newTab();
7598
View tabView = View.inflate(this, R.layout.tab_view, null);
7699
TextView v = tabView.findViewById(R.id.tv_tab_view);

app/src/main/res/values/colors.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/src/main/res/values/styles.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply from: 'properties.gradle'
55

66
buildscript {
77
repositories {
8-
maven { url 'http://maven.raeblog.com:8081/repository/maven-public/' }
8+
maven { url 'http://raedev.io:8081/repository/maven-public/' }
99
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
1010
google()
1111
jcenter()
@@ -23,7 +23,7 @@ buildscript {
2323

2424
allprojects {
2525
repositories {
26-
maven { url 'http://maven.raeblog.com:8081/repository/maven-public/' }
26+
maven { url 'http://raedev.io:8081/repository/maven-public/' }
2727
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
2828
maven { url "http://mvn.leancloud.cn/nexus/content/repositories/public" }
2929
maven { url "https://jitpack.io" }

dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ext {
2222
butterknife : 'com.jakewharton:butterknife:9.0.0-SNAPSHOT',
2323
arouter : 'com.alibaba:arouter-api:1.3.1',
2424
eventBus : 'org.greenrobot:eventbus:3.1.1',
25-
jsoup : 'org.jsoup:jsoup:1.10.1',
25+
jsoup : 'org.jsoup:jsoup:1.11.3',
2626
raeSwift : 'com.rae.swift:rae-library:1.0.1',
2727
raeOkhttpExt : 'com.squareup.okhttp3:okhttp-ext:3.9.0',
2828
raeSession : 'com.github.raee:AndroidSessionManager:1.0.0',
@@ -34,7 +34,7 @@ ext {
3434
rxlifecycle : 'com.trello.rxlifecycle2:rxlifecycle-android-lifecycle:2.2.1',
3535
skin : 'skin.support:skin-support:3.1.0-beta',
3636
skinDesign : 'skin.support:skin-support-design:3.1.0-beta',
37-
raeDesignExt : 'com.rae.widget:design-ext:1.0.1',
37+
raeDesignExt : 'com.rae.widget:design-ext:1.0.2',
3838
ptr : 'in.srain.cube:ultra-ptr:1.0.11',
3939
xRecyclerView : 'com.github.raee:XRecyclerView:1.3.3',
4040
roundedImage : 'com.makeramen:roundedimageview:2.3.0',

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ org.gradle.jvmargs=-Xmx1536m
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel=true
1414
# 是否启用模块化,当设置为TRUE的时候,所有的模块化将设置成应用程序,单独调试。
15-
IsModule=true
15+
IsModule=false

module-basic/src/main/java/com/rae/cnblogs/basic/AppImageLoader.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,21 @@ public static void displayAvatar(@Nullable String url, @Nullable ImageView view)
4747
public static void displayAvatar(@Nullable String url, @Nullable ImageView view, int resId) {
4848
if (view == null)
4949
return;
50-
if (TextUtils.isEmpty(url)) {
51-
view.setImageResource(resId);
52-
return;
53-
}
5450

5551
Context context = view.getContext();
5652
if (resId == -1) {
5753
resId = context.getResources().getIdentifier("default_avatar_placeholder", "drawable", context.getPackageName());
5854
}
5955

56+
if (TextUtils.isEmpty(url)) {
57+
view.setImageResource(resId);
58+
return;
59+
}
60+
6061
GlideApp.with(view)
6162
.load(url)
62-
// .centerCrop()
63-
.placeholder(resId)
63+
.centerCrop()
64+
// .placeholder(resId)
6465
.error(resId)
6566
// 渐变动画
6667
.transition(DrawableTransitionOptions.withCrossFade(300))

module-basic/src/main/java/com/rae/cnblogs/basic/BasicApplication.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import android.app.ActivityManager;
44
import android.app.Application;
55
import android.content.Context;
6+
import android.content.Intent;
7+
import android.os.Build;
68
import android.support.multidex.MultiDex;
79

810
import java.util.List;
@@ -15,6 +17,8 @@ public class BasicApplication extends Application {
1517
@Override
1618
public void onCreate() {
1719
super.onCreate();
20+
21+
1822
int pid = android.os.Process.myPid();
1923
String processAppName = getAppName(pid);
2024
if (processAppName == null || getPackageName().equalsIgnoreCase(processAppName)) {
@@ -27,6 +31,18 @@ public void onCreate() {
2731
*/
2832
protected void onFirstCreate() {
2933

34+
// // 启动博客园服务
35+
// Intent intent = new Intent();
36+
// intent.setClassName(getPackageName(), "com.rae.cnblogs.blog.CnblogsService");
37+
//
38+
// /*
39+
// * Android 8.0 不允许创建后台服务了
40+
// * */
41+
// if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
42+
// startForegroundService(intent);
43+
// } else {
44+
// startService(intent);
45+
// }
3046
}
3147

3248
@Override
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.rae.cnblogs.basic.rx;
2+
3+
import android.util.Log;
4+
5+
import io.reactivex.observers.DisposableObserver;
6+
7+
/**
8+
* Created by rae on 2018/5/31.
9+
* Copyright (c) https://github.com/raedev All rights reserved.
10+
*/
11+
public abstract class DefaultEmptyObserver<T> extends DisposableObserver<T> {
12+
13+
@Override
14+
public void onError(Throwable e) {
15+
Log.e("rae", "empty observer error!", e);
16+
}
17+
18+
@Override
19+
public void onComplete() {
20+
21+
}
22+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.rae.cnblogs.blog">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:fullBackupContent="true">
7+
<activity
8+
android:name=".BlogTestActivity"
9+
android:label="博客模块测试">
10+
<!-- <intent-filter>
11+
<action android:name="android.intent.action.MAIN" />
12+
<category android:name="android.intent.category.LAUNCHER" />
13+
</intent-filter>-->
14+
</activity>
15+
16+
</application>
17+
</manifest>

module-blog/src/main/AndroidManifest.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
<application
55
android:allowBackup="true"
66
android:fullBackupContent="true">
7-
<activity android:name=".BlogTestActivity">
8-
<intent-filter>
9-
<action android:name="android.intent.action.MAIN" />
10-
<category android:name="android.intent.category.LAUNCHER" />
11-
</intent-filter>
12-
</activity>
7+
138
<activity android:name=".ContentDetailActivity" />
149
<activity
1510
android:name=".CommentActivity"
1611
android:label="@string/label_comment" />
12+
<activity
13+
android:name=".FavoritesActivity"
14+
android:label="@string/my_favorites" />
15+
16+
<service
17+
android:name=".CnblogsService"
18+
android:exported="false"
19+
android:label="@string/service_name" />
1720
</application>
1821
</manifest>

0 commit comments

Comments
 (0)