GithubHelp home page GithubHelp logo

uchomepage's Introduction

UCHomePage

UC浏览器主页大部分动画效果的演示项目

这不是一个可以直接使用的lib,有很多 hardcode 的地方

  1. ViewPager
  2. ViewPager 的第一页,DragTracker,继承自 LinearLayout,用 ViewDragHelper 追踪在这一页的上下拉行为并分发给接收者
  3. ViewPager 的第二页,普通布局
  4. 与 ViewPager 在同一个FrameLayout 中的 SearchBar 控件,实现了 ViewPager 的 OnPageChangeListener,在 ViewPager 横向滑动的时候修改自己的 mHeight,但其子 view 的高度不变,通过 layout 子 view 到不同的位置实现折叠/展开的效果
  5. DragUpReceiver,继承自 ViewGroup,布局方式同垂直的 LinearLayout,用于接收 2 中 DragTracker 的 上拉行为,通过和 4 类似的方式实现折叠/展开效果,并绘制阴影效果
  6. 一个与 NewsActivity 中新闻列表一样的布局,长度要求有一屏(上下滑动不会空白),由于DragTracker 是 LinearLayout,所以在上方布局高度变化(上下拉)时,这个新闻列表也会上下滑动
  7. SearchBar 布局和 4 一样,但是是处于展开状态,并接受 2 中 DragTracker 的下拉行为,通过改变自身高度 和 绘制背景(贝塞尔曲线的弧形底边效果),实现下拉动画效果
  8. 菜单布局

ps.上下拉时会隐藏 4 的 SearchBar, 并展示 7 的 SearchBar

Thanks

NewsActivity 中使用了 baoyongzhangPullRefreshLayout 并做了简单修改,添加了OverScroll 的动作,并仿照 UC Browser 写了一个 RefreshHeader。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.