Description
Generate custom Android lint checks and have lint warn you about code you may be dealing with using Kotlin extensions or your own coding conventions.
Intervention alternatives and similar packages
Based on the "Kotlin" category.
Alternatively, view Intervention alternatives based on common mentions on social networks and blogs.
-
CalendarView
A highly customizable calendar view and compose library for Android. -
android-youtube-player
YouTube Player library for Android and Chromecast, stable and customizable. -
Balloon
:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android. -
Kotterknife
Android view injection writen in Kotlin based on ButterKnife -
Shortbread
Android library that creates app shortcuts from annotations -
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 -
DrawableToolbox
๐ ๏ธ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files. -
Navigation Toolbar for Android
:octocat: Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
CodeView
Display code with syntax highlighting :sparkles: in native way. -
Carousel Recyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager. -
Pluto Debug Framework
Android Pluto is a on-device debugging framework for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manipulating application data on-the-go. -
Pdf Viewer For Android
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space. -
Android Kotlin Samples
Some basic samples of Kotlin for Android -
CrunchyCalendar โ awesome calendar widget for android apps
A beautiful material calendar with endless scroll, range selection and a lot more! -
MaterialTimelineView
With MaterialTimelineView you can easily create a material looking timeline. -
sliding-panel
Android sliding panel that is part of the view hierarchy, not above it. -
Capturable
๐Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image๐ผ๏ธ -
MaterialDrawerKt
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library. -
Transition X
{ } Declarative Kotlin DSL for choreographing Android transitions -
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.๐๐๐ -
Only
:bouquet: An easy way to persist and run code block only as many times as necessary on Android. -
SSCustomBottomNavigation
Animated TabBar with native control and Jetpack Navigation support..โจ๐๐ -
Swagger Gradle Codegen
๐ซ A Gradle Plugin to generate your networking code from Swagger -
EasyPermissions-ktx
๐ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher. -
Permission Flow for Android
Know about real-time state of a Android app Permissions with Kotlin Flow APIs. -
Awesome Jetpack compose
A collaborative list of awesome jetpack compose resources. -
Nextflix-Composable
Includes jetpack compose, navigation, paging, hilt, retrofit, coil, coroutines, flow.. -
DeviceInfo-Sample
[Android Library] Get easy access to device information super fast, real quick -
CameraViewEx
Easy Android camera integration, advanced features. -
Aimybox voice assistant
Embeddable custom voice assistant for Android applications -
Intro Showcase View
Highlight different features of the app using Jetpack Compose -
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! -
ZoomHelper
ZoomHelper will make any view to be zoomable just like Instagram pinch-to-zoom -
Mutekt
Simplify mutating "immutable" state models (a Kotlin multiplatform library) -
SSCustomEditTextOutLineBorder
Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. ๐ ๐ -
Maildroid
Maildroid is a small robust android library for sending emails using SMTP server -
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration) -
Turtle ๐ข
Run shell commands from Kotlin scripts, apps or Gradle tasks with ease. -
Compose Compiler Reports to HTML Generator
A utility (Gradle Plugin + CLI) to convert Jetpack Compose compiler metrics and reports to beautified HTML page. -
Vanilla Place Picker
Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android -
Crowdin Android SDK
Crowdin Android SDK delivers all new translations from Crowdin project to the application immediately
Appwrite - The Open Source Firebase alternative introduces iOS support
Do you think we are missing an alternative of Intervention or a related project?
README
Intervention
Annotation based Android lint check generation
Generate custom Android lint checks and have lint warn you about code you may be dealing with using Kotlin extensions or your own coding conventions.
How is this useful?
We create and annotate the following simple extension functions:
@Intervene(name = "ContentView", warnAgainst = "setContentView")
fun Activity.layout(@LayoutRes layoutRes: Int) {
this.setContentView(layoutRes)
}
@Intervene(name = "ToastIntervention", warnAgainst = "Toast.makeText")
fun Activity.toast(message: String, length: Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, message, length).show()
}
Having the following sample Activity:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Toast.makeText(this, "Awesome", Toast.LENGTH_SHORT).show()
toast("Even more Awesome")
}
}
Running lint would generate the following report: [Intervention report printscreen](report-printscreen.jpg)
The report is detailed and also includes the annotated code that would fix the issue.
How to use?
1. Preparation
a. Lint Module
Custom lint checks in Android need to be created in a Java Module, so go ahead and create one.
File -> New -> New Module... -> Java Library
Intervention generates kotlin code, so you need to apply the Kotlin plugin in the newly created module and instruct the module to use Kotlin generated files. Also, the module must declate the Registry class for the lint checks it contains; the Registry is generated by Intervention. Finally it should have a dependency on Android Lint and the main Intervention project. All in all, the Java module's gradle script should look like this:
apply plugin: 'java-library'
apply plugin: 'kotlin'
/* Sets the JAVA compatibility */
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
/* Uses kotlin generated code in the project */
sourceSets {
main {
java {
srcDir "${buildDir.absolutePath}/generated/source/kaptKotlin/"
}
}
}
/* Declares the lint Registry class */
jar {
manifest {
attributes("Lint-Registry-v2": "com.izikode.izilib.interventions.InterventionRegistry")
}
}
/* All dependencies must be compileOnly as per lint regulations */
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11"
compileOnly "com.android.tools.lint:lint-api:26.2.1"
compileOnly "com.izikode.izilib:intervention:0.4"
}
b. Android module
Intervention uses Kotlin code generation, so you must apply the Kapt plugin on your Android module. Also, you must provide the annotation processor with the path to your Java lint module created above. To do this modify your Android gradle script and add the following:
apply plugin: 'kotlin-kapt'
kapt {
arguments {
arg('interventionsModuleDir', project(':appinterventions').projectDir.absolutePath)
}
}
Replace appinterventions
with the name of your Java lint module.
You must also add the Intervention dependencies in your Android module, as well as the Java lint module:
dependencies {
...
implementation "com.izikode.izilib:intervention:0.4"
kapt "com.izikode.izilib:interventioncompiler:0.4"
lintChecks project(":appinterventions")
}
Again replace appinterventions
with the name of your Java lint module.
2. Usage
a. Annotate
Use the Intervene
annotation to decorate extension or any other functions for which you want to have lint checks. A simple example
is the ToastIntervention from the sample project.
@Intervene(name = "ToastIntervention", warnAgainst = "Toast.makeText")
fun Activity.toast(message: String, length: Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, message, length).show()
}
Another example is the Fragment factory function from the sample project.
class MainFragment : Fragment() {
companion object {
@Intervene(name = "MainFragmentInitialization", warnAgainst = "MainFragment()", useInstead = "MainFragment.newInstance()")
fun newInstance() = MainFragment()
}
}
name
is the lint check's name and ID.warnAgainst
is the piece of code that when matched will trigger the warning.useInstead
is the code that replaces the above. When left empty (default) the compiler will provide the function signature in the report.priority
can be either Priority.LOW, Priority.NORMAL (default) or Priority.HIGH.type
can be either Type.WARNING (default) or Type.ERROR. Error stops the build.
b. Build and run lint
For a full example, see the sample app.
Licence
Copyright 2018 Fanis Veizis
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 Intervention README section above
are relevant to that project's source code only.