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 — 完成气泡动画view · YXHTom/AndroidCustomView@0976de4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .idea/inspectionProfiles
    • Project_Default.xml
    • profiles_settings.xml
  • app/src/main
    • java/com/allen/androidcustomview
      • MainActivity.java
      • bean
        • CircleBean.java
      • widget
        • BezierView.java
        • BubbleView.java
        • CircleView.java
        • WaveView.java
    • res
      • layout
        • activity_main.xml
      • mipmap-xhdpi
        • start_logo_group.png
      • values
        • colors.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.idea/inspectionProfiles/Project_Default.xml‎

Copy file name to clipboardExpand all lines: .idea/inspectionProfiles/Project_Default.xml
+10Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎.idea/inspectionProfiles/profiles_settings.xml‎

Copy file name to clipboardExpand all lines: .idea/inspectionProfiles/profiles_settings.xml
+7Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎app/src/main/java/com/allen/androidcustomview/MainActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/allen/androidcustomview/MainActivity.java
+98-31Lines changed: 98 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,44 @@
55
import android.util.Log;
66
import android.view.View;
77
import android.widget.Button;
8+
import android.widget.ImageView;
9+
import android.widget.TextView;
810

911
import com.allen.androidcustomview.bean.CircleBean;
1012
import com.allen.androidcustomview.bean.Point;
1113
import com.allen.androidcustomview.utils.DisplayUtils;
12-
import com.allen.androidcustomview.widget.BezierView;
14+
import com.allen.androidcustomview.widget.BubbleView;
1315

1416
import java.util.ArrayList;
1517
import java.util.List;
1618

1719
public class MainActivity extends AppCompatActivity {
1820

1921
private static final String TAG = "allen";
22+
private ImageView hxbIv;
23+
private TextView hxbTv;
2024
private Button button;
21-
private BezierView bezierView;
25+
private BubbleView bezierView;
2226

2327
private List<CircleBean> circleBeanList = new ArrayList<>();
2428

2529
@Override
2630
protected void onCreate(Bundle savedInstanceState) {
2731
super.onCreate(savedInstanceState);
2832
setContentView(R.layout.activity_main);
29-
bezierView = (BezierView) findViewById(R.id.circle_view);
33+
hxbIv = (ImageView) findViewById(R.id.hxb_iv);
34+
hxbTv = (TextView) findViewById(R.id.center_tv);
35+
bezierView = (BubbleView) findViewById(R.id.circle_view);
3036
button = (Button) findViewById(R.id.start_btn);
3137
button.setOnClickListener(new View.OnClickListener() {
3238
@Override
3339
public void onClick(View v) {
34-
bezierView.createInAnimation();
40+
bezierView.setCenterImg(hxbTv);
41+
bezierView.openAnimation();
3542
}
3643
});
3744

45+
3846
initPoint();
3947

4048
bezierView.setCircleBeen(circleBeanList);
@@ -43,67 +51,68 @@ public void onClick(View v) {
4351

4452
private void initPoint() {
4553

46-
int hight = DisplayUtils.getDisplayHight(this);
54+
int height = DisplayUtils.getDisplayHight(this);
4755
int width = DisplayUtils.getDisplayWidth(this);
4856

4957
int centerX = width / 2;
50-
int centerY = hight / 3;
58+
int centerY = height / 2;
5159

5260
Log.d(TAG, "initPoint: " + centerX + "----" + centerY);
5361

62+
5463
CircleBean circleBean = new CircleBean(
55-
new Point(-width / 4, hight * 3 / 5),
56-
new Point(centerX - 30, hight * 3 / 5),
64+
new Point(-width*5/21, height * 10/33),
65+
new Point(centerX - 30, height * 2 / 3),
5766
new Point(centerX - 30, centerY - 120),
5867
new Point(width / 6, centerY - 120),
5968
new Point(width / 6, 0),
60-
100, 60);
69+
84, 60);
6170
CircleBean circleBean2 = new CircleBean(
62-
new Point(-width / 4, hight * 4 / 6),
63-
new Point(centerX - 20, hight * 4 / 6),
71+
new Point(-width / 4, height * 4 / 6),
72+
new Point(centerX - 20, height * 3 / 5),
6473
new Point(centerX - 20, centerY - 10),
6574
new Point(width / 3, centerY - 10),
66-
new Point(width / 3, -hight * 5 / 27),
67-
130, 60);
75+
new Point(width / 3, -height * 5 / 27),
76+
250, 60);
6877
CircleBean circleBean3 = new CircleBean(
69-
new Point(-width / 12, hight * 5 / 7),
70-
new Point(centerX - 100, hight * 5 / 7),
78+
new Point(-width / 12, height * 5 / 7),
79+
new Point(centerX - 100, height * 2 / 3),
7180
new Point(centerX - 100, centerY + 100),
7281
new Point(0, centerY + 100),
7382
new Point(0, 0),
74-
80, 60);
83+
48, 60);
7584

7685
CircleBean circleBean4 = new CircleBean(
77-
new Point(-width / 12, hight * 4 / 5),
78-
new Point(centerX, hight * 4 / 5),
86+
new Point(-width / 12, height * 4 / 5),
87+
new Point(centerX, height * 3 / 4),
7988
new Point(centerX, centerY),
8089
new Point(width / 2, centerY),
81-
new Point(width / 2, -hight / 7),
82-
200, 60);
90+
new Point(width / 2, -height / 7),
91+
250, 60);
8392

