Search in sources :

Example 1 with Button

use of carbon.widget.Button in project Carbon by ZieIony.

the class WidgetAnimationsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initToolbar();
    final FloatingActionButton fab = findViewById(R.id.fab);
    Button button = findViewById(R.id.button);
    button.setOnClickListener(v -> fab.animateVisibility(fab.isVisible() ? View.INVISIBLE : View.VISIBLE));
    final Button button2 = findViewById(R.id.button2);
    Button button3 = findViewById(R.id.button3);
    button3.setOnClickListener(v -> button2.animateVisibility(button2.isVisible() ? View.INVISIBLE : View.VISIBLE));
    FrameLayout frame = findViewById(R.id.frame);
    Button reveal = findViewById(R.id.reveal);
    reveal.setOnClickListener(v -> {
        float radius = (float) Math.sqrt((frame.getWidth() - 20) * (frame.getWidth() - 20) + (frame.getHeight() - 20) * (frame.getHeight() - 20));
        frame.createCircularReveal(20, 20, 0, radius).start();
    });
}
Also used : Button(carbon.widget.Button) FloatingActionButton(carbon.widget.FloatingActionButton) FrameLayout(carbon.widget.FrameLayout) FloatingActionButton(carbon.widget.FloatingActionButton)

Example 2 with Button

use of carbon.widget.Button in project Carbon by ZieIony.

the class ZOrderActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initToolbar();
    final FrameLayout layout = findViewById(R.id.layout);
    Button button = findViewById(R.id.button);
    button.setOnClickListener(view -> {
        ((ShadowView) layout.getChildAt(0)).setElevation(getResources().getDimension(R.dimen.carbon_1dip) * (flag ? 2 : 3));
        ((ShadowView) layout.getChildAt(1)).setElevation(getResources().getDimension(R.dimen.carbon_1dip) * (flag ? 3 : 2));
        flag = !flag;
        layout.postInvalidate();
    });
}
Also used : Button(carbon.widget.Button) FrameLayout(android.widget.FrameLayout) ShadowView(carbon.view.ShadowView)

Example 3 with Button

use of carbon.widget.Button in project Carbon by ZieIony.

the class EditTextMenu method initCopy.

public void initCopy(final MenuItem item) {
    Button button = getContentView().findViewById(R.id.carbon_copy);
    initMenuItem(item, button);
}
Also used : Button(carbon.widget.Button)

Example 4 with Button

use of carbon.widget.Button in project Carbon by ZieIony.

the class EditTextMenu method initCut.

public void initCut(final MenuItem item) {
    Button button = getContentView().findViewById(R.id.carbon_cut);
    initMenuItem(item, button);
}
Also used : Button(carbon.widget.Button)

Example 5 with Button

use of carbon.widget.Button in project Carbon by ZieIony.

the class EditTextMenu method initPaste.

public void initPaste(final MenuItem item) {
    Button button = getContentView().findViewById(R.id.carbon_paste);
    initMenuItem(item, button);
}
Also used : Button(carbon.widget.Button)

Aggregations

Button (carbon.widget.Button)10 FrameLayout (carbon.widget.FrameLayout)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 Context (android.content.Context)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Bundle (android.os.Bundle)1 Vibrator (android.os.Vibrator)1 SoundEffectConstants (android.view.SoundEffectConstants)1 View (android.view.View)1 FrameLayout (android.widget.FrameLayout)1 TextView (android.widget.TextView)1 Carbon (carbon.Carbon)1 AnimatedView (carbon.animation.AnimatedView)1 RevealView (carbon.view.RevealView)1 ShadowView (carbon.view.ShadowView)1 FloatingActionButton (carbon.widget.FloatingActionButton)1 ImageView (carbon.widget.ImageView)1 LinearLayout (carbon.widget.LinearLayout)1 TextView (carbon.widget.TextView)1