@Override public void onClick(View v) { if (mCiclePop != null) { mCiclePop.showAsDropDown(v,-mCiclePop.getContentView().getWidth(),-(mCommentBtn.getHeight()/2+mCiclePop.getContentView().getHeight()/2)); } } });
@Override public void onClick(View v) { Animator circularReveal = ViewAnimationUtils.createCircularReveal(btnReveal1, btnReveal1.getWidth() / 2, btnReveal1.getHeight() / 2, 0, (float) Math.hypot(btnReveal1.getWidth(), btnReveal1.getHeight())); circularReveal.setDuration(1000); circularReveal.setInterpolator(new AccelerateInterpolator()); circularReveal.start(); } });
@Override public void onClick(View v) { Animator circularReveal = ViewAnimationUtils.createCircularReveal(btnReveal2, 0, 0, 0, (float) Math.hypot(btnReveal2.getWidth(), btnReveal2.getHeight())); circularReveal.setDuration(1000); circularReveal.setInterpolator(new AccelerateInterpolator()); circularReveal.start(); } });
@Override public void run() { //Force the dialog to be the right size... int w = FrameLayout.LayoutParams.MATCH_PARENT; int h = list.getChildAt(0).getHeight() + loadMore.getHeight() + keepShowing.getHeight() + Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics())); layout.setLayoutParams(new FrameLayout.LayoutParams(w, h)); } });
@Override public void run() { float button_height = b.getHeight(); // Button height in raw pixels b.setTextSize(TypedValue.COMPLEX_UNIT_PX,button_height/3); // Divisor arrived at empirically b.setBackground(bg); } });
Button button1 = (Button) findViewById(R.id.button_1); Button button2 = (Button) findViewById(R.id.button_2); RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.relativeLayout); relativeLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { relativeLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this); RelativeLayout.LayoutParams btParams = (RelativeLayout.LayoutParams) button2.getLayoutParams(); int height = button1.getHeight(); btParams.height = height; button2.setLayoutParams(btParams); } });
final Button anotherButton = (Button) findViewById(/*your_another_button_id*/); view.setOnClickListener(new OnClickListener ({ @Override public void onClick(View view) { TranslateAnimation animate = new TranslateAnimation(0,0,0,anotherButton.getHeight()); animate.setDuration(500); animate.setFillAfter(true); anotherButton.startAnimation(animate); anotherButton.setVisibility(View.GONE); } }));
int topY = (mMenuButton.getHeight() / 2) + mMenuButton.getTop();
@Override public void onClick(View v) { mIsCheater = true; if (mAnswerIsTrue){ mAnswerTextView.setText(R.string.true_button); }else { mAnswerTextView.setText(R.string.false_button); } setAnswerShownResult(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { int cx = mShowAnswer.getWidth() / 2; int cy = mShowAnswer.getHeight() / 2; float radius = mShowAnswer.getWidth(); Animator anim = ViewAnimationUtils.createCircularReveal(mShowAnswer, cx, cy, radius, 0); anim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); mShowAnswer.setVisibility(View.INVISIBLE); } }); anim.start(); }else{ mShowAnswer.setVisibility(View.INVISIBLE); } } });
@Override public void run() { setSimulateClick(btnShowSpot,btnShowSpot.getWidth()/2-btnShowSpot.getX(),btnShowSpot.getHeight()/2+btnShowSpot.getY()); } },1500);
@Override public void run() { setSimulateClick(tagBt,tagBt.getWidth()/2-tagBt.getX(),tagBt.getHeight()/2+tagBt.getY()); } },1000);
buttongame1.setX(r.nextInt(Width - buttongame1.getHeight())); buttongame1.setY(r.nextInt(height - buttongame1.getWidth()));
private void showSpinWindow() { mSpinerPopWindow.setWidth(spinerButton.getWidth()); mSpinerPopWindow.showAtLocation(spinerButton, Gravity.BOTTOM | Gravity.RIGHT, 0, spinerButton.getHeight()); }
@Override public void onClick(View v) { int xValue = container.getWidth() - animatingButton.getWidth(); int yValue = container.getHeight() - animatingButton.getHeight(); animatingButton.animate().x(xValue).y(yValue); } });
private void revealTheButton(Button v) { XposedHook.logD("androidn_ify", "reveal"); mSelectedContainer.setVisibility(View.VISIBLE); int centerX = v.getLeft() + v.getWidth() / 2; int centerY = v.getTop() + v.getHeight() / 2; Animator reveal = ViewAnimationUtils.createCircularReveal( // TODO work out why this isn't working, same for hide mSelectedContainer, centerX, centerY, 0, Math.max(centerX, mSelectedContainer.getWidth() - centerX) + Math.max(centerY, mSelectedContainer.getHeight() - centerY)); reveal.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mButton.setVisibility(View.INVISIBLE); } }); reveal.start(); //animateHintText(mSelectedLabel, v, reveal); animateHintText(mLaunchHint, v, reveal); mSelectedLabel.setText(v.getText()); mLayout.postDelayed(mHideRunnable, HIDE_DELAY); mLayout.postDelayed(mRippleRunnable, RIPPLE_PAUSE / 2); // Transfer focus from the originally clicked button to the expanded button. mSelectedContainer.requestFocus(); }