8493
CircleBean circleBean5 = new CircleBean(
85-
new Point(width * 5 / 7, hight * 4 / 5),
86-
new Point(centerX, hight * 4 / 5),
94+
new Point(width * 5 / 7, height * 4 / 5),
95+
new Point(centerX, height * 3 / 4),
8796
new Point(centerX, centerY - 20),
8897
new Point(width * 10 / 13, centerY - 20),
89-
new Point(width * 10 / 13, -hight * 2 / 13),
90-
260, 60);
98+
new Point(width * 10 / 13, -height * 2 / 13),
99+
250, 60);
91100
CircleBean circleBean6 = new CircleBean(
92-
new Point(width + width / 5, hight * 3 / 4),
93-
new Point(centerX + 20, hight * 3 / 4),
101+
new Point(width + width / 5, height * 3 / 4),
102+
new Point(centerX + 20, height * 2 / 3),
94103
new Point(centerX + 20, centerY + 10),
95104
new Point(width * 11 / 14, centerY + 10),
96105

97-
new Point(width * 11 / 14, -hight * 5 / 27),
98-
70, 60);
106+
new Point(width * 11 / 14, -height * 5 / 27),
107+
250, 60);
99108
CircleBean circleBean7 = new CircleBean(
100-
new Point(width + width / 7, hight * 5 / 8),
101-
new Point(centerX + 20, hight * 5 / 8),
109+
new Point(width + width / 7, height * 5 / 8),
110+
new Point(centerX + 20, height * 4 / 7),
102111
new Point(centerX + 20, centerY + 10),
103112
new Point(width, centerY + 10),
104113

105114
new Point(width, 0),
106-
100, 60);
115+
120, 60);
107116

108117
circleBeanList.add(circleBean);
109118
circleBeanList.add(circleBean2);
@@ -112,5 +121,63 @@ private void initPoint() {
112121
circleBeanList.add(circleBean5);
113122
circleBeanList.add(circleBean6);
114123
circleBeanList.add(circleBean7);
124+
125+
126+
127+
128+
// CircleBean circleBean = new CircleBean(
129+
// new Point(-width*5/21, height * 10/33),
130+
// new Point(centerX - 30, height * 3 / 5),
131+
// new Point(width*2/5, height/3),
132+
// new Point(width / 6, centerY - 120),
133+
// new Point(width / 6, 0),
134+
// 140, 60);
135+
// CircleBean circleBean2 = new CircleBean(
136+
// new Point(-width / 4, height * 4 / 6),
137+
// new Point(centerX - 20, height * 4 / 6),
138+
// new Point(centerX - 20, centerY - 10),
139+
// new Point(width / 3, centerY - 10),
140+
// new Point(width / 3, -height * 5 / 27),
141+
// 300, 60);
142+
// CircleBean circleBean3 = new CircleBean(
143+
// new Point(-width / 12, height * 5 / 7),
144+
// new Point(centerX - 100, height * 5 / 7),
145+
// new Point(centerX - 100, centerY + 100),
146+
// new Point(0, centerY + 100),
147+
// new Point(0, 0),
148+
// 300, 60);
149+
//
150+
// CircleBean circleBean4 = new CircleBean(
151+
// new Point(-width / 12, height * 4 / 5),
152+
// new Point(centerX, height * 4 / 5),
153+
// new Point(centerX, centerY),
154+
// new Point(width / 2, centerY),
155+
// new Point(width / 2, -height / 7),
156+
// 300, 60);
157+
//
158+
// CircleBean circleBean5 = new CircleBean(
159+
// new Point(width * 5 / 7, height * 4 / 5),
160+
// new Point(centerX, height * 4 / 5),
161+
// new Point(centerX, centerY - 20),
162+
// new Point(width * 10 / 13, centerY - 20),
163+
// new Point(width * 10 / 13, -height * 2 / 13),
164+
// 300, 60);
165+
// CircleBean circleBean6 = new CircleBean(
166+
// new Point(width + width / 5, height * 3 / 4),
167+
// new Point(centerX + 20, height * 3 / 4),
168+
// new Point(centerX + 20, centerY + 10),
169+
// new Point(width * 11 / 14, centerY + 10),
170+
//
171+
// new Point(width * 11 / 14, -height * 5 / 27),
172+
// 300, 60);
173+
// CircleBean circleBean7 = new CircleBean(
174+
// new Point(width + width / 7, height * 5 / 8),
175+
// new Point(centerX + 20, height * 5 / 8),
176+
// new Point(centerX + 20, centerY + 10),
177+
// new Point(width, centerY + 10),
178+
//
179+
// new Point(width, 0),
180+
// 180, 60);
181+
115182
}
116183
}
Collapse file

‎app/src/main/java/com/allen/androidcustomview/bean/CircleBean.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/allen/androidcustomview/bean/CircleBean.java
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,29 @@
66

77
public class CircleBean {
88

9+
/**
10+
* 真实轨迹坐标点
11+
*/
912
Point p;
13+
/**
14+
* 起点坐标
15+
*/
1016
Point p0;
17+
/**
18+
* 进入动画的控制点坐标
19+
*/
1120
Point p1;
21+
/**
22+
* 到达中心点做坐标
23+
*/
1224
Point p2;
25+
/**
26+
* 飞出动画控制点的坐标
27+
*/
1328
Point p3;
29+
/**
30+
* 结束位置坐标
31+
*/
1432
Point p4;
1533

1634
/**

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.