Skip to content

Instantly share code, notes, and snippets.

View mohamad-shafaee's full-sized avatar

Mohammad Shafaei mohamad-shafaee

View GitHub Profile
public class MainActivity extends AppCompatActivity{
Button button;
Activity activity = this;
EditText edtTxt;
float newAngle;
float oldAngle;
ObjectAnimator animatorX;
ValueAnimator.AnimatorUpdateListener mListener;
public class PieView extends View {
// magnitude of rounding rectangle
int rx;
int ry;
String titleText;
int radius;
float angle;
Paint paintBackground;
public class MainActivity extends AppCompatActivity {
Activity act = this;
TextView txtv;
FlingAnimation fling;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
public class MainActivity extends AppCompatActivity {
TextView txtv;
SpringAnimation springAnim;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtv = (TextView) findViewById(R.id.txt1);
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.msh_n.myp.springanime2.MainActivity">
<TextView
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
Button btn;
Button[] buttons;
ConstraintLayout layout;
int whichAnimation;
int flowerX = 0;
int flowerY = 0;
double[] flowerXD = new double[5];
double[] flowerYD = new double[5];
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:id="@+id/lay1"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.msh_n.myp.valueanimator1.MainActivity">
package com.msh_n.myp.customview1;
public class MainActivity extends AppCompatActivity {
Button button;
float newAngle;
float oldAngle;
ObjectAnimator animatorX;
ValueAnimator.AnimatorUpdateListener mListener;
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:animateLayoutChanges="true"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.msh_n.myp.customview1.MainActivity">
package com.msh_n.myp.customview1;
public class PieView extends View {
String titleText;
int radius;
float angle;
Paint paintBackground;
Paint paintV;