Example usage for android.view View bringToFront

List of usage examples for android.view View bringToFront

Introduction

In this page you can find the example usage for android.view View bringToFront.

Prototype

public void bringToFront() 

Source Link

Document

Change the view's z order in the tree, so it's on top of other sibling views.

Usage

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void show_imagezoom() {

    FragmentTransaction fT = fragmentManager.beginTransaction().setCustomAnimations(R.anim.fragment_slide_in,
            R.anim.fragment_slide_out, R.anim.fragment_slide_in, R.anim.fragment_slide_out);
    Fragment f = fragmentManager.findFragmentByTag("izFragment");

    //slideDown(v,0);
    //toggleDetails();
    View v = getInstance().findViewById(R.id.imageZoomFragment);
    fadeIn(v, 0, 1.0f);/*  w  ww .  j a v a  2 s. co m*/
    v.bringToFront();
    Fragment iF = fragmentManager.findFragmentByTag(FLAG_INFO);
    if (iF != null)
        fT.hide(iF);
    Fragment dF = fragmentManager.findFragmentByTag(FLAG_DETAILS);
    if (dF != null)
        fT.hide(dF);

    if (f == null) {
        if (LogWorker.isVERBOSE())
            LogWorker.d(LOG_TAG, "imagezoom wird neu gebildet");
        fT.add(R.id.imageZoomFragment, Fragment.instantiate(getInstance(), ImageZoomFragment.class.getName()),
                "izFragment").addToBackStack(null).commit();
    } else if (f.isHidden()) {
        if (LogWorker.isVERBOSE())
            LogWorker.d(LOG_TAG,
                    "imageZoom schon vorhanden" + f.isHidden() + " --" + f.isVisible() + "--" + f.isAdded());
        fT.show(f).addToBackStack(null).commit(); //replace(R.id.infoFragment, Fragment.instantiate(getInstance(), MiniInfoFragment.class.getName()), "iFragment");

    }

    KartenActivity.BackstackEXIT = false;

}

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void showSearchBar() {

    View v = getInstance().findViewById(R.id.fab_search);
    fade2Invisible(v, 200);/*w w w.ja  v a2 s .co  m*/
    final View V = getInstance().findViewById(R.id.searchContainer);

    V.animate().translationX(0).alpha(1.0f).setDuration(500).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            V.setVisibility(View.VISIBLE);
            V.bringToFront();
            V.clearFocus();
            V.findViewById(R.id.map_search).requestFocusFromTouch();
            //v.setVisibility(View.INVISIBLE);
        }
    });

}

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void rollUp(final View V, Integer offset) {
    if (V == null)
        return;//from  w ww  .  j  a v  a2  s .com
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        V.animate().setStartDelay(offset).y(0).alpha(1.0f).setDuration(500)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        V.setVisibility(View.VISIBLE);
                        V.bringToFront();
                    }
                });
    } else {
        V.animate().y(0).alpha(1.0f).setDuration(500).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                V.setVisibility(View.VISIBLE);
                V.bringToFront();
            }
        });
    }
}

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void slideUp(final View V, Integer offset) {
    if (V == null)
        return;//from w  w  w.  j  a v  a 2  s.c om
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        V.animate().setStartDelay(offset).translationY(0).alpha(1.0f).setDuration(500)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        V.setVisibility(View.VISIBLE);
                        V.bringToFront();
                    }
                });
    } else {
        V.animate().translationY(0).alpha(1.0f).setDuration(500).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                V.setVisibility(View.VISIBLE);
                V.bringToFront();
            }
        });
    }
}

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void slideTopDown(final View V, Integer offset) {

    if (V == null)
        return;//www  .  ja v  a2  s  . c om
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        V.animate().setStartDelay(offset).translationY(0).alpha(1.0f).setDuration(500)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        V.setVisibility(View.VISIBLE);
                        V.bringToFront();
                        V.clearFocus();
                    }
                });
    } else {
        V.animate().translationY(0).alpha(1.0f).setDuration(500).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                V.setVisibility(View.VISIBLE);
                V.bringToFront();
                V.clearFocus();
            }
        });
    }

}

From source file:pl.mrwojtek.sensrec.app.RecordsActivity.java

private void animateHide(final View view, boolean animate) {
    if (animate) {
        view.bringToFront();
        view.animate().alpha(0.0f).setListener(new AnimatorListenerAdapter() {
            @Override//from   ww w.  j a  v a  2s .com
            public void onAnimationEnd(Animator animation) {
                view.setVisibility(View.GONE);
            }
        });
    } else {
        view.setVisibility(View.GONE);
    }
}

