Skip to content

Commit a84e489

Browse files
author
xiaoqi
committed
update to 1.6.0
1 parent f3a3ac2 commit a84e489

6 files changed

Lines changed: 7 additions & 87 deletions

File tree

README-EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ A framework for directly generating shape through Tags, no need to write shape.x
77
Add this to your app's build.gradle:
88

99
implementation "com.android.support:appcompat-v7:$supportVersion"
10-
implementation 'com.noober.background:core:1.5.9'
10+
implementation 'com.noober.background:core:1.6.0'
1111

1212
if use androidx:
1313

1414
implementation "androidx.appcompat:appcompat:$supportVersion"
15-
implementation 'com.noober.background:core:1.5.9'
15+
implementation 'com.noober.background:core:1.6.0'
1616

1717

1818
## Example effect

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ A framework for directly generating shape through Tags, no need to write shape.x
1010
依赖方式:
1111

1212
implementation "com.android.support:appcompat-v7:$supportVersion"
13-
implementation 'com.noober.background:core:1.5.9'
13+
implementation 'com.noober.background:core:1.6.0'
1414

1515
如果项目使用了androidx:
1616

1717
implementation "androidx.appcompat:appcompat:$supportVersion"
18-
implementation 'com.noober.background:core:1.5.9'
18+
implementation 'com.noober.background:core:1.6.0'
1919

2020

2121
## 使用文档

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies {
3737
testImplementation 'junit:junit:4.12'
3838
androidTestImplementation 'com.android.support.test:runner:1.0.2'
3939
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
40-
// implementation 'com.noober.background:core:1.5.7'
41-
implementation project(':library')
40+
implementation 'com.noober.background:core:1.6.0'
41+
// implementation project(':library')
4242
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4343
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ext {
3636
userOrg = 'noober'
3737
groupId = 'com.noober.background'
3838
uploadName = 'LibraryForBackground'
39-
publishVersion = '1.5.9'
39+
publishVersion = '1.6.0'
4040
desc = "A framework for directly generating shape through Tags, no need to write shape.xml again(通过标签直接生成shape,无需再写shape.xml)"
4141
website = 'https://github.com/JavaNoober/BackgroundLibrary'
4242
// gradlew clean build bintrayUpload -PbintrayUser=xiaoqiandroid -PbintrayKey=xxxxxxxxxxxxxxxx -PdryRun=false

library/src/main/java/com/noober/background/BackgroundFactory.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public View onCreateView(String name, Context context, AttributeSet attrs) {
4646
if (name.startsWith("com.noober.background.view")) {
4747
return null;
4848
}
49-
// name = switchBLViewToOriginal(name);
5049
View view = null;
5150

5251
//防止与其他调用factory库冲突,例如字体、皮肤替换库,用已经设置的factory来创建view
@@ -61,45 +60,6 @@ public View onCreateView(String name, Context context, AttributeSet attrs) {
6160
return setViewBackground(name, context, attrs, view);
6261
}
6362

64-
private String switchBLViewToOriginal(String name) {
65-
if (name.equals(Const.BLButton)) {
66-
name = "Button";
67-
} else if (name.equals(Const.BLCheckBox)) {
68-
name = "CheckBox";
69-
} else if (name.equals(Const.BLEditText)) {
70-
name = "EditText";
71-
} else if (name.equals(Const.BLFrameLayout)) {
72-
name = "FrameLayout";
73-
} else if (name.equals(Const.BLGridLayout)) {
74-
name = "GridLayout";
75-
} else if (name.equals(Const.BLGridView)) {
76-
name = "GridView";
77-
} else if (name.equals(Const.BLImageButton)) {
78-
name = "ImageButton";
79-
} else if (name.equals(Const.BLImageView)) {
80-
name = "ImageView";
81-
} else if (name.equals(Const.BLLinearLayout)) {
82-
name = "LinearLayout";
83-
} else if (name.equals(Const.BLListView)) {
84-
name = "ListView";
85-
} else if (name.equals(Const.BLRadioButton)) {
86-
name = "RadioButton";
87-
} else if (name.equals(Const.BLRadioGroup)) {
88-
name = "RadioGroup";
89-
} else if (name.equals(Const.BLRelativeLayout)) {
90-
name = "RelativeLayout";
91-
} else if (name.equals(Const.BLScrollView)) {
92-
name = "ScrollView";
93-
} else if (name.equals(Const.BLTextView)) {
94-
name = "TextView";
95-
} else if (name.equals(Const.BLView)) {
96-
name = "View";
97-
} else if (name.equals(Const.BLConstraintLayout)) {
98-
name = "android.support.constraint.ConstraintLayout";
99-
}
100-
return name;
101-
}
102-
10363
@Nullable
10464
public static View setViewBackground(Context context, AttributeSet attrs, View view) {
10565
return setViewBackground(null, context, attrs, view);

libraryx/src/main/java/com/noober/background/BackgroundFactory.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public View onCreateView(String name, Context context, AttributeSet attrs) {
4747
if(name.startsWith("com.noober.background.view")){
4848
return null;
4949
}
50-
// name = switchBLViewToOriginal(name);
5150
View view = null;
5251

5352
//防止与其他调用factory库冲突,例如字体、皮肤替换库,用已经设置的factory来创建view
@@ -62,45 +61,6 @@ public View onCreateView(String name, Context context, AttributeSet attrs) {
6261
return setViewBackground(name, context, attrs, view);
6362
}
6463

65-
private String switchBLViewToOriginal(String name) {
66-
if(name.equals(Const.BLButton)){
67-
name = "Button";
68-
}else if(name.equals(Const.BLCheckBox)){
69-
name = "CheckBox";
70-
}else if(name.equals(Const.BLEditText)){
71-
name = "EditText";
72-
}else if(name.equals(Const.BLFrameLayout)){
73-
name = "FrameLayout";
74-
}else if(name.equals(Const.BLGridLayout)){
75-
name = "GridLayout";
76-
}else if(name.equals(Const.BLGridView)){
77-
name = "GridView";
78-
}else if(name.equals(Const.BLImageButton)){
79-
name = "ImageButton";
80-
}else if(name.equals(Const.BLImageView)){
81-
name = "ImageView";
82-
}else if(name.equals(Const.BLLinearLayout)){
83-
name = "LinearLayout";
84-
}else if(name.equals(Const.BLListView)){
85-
name = "ListView";
86-
}else if(name.equals(Const.BLRadioButton)){
87-
name = "RadioButton";
88-
}else if(name.equals(Const.BLRadioGroup)){
89-
name = "RadioGroup";
90-
}else if(name.equals(Const.BLRelativeLayout)){
91-
name = "RelativeLayout";
92-
}else if(name.equals(Const.BLScrollView)){
93-
name = "ScrollView";
94-
}else if(name.equals(Const.BLTextView)){
95-
name = "TextView";
96-
}else if(name.equals(Const.BLView)){
97-
name = "View";
98-
}else if(name.equals(Const.BLConstraintLayout)){
99-
name = "android.support.constraint.ConstraintLayout";
100-
}
101-
return name;
102-
}
103-
10464
@Nullable
10565
public static View setViewBackground(Context context, AttributeSet attrs, View view){
10666
return setViewBackground(null, context, attrs, view);

0 commit comments

Comments
 (0)