Skip to content

Commit c810df1

Browse files
committed
rm oneapm
1 parent 782ba8d commit c810df1

File tree

12 files changed

+36
-54
lines changed

12 files changed

+36
-54
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ CodeBlog是为了方便在手机端阅读编程技术博文。集成展示了CSD
1515
- 友盟推送、统计、更新、在线参数;
1616
- EventBus
1717
- bugly异常收集;
18-
- oneapm性能分析;
1918
- 腾讯X5内核;
2019
- Gson进行序列化;
2120
- litepal数据库存储;

app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
apply plugin: 'com.android.application'
2-
apply plugin: 'oneapm'
32
apply plugin: 'android-apt'
43

54
// 时间

app/libs/oneapm-android-agent.jar

-613 KB
Binary file not shown.

app/oneapm.properties

Whitespace-only changes.

app/proguard-rules.pro

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,8 @@
140140
public static ** valueOf(java.lang.String);
141141
}
142142

143-
#oneapm
144143
-keep class org.apache.http.impl.client.**
145144
-dontwarn org.apache.commons.**
146145
-dontwarn org.apache.http.**
147-
-keep class com.blueware.** { *; }
148-
-dontwarn com.blueware.**
149-
-keep class com.oneapm.** {*;}
150-
-dontwarn com.oneapm.**
151146
-keepattributes Exceptions, Signature, InnerClasses
152147
-keepattributes SourceFile, LineNumberTable

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747

4848
import java.util.List;
4949

