Make an ImageView Visible with timer - android

I know that this question has been answered, but CountdownTimer doesn't work into my method.
So basically I have an animation for a button and a textview, after a button is clicked. But I want also to have an imageview, with a timer. Because imageview is a part of the textview that I want to show it to the user.
Any help?
This is my code:
onCreate method:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView2 = (ImageView)findViewById(R.id.imageView2);
edittext = (EditText)findViewById(R.id.edittext);
leatseatbutton = (Button)findViewById(R.id.letseatbutton);
register=(Button)findViewById(R.id.register);
signin1button=(Button)findViewById(R.id.signin1button);
signinbutton_fb=(Button)findViewById(R.id.signinbutton_fb);
cancel=(Button)findViewById(R.id.cancel);
imageView1 = (ImageView)findViewById(R.id.imageView1);
First onClickListener
leatseatbutton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.width = 175;
params.height = 40;
params.setMargins(75, 240, 0, 0);
leatseatbutton.setLayoutParams(params);
edittext.setVisibility(View.VISIBLE);
TranslateAnimation slide = new TranslateAnimation(0, 0, 100,0 );
slide.setDuration(1000);
slide.setFillAfter(true);
slide.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
imageView2.setVisibility(View.VISIBLE);
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
edittext.startAnimation(slide);
}
});
Second onClickListener
signinbutton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.width = 175;
params.height = 40;
params.setMargins(75, 240, 0, 0);
signinbutton.setLayoutParams(params);
edittext.setVisibility(View.VISIBLE);
TranslateAnimation slide = new TranslateAnimation(0, 0, 100,0 );
slide.setDuration(1000);
slide.setFillAfter(true);
edittext.startAnimation(slide);
}
});
}

Maybe you need use AnimationListener
....
TranslateAnimation slide = new TranslateAnimation(0, 0, 100,0 );
slide.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
imageview.setVisible(View.VISIBLE);
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
slide.setDuration(1000);
slide.setFillAfter(true);
edittext.startAnimation(slide);
....

Related

RecyclerView onClick ViewHolder not triggering Animation

I am trying to achieve AlphaAnimation on an ImageView whenever user clicks on a RecyclerView item. I have the following code:
class CustomViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
{
TextView vh_idnumber, vh_task;
Information a;
View vh_colorTag;
FrameLayout checkboxLayout;
ImageView checkboxBackground;
Drawable checkBoxBackgroundDrawable;
private ScaleAnimation ZoomOut;
private ScaleAnimation ZoomIn;
#SuppressWarnings("deprecation")
public CustomViewHolder(View itemView)
{
super(itemView);
itemView.getId();
vh_idnumber = (TextView) itemView.findViewById(R.id.idnumber);
vh_task = (TextView) itemView.findViewById(R.id.task);
vh_colorTag = (View) itemView.findViewById(R.id.colortag);
checkboxLayout = (FrameLayout) itemView.findViewById(R.id.checkBoxLayout);
checkboxBackground = (ImageView) itemView.findViewById(R.id.checkBoxBackground);
checkBoxBackgroundDrawable= context.getResources().getDrawable(R.drawable.circle_shape);
checkboxBackground.setBackgroundDrawable(checkBoxBackgroundDrawable);
ZoomOut = new ScaleAnimation(1f, 0.3f, 1f, 0.3f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
checkboxBackground.setAnimation(ZoomOut);
ZoomOut.setDuration(100);
ZoomOut.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {}
#Override
public void onAnimationRepeat(Animation animation) {}
#Override
public void onAnimationEnd(Animation animation)
{
checkBoxBackgroundDrawable.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
}
});
ZoomIn = new ScaleAnimation(0.3f, 1f, 0.3f, 1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
checkboxBackground.setAnimation(ZoomIn);
ZoomIn.setDuration(100);
ZoomIn.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {}
#Override
public void onAnimationRepeat(Animation animation) {}
#Override
public void onAnimationEnd(Animation animation)
{
checkBoxBackgroundDrawable.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP);
}
});
random = new Random();
int index = random.nextInt(colorCode.length);
if(!colorRibbon)
{
vh_colorTag.setVisibility(View.GONE);
}
else
{
vh_colorTag.setBackgroundColor(Color.parseColor(colorCode[index]));
}
itemView.setOnClickListener(this);
vh_task.setOnClickListener(new OnClickListener()
{
#Override
public void onClick(View v)
{
a = MainActivity.data.get(getAdapterPosition());
if(a.availability.matches("available"))
{
vh_task.setPaintFlags(vh_task.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
vh_task.setTextColor(Color.RED);
a.availability="unavailable";
}
else if(a.availability.matches("unavailable"))
{
vh_task.setPaintFlags( vh_task.getPaintFlags() & (~ Paint.STRIKE_THRU_TEXT_FLAG));
vh_task.setTextColor(Color.parseColor("#212121"));
a.availability="available";
}
}
});
checkboxLayout.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v)
{
changeStatus();
}
});
}
#Override
public void onClick(View v)
{
changeStatus();
}
protected void changeStatus()
{
a = MainActivity.data.get(getAdapterPosition());
if(a.status.matches("checked"))
{
/* This dont' work */
ZoomOut.start();
a.status="unchecked";
}
else if(a.status.matches("unchecked"))
{
/* Neither this */
ZoomIn.start();
a.status="checked";
}
}
}
The AlphaAnimation does not get triggered. But onClick event gets fired. Tested the onclick event using Log. If I replace Animation with anything else it works but the Animation wont work.
What you want is achievable using startAnimation instead of setAnimation
protected void changeStatus() {
a = MainActivity.data.get(getAdapterPosition());
if(a.status.matches("checked"))
{
checkboxBackground.startAnimation(ZoomOut);
a.status="unchecked";
}
else if(a.status.matches("unchecked")) {
checkboxBackground.startAnimation(ZoomIn);
a.status="checked";
}
}
setAnimation needs a start time for the animation to be set, and you will have to invalidate checkboxBackground's parent.

