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 8399391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:17:35+00:00 2026-06-09T21:17:35+00:00

I have a view like this When a user clicks on any button like

  • 0

I have a view like this

enter image description here

When a user clicks on any button like say “Audi”.

what I want is to show a view above of this with animation like
enter image description here

What I have tried is

I make a layout like this (Just for test the animation)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
    android:id="@+id/hideLayout"
    android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:layout_above="@+id/buttonLayout"
    android:background="#f0f"
    android:visibility="gone" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
</LinearLayout>

<LinearLayout
    android:id="@+id/buttonLayout"
    android:layout_width="200dip"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/btn_showView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Show View" />
</LinearLayout>

and then make animation like

Animation showView=(Button)findViewById(R.id.btn_showView);

and my anim file is

 <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <translate
        android:duration="300"
        android:fromYDelta="100%p"
        android:toYDelta="0" />

</set>

and then

showView=(Button)findViewById(R.id.btn_showView);

    showView.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            hideLayout.startAnimation(animShow);
            animShow.setAnimationListener(new AnimationListener() {

                @Override
                public void onAnimationStart(Animation animation) {
                    hideLayout.setVisibility(View.VISIBLE);

                }

                @Override
                public void onAnimationRepeat(Animation animation) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    hideLayout.setVisibility(View.VISIBLE);

                }
            });

        }
    });

It is working but not how I want. the text View is coming from the bottom. I hope my image shows what I want.

Thanks in advance.

  • 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-09T21:17:37+00:00Added an answer on June 9, 2026 at 9:17 pm

    I found a solution for android >=3.0, Object Animator

    I fix the height of the view as it is not a problem in my case.

    I make two view

    1) Top View width fix height 100dip(Which need to be animate) make it invisible

    2) Bottom View fix height 100dip(Visible)

    3) when I click showView I call following lines

    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(topLayout,
                "y", 100, 0);
    objectAnimator.addListener(new AnimatorListener() {
    
            @Override
            public void onAnimationStart(Animator animation) {
                // TODO Auto-generated method stub
                topLayout.setVisibility(View.VISIBLE);
                showView.bringToFront();
            }
    
            @Override
            public void onAnimationRepeat(Animator animation) {
                // TODO Auto-generated method stub
    
            }
    
            @Override
            public void onAnimationEnd(Animator animation) {
    
            }
    
            @Override
            public void onAnimationCancel(Animator animation) {
                // TODO Auto-generated method stub
    
            }
        });
                objectAnimator.setDuration(500);
        objectAnimator.start();
    

    may be it will help some one. 🙂

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

Sidebar

Related Questions

I have a view like this in my Flex mobile Application: <s:View xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark
I have a block of code in my view like this: <% @map[value].each do
I have a mvc2 application with a view like this <% using (Ajax.BeginForm(UserApprove, new
I have a view model that looks like this public class ViewModelRound2 { public
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl
I have a View that renders something like this: Item 1 and Item 2
I have a view with a ComboBox like this <ComboBox Name=cmbPurpose DisplayMemberPath=@value SelectedValuePath=@key ItemsSource={Binding
I have added a UILabel to my view programmatically like this: myLabel = [[UILabel
I have a view model coming from the server as json like this {
I have an activity ( MainActivity.java ) in which content view is like this

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.