Android app-imitation Meituan loading animation, androidloading

Source: Internet
Author: User

Android app-imitation Meituan loading animation, androidloading

Preface

Presumably, the users who used the Meituan client were very impressed with the animation of the Meituan villain, and a cute villain was desperately running there. There are actually many ways to implement this animation. Today we will use frame animation to implement it.


I,



Ii. layout files

<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"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context=".MainActivity" >    <ImageView        android:id="@+id/imageView"        android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:onClick="start"        android:scaleType="fitCenter"        android:src="@anim/frame" /></RelativeLayout>

Create an anim file, which stores the image for preparing the frame Animation. You can extract the image directly from the installation package of Meituan.

<?xml version="1.0" encoding="utf-8"?><animation-list xmlns:android="http://schemas.android.com/apk/res/android"    android:oneshot="false">    <item android:drawable="@drawable/progress_loading_image_01" android:duration="50" />    <item android:drawable="@drawable/progress_loading_image_02" android:duration="50" /></animation-list>

Main function code:

Use the getDrawabel method of the image view to obtain an AnimationDrawable object and call the start method to enable the animation.

Public class MainActivity extends Activity {private ImageView imageView; private AnimationDrawable ad; @ Overrideprotected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); imageView = (ImageView) findViewById (R. id. imageView); ad = (AnimationDrawable) imageView. getDrawable (); // obtain the image content and convert it to an animated object.} public void start (View v) {if (ad. isRunning () ad. stop (); ad. start (); // start playing }}





What development technology is required for developing a mobile platform (ios and Android) similar to Meituan App or glutinous rice App?

Not to mention the server, but you need a server with certain interface capabilities, including data acquisition and data submission.
Mobile technology is not available, so you can understand the API on the Mobile End. It is mainly about the interaction between the local server and the server.
For Android and ios, we recommend that you use json format for data interaction. In addition, the push mechanism is required. It is best to embed various third-party account bindings to facilitate commodity sharing. There are no other special technologies.
Pay special attention to the need to have a good UI Designer, the interface looks good to attract users. Pay attention to memory issues and image loading technologies during program development. We recommend that you use Memory Analyzer to follow up on Memory problems. If you want to load images, use the ImageLoader open-source project if you want to be lazy. because it involves a large number of small data networks, we recommend that you use Google's volley project.
Hope to help you.

PS: If you don't want to develop a ready-made system on the server side, you can do it with the simplest CMS. The key is whether you need to display data on the Web. There are many group buying systems on the Internet, which can be easily found through simple search ~

For the Android version of planet 2 of the Solar System, I downloaded it from my thumb. After loading the game loading, it kept stuck on the white dot. How can this problem be solved?

Please send me your mobile phone model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.