Why OnAnimationEnd moves the initial position of the button but also moves the button itself? #.#

I did some animations with regards to my created button. However, after the animation, the button is at its new position, but the onclick function is at its old initial position. I did the onAnimationEnd and set the button to the new position but the Button and the invisible-like button with the onclick function moves together. Any help will be awesome
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
//move
TranslateAnimation animation = new TranslateAnimation(0.0f, ((widthPixels / 2) - 100),
0.0f, 0.0f);
animation.setDuration(1000);
animation.setRepeatCount(0);
animation.setRepeatMode(0);
animation.setFillEnabled(true);
animation.setFillAfter(true);
//fade
// Play.setVisibility(View.VISIBLE);
Play.startAnimation(animationfadein);
Play.startAnimation(animation);
Play.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent i = new Intent(DreamTales.this, Stories.class);
startActivity(i);
}
});
}
}, DELAY);
animation.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
Button Playghost = (Button) findViewById(R.id.PlayBtn);
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)Play.getLayoutParams();
lp.leftMargin = (widthPixels/100); // use topmargin for the y-property, left margin for the x-property of your view
Playghost.setLayoutParams(lp);
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});

view slide down animation not working

I am animating my relative layout with some images in my app. When i write the code to animate the layout on button click, for the first time it is just displaying not animating. Then on the same button click i am sliding up the layout. After that if i click the button sliding down animation works fine.Actually i have to write this sliding down animation inside onCreate itself instead of button click. Given below is my code. Can anyone tell me why it s not showing the animation?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.fadeview);
iconLayout=(RelativeLayout)findViewById(R.id.icon_ayout);
iconLayout.postDelayed(new Runnable() {
#Override
public void run() {
// TODO Auto-generated method stub
iconLayout.setVisibility(View.VISIBLE);
SlideToDown();
}
}, 500);
}
public void SlideToAbove() {
Animation slide = null;
slide=new TranslateAnimation(0.0f, 0.0f, 0.0f,-iconLayout.getHeight());
slide.setDuration(1000);
slide.setFillAfter(true);
slide.setFillEnabled(true);
iconLayout.startAnimation(slide);
slide.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
iconLayout.clearAnimation();
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
iconLayout.getWidth(), iconLayout.getHeight());
// lp.setMargins(0, 0, 0, 0);
//lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
iconLayout.setLayoutParams(lp);
}
});
}
public void SlideToDown() {
Animation slide = null;
slide=new TranslateAnimation(0.0f, 0.0f, -iconLayout.getHeight(), 0.0f);
slide.setDuration(1000);
slide.setFillAfter(true);
slide.setFillEnabled(true);
iconLayout.startAnimation(slide);
slide.setAnimationListener(new AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
iconLayout.clearAnimation();
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
iconLayout.getWidth(), iconLayout.getHeight());
lp.setMargins(0,0, 0, 0);
lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
iconLayout.setLayoutParams(lp);
}
});
}
This is because you are starting animation in onCreate() and in this time the view is available but it is not actually drawn(doesnt have width and height). Here the value of iconLayout.getHeight() will return value 0.
Solution is to setup a Layoutlistener to the view and the listener will notity you when it is drawn. After that you can start the animation.
ViewTreeObserver loadingObserver = iconLayout.getViewTreeObserver();
loadingObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
#Override
public void onGlobalLayout() {
iconLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
SlideToDown();
}
});

