Skip to content

Commit 53b8a28

Browse files
committed
修复自定义View的Style报错
1 parent 6834cf0 commit 53b8a28

File tree

12 files changed

+39
-38
lines changed

12 files changed

+39
-38
lines changed

RxArcGisKit/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ apply plugin: 'kotlin-android-extensions'
55

66

77
android {
8-
compileSdkVersion 29
9-
buildToolsVersion = '29.0.3'
8+
compileSdkVersion 30
9+
buildToolsVersion = '30.0.3'
1010

1111
defaultConfig {
1212
minSdkVersion 21
13-
targetSdkVersion 29
13+
targetSdkVersion 30
1414
versionCode 1
1515
versionName "1.0"
1616

@@ -35,7 +35,7 @@ android {
3535
dependencies {
3636
implementation fileTree(dir: 'libs', include: ['*.jar'])
3737
compileOnly 'androidx.appcompat:appcompat:1.2.0'
38-
testImplementation 'junit:junit:4.13'
38+
testImplementation 'junit:junit:4.13.1'
3939
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
4040
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
4141
compileOnly 'com.esri.arcgisruntime:arcgis-android:100.3.0'

RxDemo/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ android {
99
buildToolsVersion = '29.0.3'
1010

1111
signingConfigs {
12-
debug {
13-
storeFile file('/home/tamsiree/Documents/TamDocuments/WorkSpace/Android/TamKey.jks')
14-
storePassword 'Ls547817'
15-
keyAlias = 'TamKey'
16-
keyPassword 'Ls547817'
17-
}
12+
// debug {
13+
// storeFile file('TamKey.jks')
14+
// storePassword 'Ls547817'
15+
// keyAlias = 'TamKey'
16+
// keyPassword 'Ls547817'
17+
// }
1818
}
1919

2020

RxDemo/src/main/java/com/tamsiree/rxdemo/view/RxFakeAddImageView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import androidx.appcompat.widget.AppCompatImageView
1111
class RxFakeAddImageView : AppCompatImageView {
1212
private val mPointF: PointF? = null
1313

14-
constructor(context: Context?) : super(context)
15-
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
16-
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
14+
constructor(context: Context) : super(context)
15+
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
16+
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
1717

1818
fun setMPointF(pointF: PointF) {
1919
x = pointF.x

RxKit/src/main/java/com/tamsiree/rxkit/RxAppTool.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ object RxAppTool {
105105
* @return `true`: 是<br></br>`false`: 否
106106
*/
107107
@JvmStatic
108-
fun isSystemApp(context: Context, packageName: String?): Boolean {
108+
fun isSystemApp(context: Context, packageName: String): Boolean {
109109
return if (RxDataTool.isNullString(packageName)) false else try {
110110
val pm = context.packageManager
111111
val ai = pm.getApplicationInfo(packageName, 0)
@@ -254,7 +254,7 @@ object RxAppTool {
254254
* @return App名称
255255
*/
256256
@JvmStatic
257-
fun getAppName(context: Context, packageName: String?): String? {
257+
fun getAppName(context: Context, packageName: String): String? {
258258
return if (RxDataTool.isNullString(packageName)) null else try {
259259
val pm = context.packageManager
260260
val pi = pm.getPackageInfo(packageName, 0)
@@ -284,7 +284,7 @@ object RxAppTool {
284284
* @return App图标
285285
*/
286286
@JvmStatic
287-
fun getAppIcon(context: Context, packageName: String?): Drawable? {
287+
fun getAppIcon(context: Context, packageName: String): Drawable? {
288288
return if (RxDataTool.isNullString(packageName)) null else try {
289289
val pm = context.packageManager
290290
val pi = pm.getPackageInfo(packageName, 0)
@@ -314,7 +314,7 @@ object RxAppTool {
314314
* @return App路径
315315
*/
316316
@JvmStatic
317-
fun getAppPath(context: Context, packageName: String?): String? {
317+
fun getAppPath(context: Context, packageName: String): String? {
318318
return if (RxDataTool.isNullString(packageName)) null else try {
319319
val pm = context.packageManager
320320
val pi = pm.getPackageInfo(packageName, 0)
@@ -344,7 +344,7 @@ object RxAppTool {
344344
* @return App版本号
345345
*/
346346
@JvmStatic
347-
fun getAppVersionName(context: Context, packageName: String?): String? {
347+
fun getAppVersionName(context: Context, packageName: String): String? {
348348
return if (RxDataTool.isNullString(packageName)) null else try {
349349
val pm = context.packageManager
350350
val pi = pm.getPackageInfo(packageName, 0)
@@ -374,7 +374,7 @@ object RxAppTool {
374374
* @return App版本码
375375
*/
376376
@JvmStatic
377-
fun getAppVersionCode(context: Context, packageName: String?): Int {
377+
fun getAppVersionCode(context: Context, packageName: String): Int {
378378
return if (RxDataTool.isNullString(packageName)) -1 else try {
379379
val pm = context.packageManager
380380
val pi = pm.getPackageInfo(packageName, 0)
@@ -404,7 +404,7 @@ object RxAppTool {
404404
* @return `true`: 是<br></br>`false`: 否
405405
*/
406406
@JvmStatic
407-
fun isAppDebug(context: Context, packageName: String?): Boolean {
407+
fun isAppDebug(context: Context, packageName: String): Boolean {
408408
return if (RxDataTool.isNullString(packageName)) false else try {
409409
val pm = context.packageManager
410410
val ai = pm.getApplicationInfo(packageName, 0)
@@ -435,7 +435,7 @@ object RxAppTool {
435435
*/
436436
@JvmStatic
437437
@SuppressLint("PackageManagerGetSignatures")
438-
fun getAppSignature(context: Context, packageName: String?): Array<Signature>? {
438+
fun getAppSignature(context: Context, packageName: String): Array<Signature>? {
439439
return if (RxDataTool.isNullString(packageName)) null else try {
440440
val pm = context.packageManager
441441
val pi = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES)
@@ -469,7 +469,7 @@ object RxAppTool {
469469
* @return 应用签名的SHA1字符串, 比如:53:FD:54:DC:19:0F:11:AC:B5:22:9E:F1:1A:68:88:1B:8B:E8:54:42
470470
*/
471471
@JvmStatic
472-
fun getAppSignatureSHA1(context: Context, packageName: String?): String? {
472+
fun getAppSignatureSHA1(context: Context, packageName: String): String? {
473473
val signature = getAppSignature(context, packageName) ?: return null
474474
return RxEncryptTool.encryptSHA1ToString(signature[0].toByteArray()).replace("(?<=[0-9A-F]{2})[0-9A-F]{2}".toRegex(), ":$0")
475475
}

RxKit/src/main/java/com/tamsiree/rxkit/RxExifTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object RxExifTool {
1919
* @param dLon 经度
2020
*/
2121
@JvmStatic
22-
fun writeLatLonIntoJpeg(picPath: String?, dLat: Double, dLon: Double) {
22+
fun writeLatLonIntoJpeg(picPath: String, dLat: Double, dLon: Double) {
2323
val file = File(picPath)
2424
if (file.exists()) {
2525
try {

RxKit/src/main/java/com/tamsiree/rxkit/RxImageTool.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import java.io.*
1919
import java.net.HttpURLConnection
2020
import java.net.URL
2121
import java.util.*
22+
import kotlin.jvm.Throws
2223

2324
/**
2425
* @author tamsiree
@@ -1516,7 +1517,7 @@ object RxImageTool {
15161517
* @return
15171518
*/
15181519
@JvmStatic
1519-
fun getThumb(filePath: String?, kind: Int): Bitmap {
1520+
fun getThumb(filePath: String, kind: Int): Bitmap? {
15201521
return ThumbnailUtils.createVideoThumbnail(filePath, kind)
15211522
}
15221523

RxKit/src/main/java/com/tamsiree/rxkit/RxLocationTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object RxLocationTool {
106106
return false
107107
}
108108
val provider = mLocationManager!!.getBestProvider(criteria, true)
109-
val location = mLocationManager!!.getLastKnownLocation(provider)
109+
val location = mLocationManager!!.getLastKnownLocation(provider!!)
110110
if (location != null) {
111111
listener.getLastKnownLocation(location)
112112
}

RxUI/src/main/java/com/tamsiree/rxui/view/RxArcProgress.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class RxArcProgress @JvmOverloads constructor(context: Context, attrs: Attribute
218218
roundWidth = mTypedArray.getDimension(R.styleable.RxArcProgress_roundWidth, 20f)
219219
max = mTypedArray.getInteger(R.styleable.RxArcProgress_max, 100).toDouble()
220220
textIsDisplayable = mTypedArray.getBoolean(R.styleable.RxArcProgress_textIsDisplayable, true)
221-
style = mTypedArray.getInt(R.styleable.RxArcProgress_style, 0)
221+
style = mTypedArray.getInt(R.styleable.RxArcProgress_style_ui, 0)
222222
mTypedArray.recycle()
223223
}
224224
}

RxUI/src/main/java/com/tamsiree/rxui/view/RxRunTextView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import androidx.appcompat.widget.AppCompatTextView
1010
* @date 2016/6/28
1111
*/
1212
class RxRunTextView : AppCompatTextView {
13-
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
14-
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
15-
constructor(context: Context?) : super(context)
13+
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
14+
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
15+
constructor(context: Context) : super(context)
1616

1717
/**
1818
* 当前并没有焦点,我只是欺骗了Android系统

RxUI/src/main/java/com/tamsiree/rxui/view/heart/RxHeartView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class RxHeartView : AppCompatImageView {
2929
private var mHeartResId = R.drawable.anim_heart
3030
private var mHeartBorderResId = R.drawable.anim_heart_border
3131

32-
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
33-
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
34-
constructor(context: Context?) : super(context)
32+
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
33+
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
34+
constructor(context: Context) : super(context)
3535

3636
fun setColor(color: Int) {
3737
val heart = createHeart(color)

0 commit comments

Comments
 (0)