Android Tutorial
Software Setup and Configuration
Android Studio
File Structure
Components
Core Topics
Layout
View
Button
Intent and Intent Filters
Toast
RecyclerView
Fragments
Adapters
Other UI Component
Image Loading Libraries
Date and Time
Material Design
Bars
Working with Google Maps
Chart
Animation
Database
Advance Android
Jetpack
Architecture
App Publish
App Monetization
Croller
is a custom Android widget for a circular roller. It offers more customization and is a better alternative to the traditional Android SeekBar
. With Croller
, you can customize things like the color, number of indicators, and more.
Here's a guide to integrating and using Croller
in your Android project:
First, add the Croller
dependency in your build.gradle
(Module: app):
dependencies { implementation 'com.sdsmdg.harjot:croller:1.0.5' }
Make sure you check for the latest version.
Croller
to Your Layout:In your XML layout file, you can add the Croller
like:
<com.sdsmdg.harjot.crollerTest.Croller android:id="@+id/croller" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" app:back_circle_color="#E0E0E0" app:main_circle_color="#FFFFFF" app:indicator_color="#FF5722" app:main_circle_radius="120" app:number_of_stages="5" app:progress_primary_color="#0B3D91" app:progress_secondary_color="#81B9BF" app:is_continuous="false"/>
This creates a Croller
with specific customization, such as color, number of indicators (stages), and more.
Croller
in Your Activity/Fragment:In your Activity
or Fragment
, you can retrieve and use the Croller
like:
val croller = findViewById<Croller>(R.id.croller) croller.setOnProgressChangedListener(object : Croller.onProgressChangedListener { override fun onProgressChanged(progress: Int) { // Use the progress value as required Log.d("CROLLER", "Progress: $progress") } })
With this, whenever the user moves the Croller
, you'll get the updated progress in the provided callback, which you can then use as needed.
The features mentioned above are just a subset of what Croller
offers. The widget provides a lot of customization options that allow you to tweak its appearance and behavior to match your application's theme and requirements. Always refer to the official documentation or repository for additional details and updates.
Using Circular Slider (Croller) in Android Kotlin:
// Example of using Circular Slider (Croller) in Android val croller: Croller = findViewById(R.id.circularSlider) croller.setOnCrollerChangeListener { croller -> // Handle the value change event val selectedValue = croller.progress // Perform actions based on the selected value }
Croller library for Android example:
// Example of using Croller library in Android implementation 'com.github.captain-miao:Croller:1.0.8'
Customizing Croller appearance in Android:
// Example of customizing Croller appearance val croller: Croller = findViewById(R.id.circularSlider) croller.mainCircleColor = Color.BLUE croller.indicatorColor = Color.RED // Set other customization properties as needed
Handling events with Croller in Android:
// Example of handling events with Croller val croller: Croller = findViewById(R.id.circularSlider) croller.setOnCrollerChangeListener { croller -> // Handle the value change event val selectedValue = croller.progress // Perform actions based on the selected value }
Adding labels to Croller in Android:
// Example of adding labels to Croller val croller: Croller = findViewById(R.id.circularSlider) croller.label = "Volume" // Set other label-related properties as needed
Setting minimum and maximum values in Croller:
// Example of setting minimum and maximum values in Croller val croller: Croller = findViewById(R.id.circularSlider) croller.min = 0 croller.max = 100 // Set other properties related to the range
Integrating Croller into Android layout:
<!-- Example of integrating Croller into Android layout --> <com.sdsmdg.harjot.crollerTest.Croller android:id="@+id/circularSlider" android:layout_width="match_parent" android:layout_height="match_parent" app:is_continuous="true" app:start_offset="45" app:max="100" app:label="Progress" app:label_size="12sp" app:indicator_width="10dp" app:back_circle_radius="80dp" app:main_circle_radius="100dp" app:progress_primary_color="#FF5722" app:progress_secondary_color="#757575" app:progress_max_color="#FF9800" app:progress_min_color="#4CAF50"/>