项目作者: LiteKite

项目描述 :
An Android Custom Widgets Library, offers custom ui components.
高级语言: Kotlin
项目地址: git://github.com/LiteKite/Android-Widgets.git
创建时间: 2020-07-23T14:57:39Z
项目社区:https://github.com/LiteKite/Android-Widgets

开源协议:Apache License 2.0

下载


Android-Widgets

Maven Central

An Android Custom Widgets Library, offers custom ui components.

SmoothSeekBar

SmoothSeekBar extends the implementation of AppCompatSeekBar, which updates the progress based on the ACTION_MOVE Touch Event rather than the ACTION_DOWN Touch Event, which makes smooth transition from the previous progress to the current one.

1) A Horizontal SmoothSeekBar.


Smooth Seek Bar

  1. <com.litekite.widget.SmoothSeekBar
  2. style="@style/Widget.AppCompat.SeekBar"
  3. android:layout_width="300dp"
  4. android:layout_height="50dp"
  5. android:max="100"
  6. android:progress="0"
  7. android:progressTint="@android:color/holo_red_light"
  8. android:thumbTint="@android:color/holo_red_light" ></com.litekite.widget.SmoothSeekBar>

2) A SmoothSeekBar turned as vertical with ViewRotator.


Vertical Smooth Seek Bar

  1. <com.litekite.widget.ViewRotator
  2. android:layout_width="wrap_content"
  3. android:layout_height="wrap_content">
  4. <com.litekite.widget.SmoothSeekBar
  5. style="@style/Widget.AppCompat.SeekBar"
  6. android:layout_width="300dp"
  7. android:layout_height="50dp"
  8. android:max="100"
  9. android:progress="0"
  10. android:progressTint="@android:color/holo_red_light"
  11. android:thumbTint="@android:color/holo_red_light" ></com.litekite.widget.SmoothSeekBar>
  12. </com.litekite.widget.ViewRotator>

ViewRotator

ViewRotator is a View Group which hosts a single view rotated by 90 degrees counterclockwise.

1) A Horizontal Material Slider View turned vertical by rotation.


Vertical Rotator with Slider

  1. <com.litekite.widget.ViewRotator
  2. android:layout_width="wrap_content"
  3. android:layout_height="wrap_content">
  4. <com.google.android.material.slider.Slider
  5. style="@style/Widget.MaterialComponents.Slider"
  6. android:layout_width="300dp"
  7. android:layout_height="50dp"
  8. android:theme="@style/Theme.MaterialComponents"
  9. app:haloColor="@android:color/holo_red_light"
  10. app:labelBehavior="gone"
  11. app:thumbColor="@android:color/holo_red_light"
  12. app:trackColorActive="@android:color/holo_red_light"
  13. app:trackColorInactive="@android:color/darker_gray" ></com.google.android.material.slider.Slider>
  14. </com.litekite.widget.ViewRotator>

CircleImageButton

CircleImageButton is a clickable image button that makes image source [app:srcCompat] and background source [android:background] a circle.

1) Color resource as a circle (An alternative way is to use shape drawable)


Circle Image Button Source As Color Resource

  1. <com.litekite.widget.CircleImageButton
  2. ...
  3. style="@style/Widget.AppCompat.ImageButton"
  4. app:srcCompat="@android:color/black"
  5. ... ></com.litekite.widget.CircleImageButton>

2) Background and image source with color resource as a circle with inner padding (An alternative way is to use shape drawable with oval type, stroke and shape color)


Circle Image Button Background And Source As Color Resource

  1. <com.litekite.widget.CircleImageButton
  2. ...
  3. style="@style/Widget.AppCompat.ImageButton"
  4. android:background="@android:color/holo_red_light"
  5. app:innerPadding="10dp"
  6. app:srcCompat="@android:color/black"
  7. ... ></com.litekite.widget.CircleImageButton>

3) Background and image source with color resource as a circle with inner padding plus ripple effect


Circle Image Button Background And Source As Color Resource Plus Ripple Effect

  1. <com.litekite.widget.CircleImageButton
  2. ...
  3. style="@style/Widget.AppCompat.ImageButton"
  4. android:background="@android:color/holo_red_light"
  5. app:innerPadding="10dp"
  6. app:rippleDrawable="@drawable/drawable_ripple"
  7. app:srcCompat="@android:color/black"
  8. ... ></com.litekite.widget.CircleImageButton>
  9. <!--Ripple drawable-->
  10. <ripple xmlns:android="http://schemas.android.com/apk/res/android"
  11. android:color="#50000000" android:radius="54dp" ></ripple>

4) Profile drawable image plus background plus ripple effect


Profile Drawable Image Plus Background Plus Ripple Effect

  1. <com.litekite.widget.CircleImageButton
  2. ...
  3. style="@style/Widget.AppCompat.ImageButton"
  4. android:background="@android:color/black"
  5. app:innerPadding="5dp"
  6. app:rippleDrawable="@drawable/drawable_ripple"
  7. app:srcCompat="@drawable/ic_preview_user_avatar"
  8. ... ></com.litekite.widget.CircleImageButton>

5) Profile drawable image plus transparent background plus ripple effect


Profile Drawable Image Plus Background Plus Ripple Effect

  1. <com.litekite.widget.CircleImageButton
  2. ...
  3. style="@style/Widget.AppCompat.ImageButton"
  4. android:background="@android:color/transparent"
  5. app:rippleDrawable="@drawable/drawable_ripple"
  6. app:srcCompat="@drawable/ic_preview_user_avatar"
  7. ... ></com.litekite.widget.CircleImageButton>

Download

1) Add the maven central repo in your root build.gradle at the end of repositories:

  1. buildscript {
  2. ...
  3. repositories {
  4. ...
  5. mavenCentral()
  6. ...
  7. }
  8. ...
  9. }
  10. ...
  11. allprojects {
  12. repositories {
  13. ...
  14. mavenCentral()
  15. ...
  16. }
  17. }

2) Add the dependency in your app build.gradle:

  1. dependencies {
  2. implementation 'com.github.litekite:android-widgets:0.0.7'
  3. }

License

  1. Copyright 2021 LiteKite Startup.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.