Swapping two images doesnt work correctly using relative layout

This is the code for swapping based on finger movement. I am able to swap but the images are not replacing the positions. After swapping the swapped image has to take the new position and animation has to set again for that. For this code it is redirecting to the old position and taking animation effect second time.
if (imageendX > imagestartX && imageendY < imagestartY) {
if (imageendX - imagestartX < 60) {
} else {
TranslateAnimation tr = new TranslateAnimation(0,
90, 0, 0);
tr.setDuration(1000);
// tr.setFillAfter(true);
// tr.setFillEnabled(true);
TranslateAnimation tr2 = new TranslateAnimation(0, -90, 0, 0);
tr2.setDuration(1000);
// tr2.setFillAfter(true);
// tr2.setFillEnabled(true);
currentView.startAnimation(tr);
RightView.startAnimation(tr2);
tr.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
tr2.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
}
} else if (imageendY < -10) {
TranslateAnimation tr = new TranslateAnimation(0, 0, 0, -90);
tr.setDuration(1000);
// tr.setFillAfter(true);
TranslateAnimation tr2 = new TranslateAnimation(0, 0, 0,90);
tr2.setDuration(1000);
// tr2.setFillAfter(true);
currentView.startAnimation(tr);
TopView.startAnimation(tr2);
tr2.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
android.widget.RelativeLayout.LayoutParams pr = (android.widget.RelativeLayout.LayoutParams) TopView
.getLayoutParams();
// pr.topMargin += 90;
pr.topMargin += 90;
TopView.setLayoutParams(pr);
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
tr.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
android.widget.RelativeLayout.LayoutParams pr = (android.widget.RelativeLayout.LayoutParams) currentView
.getLayoutParams();
// pr.topMargin += 90;
pr.bottomMargin += 90;
currentView.setLayoutParams(pr);
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
} else if (imageendY > imagestartY && imageendX < imagestartX) {
if (imageendY - imagestartY < 60) {
} else {
TranslateAnimation tr = new TranslateAnimation(0, 0, 0, RM);
tr.setDuration(1000);
// tr.setFillAfter(true);
TranslateAnimation tr2 = new TranslateAnimation(0, 0, 0, -RM);
tr2.setDuration(1000);
// tr2.setFillAfter(true);
currentView.startAnimation(tr);
BottomView.startAnimation(tr2);
tr2.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
tr.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
}
} else if (imagestartX >= imageendX) {
if (imagestartX - imageendX < 90) {
} else {
System.out.println("right to left");
TranslateAnimation tr = new TranslateAnimation(0, RM, 0, 0);
tr.setDuration(1000);
tr.setFillAfter(true);
TranslateAnimation tr2 = new TranslateAnimation(0, -RM, 0, 0);
tr2.setDuration(1000);
tr2.setFillAfter(true);
LeftView.startAnimation(tr);
currentView.startAnimation(tr2);
tr2.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
tr.setAnimationListener(new Animation.AnimationListener() {
#Override
public void onAnimationStart(Animation animation) {
}
#Override
public void onAnimationEnd(Animation animation) {
}
#Override
public void onAnimationRepeat(Animation animation) {
}
});
}
// }
}
Using View Animation the views will be in Original Position after the animation, So according to your requirement use Property Animation the views will be in Animated positons after the animation but the only downside is Property Animation supports from API 11
No Problem...Use NineOldAndroids to overcome that Problem..
Sample Code with two image views
Animation between imageOne and imageTwo
ObjectAnimator imageOneAnimator = ObjectAnimator.ofFloat(
imageOne, "X", imageOne.getX(), imageTwo.getX());
ObjectAnimator imageTwoAnimator = ObjectAnimator.ofFloat(
imageTwo, "X", imageTwo.getX(), imageOne.getX());
imageOneAnimator.setDuration(1000);
imageTwoAnimator.setDuration(1000);
AnimatorSet set = new AnimatorSet();
set.playTogether(imageOneAnimator, imageTwoAnimator);
set.start();
Animation between imageThree and imageOne
ObjectAnimator imageOneYAnimator = ObjectAnimator.ofFloat(
imageOne, "Y", imageOne.getY(), imageThree.getY());
ObjectAnimator imageThreeYAnimator = ObjectAnimator.ofFloat(
imageThree, "Y", imageThree.getY(), imageOne.getY());
imageOneYAnimator.setDuration(1000);
imageThreeYAnimator.setDuration(1000);
AnimatorSet setY = new AnimatorSet();
setY.setStartDelay(1000);
setY.playTogether(imageOneYAnimator, imageThreeYAnimator);
setY.start();
You can start the animation in your touch listener according to your calculations

Top to bottom - translate animation

