Skip to content

Commit 76bdd9e

Browse files
committed
- 修复搜索退出导致崩溃问题
- 修复博客评论Html解析器为空问题 - 修复闪存登录状态没有显示评论问题 - 修复添加/删除收藏问题 - 新闻知识库查看时显示作者信息
1 parent 3edf3fb commit 76bdd9e

30 files changed

+313
-149
lines changed

Diff for: CHANGES.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# 版本更新记录
22

3+
## V1.1.3
4+
5+
*开发中*
6+
7+
> **2018-01-25**
8+
9+
- 修复搜索退出导致崩溃问题
10+
- 修复博客评论Html解析器为空问题
11+
- 修复闪存登录状态没有显示评论问题
12+
- 修复添加/删除收藏问题
13+
- 新闻知识库查看时显示作者信息
14+
315
## V1.0.1
416

517
*发布于:2017-09-11 13:00*

Diff for: app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ android {
4444
applicationId "com.rae.cnblogs"
4545
minSdkVersion rootProject.ext.minSdkVersion
4646
targetSdkVersion rootProject.ext.targetSdkVersion
47-
versionCode 5
48-
versionName "1.1.2"
47+
versionCode 6
48+
versionName "1.1.3"
4949
multiDexEnabled true
5050
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
5151
buildConfigField 'String', 'BUGLY_APP_ID', '"' + buglyAppId + '"'
@@ -136,7 +136,7 @@ dependencies {
136136
compile 'com.makeramen:roundedimageview:2.3.0'
137137
compile 'com.github.bumptech.glide:glide:4.0.0'
138138
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
139-
compile 'com.umeng.analytics:analytics:6.1.2'
139+
compile 'com.umeng.analytics:analytics:6.1.3'
140140
compile 'org.greenrobot:eventbus:3.0.0'
141141
compile 'me.imid.swipebacklayout.lib:library:1.0.0'
142142
compile 'com.github.chrisbanes:PhotoView:2.1.2'

Diff for: app/src/debug/res/AndroidManifest.xml

+18-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"/>
1313
<uses-permission android:name="android.permission.CAMERA"/>
1414
<uses-permission android:name="android.permission.INTERNET"/>
15-
<!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
16-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
17-
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>-->
1815
<uses-permission android:name="android.permission.READ_LOGS"/>
1916

2017
<application
@@ -25,6 +22,24 @@
2522
android:supportsRtl="true"
2623
android:theme="@style/AppTheme">
2724

25+
<!--启动页-->
26+
<activity
27+
android:name=".activity.LauncherActivity"
28+
android:theme="@style/AppTheme.NoActionBar.FullScreen"
29+
tools:node="remove"/>
30+
31+
<!--主界面-->
32+
<activity
33+
android:name=".activity.MainActivity"
34+
android:theme="@style/AppTheme.Dark"
35+
tools:node="replace">
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN"/>
38+
39+
<category android:name="android.intent.category.LAUNCHER"/>
40+
</intent-filter>
41+
</activity>
42+
2843
<!--开始-快速开发需要移除下面的多进程-->
2944
<service
3045
android:name="com.squareup.leakcanary.internal.HeapAnalyzerService"

Diff for: app/src/main/AndroidManifest.xml

+8-10
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@
2323
<!--启动页-->
2424
<activity
2525
android:name=".activity.LauncherActivity"
26-
2726
android:theme="@style/AppTheme.NoActionBar.FullScreen">
28-
<intent-filter>
29-
<action android:name="android.intent.action.MAIN"/>
27+
<!-- <intent-filter>
28+
<action android:name="android.intent.action.MAIN"/>
3029
31-
<category android:name="android.intent.category.LAUNCHER"/>
32-
</intent-filter>
30+
<category android:name="android.intent.category.LAUNCHER"/>
31+
</intent-filter>-->
3332
</activity>
3433

3534
<!--主界面-->
3635
<activity
3736
android:name=".activity.MainActivity"
3837
android:theme="@style/AppTheme.Dark">
39-
<!-- <intent-filter>
40-
<action android:name="android.intent.action.MAIN"/>
38+
<intent-filter>
39+
<action android:name="android.intent.action.MAIN"/>
4140

42-
<category android:name="android.intent.category.LAUNCHER"/>
43-
</intent-filter>-->
41+
<category android:name="android.intent.category.LAUNCHER"/>
42+
</intent-filter>
4443
</activity>
4544

4645
<activity
@@ -192,7 +191,6 @@
192191
android:name=".wxapi.WXEntryActivity"
193192
android:configChanges="keyboardHidden|orientation|screenSize"
194193
android:exported="true"
195-
196194
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
197195

198196

Diff for: app/src/main/assets/view.html

+31-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8"/>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<meta name="msapplication-tap-highlight" content="no">
6+
<meta name="msapplication-tap-highlight" content="no">
77
<title>博文</title>
88
<link type="text/css" rel="stylesheet" href="css/shCore.css"/>
99
<link rel="stylesheet" type="text/css" href="css/blog-common.css">
@@ -13,9 +13,9 @@
1313
<link rel="stylesheet" type="text/css" href="css/rae-common.css">
1414
<!--主题-->
1515
<link rel="stylesheet" type="text/css" href="css/{{theme}}" id="RaeStyle">
16-
<link rel="stylesheet" type="text/css" href="http://www.raeblog.com/cnblogs/Content/app/rae-ext.css"/>
17-
<!-- <link type="text/css" rel="stylesheet" href="css/shThemeRDark.css" />
18-
<link rel="stylesheet" type="text/css" href="css/rae-night.css" /> -->
16+
<link rel="stylesheet" type="text/css" href="http://www.raeblog.com/cnblogs/Content/app/rae-ext.css"/>
17+
<!-- <link type="text/css" rel="stylesheet" href="css/shThemeRDark.css" />
18+
<link rel="stylesheet" type="text/css" href="css/rae-night.css" /> -->
1919

2020
<script src="js/jquery.js" type="text/javascript"></script>
2121
<script src="js/highlight.min.js" type="text/javascript"></script>
@@ -123,9 +123,11 @@
123123
// 图片适配屏幕
124124
if(screenWidth>0 && w< screenWidth/2){
125125
$(val).css("width","auto");
126+
$(val).css("height","auto");
126127
}else{
127128
// 填充全屏
128129
$(val).css("width","100%");
130+
$(val).css("height","auto");
129131
}
130132
})
131133
// $(val).load(function(){
@@ -146,6 +148,9 @@
146148
$("#blog_date").text(blog.postDate);
147149
$("#author_name").text(blog.author);
148150

