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

  • SEARCH
  • Home
  • 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 8218469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:48:16+00:00 2026-06-07T12:48:16+00:00

I want to have facebook like menu in my application. There are many threads

  • 0

I want to have facebook like menu in my application. There are many threads on this and all of them suggest to use a library which actually just takes a screenshot of the screen and slides that image towards right so as to show menu on left hand side and slide image with some transition. But in that case, the layout on the right is not clickable since its an image.

But I have some another way of doing it in which I have a Root Layout which already has Menu Layout and Content Layout. But root layout is set some negative margin towards left so it is not visible. Like this-

Content when menu is not pressed

When user presses menu button, the Menu Layout is slid to the right and root layout’s left margin is set to 0. So now what we see is this-

Content when menu is pressed and menu layout is shown

Now, The real problem starts here

I want to slide both the layouts with some animation. So when I animate the Menu layout & Content Layout, the animation for both the layouts is not at same speed even if I am applying same animation to it. So I tried to Shift ROOT LAYOUT only towards right/left by setting margin to it. But on doing so nothing is shown on the screen. Where am I going wrong. The way I set margin is shown here-

int width = leftLayout.getWidth();
isLayoutShown = !isLayoutShown;
if(isLayoutShown){
    rootLayoutParams.setMargins(0, 0, 0, 0);
    rootLayout.setLayoutParams(rootLayoutParams);    
}else{
    rootLayoutParams.setMargins(-width, 0, 0, 0);
    rootLayout.setLayoutParams(rootLayoutParams);
}
  • 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-07T12:48:19+00:00Added an answer on June 7, 2026 at 12:48 pm

    Finally somehow I could do it. Here’s the code used when I click on the menu button on the left top corner:

    @Override
    public void onClick(View v) {
    rootLayoutParams = new LayoutParams(rightLayout.getWidth(),
        rightLayout.getHeight());
    
    if (lhsMenu.getVisibility() == View.GONE) {
        lhsMenu.setVisibility(View.VISIBLE);
        Animation slideRight = setRightSlidingAnimation();
        rightLayout.setAnimation(slideRight);
        lhsMenu.setAnimation(slideRight);
    } else {
        Animation slideLeft = setLeftSlidingAnimation();
        rightLayout.setAnimation(slideLeft);
        lhsMenu.setAnimation(slideLeft);
        lhsMenu.setVisibility(View.GONE);
        }
    }
    

    Update: Also set margin to left and right (if needed) of rightLayout so that the rightLayout will not shrink.

    _rightLayoutParams.setMargins(width, 0, -width, 0);

    where width = 200 in my case.

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

Sidebar

Related Questions

I'm trying to do a fully customized Facebook Like-Box. I want to have this
I have a facebook canvas app like this: http://dpaste.com/809111/ I use this to redirect
I want to have multiple Facebook Like Buttons on a single page, all pointing
i have this facebook page: LINK And i want to implement multiple facebook like
I have a image gallery like Google+ or Facebook and i want to avoid
Now facebook require to have these options when you want to use bulit-in actions
I am building a Drupal website and want to have a facebook like box
I have a facebook like system, I want the DIV containing the messages to
I want to force users to like a Facebook page before installing an application,
I have a website where I want to show a facebook like button, which

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.