Skip to content

Commit cd5e609

Browse files
committed
fix log config
1 parent b199dc9 commit cd5e609

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,23 @@ android {
110110
// 配置渠道包
111111
productFlavors {
112112
WANDOUJIA {
113-
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "WANDOUJIA", DEBUG_ENABLE: false]
113+
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "WANDOUJIA"]
114114
}
115115

116116
BAIDU {
117-
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "BAIDU", DEBUG_ENABLE: false]
117+
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "BAIDU"]
118118
}
119119

120120
QIHU360 {
121-
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "QIHU360", DEBUG_ENABLE: false]
121+
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "QIHU360"]
122122
}
123123

124124
XIAOMI {
125-
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "XIAOMI", DEBUG_ENABLE: false]
125+
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "XIAOMI"]
126126
}
127127

128128
YINGYONGBAO {
129-
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "YINGYONGBAO", DEBUG_ENABLE: false]
129+
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "YINGYONGBAO"]
130130
}
131131
}
132132
}

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
android:label="@string/app_name"
3636
android:theme="@style/AppTheme">
3737

38-
<meta-data android:name="DEBUG_ENABLE" android:value="${DEBUG_ENABLE}" />
39-
4038
<activity
4139
android:name="com.brian.csdnblog.activity.SplashActivity"
4240
android:theme="@style/AppBaseTheme"

app/src/main/java/com/brian/csdnblog/activity/BlogContentActivity.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,21 @@ protected void onCreate(Bundle savedInstanceState) {
138138
mTitleBar.setTitle(mBlogInfo.title);
139139
mCurrentTitle = mBlogInfo.title;
140140

141-
// 开始请求数据
142-
if (TypeManager.getWebType(mBlogInfo.type) == TypeManager.TYPE_WEB_JCC) {
143-
BlogManager.getInstance().fetchBlogContent(mCurrentUrl, "GB2312", this);
144-
} else {
145-
BlogManager.getInstance().fetchBlogContent(mCurrentUrl, this);
146-
}
147-
148141
mProgressBar.setVisibility(View.VISIBLE);
149-
150-
BlogManager.getInstance().saveBlog(mBlogInfo);
142+
143+
getUIHandler().post(new Runnable() {
144+
@Override
145+
public void run() {
146+
// 开始请求数据
147+
if (TypeManager.getWebType(mBlogInfo.type) == TypeManager.TYPE_WEB_JCC) {
148+
BlogManager.getInstance().fetchBlogContent(mCurrentUrl, "GB2312", BlogContentActivity.this);
149+
} else {
150+
BlogManager.getInstance().fetchBlogContent(mCurrentUrl, BlogContentActivity.this);
151+
}
152+
153+
BlogManager.getInstance().saveBlog(mBlogInfo);
154+
}
155+
});
151156
}
152157

153158
private void initBlogInfo() {
@@ -216,7 +221,7 @@ public void onSpotClicked(boolean isWebPage) {
216221
}
217222

218223
private void toggleAdShow(boolean isShow) {
219-
if (isShow && SettingPreference.getInstance().getAdsEnable()) {
224+
if (mAdView != null && isShow && SettingPreference.getInstance().getAdsEnable()) {
220225
RelativeLayout.LayoutParams layoutParams =
221226
new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
222227
ViewGroup.LayoutParams.WRAP_CONTENT);

app/src/main/java/com/brian/csdnblog/activity/SplashActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
4141
super.onCreate(savedInstanceState);
4242
setContentView(R.layout.activity_splash);
4343
ButterKnife.bind(this);
44-
AdManager.getInstance(this).init(Constants.APPID, Constants.APPSECTET, true, true);
44+
AdManager.getInstance(this).init(Constants.APPID, Constants.APPSECTET, Config.isDebug, Config.isDebug);
4545

4646
// 打开调试模式
4747
MobclickAgent.setDebugMode(Config.isDebug);

app/src/main/java/com/brian/csdnblog/util/ConfigHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.content.pm.PackageManager;
66
import android.util.Log;
77

8+
import com.brian.csdnblog.BuildConfig;
89
import com.brian.csdnblog.Config;
910

1011
/**
@@ -17,7 +18,7 @@ public static void init(Context context) {
1718
try {
1819
ApplicationInfo info = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
1920
// 调试 (PS:默认为false)
20-
// Config.isDebug = info.metaData.getBoolean("DEBUG_ENABLE");
21+
Config.isDebug = BuildConfig.LOG_DEBUG;
2122
Log.w("ConfigHelper", "Config.isDebug=" + Config.isDebug);
2223

2324
AppInfoUtil.sChannelName = info.metaData.getString("UMENG_CHANNEL");

0 commit comments

Comments
 (0)