Search in sources :

Example 1 with FrameLayout

use of carbon.widget.FrameLayout 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 FrameLayout

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

the class DropDownMenu method dismiss.

@Override
public void dismiss() {
    FrameLayout content = getContentView().findViewById(R.id.carbon_popupContainer);
    content.animateVisibility(View.INVISIBLE).addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            DropDownMenu.super.dismiss();
        }
    });
}
Also used : Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FrameLayout(carbon.widget.FrameLayout)

Example 3 with FrameLayout

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

the class DropDownMenu method showImmediate.

public boolean showImmediate(View anchor) {
    anchorView = anchor;
    super.showAtLocation(anchor, Gravity.START | Gravity.TOP, 0, 0);
    update();
    FrameLayout content = getContentView().findViewById(R.id.carbon_popupContainer);
    content.setVisibility(View.VISIBLE);
    return true;
}
Also used : FrameLayout(carbon.widget.FrameLayout)

Example 4 with FrameLayout

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

the class DropDownMenu method show.

public boolean show(View anchor) {
    anchorView = anchor;
    super.showAtLocation(anchor, Gravity.START | Gravity.TOP, 0, 0);
    update();
    FrameLayout content = getContentView().findViewById(R.id.carbon_popupContainer);
    content.animateVisibility(View.VISIBLE);
    return true;
}
Also used : FrameLayout(carbon.widget.FrameLayout)

Aggregations

FrameLayout (carbon.widget.FrameLayout)4 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 Button (carbon.widget.Button)1 FloatingActionButton (carbon.widget.FloatingActionButton)1