151+
$("#news_date").text(blog.postDate);
152+
$("#news_author").text(blog.author);
153+
149154
if(!blog.avatar|| blog.avatar==null || blog.avatar==""){
150155
$("#blog_avatar").hide();
151156
}
@@ -163,7 +168,9 @@
163168
alert("不支持跳转到作者主页");
164169
}
165170
});
171+
$("#news").hide();
166172
}else{
173+
$("#news").show();
167174
$("#author").hide();
168175
$("#header").css("margin-top","60px");
169176
}
@@ -195,12 +202,6 @@
195202
}
196203

197204
}
198-
199-
200-
201-
202-
203-
204205
</script>
205206
</head>
206207
<body>
@@ -217,25 +218,32 @@
217218
<button id="btn_author" type="button" class="btn btn_author btn-default">作者主页</button>
218219
</div>
219220

220-
<script type="text/javascript">
221-
if(typeof(app) =="object"){
222-
var blog = app.getBlog();
223-
if(blog!=""){
224-
blog = $.parseJSON(blog);
225-
if(blog.blogType != "BLOG"){
226-
$("#author").hide();
227-
}
228-
}
229-
}
230221

222+
<h3 id="blog_title" class="clearfix">标题</h3>
231223

224+
<div class="author clearfix" id="news">
225+
<span id="news_author"></span>
226+
<span id="news_date">发布时间</span>
227+
</div>
232228

233229

230+
</div>
234231

235-
</script>
232+
<script type="text/javascript">
233+
if(typeof(app) =="object"){
234+
var blog = app.getBlog();
235+
if(blog!=""){
236+
blog = $.parseJSON(blog);
237+
if(blog.blogType != "BLOG"){
238+
$("#author").hide();
239+
$("#news").show();
240+
}else{
241+
$("#news").hide();
242+
}
243+
}
244+
}
245+
</script>
236246

237-
<h3 id="blog_title" class="clearfix">标题</h3>
238-
</div>
239247
<div id="blog_content" class="clearfix">
240248

241249
</div>

