Skip to content

Commit 4511c5d

Browse files
committed
添加bl_function属性
1 parent 397bd47 commit 4511c5d

7 files changed

Lines changed: 155 additions & 77 deletions

File tree

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.5.7'
41+
implementation project(':library')
4242
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4343
}

app/src/main/java/com/noober/backgroudlibrary/MainActivity.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import android.content.Intent;
44
import android.content.res.ColorStateList;
55
import android.graphics.Color;
6-
import android.graphics.drawable.AnimationDrawable;
76
import android.graphics.drawable.Drawable;
87
import android.os.Build;
98
import android.os.Bundle;
@@ -14,7 +13,7 @@
1413
import android.widget.Button;
1514
import android.widget.TextView;
1615

17-
import com.noober.background.BackgroundLibrary;
16+
import com.noober.background.annotation.BLUsed;
1817
import com.noober.background.drawable.DrawableCreator;
1918

2019
public class MainActivity extends AppCompatActivity {
@@ -24,13 +23,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
2423
super.onCreate(savedInstanceState);
2524
setContentView( R.layout.activity_main);
2625
getSupportFragmentManager().beginTransaction().add(R.id.fl_content, new BlankFragment()).commitAllowingStateLoss();
27-
Button button = findViewById(R.id.btn);
28-
button.setOnClickListener(new View.OnClickListener() {
29-
@Override
30-
public void onClick(View v) {
31-
startActivity(new Intent(MainActivity.this, ListActivity.class));
32-
}
33-
});
3426

3527
View vAnim = findViewById(R.id.v_anim);
3628
// AnimationDrawable animationDrawable = (AnimationDrawable) vAnim.getBackground();
@@ -127,4 +119,9 @@ public int dip2px(float dipValue) {
127119
return (int)(dipValue * scale + 0.5F);
128120
}
129121

122+
@BLUsed
123+
private void jumpToList(){
124+
startActivity(new Intent(MainActivity.this, ListActivity.class));
125+
}
126+
130127
}

app/src/main/res/layout/activity_main.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
android:layout_width="wrap_content"
3232
android:layout_height="36dp"
3333
android:layout_marginTop="5dp"
34-
app:bl_padding_left= "15dp"
35-
app:bl_padding_top= "15dp"
36-
app:bl_padding_bottom= "5dp"
37-
app:bl_padding_right= "5dp"
3834
android:gravity="center"
3935
android:text="虚线圆角边框以及填充"
4036
android:textColor="#8c6822"
4137
android:textSize="20sp"
4238
app:bl_corners_radius="4dp"
39+
app:bl_padding_bottom="5dp"
40+
app:bl_padding_left="15dp"
41+
app:bl_padding_right="5dp"
42+
app:bl_padding_top="15dp"
4343
app:bl_solid_color="#E3B666"
4444
app:bl_stroke_color="#8c6822"
4545
app:bl_stroke_dashGap="5dp"
@@ -181,7 +181,7 @@
181181
android:textColor="#8c6822"
182182
android:textSize="20sp" />
183183

184-
<com.noober.background.view.BLButton
184+
<Button
185185
android:id="@+id/btn"
186186
android:layout_width="130dp"
187187
android:layout_height="36dp"
@@ -193,6 +193,8 @@
193193
android:textColor="#4F94CD"
194194
android:textSize="20sp"
195195
app:bl_corners_radius="20dp"
196+
android:onClick="finish"
197+
android:clickable="true"
196198
app:bl_gradient_angle="0"
197199
app:bl_gradient_endColor="#4F94CD"
198200
app:bl_gradient_startColor="#63B8FF"
@@ -497,10 +499,10 @@
497499

498500
</FrameLayout>
499501

500-
<!-- <fragment-->
501-
<!-- android:id="@+id/fragmentTest"-->
502-
<!-- android:name="com.noober.backgroudlibrary.BlankFragment"-->
503-
<!-- android:layout_width="match_parent"-->
504-
<!-- android:layout_height="match_parent" />-->
502+
<!-- <fragment-->
503+
<!-- android:id="@+id/fragmentTest"-->
504+
<!-- android:name="com.noober.backgroudlibrary.BlankFragment"-->
505+
<!-- android:layout_width="match_parent"-->
506+
<!-- android:layout_height="match_parent" />-->
505507
</LinearLayout>
506508
</android.support.v4.widget.NestedScrollView>

0 commit comments

Comments
 (0)