All Projects → skydoves → Androidribbon

skydoves / Androidribbon

Licence: apache-2.0
🎀 The simple way to implement a beautiful ribbon with the shimmering on Android.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Androidribbon

Pageindicator
An Instagram like page indicator compatible with RecyclerView and ViewPager.
Stars: ✭ 236 (-52.99%)
Mutual labels:  recyclerview, android-ui
android-tableview-kotlin
Android's missing TableView component.
Stars: ✭ 40 (-92.03%)
Mutual labels:  recyclerview, android-ui
recyclerfragment
An Android Fragment that displays a set of items in a RecyclerView.
Stars: ✭ 16 (-96.81%)
Mutual labels:  recyclerview, android-ui
Easyadapter
Recyclerview adapter library- Create adapter in just 3 lines of code
Stars: ✭ 122 (-75.7%)
Mutual labels:  recyclerview, android-ui
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+599.6%)
Mutual labels:  recyclerview, android-ui
Carouselrecyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Stars: ✭ 107 (-78.69%)
Mutual labels:  recyclerview, android-ui
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-75.3%)
Mutual labels:  recyclerview, android-ui
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+1002.19%)
Mutual labels:  recyclerview, android-ui
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+483.27%)
Mutual labels:  recyclerview, android-ui
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (-94.62%)
Mutual labels:  recyclerview, android-ui
Multilinedivider
Multi divider in RecyclerView on Android.
Stars: ✭ 13 (-97.41%)
Mutual labels:  recyclerview, android-ui
Recyclerstickyheaderview
Sticky header view or suspending view for RecyclerView.
Stars: ✭ 347 (-30.88%)
Mutual labels:  recyclerview, android-ui
Androidveil
🎭 An easy, flexible way to implement veil skeletons and shimmering effect for Android.
Stars: ✭ 792 (+57.77%)
Mutual labels:  recyclerview, android-ui
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (-68.53%)
Mutual labels:  recyclerview, android-ui
Codeview Android
Display code with syntax highlighting ✨ in native way.
Stars: ✭ 748 (+49%)
Mutual labels:  recyclerview, android-ui
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (-84.06%)
Mutual labels:  recyclerview, android-ui
Zoomrecylerlayout
🎢 Zoom Recycler Layout Manager For Android Kotlin
Stars: ✭ 618 (+23.11%)
Mutual labels:  recyclerview, android-ui
CeilingLayout
CeilingLayout用来控制子View的吸顶联滑,理论上支持实现了NestedScrollingChild的联滑控件,如NestedScrollView、RecyclerView、SmartRefreshLayout等;只需要在xml里配置需要吸顶子View的位置索引就能自动实现吸顶联滑效果。
Stars: ✭ 26 (-94.82%)
Mutual labels:  recyclerview, android-ui
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-31.67%)
Mutual labels:  recyclerview, android-ui
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (-16.53%)
Mutual labels:  recyclerview, android-ui

AndroidRibbon

License API Codacy Build Status Javadoc Profile

🎀 The simple way to implement a beautiful ribbon with the shimmering on Android. 中文語

Download

Maven Central Jitpack

Gradle

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:androidribbon:1.0.3"
}

Usage

Add following XML namespace inside your XML layout file.

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

RibbonView in layout

<com.skydoves.androidribbon.RibbonView
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:text="skydoves"
     android:textColor="@android:color/white"
     app:ribbon_rotation="-45" // set rotation
     app:ribbon_background_color="@color/colorPrimary" // set background color
     app:ribbon_ribbonRadius="4dp" // set radius
     app:ribbon_drawable="@drawable/ribbon03" // set drawable, not background color
     app:ribbon_padding_top="4dp"
     app:ribbon_padding_bottom="8dp"/>

create using Builder

This is how to create RibbonView's instance using RibbonView.Builder class.

new RibbonView.Builder(context)
      .setText("Android-Ribbon")
      .setTextColor(Color.WHITE)
      .setTextSize(13f)
      .setRibbonRotation(-45)
      .setRibbonBackgroundColor(ContextCompat.getColor(context, R.color.bright_lavender))
      .setRibbonDrawable(ContextCompat.getDrawable(context, R.drawable.ribbon03))
      .build();

create using kotlin dsl

This is how to create RibbonView's instance using kotlin dsl.

val ribbonView = ribbonView(this) {
      setText("Android-Ribbon")
      setTextColor(Color.WHITE)
      setTextSize(13f)
      setTextStyle(Typeface.BOLD)
      setRibbonRotation(-45)
      setRibbonDrawableResource(R.drawable.ribbon02)
    }

ShimmerRibbonView

ShimmerRibbonView lets you implement shimmer animation easily.

ShimmerRibbonView in layout

<com.skydoves.androidribbon.ShimmerRibbonView
      android:layout_width="130dp"
      android:layout_height="wrap_content"
      android:alpha="0.8"
      app:shimmer_base_alpha="1.0"
      app:shimmer_highlight_alpha="0.5"
      app:shimmer_ribbon_text="Android-Ribbon"
      app:shimmer_ribbon_textColor="@android:color/white"
      app:shimmer_ribbon_textStyle="bold"
      app:shimmer_ribbon_padding_top="3dp"
      app:shimmer_ribbon_padding_bottom="3dp"
      app:shimmer_ribbon_rotation="-45"
      app:shimmer_ribbon_background_color="@color/colorPrimary"/>