Need to make next animation (on android 2.2 and above):
1.Moving button from top to bottom (after clicking on him),
2.Moving back from bottom to top (After clicking on him again).
First animation works fine, but the second not, the btn "jumps" from bottom to top and not animate.
Code:
public class MainActivity extends Activity {
static RelativeLayout relativeLayout;
static Button btn;
static Boolean isUp = true;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = (Button) findViewById(R.id.button1);
relativeLayout = (RelativeLayout) findViewById(R.id.relative_layout);
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if(isUp){
isUp = false;
v.startAnimation(MainActivity.getVerticalSlideAnimation(0,relativeLayout.getBottom() - v.getHeight(),500,0));
}else{
isUp = true;
v.startAnimation(MainActivity.getVerticalSlideAnimation(relativeLayout.getBottom() - v.getHeight(),0,500,0));
}
}
});
}
public static Animation getVerticalSlideAnimation(int fromYPosition, final int toYPosition, int duration, int startOffset)
{
TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0F, 1, 0.0F, 0, fromYPosition, 0, toYPosition);
translateAnimation.setDuration(duration);
translateAnimation.setInterpolator(new AccelerateInterpolator());
translateAnimation.setStartOffset(startOffset);
//Stop animation after finishing.
//translateAnimation.setFillAfter(true);
translateAnimation.setAnimationListener(new AnimationListener()
{
public void onAnimationStart(Animation animation) { }
public void onAnimationRepeat(Animation animation) { }
public void onAnimationEnd(Animation animation) {
btn.setY(toYPosition);
}
});
return translateAnimation;
}
}
Layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relative_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Button" />
</RelativeLayout>
Ok, I solved it.
There are few issuses you should know about animation:
The animation paremeters are not simple "From (fixed position)" --> "To (fix position)" as you should think. There are more like "From (current position/0)" --> "How much steps to do and on which direction (pluse for positive/ minus for negative)"
The Animation doesn't change the real position of the view on the screen, Therefore if you want to stop the animation at the end position, you should use:
animation.setFillAfter(true);
If you do want to change the REAL position of the view you should update the view parameters on "onAnimationEnd" (like below code), or calculate position and set Y/X position manually (again on "onAnimationEnd"), like:
animatedView.setY(stopPosition);
The Code:
public class AnimationActivity extends Activity {
private boolean isUp;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
((Button) findViewById(R.id.button1))
.setOnClickListener(new OnClickListener() {
public void onClick(final View v) {
final float direction = (isUp) ? -1 : 1;
final float yDelta = getScreenHeight() - (2 * v.getHeight());
final int layoutTopOrBottomRule = (isUp) ? RelativeLayout.ALIGN_PARENT_TOP : RelativeLayout.ALIGN_PARENT_BOTTOM;
final Animation animation = new TranslateAnimation(0,0,0, yDelta * direction);
animation.setDuration(500);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
// fix flicking
// Source : http://stackoverflow.com/questions/9387711/android-animation-flicker
TranslateAnimation anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
anim.setDuration(1);
v.startAnimation(anim);
//set new params
LayoutParams params = new LayoutParams(v.getLayoutParams());
params.addRule(RelativeLayout.CENTER_HORIZONTAL);
params.addRule(layoutTopOrBottomRule);
v.setLayoutParams(params);
}
});
v.startAnimation(animation);
//reverse direction
isUp = !isUp;
}
});
}
private float getScreenHeight() {
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
return (float) displaymetrics.heightPixels;
}
}
public class AnimationActivity extends Activity {
private boolean isUp;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
((Button) findViewById(R.id.button1))
.setOnClickListener(new OnClickListener() {
public void onClick(final View v) {
final float direction = (isUp) ? -1 : 1;
final float yDelta = getScreenHeight() - (2 * v.getHeight());
final int layoutTopOrBottomRule = (isUp) ? RelativeLayout.ALIGN_PARENT_TOP : RelativeLayout.ALIGN_PARENT_BOTTOM;
final Animation animation = new TranslateAnimation(0,0,0, yDelta * direction);
animation.setDuration(500);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
// fix flicking
// Source : http://stackoverflow.com/questions/9387711/android-animation-flicker
TranslateAnimation anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
anim.setDuration(1);
v.startAnimation(anim);
//set new params
LayoutParams params = new LayoutParams(v.getLayoutParams());
params.addRule(RelativeLayout.CENTER_HORIZONTAL);
params.addRule(layoutTopOrBottomRule);
v.setLayoutParams(params);
}
});
v.startAnimation(animation);
//reverse direction
isUp = !isUp;
}
});
}
private float getScreenHeight() {
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
return (float) displaymetrics.heightPixels;
}

Categories

Resources