All Projects → skydoves → Indicatorscrollview

skydoves / Indicatorscrollview

Licence: apache-2.0
🧀 A dynamic scroll view that animates indicators according to its scroll position.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Indicatorscrollview

BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-90.99%)
Mutual labels:  android-ui, indicator
Jxsegmentedview
A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 1,905 (+436.62%)
Mutual labels:  scrollview, indicator
Jxcategoryview
A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 5,561 (+1466.48%)
Mutual labels:  scrollview, indicator
Smartchart
智能折线图、柱状图,支持水平垂直滚动拉伸,自适应屏幕(解决与scrollview滑动冲突),x轴y轴自定义刻度以及标题,双向滚动列表;增加一周天气折线图以及24小时天气预报
Stars: ✭ 85 (-76.06%)
Mutual labels:  android-ui, scrollview
Pageindicator
An Instagram like page indicator compatible with RecyclerView and ViewPager.
Stars: ✭ 236 (-33.52%)
Mutual labels:  android-ui, indicator
Consecutivescroller
ConsecutiveScrollerLayout是Android下支持多个滑动布局(RecyclerView、WebView、ScrollView等)和普通控件(TextView、ImageView、LinearLayou、自定义View等)持续连贯滑动的容器,它使所有的子View像一个整体一样连续顺畅滑动。并且支持布局吸顶功能。
Stars: ✭ 1,383 (+289.58%)
Mutual labels:  android-ui, scrollview
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (+18.03%)
Mutual labels:  android-ui, indicator
ArcPageIndicator
Android Page Indicator for ViewPager with original animations. It uses an ellipse to dispose indication spots, and can draw a hand, like in old elevators.
Stars: ✭ 73 (-79.44%)
Mutual labels:  android-ui, indicator
Stickyscrollview
Sticky header and footer for android ScrollView.
Stars: ✭ 284 (-20%)
Mutual labels:  android-ui, scrollview
Elasticprogressbar
Elastic Progress Bar Renew!
Stars: ✭ 314 (-11.55%)
Mutual labels:  android-ui
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+889.3%)
Mutual labels:  android-ui
Avatar View
Avatar ImageView with user's name first letter Drawable placeholder
Stars: ✭ 309 (-12.96%)
Mutual labels:  android-ui
Android Login
Stars: ✭ 317 (-10.7%)
Mutual labels:  android-ui
Fancyscrollview
A SwiftUI ScrollView Designed to imitate the App Store and Apple Music ScrollViews (with or without a Parallax Header)
Stars: ✭ 330 (-7.04%)
Mutual labels:  scrollview
Loopingviewpager
A ViewPager and PagerAdapter combination that support auto scroll, infinite loop and page indicators.
Stars: ✭ 310 (-12.68%)
Mutual labels:  indicator
Recyclerstickyheaderview
Sticky header view or suspending view for RecyclerView.
Stars: ✭ 347 (-2.25%)
Mutual labels:  android-ui
Autocomplete
Simple yet powerful autocomplete behavior for EditTexts, to avoid working with MultiAutoCompleteTextView APIs.
Stars: ✭ 307 (-13.52%)
Mutual labels:  android-ui
Skeleton
A library provides an easy way to show skeleton loading view like Facebook and Alipay
Stars: ✭ 3,368 (+848.73%)
Mutual labels:  android-ui
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (-0.85%)
Mutual labels:  android-ui
Doublelift
🦋 Expands and collapses a layout horizontally and vertically sequentially.
Stars: ✭ 343 (-3.38%)
Mutual labels:  android-ui

IndicatorScrollView

License API Build Status Javadoc

🧀 A dynamic way that animates indicators according to positions of a scroll view.

Including in your project

Maven Central JitPack
Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
    repositories {
        mavenCentral()
    }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:indicatorscrollview:1.0.4"
}

Usage

Add following XML namespace inside your XML layout file.

xmlns:app="http://schemas.android.com/apk/res-auto"

IndicatorScrollView & indicatorView in layout

Here is a basic example of implementing IndicatorScrollView and indicatorView.

