Here in this code I have tried some touch screen event
@Override
public boolean onTouchEvent(MotionEvent touchevent) {
switch (touchevent.getAction())
{
case MotionEvent.ACTION_DOWN:
{
oldTouchValue = touchevent.getX();
break;
}
case MotionEvent.ACTION_UP:
{
float currentX = touchevent.getX();
if (oldTouchValue < currentX && panel.getVisibility() == View.VISIBLE)
{
panel.clearAnimation();
panel.startAnimation(mAnimHide);
panel.setVisibility(View.INVISIBLE);
}
if (oldTouchValue > currentX && panel.getVisibility() == View.INVISIBLE)
{
panel.setVisibility(View.VISIBLE);
panel.startAnimation(mAnimShow);
}
break;
}
}
return false;
}
//when i tried the below its not working
public void onClick(View v) {
switch(v.getId())
{
case R.id.onClick:
}
if(panel.getVisibility()==View.INVISIBLE)
{
panel.setVisibility(View.VISIBLE);
panel.startAnimation(mAnimShow);
}
}
When I Tried to have to make the Hidden Layout Visible on the Button Click
The program is not Responding. I have tried enough.
Can anyone please help me? How should we make the action event work ?
instead of View.INVISIBLE use class of panel .
for example if panel is instance of TextView :