未验证 提交 b5149ce3 编写于 作者: L LinJZong 提交者: GitHub

Merge pull request #269 from sagdragon/master

OPTIMIZE:For maps where the keys are of type integer, it's typically …
......@@ -3,21 +3,19 @@ package com.didichuxing.doraemonkit.kit.logInfo.util;
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.util.SparseIntArray;
import com.didichuxing.doraemonkit.R;
import java.util.HashMap;
/**
* @author: linjizong
* @date: 2019/4/30
* @desc:
*/
public class TagColorUtil {
private static final HashMap<Integer, Integer> TEXT_COLOR = new HashMap<>(6);
private static final HashMap<Integer, Integer> TEXT_COLOR_EXPAND = new HashMap<>(6);
private static final HashMap<Integer, Integer> LEVEL_COLOR = new HashMap<>(6);
private static final HashMap<Integer, Integer> LEVEL_BG_COLOR = new HashMap<>(6);
private static final SparseIntArray TEXT_COLOR = new SparseIntArray(6);
private static final SparseIntArray TEXT_COLOR_EXPAND = new SparseIntArray(6);
private static final SparseIntArray LEVEL_COLOR = new SparseIntArray(6);
private static final SparseIntArray LEVEL_BG_COLOR = new SparseIntArray(6);
static {
TEXT_COLOR.put(Log.DEBUG, R.color.dk_color_000000);
......@@ -50,7 +48,7 @@ public class TagColorUtil {
}
public static int getTextColor(Context context, int level, boolean expand) {
HashMap<Integer, Integer> map = expand ? TEXT_COLOR_EXPAND : TEXT_COLOR;
SparseIntArray map = expand ? TEXT_COLOR_EXPAND : TEXT_COLOR;
Integer result = map.get(level);
if (result == null) {
result = map.get(Log.VERBOSE);
......
......@@ -90,7 +90,7 @@ public class DevToolActivity extends AppCompatActivity {
}
private void handleNoResult() {
Toast.makeText(getApplicationContext(), "没有扫描到任何内容>_<", Toast.LENGTH_SHORT);
Toast.makeText(getApplicationContext(), "没有扫描到任何内容>_<", Toast.LENGTH_SHORT).show();
finish();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册