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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:20:18+00:00 2026-05-29T12:20:18+00:00

I’m porting an app from iOS to Android. In the iOS app, there is

  • 0

I’m porting an app from iOS to Android. In the iOS app, there is an animation of a view “dropping down” while pushing the views beneath it down with it. See example here (download this app & click the “Join” button to see the drop down panel effect):
AppFreeway

I’ve been trying to replicate this effect in Android, I got pretty close by creating a TranslateAnimation in XML and later calling setAnimation for the view that’s dropping down:

<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0%" android:toXDelta="0%"
android:fromYDelta="-100%" android:toYDelta="0%"
android:duration="500" />

anim = AnimationUtils.loadAnimation(
                this, R.anim.contact_animation_enter);
joinPanel.startAnimation(anim);

The problem is when I add the view to the parent view using parent.addView(panel, 0) because the parent instantly moves everything down and only later the animation begins. If you watch the iOS version, you’ll see that when the “Join” button is clicked, everything gets animated down as the drop down panel moves into view.

Any ideas on how to achieve the same effect?

  • 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-05-29T12:20:19+00:00Added an answer on May 29, 2026 at 12:20 pm

    This is how I did it in a custom view I created. I had the view I wanted to display already coded into the xml layout file with android:visibility = "gone". The only thing I haven’t figured out yet is when the EditText box is scaling, it enlarges the text, then shrinks it to normal size. If I find a solution to this problem I will post it.

    private EditText m_editText;  
    
    protected void onFinishInflate ()
    {
        super.onFinishInflate ();
    
        m_editText = (EditText) findViewById(R.id.edit_text);
    }
    
    
    public void displayView(View activateView)
    {
        if (activateView.getVisibility() == View.GONE)
        {
            //fade in from top
            activateView.setVisibility(View.VISIBLE);
            final Animation fadeInFromTopAnimation = AnimationUtils.loadAnimation(context, R.anim.fade_in_from_top);
            fadeInFromTopAnimation.setAnimationListener(new AnimationListener()
                {
                    public void onAnimationStart(Animation anim)
                    {
                        //Shrink the text box down while inserting new view
                        //Add any padding or margins if needed
                        float scale = (float)(m_editText.getHeight() + m_weatherRow.getHeight()) / m_editText.getHeight();
    
                        AnimationSet shrinkDownAnimation = new AnimationSet(true);
                        shrinkDownAnimation.setInterpolator(new LinearInterpolator());
                        ScaleAnimation scaleAnimation = new ScaleAnimation(1, 1,  //X Scale
                                                                           scale, 1,  //Y Scale
                                                                           Animation.RELATIVE_TO_SELF, 0.5f, //X Pivot Point (set to center but it shouldn't matter)
                                                                           Animation.RELATIVE_TO_SELF, 1.0f); //Y Pivot Point (bottom)
                        scaleAnimation.setDuration(fadeInFromTopAnimation.getDuration());
                        shrinkDownAnimation.addAnimation(scaleAnimation);
    
                        m_editText.startAnimation(shrinkDownAnimation);
                    }
                    public void onAnimationEnd(Animation anim) {}
                    public void onAnimationRepeat(Animation anim) {}
                });
    
            activateView.startAnimation(fadeInFromTopAnimation);
    

    And here is my fade_in_from_top.xml animation file:

    <?xml version="1.0" encoding="utf-8"?>
    <set
        xmlns:android           = "http://schemas.android.com/apk/res/android"
        android:interpolator    = "@android:anim/linear_interpolator">
    
        <alpha
            android:fromAlpha       = "0"
            android:toAlpha         = "1"
            android:duration        = "500">
        </alpha>
    
        <scale
            android:fromXScale      = "1"
            android:fromYScale      = "0"
            android:toXScale        = "1"
            android:toYScale        = "1"
            android:pivotX          = "50%"
            android:pivotY          = "0%"
            android:duration        = "500">
        </scale>
    </set>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I am writing an app with both english and french support. The app requests

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.