Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
Java
public class MainActivity extends AppCompatActivity implements BottomNavigationView.OnNavigationItemSelectedListener {
private CurvedBottomNavigationView mView;
private VectorMasterView heartVector;
private VectorMasterView heartVector1;
private VectorMasterView heartVector2;
private float mYVal;
private RelativeLayout mlinId;
PathModel outline;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mView = findViewById(R.id.customBottomBar);
heartVector = findViewById(R.id.fab);
heartVector1 = findViewById(R.id.fab1);
heartVector2 = findViewById(R.id.fab2);
mlinId = findViewById(R.id.lin_id);
mView.inflateMenu(R.menu.bottom_menu);
mView.setSelectedItemId(R.id.action_schedules);
//getting bottom navigation view and attaching the listener
//BottomNavigationView navigation = findViewById(R.id.customBottomBar);
mView.setOnNavigationItemSelectedListener(MainActivity.this);
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_favorites:
tet(6);
// find the correct path using name
mlinId.setX(mView.mFirstCurveControlPoint1.x );
heartVector.setVisibility(View.VISIBLE);
heartVector1.setVisibility(View.GONE);
heartVector2.setVisibility(View.GONE);
selectAnimation(heartVector);
break;
case R.id.action_schedules:
tet(2);
mlinId.setX(mView.mFirstCurveControlPoint1.x );
heartVector.setVisibility(View.GONE);
heartVector1.setVisibility(View.VISIBLE);
heartVector2.setVisibility(View.GONE);
selectAnimation(heartVector1);
break;
case R.id.action_music:
tet();
mlinId.setX(mView.mFirstCurveControlPoint1.x ) ;
heartVector.setVisibility(View.GONE);
heartVector1.setVisibility(View.GONE);
heartVector2.setVisibility(View.VISIBLE);
selectAnimation(heartVector2);
break;
}
return true;
}
private void selectAnimation(final VectorMasterView heartVector) {
outline = heartVector.getPathModelByName("outline");
outline.setStrokeColor(Color.parseColor("#ffffff"));
outline.setTrimPathEnd(0.0f);
// initialise valueAnimator and pass start and end float values
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
valueAnimator.setDuration(1000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
// set trim end value and update view
outline.setTrimPathEnd((Float) valueAnimator.getAnimatedValue());
heartVector.update();
}
});
valueAnimator.start();
}
private void tet(int i) {
// get width and height of navigation bar
// Navigation bar bounds (width & height)
//mNavigationBarHeight = getHeight();
//mNavigationBarWidth = getWidth();
// the coordinates (x,y) of the start point before curve
mView.mFirstCurveStartPoint.set((mView.mNavigationBarWidth / i) - (mView.CURVE_CIRCLE_RADIUS * 2) - (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the end point after curve
mView.mFirstCurveEndPoint.set(mView.mNavigationBarWidth / i, mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4));
// same thing for the second curve
mView.mSecondCurveStartPoint = mView.mFirstCurveEndPoint;
mView.mSecondCurveEndPoint.set((mView.mNavigationBarWidth / i) + (mView.CURVE_CIRCLE_RADIUS * 2) + (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the 1st control point on a cubic curve
mView.mFirstCurveControlPoint1.set(mView.mFirstCurveStartPoint.x + mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4), mView.mFirstCurveStartPoint.y);
// the coordinates (x,y) of the 2nd control point on a cubic curve
mView.mFirstCurveControlPoint2.set(mView.mFirstCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS * 2) + mView.CURVE_CIRCLE_RADIUS, mView.mFirstCurveEndPoint.y);
mView.mSecondCurveControlPoint1.set(mView.mSecondCurveStartPoint.x + (mView.CURVE_CIRCLE_RADIUS * 2) - mView.CURVE_CIRCLE_RADIUS, mView.mSecondCurveStartPoint.y);
mView.mSecondCurveControlPoint2.set(mView.mSecondCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4)), mView.mSecondCurveEndPoint.y);
}
private void tet() {
// get width and height of navigation bar
// Navigation bar bounds (width & height)
//mNavigationBarHeight = getHeight();
//mNavigationBarWidth = getWidth();
// the coordinates (x,y) of the start point before curve
mView.mFirstCurveStartPoint.set((mView.mNavigationBarWidth * 10/12) - (mView.CURVE_CIRCLE_RADIUS * 2) - (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the end point after curve
mView.mFirstCurveEndPoint.set(mView.mNavigationBarWidth * 10/12, mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4));
// same thing for the second curve
mView.mSecondCurveStartPoint = mView.mFirstCurveEndPoint;
mView.mSecondCurveEndPoint.set((mView.mNavigationBarWidth * 10/12) + (mView.CURVE_CIRCLE_RADIUS * 2) + (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the 1st control point on a cubic curve
mView.mFirstCurveControlPoint1.set(mView.mFirstCurveStartPoint.x + mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4), mView.mFirstCurveStartPoint.y);
// the coordinates (x,y) of the 2nd control point on a cubic curve
mView.mFirstCurveControlPoint2.set(mView.mFirstCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS * 2) + mView.CURVE_CIRCLE_RADIUS, mView.mFirstCurveEndPoint.y);
mView.mSecondCurveControlPoint1.set(mView.mSecondCurveStartPoint.x + (mView.CURVE_CIRCLE_RADIUS * 2) - mView.CURVE_CIRCLE_RADIUS, mView.mSecondCurveStartPoint.y);
mView.mSecondCurveControlPoint2.set(mView.mSecondCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4)), mView.mSecondCurveEndPoint.y);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
public class MainActivity extends AppCompatActivity implements BottomNavigationView.OnNavigationItemSelectedListener {
private CurvedBottomNavigationView mView;
private VectorMasterView heartVector;
private VectorMasterView heartVector1;
private VectorMasterView heartVector2;
private float mYVal;
private RelativeLayout mlinId;
PathModel outline;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mView = findViewById(R.id.customBottomBar);
heartVector = findViewById(R.id.fab);
heartVector1 = findViewById(R.id.fab1);
heartVector2 = findViewById(R.id.fab2);
mlinId = findViewById(R.id.lin_id);
mView.inflateMenu(R.menu.bottom_menu);
mView.setSelectedItemId(R.id.action_schedules);
//getting bottom navigation view and attaching the listener
//BottomNavigationView navigation = findViewById(R.id.customBottomBar);
mView.setOnNavigationItemSelectedListener(MainActivity.this);
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_favorites:
tet(6);
// find the correct path using name
mlinId.setX(mView.mFirstCurveControlPoint1.x );
heartVector.setVisibility(View.VISIBLE);
heartVector1.setVisibility(View.GONE);
heartVector2.setVisibility(View.GONE);
selectAnimation(heartVector);
break;
case R.id.action_schedules:
tet(2);
mlinId.setX(mView.mFirstCurveControlPoint1.x );
heartVector.setVisibility(View.GONE);
heartVector1.setVisibility(View.VISIBLE);
heartVector2.setVisibility(View.GONE);
selectAnimation(heartVector1);
break;
case R.id.action_music:
tet();
mlinId.setX(mView.mFirstCurveControlPoint1.x ) ;
heartVector.setVisibility(View.GONE);
heartVector1.setVisibility(View.GONE);
heartVector2.setVisibility(View.VISIBLE);
selectAnimation(heartVector2);
break;
}
return true;
}
private void selectAnimation(final VectorMasterView heartVector) {
outline = heartVector.getPathModelByName("outline");
outline.setStrokeColor(Color.parseColor("#ffffff"));
outline.setTrimPathEnd(0.0f);
// initialise valueAnimator and pass start and end float values
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
valueAnimator.setDuration(1000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
// set trim end value and update view
outline.setTrimPathEnd((Float) valueAnimator.getAnimatedValue());
heartVector.update();
}
});
valueAnimator.start();
}
private void tet(int i) {
// get width and height of navigation bar
// Navigation bar bounds (width & height)
//mNavigationBarHeight = getHeight();
//mNavigationBarWidth = getWidth();
// the coordinates (x,y) of the start point before curve
mView.mFirstCurveStartPoint.set((mView.mNavigationBarWidth / i) - (mView.CURVE_CIRCLE_RADIUS * 2) - (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the end point after curve
mView.mFirstCurveEndPoint.set(mView.mNavigationBarWidth / i, mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4));
// same thing for the second curve
mView.mSecondCurveStartPoint = mView.mFirstCurveEndPoint;
mView.mSecondCurveEndPoint.set((mView.mNavigationBarWidth / i) + (mView.CURVE_CIRCLE_RADIUS * 2) + (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the 1st control point on a cubic curve
mView.mFirstCurveControlPoint1.set(mView.mFirstCurveStartPoint.x + mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4), mView.mFirstCurveStartPoint.y);
// the coordinates (x,y) of the 2nd control point on a cubic curve
mView.mFirstCurveControlPoint2.set(mView.mFirstCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS * 2) + mView.CURVE_CIRCLE_RADIUS, mView.mFirstCurveEndPoint.y);
mView.mSecondCurveControlPoint1.set(mView.mSecondCurveStartPoint.x + (mView.CURVE_CIRCLE_RADIUS * 2) - mView.CURVE_CIRCLE_RADIUS, mView.mSecondCurveStartPoint.y);
mView.mSecondCurveControlPoint2.set(mView.mSecondCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4)), mView.mSecondCurveEndPoint.y);
}
private void tet() {
// get width and height of navigation bar
// Navigation bar bounds (width & height)
//mNavigationBarHeight = getHeight();
//mNavigationBarWidth = getWidth();
// the coordinates (x,y) of the start point before curve
mView.mFirstCurveStartPoint.set((mView.mNavigationBarWidth * 10/12) - (mView.CURVE_CIRCLE_RADIUS * 2) - (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the end point after curve
mView.mFirstCurveEndPoint.set(mView.mNavigationBarWidth * 10/12, mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4));
// same thing for the second curve
mView.mSecondCurveStartPoint = mView.mFirstCurveEndPoint;
mView.mSecondCurveEndPoint.set((mView.mNavigationBarWidth * 10/12) + (mView.CURVE_CIRCLE_RADIUS * 2) + (mView.CURVE_CIRCLE_RADIUS / 3), 0);
// the coordinates (x,y) of the 1st control point on a cubic curve
mView.mFirstCurveControlPoint1.set(mView.mFirstCurveStartPoint.x + mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4), mView.mFirstCurveStartPoint.y);
// the coordinates (x,y) of the 2nd control point on a cubic curve
mView.mFirstCurveControlPoint2.set(mView.mFirstCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS * 2) + mView.CURVE_CIRCLE_RADIUS, mView.mFirstCurveEndPoint.y);
mView.mSecondCurveControlPoint1.set(mView.mSecondCurveStartPoint.x + (mView.CURVE_CIRCLE_RADIUS * 2) - mView.CURVE_CIRCLE_RADIUS, mView.mSecondCurveStartPoint.y);
mView.mSecondCurveControlPoint2.set(mView.mSecondCurveEndPoint.x - (mView.CURVE_CIRCLE_RADIUS + (mView.CURVE_CIRCLE_RADIUS / 4)), mView.mSecondCurveEndPoint.y);
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team