50+
import butterknife.BindView;
51+
import butterknife.ButterKnife;
52+
5053
/**
5154
* Fragment页面
5255
*/
@@ -55,9 +58,9 @@ public class BlogListFrag extends Fragment {
5558
private static final String TAG = BlogListFrag.class.getSimpleName();
5659

5760
private View mRootLy;
58-
private RefreshLayout mRefreshLayout;
59-
private ListView mBlogListView;// 博客列表
60-
private View mNoBlogView; // 无数据时显示
61+
@BindView(R.id.swipe_container) RefreshLayout mRefreshLayout;
62+
@BindView(R.id.blogListView) ListView mBlogListView;// 博客列表
63+
@BindView(R.id.no_blog) View mNoBlogView; // 无数据时显示
6164
private View mFooterLayout;
6265

6366
private boolean mRefreshable = true;
@@ -127,10 +130,9 @@ public void notifyDataSetChanged() {
127130
};
128131

129132
mRootLy = inflater.inflate(R.layout.frag_bloglist, null);
130-
mRefreshLayout = (RefreshLayout) mRootLy.findViewById(R.id.swipe_container);
131-
mBlogListView = (ListView) mRootLy.findViewById(R.id.blogListView);
132-
mRefreshLayout.setChildView(mBlogListView);
133+
ButterKnife.bind(this, mRootLy);
133134

135+
mRefreshLayout.setChildView(mBlogListView);
134136
mRefreshLayout.setColorSchemeResources(R.color.blue,
135137
R.color.green_yellow,
136138
R.color.red,
@@ -149,7 +151,6 @@ public void notifyDataSetChanged() {
149151
mBlogListView.addFooterView(mFooterLayout);
150152
mBlogListView.setAdapter(mAdapter);// 设置适配器
151153

152-
mNoBlogView = mRootLy.findViewById(R.id.no_blog);
153154
mNoBlogView.setOnClickListener(new OnClickListener() {
154155
@Override
155156
public void onClick(View v) {

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

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@
2626
import com.xiaomi.market.sdk.XiaomiUpdateAgent;
2727
import com.xiaomi.market.sdk.XiaomiUpdateListener;
2828

29+
import butterknife.BindView;
2930
import butterknife.ButterKnife;
3031

3132
/**
3233
* 个人中心
3334
*/
3435
public class PersonCenterFragment extends Fragment implements OnClickListener {
35-
3636
private static final String TAG = "CSNDBlog_PersonCenterFragment";
3737

38-
private View viewCheckUpdate; // 检查更新
39-
private View viewSelectType; // 设置类型
40-
private View viewHistory;
41-
private View viewFavo;
42-
private View viewNews;
43-
private View viewAbout;
44-
private View viewSettings;
45-
private View viewChat;
46-
47-
private TextView tvSelectType = null;
38+
@BindView(R.id.checkUpdateView) View mCheckUpdateLy; // 检查更新
39+
@BindView(R.id.select_article_type) View mSelectTypeLy; // 设置类型
40+
@BindView(R.id.blog_history) View mHistoryLy;
41+
@BindView(R.id.blog_favo) View mFavoLy;
42+
@BindView(R.id.news) View mNewsLy;
43+
@BindView(R.id.aboutView) View mAboutLy;
44+
@BindView(R.id.settings) View mSettingsLy;
45+
@BindView(R.id.chat) View viewChat;
46+
@BindView(R.id.tv_select_type) TextView mSelectTypeView;
4847

4948
@Override
5049
public void onActivityCreated(Bundle savedInstanceState) {
@@ -56,36 +55,24 @@ public void onActivityCreated(Bundle savedInstanceState) {
5655
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
5756
View view = inflater.inflate(R.layout.person_center, null);
5857
ButterKnife.bind(this, view);
59-
initComponent(view);
58+
initUI();
6059

6160
return view;
6261
}
6362

6463
/**
65-
* 查找控件
66-
*
67-
* @param view
64+
* 初始化控件
6865
*/
69-
private void initComponent(View view) {
70-
viewSelectType = view.findViewById(R.id.select_article_type);
71-
viewCheckUpdate = view.findViewById(R.id.checkUpdateView);
72-
viewHistory = view.findViewById(R.id.blog_history);
73-
viewFavo = view.findViewById(R.id.blog_favo);
74-
viewNews = view.findViewById(R.id.news);
75-
viewAbout = view.findViewById(R.id.aboutView);
76-
viewSettings = view.findViewById(R.id.settings);
77-
viewChat = view.findViewById(R.id.chat);
78-
79-
tvSelectType = (TextView) view.findViewById(R.id.tv_select_type);
80-
tvSelectType.setText(TypeManager.getCurrCateName());
81-
82-
viewSelectType.setOnClickListener(this);
83-
viewCheckUpdate.setOnClickListener(this);
84-
viewFavo.setOnClickListener(this);
85-
viewNews.setOnClickListener(this);
86-
viewHistory.setOnClickListener(this);
87-
viewAbout.setOnClickListener(this);
88-
viewSettings.setOnClickListener(this);
66+
private void initUI() {
67+
mSelectTypeView.setText(TypeManager.getCurrCateName());
68+
69+
mSelectTypeLy.setOnClickListener(this);
70+
mCheckUpdateLy.setOnClickListener(this);
71+
mFavoLy.setOnClickListener(this);
72+
mNewsLy.setOnClickListener(this);
73+
mHistoryLy.setOnClickListener(this);
74+
mAboutLy.setOnClickListener(this);
75+
mSettingsLy.setOnClickListener(this);
8976
viewChat.setOnClickListener(this);
9077
}
9178

@@ -132,7 +119,7 @@ public void onClick(View view) {
132119
@Override
133120
public void onClick(DialogInterface dialog, int which) {
134121
TypeManager.setCateType(which);
135-
tvSelectType.setText(TypeManager.getCurrCateName());
122+
mSelectTypeView.setText(TypeManager.getCurrCateName());
136123
}
137124
});
138125
builder.show();

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import com.brian.csdnblog.util.PermissionUtil;
1414
import com.brian.csdnblog.util.PreferenceUtil;
1515
import com.brian.csdnblog.util.UIUtil;
16-
import com.oneapm.agent.android.OneApmAgent;
1716
import com.qhad.ads.sdk.adcore.Qhad;
1817
import com.umeng.analytics.MobclickAgent;
1918

@@ -40,7 +39,6 @@ protected void onCreate(Bundle savedInstanceState) {
4039
// 打开调试模式
4140
MobclickAgent.setDebugMode(Config.isDebug);
4241
Qhad.setLogSwitch(this, false);
43-
OneApmAgent.init(getApplicationContext()).setToken("3FDB8B95F6000180CD03B23EE6A6560B59").start();
4442
}
4543

4644
private void jumpMainActivity() {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public class AppInfoUtil {
2727
public static String getProcessName(Context context) {
2828
int pid = android.os.Process.myPid();
2929
ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
30-
for (ActivityManager.RunningAppProcessInfo appProcess : mActivityManager.getRunningAppProcesses()) {
30+
List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = mActivityManager.getRunningAppProcesses();
31+
if (runningAppProcesses == null || runningAppProcesses.isEmpty()) {
32+
return null;
33+
}
34+
for (ActivityManager.RunningAppProcessInfo appProcess : runningAppProcesses) {
3135
if (appProcess.pid == pid) {
3236
return appProcess.processName;
3337
}

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ buildscript {
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
12-
classpath fileTree(dir: 'plugin', include: ['*.jar'])
1312
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
1413
}
1514
}

0 commit comments

Comments
 (0)