<com.skydoves.indicatorscrollview.IndicatorScrollView 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/indicatorScrollView"
  android:layout_width="match_parent"
  android:layout_height="wrap_content">

  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <com.skydoves.indicatorscrollview.IndicatorView
      android:id="@+id/indicatorView"
      android:layout_width="60dp"
      android:layout_height="match_parent"
      android:background="@color/background800"
      android:paddingLeft="6dp"
      android:paddingRight="6dp"
      app:indicator_expandingRatio="0.2" // expands when an indicator item reaches the display's height ratio.
      app:indicator_expandingAllItemRatio="0.9" // expands all items when scroll reaches a specific position ratio.
      app:indicator_itemPadding="6dp" // padding size between indicator items.
    />
      
    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingBottom="40dp">
   
      // some complicated views..
   
      <LinearLayout // This layout will be used for composing indicator.
        android:id="@+id/section1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
        
      <LinearLayout  // This layout will be used for composing indicator.
        android:id="@+id/section2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"        
   
    </LinearLayout/>
  </LinearLayout>
</com.skydoves.indicatorscrollview.IndicatorScrollView>

IndicatorScrollView

IndicatorScrollView is a scrollView for reacting with IndicatorView when scroll is changed. It extends NestedScrollView. So it must have a ViewGroup child like what LinearLayout or RelativeLayout.

IndicatorView

IndicatorView is an indicator view for reacting to IndicatorScrollView when the scroll is changed. It should be used in IndicatorScrollView.

Create using builder class

We can create an instance of the IndicatorView using IndicatorView.Builder class.

val indicatorView = IndicatorView.Builder(this)
  .setIndicatorItemPadding(16)
  .setExpandingRatio(0.2f)
  .setExpandingAllItemRatio(1.0f)
  .build()

Binding

We should bind an IndicatorView to IndicatorScrollView like bellow.

indicatorScrollView.bindIndicatorView(indicatorView)

IndicatorItem

IndicatorItem is an attribute item data for composing the IndicatorView.
We can create an instance of the IndicatorItem using the IndicatorItem.Builder class.

val myIndicatorItem = 
    IndicatorItem.Builder(section1) // section1 is the target view for the start of expanding.
    .setItemColor(myColor) // sets the background color of the indicator item using value.
    .setItemColorResource(R.color.colorPrimary) // sets the background color of the item using resource.
    .setItemIcon(myIcon) // sets the icon of the indicator item using drawable.
    .setItemIconResource(R.drawable.ic_heart) // sets the icon of the indicator item using resource.
    .setItemDuration(400) // sets the expanding and collapsing duration.
    .setItemCornerRadius(40f) // sets the corner radius of the indicator item.
    .setItemIconTopPadding(12) // sets the padding top value between the indicator items.
    .setExpandedSize(600) // customizes the fully expanded height size.
    .build()

We can create it using kotlin dsl.

val myIndicatorItem = indicatorItem(section1) {
  setItemColor(myColor) // sets the background color of the indicator item using value.
  setItemColorResource(R.color.colorPrimary) // sets the background color of the item using resource.
  setItemIcon(myIcon) // sets the icon of the indicator item using drawable.
  setItemIconResource(R.drawable.ic_heart) // sets the icon of the indicator item using resource.
  setItemDuration(400) // sets the expanding and collapsing duration.
  setItemCornerRadius(40f) // sets the corner radius of the indicator item.
  setItemIconTopPadding(12) // sets the padding top value between the indicator items.
  setExpandedSize(600) // customizes the fully expanded height size.
}

And add the instance of the IndicatorItem to IndicatorView.

indicatorView.addIndicatorItem(myIndicatorItem)

// or we can use plus operator.
indicatorView + myIndicatorItem

IndicatorAnimation

We can customize the expanding and collapsing animation.

IndicatorAnimation.NORMAL
IndicatorAnimation.ACCELERATE
IndicatorAnimation.BOUNCE
NORMAL ACCELERATE BOUNCE

IndicatorView Attributes

Attributes Type Default Description
expandingRatio Float 0.2 expands when an indicator item reaches the display's height ratio.
expandingAllItemRatio Float 0.9 expands all items when scroll reaches a specific position ratio.
itemPadding Dimension 6dp padding size between indicator items.

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐️
And follow me for my next creations! 🤩

License

Copyright 2019 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].