create using Builder

This is how to create ShimmerRibbonView's instance using ShimmerRibbonView.Builder class.

new ShimmerRibbonView.Builder(context)
      .setRibbonView(ribbonView)
      .setShimmer(shimmer)
      .build();

create using kotlin dsl

This is how to create ShimmerRibbonView's instance using kotlin dsl.

val shimmerRibbonView = shimmerRibbonView(context) {
      ribbon = ribbonView(context) {
          text = "Android-Ribbon"
          textColor = Color.WHITE
          textSize = 13f
          textStyle = Typeface.BOLD
          ribbonRotation = -45
          ribbonDrawable = ContextCompat.getDrawable(context, R.drawable.ribbon02)
      }
      shimmer = alphaShimmer {
          setBaseAlpha(1.0f)
          setHighlightAlpha(0.5f)
       }
    }

Shimmer

This library using shimmer-android by Facebook.
Here are the detail shimmer-instruction about shimmer or you can reference below examples.

create using Builder

This is how to create Shimmer's instance using Shimmer.Builder class.

new Shimmer.AlphaHighlightBuilder()
      .setBaseAlpha(1.0f)
      .setHighlightAlpha(0.5f)
      .setRepeatDelay(1000)
      .setDuration(1000)
      .setDirection(Shimmer.Direction.RIGHT_TO_LEFT)
      .build();

create using kotlin dsl

This is how to create Shimmer's instance using kotlin dsl.

val shimmer_alpha = alphaShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
}
val shimmer_color = colorShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
      setBaseColor(ContextCompat.getColor(context, R.color.colorPrimary))
      setHighlightColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
}

RibbonLayout

RibbonLayout lets RibbonViews overlap with other child views.

RibbonLayout in layout

<com.skydoves.androidribbon.RibbonLayout
      android:id="@+id/ribbonLayout01"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:ribbonLayout_header_align="left"
      app:ribbonLayout_bottom_align="center">

     <ImageView
          android:layout_width="match_parent"
          android:layout_height="180dp"
          android:src="@drawable/background02"
          android:scaleType="fitXY"/>
</com.skydoves.androidribbon.RibbonLayout>

And should set ribbonHeader or ribbonBottom using RibbonView or ShimmerRibbonView instance.

ribbonLayout.setRibbonHeader(ribbon_header);
ribbonLayout.setRibbonBottomAlign(Gravity.LEFT);
ribbonLayout.setRibbonBottom(ribbon_bottom);
ribbonLayout.setRibbonBottomAlign(Gravity.RIGHT);

RibbonRecyclerView

RibbonRecyclerView lets you implement RecyclerView has RibbonView items easily.

RibbonRecyclerView in layout

<com.skydoves.androidribbon.RibbonRecyclerView
      android:id="@+id/ribbonRecyclerView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="15dp"
      app:ribbon_recycler_space="3dp"
      app:ribbon_recycler_orientation="horizontal"/>

Add or remove RibbonView items.

recyclerView.addRibbon(ribbonView);
recyclerView.addRibbon(2, ribbonView);
recyclerView.addRibbonList(ribbonViewList);
recyclerView.removeRibbon(ribbonView);
recyclerView.removeRibbon(2);
recyclerView.clear();

RibbonView Attributes

Attributes Type Default Description
ribbonBackgroundColor Color #e254ff sets ribbon background using color.
ribbonRadius Float 10f sets ribbon corner's radius. It's only active using with ribbonBackgroundColor.
ribbonDrawable Drawable null sets ribbon background using drawable. ribbonBackgroundColor and ribbonRadius will be ignored.
ribbonRotation Int 0 sets ribbon rotation. Only between 1 to 90 or -90 to -1 degree.
paddingLeft Float 8f sets left padding of the text.
paddingTop Float 4f sets top padding of the text.
paddingRight Float 8f sets right padding of the text.
paddingBottom Float 4f sets bottom padding of the text.
text String "" sets text. It is same as android:text attribute.
textColor Color Color.WHITE sets text color. It is same as android:textColor attribute.
textSize Float 12f sets text size. It is same as android:textSize attribute.
textStyle Int Typeface.NORMAL sets text style. It is same as android:textStyle attribute.

ShimmerRibbonView Attributes

Attributes Type Default Description
ribbon RibbonView RibbonView(context) sets RibbonView on the frame.
shimmer Shimmer AlphaHighlightBuilder(context).build() sets Shimmer on the frame.

ShimmerLayout Attributes

Attributes Type Default Description
ribbonHeader RibbonView RibbonView(context) sets header RibbonView on the frame.
ribbonBottom RibbonView RibbonView(context) sets bottom RibbonView on the frame.
ribbonHeaderAlign Gravity Gravity.START sets an align of the header ribbon.
ribbonBottomAlign Gravity Gravity.CENTER sets an align of the bottom ribbon.

Find this library useful? ❤️

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

License

Copyright 2019 skydoves

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].