android-Custom Multi-tab hover control for Mushroom Street homepage effect

Source: Internet
Author: User


Because some of the needs of the project need to use this kind of presentation.  Found the majority of the market with similar features of the application. The basic idea of nesting scrollview conversion events is distributed to the ListView implementation. But there is a downside to such a scheme.

When the ScrollView switches to the ListView event.   Will be Dayton.    The experience is not good.   Application of this scenario: Mushroom Street.    Pocket to rob Treasure.  Mushroom Street will be stuck in a quick slide. Optimized for processing.


In the process of looking for the demo. Fewer scenarios are found for this control. There are only a few problems. For example, if the ListView is not long, switching viewpager will cause large blanks. Need to redraw the Viewpager interface,

But even if it was redrawn. In the viewpager of the sliding switch process.    Will cause a splash screen phenomenon. So you can only rewrite the beginning.

---------------------------time to--------------to go home and update.


So I thought of 2 options.

Scenario One: ListView Implementation,

This scenario is relatively simple to implement, and does not require much complexity.  But there is a fatal flaw. Because the ListView cannot directly get to the sliding distance.  Can only be obtained indirectly by calculating the item height. And when the gesture is sliding quickly, it produces inertial sliding, which is not correct.

Gets the height of the slide, and the slide effect is not smooth. The program then discards.

Scenario Two: ScrollView nested listview implementation.

This demo uses this notation.  Why use ScrollView to nest? Because the ScrollView can accurately get the height of the slide. The sliding switch is very smooth to implement. And you do not need to overwrite event distribution.

There will be no lag phenomenon;

This scenario does not use ScrollView to nest all layouts in the overall interface. But in the Viewpager item inside the ScrollView nested listview;

Difficulty: The difficulty of the whole control lies in the processing of the public area head. The suspension window is the simplest. (digression: The main purpose is to write the effect of the suspended window, the result is the simplest.) The egg hurts, there's Wood!!! (╮(╯▽╰)╭)

Another difficulty is that the state of the Viewpager switch is saved.  This segment is compared around. I also walked around for a long time to understand.


Finally: because it is the test demo code clutter.  Don't blame it. These days will be pulled into a library, plus a drop-down refresh and load more features. Hope to help the useful students to put.

Demo Monday attached (forgot to upload the network disk.) in the company computer (. _°☆╲ (-)


Note: The reprint indicates the source. Thank you, everyone!


android-Custom Multi-tab hover control for Mushroom Street homepage effect

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.