GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — animated vector drawable update · CoderGuoy/Coder@5463c71

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main
    • java/com/coder/guoy/recyclerview/ui
      • PlayAnimateVectorDrawables.java
    • res
      • animator
        • animator_heart_line.xml
        • animator_heart_rotate.xml
      • drawable
        • animated_bonc.xml
        • vector_bonc.xml
        • vector_heart1.xml
      • layout
        • activity_play_animate_vector_drawables.xml
      • values
        • strings.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/coder/guoy/recyclerview/ui/PlayAnimateVectorDrawables.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/coder/guoy/recyclerview/ui/PlayAnimateVectorDrawables.java
+9-11Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* @Descrpiton:AnimateVectorDrawables|矢量图片动画
1616
*/
1717
public class PlayAnimateVectorDrawables extends MvvmBaseActivity<ActivityPlayAnimateVectorDrawablesBinding> implements View.OnClickListener {
18-
private boolean isFirst = true;
1918

2019
@Override
2120
protected void onCreate(Bundle savedInstanceState) {
@@ -24,9 +23,7 @@ protected void onCreate(Bundle savedInstanceState) {
2423
showContentView();
2524
bindingView.animatevectordrawable.textviewTitle.setText("Animate Vector Drawables|矢量图片动画");
2625
bindingView.animatevectordrawable.toolbarBack.setOnClickListener(this);
27-
bindingView.imageSmile.setOnClickListener(this);
28-
bindingView.btnGiveheart.setOnClickListener(this);
29-
bindingView.imageRedheart.setOnClickListener(this);
26+
bindingView.btnSuprise.setOnClickListener(this);
3027
}
3128

3229
@Override
@@ -35,16 +32,17 @@ public void onClick(View v) {
3532
case R.id.toolbar_back:
3633
finish();
3734
break;
38-
case R.id.image_smile://笑脸
35+
case R.id.btn_suprise:
36+
//笑脸
3937
((Animatable) bindingView.imageSmile.getDrawable()).start();
40-
break;
41-
case R.id.image_redheart://红心
38+
//红心
4239
((Animatable) bindingView.imageRedheart.getDrawable()).start();
43-
break;
44-
case R.id.btn_giveheart:
40+
//bonc
41+
bindingView.imageBonc.setVisibility(View.VISIBLE);
42+
((Animatable) bindingView.imageBonc.getDrawable()).start();
43+
//线性心
4544
bindingView.imageHeart.setVisibility(View.VISIBLE);
46-
Animatable animatable = (Animatable) bindingView.imageHeart.getDrawable();
47-
animatable.start();
45+
((Animatable) bindingView.imageHeart.getDrawable()).start();
4846
break;
4947
}
5048
}
Collapse file

‎app/src/main/res/animator/animator_heart_line.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/animator/animator_heart_line.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:duration="2000"
3+
android:duration="3000"
44
android:interpolator="@android:anim/decelerate_interpolator"
55
android:propertyName="trimPathEnd"
66
android:valueFrom="0"
Collapse file

‎app/src/main/res/animator/animator_heart_rotate.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/animator/animator_heart_rotate.xml
-6Lines changed: 0 additions & 6 deletions
This file was deleted.
Collapse file

‎app/src/main/res/drawable/animated_bonc.xml‎

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:drawable="@drawable/vector_bonc">
4+
<target
5+
android:animation="@animator/animator_heart_line"
6+
android:name="bonc"/>
7+
8+
</animated-vector>
Collapse file

‎app/src/main/res/drawable/vector_bonc.xml‎

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:height="200dp"
4+
android:width="400dp"
5+
android:viewportHeight="100"
6+
android:viewportWidth="200"
7+
>
8+
9+
<path
10+
android:name="rect"
11+
android:fillColor="@color/red"
12+
android:pathData="M 0,0 L 0,100 L 200,100 L 200,0 "/>
13+
14+
<path
15+
android:name="bonc"
16+
android:pathData="@string/path_bonc"
17+
android:strokeColor="@color/colorWrite"
18+
android:strokeLineCap="round"
19+
android:strokeWidth="1"/>
20+
</vector>
Collapse file

‎app/src/main/res/drawable/vector_heart1.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/drawable/vector_heart1.xml
-13Lines changed: 0 additions & 13 deletions
This file was deleted.
Collapse file

‎app/src/main/res/layout/activity_play_animate_vector_drawables.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_play_animate_vector_drawables.xml
+12-10Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
android:id="@+id/animatevectordrawable"
1414
layout="@layout/toolbar"/>
1515

16+
<Button
17+
android:id="@+id/btn_suprise"
18+
android:layout_width="match_parent"
19+
android:layout_height="wrap_content"
20+
android:text="点我有惊喜^_^"/>
21+
1622
<LinearLayout
1723
android:layout_width="match_parent"
1824
android:layout_height="wrap_content"
@@ -32,24 +38,20 @@
3238
</LinearLayout>
3339

3440
<ImageView
35-
android:id="@+id/image_heart"
41+
android:id="@+id/image_bonc"
3642
android:layout_width="wrap_content"
3743
android:layout_height="wrap_content"
3844
android:layout_gravity="center"
39-
android:src="@drawable/animated_heart"
45+
android:src="@drawable/animated_bonc"
4046
android:visibility="invisible"/>
4147

4248
<ImageView
43-
android:id="@+id/image_bonc"
49+
android:id="@+id/image_heart"
4450
android:layout_width="wrap_content"
4551
android:layout_height="wrap_content"
46-
android:layout_gravity="center"/>
47-
48-
<Button
49-
android:id="@+id/btn_giveheart"
50-
android:layout_width="match_parent"
51-
android:layout_height="wrap_content"
52-
android:text="点我有惊喜^_^"/>
52+
android:layout_gravity="center"
53+
android:src="@drawable/animated_heart"
54+
android:visibility="invisible"/>
5355

5456
</LinearLayout>
5557

Collapse file

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

Copy file name to clipboardExpand all lines: app/src/main/res/values/strings.xml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@
4444
L 50,85 L 15,50
4545
A 17.5,17.5,0,1,1,50,15
4646
</string>
47+
<!--bonc-->
48+
<string name="path_bonc">M 12,25 L 42,25 A 12.5,12.5,90,1,1,42,50 L 56,50 A 24,24,0,1,1,104,50 L 108,50 L 108,25 L 118,25 133,50 L 133,25 L 143,25 L 143,50 L 148,50 A 25,25 -90,0,1,178,25 L 178,35 A 15,15,-90,0,0,158,50 A 15,15,90,0,0,178,65 L 178,75 A 25,25,90,0,1,148,50 L 143,50 L 143,75 L 133,75,118,50 L 118,75 L 108 75 L 108,50 L 104,50 A 24,24,180,1,1,56,50 L 42,50 A 12.5,12.5,90,1,1,42,75 L 12,75 L 12 ,25</string>
4749

4850
</resources>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.