From source file:de.teammartens.android.wattfinder.worker.AnimationWorker.java

public static void fadeIn(final View V, Integer offset, Float Alpha) {
    if (V == null)
        return;//  www .j  av  a2s. com
    if (V.getVisibility() == View.GONE) {
        V.setAlpha(0f);
        V.setVisibility(View.VISIBLE);
    }
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        V.animate().setStartDelay(offset)

                .alpha(Alpha).setDuration(500).setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        V.setVisibility(View.VISIBLE);
                        V.bringToFront();
                    }
                });
    } else {
        V.animate()

                .alpha(Alpha).setDuration(500).setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        V.setVisibility(View.VISIBLE);
                        V.bringToFront();
                    }
                });
    }
}

From source file:com.primalpond.hunt.TheHunt.java

private void returnFromTutorial() {
    mInTutorial = false;/*from   w w  w  . jav  a  2s.  c o  m*/

    mGLView.onPause();
    final RelativeLayout rootLayout = (RelativeLayout) findViewById(R.id.root_layout);
    Handler handler = new Handler();
    class RefreshRunnable implements Runnable {

        public RefreshRunnable() {

        }

        public void run() {
            rootLayout.removeView(findViewById(R.id.glSurfaceView));

            D3GLSurfaceView surfaceview = new D3GLSurfaceView(getApplication(), null,
                    new TheHuntRenderer(TheHunt.this));
            surfaceview.setId(R.id.glSurfaceView);
            rootLayout.addView(surfaceview);

            mGLView = (D3GLSurfaceView) findViewById(R.id.glSurfaceView);

            View actionBarPart = findViewById(R.id.actionBarPart);
            actionBarPart.bringToFront();

            mGLView.mRenderer.setActivity(TheHunt.this);
            MyApplication.setFirstRun(false);
        }
    }
    ;

    RefreshRunnable r = new RefreshRunnable();
    handler.postDelayed(r, 500);
}

From source file:com.primalpond.hunt.TheHunt.java

private void beginTutorial() {
    mInTutorial = true;//ww w  . j av  a2 s  . c om

    if (mGLView != null) {
        mGLView.onPause();
    }
    final RelativeLayout rootLayout = (RelativeLayout) findViewById(R.id.root_layout);
    Handler handler = new Handler();
    class RefreshRunnable implements Runnable {

        public RefreshRunnable() {

        }

        public void run() {
            rootLayout.removeView(findViewById(R.id.glSurfaceView));

            D3GLSurfaceView surfaceview = new D3GLSurfaceView(getApplication(), null,
                    new TutorialRenderer(TheHunt.this));
            surfaceview.setId(R.id.glSurfaceView);
            rootLayout.addView(surfaceview);

            View actionBarPart = findViewById(R.id.actionBarPart);
            actionBarPart.bringToFront();

            mGLView = (D3GLSurfaceView) findViewById(R.id.glSurfaceView);

            FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
            mTutorialFragment = new TutorialFragment();
            ft.add(R.id.root_layout, mTutorialFragment);
            ft.commit();
            mGLView.mRenderer.setActivity(TheHunt.this);
            onToHideNavigation();
        }
    }
    ;

    RefreshRunnable r = new RefreshRunnable();
    handler.postDelayed(r, 500);
}

From source file:tan.chesley.rssfeedreader.DepthPageTransformer.java

public void transformPage(View view, float position) {
    int pageWidth = view.getWidth();

    if (position < -1) { // [-Infinity,-1)
        // This page is way off-screen to the left.
        view.setAlpha(0);/*from w  w w .j  a  v a  2  s. c  o m*/
    } else if (position <= 0) { // [-1,0]
        // Use the default slide transition when moving to the left page
        view.setAlpha(1 + position);
        view.setTranslationX(0);
        view.setScaleX(1);
        view.setScaleY(1);

        // Prevent old views from stealing touches
        if (position >= -0.01) {
            view.bringToFront();
            view.getParent().requestLayout();
            ((View) view.getParent()).invalidate();
        }
    } else if (position <= 1) { // (0,1]
        // Fade the page out.
        view.setAlpha(1 - position);

        // Counteract the default slide transition
        view.setTranslationX(pageWidth * -position);

        // Scale the page down (between MIN_SCALE and 1)
        float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position));
        view.setScaleX(scaleFactor);
        view.setScaleY(scaleFactor);

    } else { // (1,+Infinity]
             // This page is way off-screen to the right.
        view.setAlpha(0);
    }
}