Diff for: app/src/main/java/com/rae/cnblogs/RxObservable.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@
2222
public final class RxObservable {
2323

2424
private final static Map<String, List<Disposable>> sObservableDisposableList = new WeakHashMap<>();
25+
private static final String DEFAULT_TAG = "--DEFAULT--";
2526

2627

28+
public static <T> Observable<T> create(Observable<T> observable) {
29+
return create(observable, DEFAULT_TAG);
30+
}
31+
2732
public static <T> Observable<T> create(Observable<T> observable, final String tag) {
2833
return observable
2934
.doOnSubscribe(new Consumer<Disposable>() {
@@ -56,9 +61,16 @@ private static void put(@NonNull Disposable disposable, String tag) {
5661
}
5762

5863
/**
59-
* 释放当前所有HTTP请求
64+
* 释放当前请求
6065
*/
6166
public static void dispose() {
67+
dispose(DEFAULT_TAG);
68+
}
69+
70+
/**
71+
* 释放当前所有HTTP请求
72+
*/
73+
public static void disposeAll() {
6274
try {
6375
for (List<Disposable> disposables : sObservableDisposableList.values()) {
6476
for (Disposable disposable : disposables) {

Diff for: app/src/main/java/com/rae/cnblogs/activity/BaseActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.rae.cnblogs.AppStatusBar;
1616
import com.rae.cnblogs.CnblogsApplication;
1717
import com.rae.cnblogs.R;
18+
import com.rae.cnblogs.RxObservable;
1819
import com.rae.cnblogs.sdk.config.CnblogSdkConfig;
1920
import com.rae.swift.Rx;
2021
import com.umeng.analytics.MobclickAgent;
@@ -67,6 +68,12 @@ protected void onPause() {
6768
MobclickAgent.onPause(this);
6869
}
6970

71+
@Override
72+
protected void onDestroy() {
73+
super.onDestroy();
74+
RxObservable.dispose();
75+
}
76+
7077
@Override
7178
public void setContentView(@LayoutRes int layoutResID) {
7279
super.setContentView(layoutResID);

Diff for: app/src/main/java/com/rae/cnblogs/activity/MainActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ protected void onDestroy() {
227227
mServiceConnection = null;
228228
stopService(new Intent(this, CnblogsService.class));
229229
}
230-
RxObservable.dispose(); // 释放所有请求
230+
RxObservable.disposeAll(); // 释放所有请求
231231
RaeImageLoader.clearMemoryCache(getApplicationContext()); // 清除图片内存
232232
config().setMainExitTimeMillis(System.currentTimeMillis());
233233
super.onDestroy();

Diff for: app/src/main/java/com/rae/cnblogs/activity/SystemMessageActivity.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class SystemMessageActivity extends SwipeBackBaseActivity {
3535

3636
SystemMessageAdapter mAdapter;
3737

38-
private String mTag = "SystemMessageActivity";
39-
4038
@Override
4139
protected void onCreate(@Nullable Bundle savedInstanceState) {
4240
super.onCreate(savedInstanceState);
@@ -55,7 +53,7 @@ public void onItemClick(SystemMessageBean item) {
5553
});
5654

5755
// 获取消息列表
58-
RxObservable.create(mRaeServerApi.getMessages(), mTag)
56+
RxObservable.create(mRaeServerApi.getMessages())
5957
.subscribe(new ApiDefaultObserver<List<SystemMessageBean>>() {
6058
@Override
6159
protected void onError(String message) {
@@ -75,7 +73,7 @@ protected void accept(List<SystemMessageBean> data) {
7573
});
7674

7775
// 更新消息数量
78-
RxObservable.create(mRaeServerApi.getMessageCount(), mTag)
76+
RxObservable.create(mRaeServerApi.getMessageCount())
7977
.subscribe(new ApiDefaultObserver<Integer>() {
8078
@Override
8179
protected void onError(String message) {
@@ -89,10 +87,4 @@ protected void accept(Integer count) {
8987
});
9088

9189
}
92-
93-
@Override
94-
protected void onDestroy() {
95-
super.onDestroy();
96-
RxObservable.dispose(mTag);
97-
}
9890
}

Diff for: app/src/main/java/com/rae/cnblogs/fragment/HomeFragment.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.support.design.widget.DesignTabLayout;
88
import android.support.v4.view.ViewPager;
99
import android.view.View;
10+
import android.widget.TextView;
1011

1112
import com.rae.cnblogs.AppRoute;
1213
import com.rae.cnblogs.AppUI;
@@ -46,11 +47,8 @@ public static HomeFragment newInstance() {
4647

4748
@BindView(R.id.vp_blog_list)
4849
ViewPager mViewPager;
49-
50-
// @BindView(R.id.img_actionbar_avatar)
51-
// ImageView mAvatarView;
52-
// @BindView(R.id.img_actionbar_avatar_not_login)
53-
// ImageView mNotLoginAvatarView;
50+
@BindView(R.id.tv_search)
51+
TextView mSearchView;
5452

5553
@Override
5654
protected int getLayoutId() {
@@ -130,6 +128,11 @@ public void onTabReselected(DesignTabLayout.Tab tab) {
130128
}
131129
}
132130

131+
@Override
132+
public void onLoadHotSearchData(String keyword) {
133+
mSearchView.setText(keyword);
134+
}
135+
133136
@Override
134137
public void onActivityResult(int requestCode, int resultCode, Intent data) {
135138
super.onActivityResult(requestCode, resultCode, data);
@@ -147,14 +150,15 @@ public void run() {
147150
}
148151
}
149152

150-
@OnClick(R.id.img_search)
153+
@OnClick(R.id.fl_search)
151154
public void onSearchClick() {
152155
AppRoute.jumpToSearch(this.getContext());
153156
}
154157

155158
@OnClick(R.id.img_actionbar_logo)
156159
public void onLogoClick() {
157-
onSearchClick();
160+
// onSearchClick();
161+
goTop();
158162
}
159163

160164
private void goTop() {

0 commit comments

Comments
 (0)