Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:53:44+00:00 2026-06-13T06:53:44+00:00

So, When I click on it it will go do the first animation which

  • 0

So, When I click on it it will go do the first animation which is sliding the right alittle bit and staying there and then it will AUTO do the second animation and slide back

This is how its SUPPOSED TO GO

You click on it and it will slide to the right. And when you click on it again it will slide BACK to the left.

My code:

     public void sideBar()
   {



       ImageView sidebar = (ImageView)findViewById(R.id.sidebar);

       if(out == 0)
       {
       mSlideInRight = AnimationUtils.loadAnimation(this, R.anim.slide_in_right);
       mSlideInRight.setFillAfter(true);
       sidebar.startAnimation(mSlideInRight);
       out= 1;
       }

       if(out == 1)
       {
               mSlideInLeft = AnimationUtils.loadAnimation(this, R.anim.slide_in_left);
               sidebar.startAnimation(mSlideInLeft);
               out=0;
       }

   }

This part is where it handles when you click on it

public void onClick(View v) {

        switch(v.getId())
        {


            case R.id.sidebar:
                sideBar();
            break;
        }



    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:53:45+00:00Added an answer on June 13, 2026 at 6:53 am

    Change your

    if (out == 1)
    

    condition to

    else if (out == 1)
    

    In it’s current form, the code will execute the second block after finishing the first. After all, you just explicitly set out = 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will click 'post' and then I will close the app, but I want
I have two buttons, which the user can click and will open a FileDiagloag
I am willing to add a button in my application which on-click will restart
See the page at: http://216.231.135.200/test/view.html As you click 'Next', the next bar will first
If I 'click', it will print click. However, once I 'long click' it will
I'm writing a macro that will click certain spots on the screen when I
I'm trying to create code in AppleScript that will click my mouse randomly every
The website has a list of thumbnails,containing people's name,ID,and photo,if click it will pop
I have 4 tabs in my iphone application. When user will click a button
Click on this link , you will be redirected to a shopping site. On

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.