Java Code Examples for android.widget.ImageView#bringToFront()

The following examples show how to use android.widget.ImageView#bringToFront() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
public FloatingNavigationView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    setImageResource(R.drawable.ic_menu_vector);

    mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);

    mNavigationView = (CircularRevealNavigationView) LayoutInflater.from(context).inflate(R.layout.navigation_view, null);
    mNavigationView.setBackground(new ColorDrawable(getBackgroundColor()));
    mNavigationView.setOnTouchListener(mNavigationTouchListener);
    mNavigationMenuView = (NavigationMenuView) mNavigationView.findViewById(R.id.design_navigation_view);

    mFabView = (ImageView) mNavigationView.findViewById(R.id.fab_view);
    mFabView.setOnClickListener(mFabClickListener);
    mFabView.setContentDescription(getContentDescription());
    mFabView.bringToFront();

    // Custom attributes
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MenuView, defStyleAttr, R.style.Widget_Design_NavigationView);
    if (a.hasValue(R.styleable.MenuView_menu)) {
        mNavigationView.inflateMenu(a.getResourceId(R.styleable.MenuView_menu, 0));
    }
    if (a.hasValue(R.styleable.MenuView_headerLayout)) {
        mNavigationView.inflateHeaderView(a.getResourceId(R.styleable.MenuView_headerLayout, 0));
    }
    mDrawMenuBelowFab = a.getBoolean(R.styleable.MenuView_drawMenuBelowFab, false);
    a.recycle();
}
 
Example 2
Source Project: microbit   File: CameraActivity_OldAPI.java    License: Apache License 2.0 4 votes vote down vote up
public void onShutter() {
    ImageView blinkRect = (ImageView) findViewById(R.id.blink_rectangle);
    blinkRect.setVisibility(View.VISIBLE);
    blinkRect.bringToFront();
    blinkRect.invalidate();
}