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 add · AndroidLu/Coder@3e1fd08

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main
    • AndroidManifest.xml
    • java/com/coder/guoy/recyclerview/ui
      • PlayAnimateVectorDrawables.java
      • holder
        • MaterialDesignHolder.java
    • res
      • animator
        • smile.xml
      • drawable
        • animated_smile.xml
        • vector_smile.xml
      • layout
        • activity_material_design_holder.xml
        • activity_play_animate_vector_drawables.xml
      • values
        • strings.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/AndroidManifest.xml‎

Copy file name to clipboardExpand all lines: app/src/main/AndroidManifest.xml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
<activity
136136
android:name=".ui.PlayActivityTransitions"
137137
android:screenOrientation="portrait"/>
138+
<activity android:name=".ui.PlayAnimateVectorDrawables">
139+
</activity>
138140
</application>
139141

140142
</manifest>
Collapse file

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

Copy file name to clipboard
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.coder.guoy.recyclerview.ui;
2+
3+
import android.graphics.drawable.Animatable;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
7+
import com.coder.guoy.recyclerview.R;
8+
import com.coder.guoy.recyclerview.base.MvvmBaseActivity;
9+
import com.coder.guoy.recyclerview.databinding.ActivityPlayAnimateVectorDrawablesBinding;
10+
11+
public class PlayAnimateVectorDrawables extends MvvmBaseActivity<ActivityPlayAnimateVectorDrawablesBinding> implements View.OnClickListener {
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_play_animate_vector_drawables);
17+
showContentView();
18+
bindingView.animatevectordrawable.textviewTitle.setText("Animate Vector Drawables|矢量图片动画");
19+
bindingView.animatevectordrawable.toolbarBack.setOnClickListener(this);
20+
bindingView.imageSmile.setOnClickListener(this);
21+
}
22+
23+
@Override
24+
public void onClick(View v) {
25+
switch (v.getId()) {
26+
case R.id.toolbar_back:
27+
finish();
28+
break;
29+
case R.id.image_smile:
30+
((Animatable) bindingView.imageSmile.getDrawable()).start();
31+
}
32+
}
33+
}
Collapse file

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

Copy file name to clipboardExpand all lines: app/src/main/java/com/coder/guoy/recyclerview/ui/holder/MaterialDesignHolder.java
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.coder.guoy.recyclerview.base.MvvmBaseActivity;
99
import com.coder.guoy.recyclerview.databinding.ActivityMaterialDesignHolderBinding;
1010
import com.coder.guoy.recyclerview.ui.PlayActivityTransitions;
11+
import com.coder.guoy.recyclerview.ui.PlayAnimateVectorDrawables;
1112
import com.coder.guoy.recyclerview.ui.PlayCurvedMotion;
1213
import com.coder.guoy.recyclerview.ui.PlayFloatingActionButton;
1314
import com.coder.guoy.recyclerview.ui.PlayRevealEffect;
@@ -52,6 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {
5253
bindingView.btnCurved.setOnClickListener(this);
5354
bindingView.btnViewstate.setOnClickListener(this);
5455
bindingView.btnActivitytransition.setOnClickListener(this);
56+
bindingView.btnVectordrawable.setOnClickListener(this);
5557
}
5658

5759
@Override
@@ -108,6 +110,9 @@ public void onClick(View v) {
108110
case R.id.btn_activitytransition:
109111
startActivity(new Intent(MaterialDesignHolder.this, PlayActivityTransitions.class));
110112
break;
113+
case R.id.btn_vectordrawable:
114+
startActivity(new Intent(MaterialDesignHolder.this, PlayAnimateVectorDrawables.class));
115+
break;
111116
}
112117
}
113118
}
Collapse file

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

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:duration="1000"
4+
android:interpolator="@android:anim/accelerate_interpolator"
5+
android:propertyName="pathData"
6+
android:valueFrom="@string/path_face_mouth_sad"
7+
android:valueTo="@string/path_face_mouth_happy"
8+
android:valueType="pathType"/>
9+
Collapse file

‎app/src/main/res/drawable/animated_smile.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_smile">
4+
<target
5+
android:name="smile"
6+
android:animation="@animator/smile"/>
7+
8+
</animated-vector>
Collapse file

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

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="200dp"
4+
android:height="200dp"
5+
android:viewportHeight="100"
6+
android:viewportWidth="100">
7+
8+
<path
9+
android:fillColor="@color/yello"
10+
android:pathData="m 50,50 m -48 ,0 a 48,48 0 1,0 96,0 a 48,48 0 1,0 -96,0"/>
11+
12+
<path
13+
android:fillColor="@color/colorBlack"
14+
android:pathData="m 35 ,40 m -7,0 a 7,7 0 1,0 14,0 a 7,7 0 1,0 -14 ,0"/>
15+
<path
16+
android:fillColor="@color/colorBlack"
17+
android:pathData="m 65 ,40 m -7,0 a 7,7 0 1,0 14,0 a 7,7 0 1,0 -14 ,0"/>
18+
19+
<path
20+
android:name="smile"
21+
android:pathData="m 30,75 Q 50,55 70,75"
22+
android:strokeColor="@color/colorBlack"
23+
android:strokeLineCap="round"
24+
android:strokeWidth="4"/>
25+
26+
</vector>
Collapse file

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

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_material_design_holder.xml
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@
111111
android:layout_height="wrap_content"
112112
android:text="Activity Transitions|转场动画"
113113
android:textAllCaps="false"/>
114+
<Button
115+
android:id="@+id/btn_vectordrawable"
116+
android:layout_width="match_parent"
117+
android:layout_height="wrap_content"
118+
android:text="Animate Vector Drawables|矢量图片动画"
119+
android:textAllCaps="false"/>
114120

115121
</LinearLayout>
116122
</android.support.v4.widget.NestedScrollView>
Collapse file

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

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools">
5+
6+
<LinearLayout
7+
android:layout_width="match_parent"
8+
android:layout_height="match_parent"
9+
android:orientation="vertical">
10+
11+
<include
12+
android:id="@+id/animatevectordrawable"
13+
layout="@layout/toolbar"/>
14+
15+
<ImageView
16+
android:id="@+id/image_smile"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
android:src="@drawable/animated_smile"/>
20+
</LinearLayout>
21+
22+
</layout>
Collapse file

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

Copy file name to clipboardExpand all lines: app/src/main/res/values/strings.xml
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@
2020
<string name="CoordinatorLayout">折叠布局的嵌套</string>
2121
<string name="FAILE">加载失败,点击重试</string>
2222
<string name="LOADING">努力加载中...</string>
23+
24+
<string name="path_face_mouth_sad">
25+
M 30,75
26+
Q 50,55 70,75
27+
</string>
28+
<string name="path_face_mouth_happy">
29+
M 30,65
30+
Q 50,85 70,65
31+
</string>
2332
</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.