Skip to content

Commit 4894a11

Browse files
author
Faqiang Lv
committed
updateCode
1 parent 34546fa commit 4894a11

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
用于Android 日常代码测试,效果整理
33

44
### Update Log:
5+
- [strings.xml 配置 brand、tag 等公共文本](https://github.com/lvfaqiang/AndroidTestCode/blob/master/app/src/main/res/values/strings.xml)
56
- 2018年09月02日
67

78
[获取、移除 View 的OnClickListener](https://github.com/lvfaqiang/AndroidTestCode/blob/master/app/src/main/java/com/lvfq/code/view/click/ViewClickActivity.kt)

app/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ android {
1717
versionName "1.0"
1818
multiDexEnabled true
1919
// jackOptions.enabled = true
20+
manifestPlaceholders = [
21+
APP_NAME : "NAME1",
22+
UMENG_CHANNEL_VALUE: "ocx"
23+
]
2024
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2125
}
2226
compileOptions {

app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
android:supportsRtl="true"
2020
android:theme="@style/AppTheme">
2121

22-
<activity android:name=".animation.AnimationActivity">
22+
<activity android:name=".view.ViewMainActivity">
2323
<intent-filter>
2424
<action android:name="android.intent.action.MAIN" />
2525

app/src/main/java/com/lvfq/code/view/CircleProgressBar.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class CircleProgressBar constructor(context: Context, attrs: AttributeSet? = nul
3131
private lateinit var mPaint: Paint
3232
private var strokeWidth = 5//线条宽度
3333
private var rectF: RectF? = null
34-
private var normalColor = Color.parseColor("#A5A5A5")//普通的颜色
35-
private var progressColor = Color.parseColor("#FA9025")//已经走了的进度条颜色
34+
private var normalColor = resources.getColor(R.color.c_f8e71c)//普通的颜色
35+
private var progressColor = resources.getColor(R.color.c_09c002)//已经走了的进度条颜色
3636
private var completeColor = 0
3737
private var textColor = normalColor//文字颜色
3838
private var textSize = 20f//文字大小
@@ -116,7 +116,8 @@ class CircleProgressBar constructor(context: Context, attrs: AttributeSet? = nul
116116
} else {
117117
mPaint.color = progressColor
118118
}
119-
val colors = intArrayOf(0xFF5A66E8.toInt(), 0xFFDF97FF.toInt())
119+
// val colors = intArrayOf(0xFF5A66E8.toInt(), 0xFFDF97FF.toInt())
120+
val colors = intArrayOf(resources.getColor(R.color.c_11c111), resources.getColor(R.color.c_1495eb))
120121

121122
val shader = LinearGradient(0f, 0f, mWidth.toFloat(), mHeight.toFloat(), colors, null, Shader.TileMode.CLAMP)
122123
mPaint.shader = shader

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

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99

1010
<color name="c_8e9ab5">#8e9ab5</color>
1111
<color name="c_e3e7ed">#e3e7ed</color>
12+
<color name="c_282843">#282843</color>
1213
</resources>

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

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!DOCTYPE resources[
4+
<!ENTITY brandName "Demo">
5+
<!ENTITY brandWebSite "atc.bitsaas.tech">
6+
]>
7+
18
<resources>
2-
<string name="app_name">MyWorkingTest</string>
9+
<string name="app_name">&brandName;</string>
310
<string name="str_login">登录</string>
411
<string name="str_register">注册</string>
5-
12+
<string name="str_about">关于 &brandName; 相关介绍</string>
13+
<string name="str_tips">温馨提示:\n 请仔细阅读 &brandName; 的使用说明</string>
14+
<string name="str_webSite">官网地址: &brandWebSite;/ </string>
615
</resources>

0 commit comments

Comments
 (0)