Description
The missing DrawableToolbox for Android. Get rid of the boring and always repeated drawable.xml files.
DrawableToolbox alternatives and similar packages
Based on the "Kotlin" category.
Alternatively, view DrawableToolbox alternatives based on common mentions on social networks and blogs.
-
CalendarView
A highly customizable calendar view and compose library for Android and Kotlin Multiplatform. -
Balloon
:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android. -
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ -
NotyKT ๐๏ธ
๐ NotyKT is a complete ๐Kotlin-stack (Backend + Android) ๐ฑ application built to demonstrate the use of Modern development tools with best practices implementation๐ฆธ. -
Material Chip View
Material Chip view. Can be used as tags for categories, contacts or creating text clouds -
Navigation Toolbar for Android
:octocat: Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
Capturable
๐Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image๐ผ๏ธ -
Pdf Viewer For Android
A Lightweight PDF Viewer Android library which only occupies around 80kb while most of the Pdf viewer occupies up to 16MB space. -
Carousel Recyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager. -
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.๐๐๐ -
CrunchyCalendar โ awesome calendar widget for android apps
A beautiful material calendar with endless scroll, range selection and a lot more! -
Pluto Debug Framework
Android Pluto is a on-device debugging framework for Android applications, which helps intercept Network calls, capture Crashes & ANRs, manipulate application data on-the-go, and much more. -
Permission Flow for Android
Know about real-time state of a Android app Permissions with Kotlin Flow APIs. -
SSCustomBottomNavigation
Animated TabBar with native control and Jetpack Navigation support..โจ๐๐ -
Only
:bouquet: An easy way to persist and run code block only as many times as necessary on Android. -
Nextflix-Composable
Includes jetpack compose, navigation, paging, hilt, retrofit, coil, coroutines, flow.. -
EasyPermissions-ktx
๐ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher. -
Compose Compiler Reports to HTML Generator
A utility (Gradle Plugin + CLI) to convert Jetpack Compose compiler metrics and reports to beautified HTML page. -
MidJourney Images Compose Multiplatform Mobile Application
This application is developed to display the images created by MidJourney. The application is developed with Compose Multiplatform and works on many platforms including Android and iOS platforms. -
Events Calendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project! -
FlowMVI
A Kotlin Multiplatform MVI library based on coroutines with a rich DSL and a powerful plugin system. -
SSCustomEditTextOutLineBorder
Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. ๐ ๐ -
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration) -
Bytemask
Android Gradle Plugin that masks secret strings for the app in the source code making it difficult to extract from reverse engineering.
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of DrawableToolbox or a related project?
README
DrawableToolbox
English | [ไธญๆ](README_cn.md)
The missing DrawableToolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml
files.
Features
- Create drawables programmatically
- Support
<shape>
,<rotate>
,<scale>
,<ripple>
,<layer-list>
drawables - Support 'flip' (vertical or horizontal)
Contribute
- Please file an issue or pull request
Gradle
dependencies {
implementation 'com.github.duanhong169:drawabletoolbox:${latestVersion}'
...
}
Replace
${latestVersion}
with the latest version code. See releases.
Usage
Use the DrawableBuilder
to setup the Drawable
and call build()
to create it.
Please check all the supported APIs in DrawableBuilder.kt.
Here are some examples:
Code:
DrawableBuilder()
.rectangle()
.hairlineBordered()
.strokeColor(COLOR_DEFAULT)
.strokeColorPressed(COLOR_PRESSED)
.ripple()
.build()
Result:
[Bordered with Ripple](art/sample-1.png)
Code:
DrawableBuilder()
.rectangle()
.hairlineBordered()
.mediumDashed()
.strokeColor(COLOR_DEFAULT)
.strokeColorPressed(COLOR_PRESSED)
.ripple()
.build()
Result:
[Medium-dashed, Bordered with Ripple](art/sample-2.png)
Code:
DrawableBuilder()
.rectangle()
.rounded()
.solidColor(COLOR_DEFAULT)
.solidColorPressed(COLOR_PRESSED)
.build()
Result:
[Rounded, Filled with States](art/sample-4.png)
Code:
DrawableBuilder()
.rectangle()
.hairlineBordered()
.longDashed()
.rounded()
.strokeColor(COLOR_DEFAULT)
.strokeColorPressed(COLOR_PRESSED)
.ripple()
.build()
Result:
[Rounded, Long-dashed, Bordered with Ripple](art/sample-6.png)
Code:
DrawableBuilder()
.rectangle()
.rounded()
.gradient()
.linearGradient()
.angle(90)
.startColor(COLOR_DEFAULT)
.endColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
.ripple()
.rippleColor(COLOR_PRESSED)
.build()
Result:
[Rounded, Gradient with Ripple](art/sample-8.png)
Code:
val baseBuilder = DrawableBuilder()
.rectangle()
.rounded()
.gradient()
.gradientType(GradientDrawable.LINEAR_GRADIENT)
.angle(90)
val normalState = baseBuilder
.startColor(COLOR_DEFAULT)
.endColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
.build()
val pressedState = baseBuilder
.startColor(COLOR_PRESSED)
.endColor(ContextCompat.getColor(context, R.color.colorAccentDark))
.build()
StateListDrawableBuilder()
.normal(normalState)
.pressed(pressedState)
.build()
Result:
[Rounded, Gradient with States](art/sample-9.png)
Code:
val baseBuilder = DrawableBuilder()
.rectangle()
.rounded()
.hairlineBordered()
.strokeColor(COLOR_DEFAULT)
.solidColorSelected(COLOR_DEFAULT)
.ripple()
return when(type) {
SegmentedControlDrawableSpec.TYPE_LEFT_MOST -> {
baseBuilder.topRightRadius(0)
.bottomRightRadius(0)
.build()
}
SegmentedControlDrawableSpec.TYPE_RIGHT_MOST -> {
baseBuilder.topLeftRadius(0)
.bottomLeftRadius(0)
.build()
}
else -> {
baseBuilder.cornerRadius(0).build()
}
}
Result:
[Segmented Control](art/sample-10.png)
Code:
val layer1 = DrawableBuilder()
.size(200)
.rectangle()
.rounded()
.hairlineBordered()
.strokeColor(COLOR_DEFAULT)
.strokeColorPressed(COLOR_PRESSED)
.build()
val layer2 = DrawableBuilder()
.rectangle()
.rounded()
.solidColor(COLOR_DEFAULT)
.build()
val layer3 = DrawableBuilder()
.rectangle()
.rounded()
.solidColor(Color.WHITE)
.ripple()
.rippleColor(COLOR_DEFAULT)
.build()
LayerDrawableBuilder()
.add(layer1)
.add(layer2)
.inset(10)
.add(layer3)
.inset(20)
.build()
Result:
[Layer List: Several Borders](art/sample-14.png)
Code:
val layer1 = DrawableBuilder()
.size(180)
.rectangle()
.build()
val layer2 = DrawableBuilder()
.oval()
.solidColor(COLOR_DEFAULT)
.build()
val layer3 = DrawableBuilder()
.rectangle()
.solidColor(COLOR_DEFAULT_DARK)
.rotate(45f)
.build()
val layer4 = DrawableBuilder()
.rectangle()
.bottomLeftRadius(100)
.solidColor(COLOR_DEFAULT_DARK)
.build()
val layer5 = DrawableBuilder()
.oval()
.solidColor(COLOR_DEFAULT)
.build()
val layerDrawable = LayerDrawableBuilder()
.add(layer1)
.add(layer2)
.inset(20, 20, 100, 100)
.add(layer3)
.inset(100, 20, 20, 100)
.add(layer4)
.inset(20, 100, 100, 20)
.add(layer5)
.inset(100, 100, 20, 20)
.build()
DrawableBuilder()
.baseDrawable(layerDrawable)
.rotate(0f, 360f)
.build()
Result:
[Showcase: Layer List 1](art/sample-15.png)
Code:
// Rotate & Leveled the Ring
DrawableBuilder()
.size(200)
.ring()
.useLevelForRing()
.solidColor(COLOR_DEFAULT)
.innerRadiusRatio(3f)
.thicknessRatio(10f)
.rotate(0f, 720f)
.build()
Result:
[Rotate & Leveled the Ring](art/sample-11.png)
Code:
// Rotate, Sweep & Flip the Ring
DrawableBuilder()
.size(200)
.ring()
.innerRadiusRatio(3f)
.thicknessRatio(10f)
.gradient()
.sweepGradient()
.rotate(0f, 360f)
.flip()
.build()
Result:
[Rotate, Sweep & Flip the Ring](art/sample-12.png)
Code:
// Rotate, Sweep & Scale the Oval with States
val baseBuilder = DrawableBuilder()
.size(400)
.oval()
.gradient()
.sweepGradient()
.rotate(0f, 360f)
.scale(0.5f)
.scaleGravity(Gravity.START or Gravity.TOP)
val normalState = baseBuilder.build()
val pressedState = baseBuilder
.startColor(COLOR_PRESSED)
.endColor(0x7FFFFFFF)
.build()
StateListDrawableBuilder()
.normal(normalState)
.pressed(pressedState)
.build()
Result:
[Rotate, Sweep & Scale the Oval with States](art/sample-13.png)
Please check out the app sample code SampleCodeSnippets.kt for more details.
License
Copyright 2018 Hong Duan
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 all licence references and agreements mentioned in the DrawableToolbox README section above
are relevant to that project's source code only.