List of usage examples for android.view View bringToFront
public void bringToFront()
From source file:com.admin.control.ab.AbInnerViewPager.java
private void animStack(View left, View right, float offset, int offsetPixels) { if (right != null) { // 0-1offset:0`1 mScale = (1 - MIN_SCALE) * offset + MIN_SCALE; mTrans = -getWidth() - getPageMargin() + offsetPixels; ViewHelper.setScaleX(right, mScale); ViewHelper.setScaleY(right, mScale); ViewHelper.setTranslationX(right, mTrans); }//from w w w. j a v a 2 s. c o m if (left != null) { left.bringToFront(); } }
From source file:com.linkbubble.ui.BubbleFlowView.java
private void bringTabViewToFront(View tabView) { tabView.clearAnimation(); tabView.bringToFront(); mContent.requestLayout(); mContent.invalidate(); }
From source file:com.nanostuffs.yurdriver.fragment.RegisterFragment.java
private void datepicker() { final Dialog dialog = new Dialog(getActivity()); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCanceledOnTouchOutside(true); dialog.setContentView(R.layout.datepicker_layout); final DatePicker date = (DatePicker) dialog.findViewById(R.id.datePicker1); final Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_YEAR, -1 * (16 * 365)); date.setMaxDate(c.getTimeInMillis()); Button text = (Button) dialog.findViewById(R.id.ok); text.setOnClickListener(new OnClickListener() { @Override//from w w w.j a va 2 s. co m public void onClick(View v) { v.bringToFront(); String dateString = String .valueOf(date.getYear() + "-" + (date.getMonth() + 1) + "-" + date.getDayOfMonth()); etDOB.setText(dateString); dialog.dismiss(); } }); Button cancel = (Button) dialog.findViewById(R.id.cancel); cancel.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub v.bringToFront(); dialog.dismiss(); } }); dialog.show(); }
From source file:metro.k.cover.view.JazzyViewPager.java
protected void animateStack(View left, View right, float positionOffset, int positionOffsetPixels) { if (mState == State.IDLE) { return;/* w ww .ja v a 2 s . com*/ } if (right != null) { manageLayer(right, true); mScale = (1 - SCALE_MAX) * positionOffset + SCALE_MAX; mTrans = -getWidth() - getPageMargin() + positionOffsetPixels; ViewHelper.setScaleX(right, mScale); ViewHelper.setScaleY(right, mScale); ViewHelper.setTranslationX(right, mTrans); } if (left != null) { left.bringToFront(); } }
From source file:com.insalyon.les24heures.JazzyViewPager.JazzyViewPager.java
protected void animateStack(View left, View right, float positionOffset, int positionOffsetPixels) { if (mState != State.IDLE) { if (right != null) { manageLayer(right, true);//from w w w.j ava 2 s . c o m mScale = (1 - SCALE_MAX) * positionOffset + SCALE_MAX; mTrans = -getWidth() - getPageMargin() + positionOffsetPixels; ViewHelper.setScaleX(right, mScale); ViewHelper.setScaleY(right, mScale); ViewHelper.setTranslationX(right, mTrans); } if (left != null) { left.bringToFront(); } } }
From source file:com.runmit.sweedee.view.flippablestackview.StackPageTransformer.java
@Override public void transformPage(View view, float position) { int dimen = view.getHeight(); if (!mInitialValuesCalculated) { mInitialValuesCalculated = true; calculateInitialValues(dimen);/*from w w w . j a v a 2 s. c o m*/ } view.setRotationX(0); view.setPivotY(dimen / 2f); view.setPivotX(view.getWidth() / 2f); if (position < -mNumberOfStacked - 1) { view.setAlpha(0f); } else if (position <= 0) { float scale = mZeroPositionScale + (position * mStackedScaleFactor); float baseTranslation = (-position * dimen); float shiftTranslation = calculateShiftForScale(position, scale, dimen); view.setScaleX(scale); view.setScaleY(scale); view.setAlpha(1.0f + (position * mAlphaFactor)); Log.d("position", "baseTranslation=" + baseTranslation + ",shiftTranslation=" + shiftTranslation + ",transY=" + (baseTranslation + shiftTranslation)); view.setTranslationY(baseTranslation + shiftTranslation); } else if (position <= 1) { view.bringToFront(); float baseTranslation = position * dimen; float scale = mZeroPositionScale - mValueInterpolator.map(mScaleInterpolator.getInterpolation(position)); scale = (scale < 0) ? 0f : scale; float shiftTranslation = (1.0f - position) * mOverlap; float rotation = -mRotationInterpolator.getInterpolation(position) * 90; rotation = (rotation < -90) ? -90 : rotation; float alpha = 1.0f - position; alpha = (alpha < 0) ? 0f : alpha; view.setAlpha(alpha); view.setPivotY(dimen); view.setRotationX(rotation); view.setScaleX(mZeroPositionScale); view.setScaleY(scale); view.setTranslationY(-baseTranslation - mBelowStackSpace - shiftTranslation); } else if (position > 1) { view.setAlpha(0f); } }
From source file:uk.co.armedpineapple.cth.SDLActivity.java
void loadApplication() { // Load the libraries System.loadLibrary("SDL"); System.loadLibrary("luajit"); System.loadLibrary("SDL_mixer"); System.loadLibrary("ffmpeg"); System.loadLibrary("appmain"); try {/*from w w w . j a v a2 s.com*/ app.configuration.writeToFile(); } catch (IOException e) { e.printStackTrace(); Log.e(LOG_TAG, "Couldn't write to configuration file"); BugSenseHandler.sendException(e); } File f = new File(app.configuration.getSaveGamesPath()); if (!f.isDirectory()) { f.mkdirs(); } // So we can call stuff from static callbacks mSingleton = this; hideSystemUi(); mSurface = new SDLSurface(this, app.configuration.getDisplayWidth(), app.configuration.getDisplayHeight()); mSurface.setZOrderOnTop(false); DrawerLayout mainLayout = (DrawerLayout) getLayoutInflater().inflate(R.layout.game, null); FrameLayout gameFrame = ((FrameLayout) mainLayout.findViewById(R.id.game_frame)); gameFrame.addView(mSurface); setContentView(mainLayout); mHapticLauncher = new Launcher(this); mDrawerLayout = (DrawerLayout) findViewById(R.id.main_layout); mDrawerList = (ListView) findViewById(R.id.menu_drawer); mDrawerList.setAdapter(new NavDrawerAdapter(this, uk.co.armedpineapple.cth.MenuItems.getItems(BuildConfig.DEBUG || app.configuration.getDebug()))); mDrawerList.setOnItemClickListener(new NavDrawerListListener(this)); mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); mDrawerLayout.setDrawerListener(new DrawerListener() { @Override public void onDrawerClosed(View arg0) { // Restore game speed cthGameSpeed(app.configuration.getGameSpeed()); mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } @Override public void onDrawerOpened(View arg0) { // Pause the game cthGameSpeed(0); } @Override public void onDrawerSlide(View arg0, float arg1) { arg0.bringToFront(); mDrawerLayout.bringChildToFront(arg0); mDrawerLayout.requestLayout(); } @Override public void onDrawerStateChanged(int arg0) { // TODO Auto-generated method stub } }); SurfaceHolder holder = mSurface.getHolder(); holder.setFixedSize(app.configuration.getDisplayWidth(), app.configuration.getDisplayHeight()); gameFrame.setVisibility(View.VISIBLE); hasGameLoaded = true; }
From source file:com.aretha.slidemenu.SlideMenu.java
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int count = getChildCount(); final int paddingLeft = getPaddingLeft(); final int paddingRight = getPaddingRight(); final int paddingTop = getPaddingTop(); final int statusBarHeight = mSlideMode == MODE_SLIDE_WINDOW ? STATUS_BAR_HEIGHT : 0; for (int index = 0; index < count; index++) { View child = getChildAt(index); final int measureWidth = child.getMeasuredWidth(); final int measureHeight = child.getMeasuredHeight(); LayoutParams layoutParams = (LayoutParams) child.getLayoutParams(); switch (layoutParams.role) { case LayoutParams.ROLE_CONTENT: // we should display the content in front of all other views child.bringToFront(); child.layout(mCurrentContentOffset + paddingLeft, paddingTop, paddingLeft + measureWidth + mCurrentContentOffset, paddingTop + measureHeight); break; case LayoutParams.ROLE_PRIMARY_MENU: mContentBoundsRight = measureWidth; child.layout(paddingLeft, statusBarHeight + paddingTop, paddingLeft + measureWidth, statusBarHeight + paddingTop + measureHeight); break; case LayoutParams.ROLE_SECONDARY_MENU: mContentBoundsLeft = -measureWidth; child.layout(r - paddingRight - measureWidth, statusBarHeight + paddingTop, r - paddingRight, statusBarHeight + t + measureHeight); break; default:// ww w . ja va 2 s.c o m continue; } } }
From source file:com.mvn.virtualneighbor.slidemenu.SlideMenu.java
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int count = getChildCount(); final int paddingLeft = getPaddingLeft(); final int paddingRight = getPaddingRight(); final int paddingTop = getPaddingTop(); final int statusBarHeight = mSlideMode == MODE_SLIDE_WINDOW ? STATUS_BAR_HEIGHT : 0; for (int index = 0; index < count; index++) { View child = getChildAt(index); final int measureWidth = child.getMeasuredWidth(); final int measureHeight = child.getMeasuredHeight(); LayoutParams layoutParams = (LayoutParams) child.getLayoutParams(); switch (layoutParams.role) { case LayoutParams.ROLE_CONTENT: // we should display the content in front of all other views child.bringToFront(); child.layout(mCurrentContentOffset + paddingLeft, paddingTop, paddingLeft + measureWidth + mCurrentContentOffset, paddingTop + measureHeight); break; case LayoutParams.ROLE_PRIMARY_MENU: mContentBoundsRight = measureWidth; child.layout(paddingLeft, statusBarHeight + paddingTop, paddingLeft + measureWidth, statusBarHeight + paddingTop + measureHeight); break; case LayoutParams.ROLE_SECONDARY_MENU: mContentBoundsLeft = -measureWidth; child.layout(r - paddingRight - measureWidth, statusBarHeight + paddingTop, r - paddingRight, statusBarHeight + paddingTop + measureHeight); break; default:/*from w w w . ja va 2 s . c om*/ continue; } } }
From source file:com.base.view.slidemenu.SlideMenu.java
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int count = getChildCount(); final int paddingLeft = getPaddingLeft(); final int paddingRight = getPaddingRight(); final int paddingTop = getPaddingTop(); final int statusBarHeight = mSlideMode == MODE_SLIDE_WINDOW ? STATUS_BAR_HEIGHT : 0; for (int index = 0; index < count; index++) { View child = getChildAt(index); final int measureWidth = child.getMeasuredWidth(); final int measureHeight = child.getMeasuredHeight(); LayoutParams layoutParams = (LayoutParams) child.getLayoutParams(); switch (layoutParams.role) { case LayoutParams.ROLE_CONTENT: // we should display the content in front of all other views child.bringToFront(); child.layout(mCurrentContentOffset + paddingLeft, paddingTop, paddingLeft + measureWidth + mCurrentContentOffset, paddingTop + measureHeight); break; case LayoutParams.ROLE_PRIMARY_MENU: mContentBoundsRight = measureWidth; child.layout(paddingLeft, statusBarHeight + paddingTop, paddingLeft + measureWidth, statusBarHeight + paddingTop + measureHeight); break; case LayoutParams.ROLE_SECONDARY_MENU: mContentBoundsLeft = -measureWidth; child.layout(r - l - paddingRight - measureWidth, statusBarHeight + paddingTop, r - l - paddingRight, statusBarHeight + paddingTop + measureHeight); break; default://from w w w .j a va 2 s. c o m continue; } } }