Hello, everyone, I’m Seeger!

Again to everyone’s favorite link – open source library recommendation, the front for everyone recommended my collection of some very cool open source library, received unanimous praise, have not seen, please move to:

10 cool open source libraries are recommended

[Open source recommendation] Advanced combat, from a music player to start

Here are the Top10 Android open source libraries for 2020 on GitHub.

What interesting libraries have we brought to you in this issue? Here are 15 interesting and useful open source ideas, in no particular order.

1. Coil

Coil is a new image loading framework for Android. Its full name is Coroutine Image Loader. Compare that to traditional image loading libraries such as Glide, Picasso or Fresco. This has the advantages of being lightweight (only about 1500 methods), fast, easy to use, and a more modern API.

It supports GIF and SVG, and can perform four default conversions: Blur, circle cropping, grayscale, and rounded corners.

The following is an example:

ImageView. Load (" HTTPS://www.example.com/image.jpg") {
 crossfade(true)
 placeholder(R.drawable.image)
 transformations(CircleCropTransformation())
}
Copy the code

Written entirely in Kotlin, this library should be your first choice if you are a pure Kotlin project.

Github address: github.com/coil-kt/coi…

2. MultiSearchView

The library has a very cool Search View animation!

Very simple to use and customizable, you can add custom styles under styles.xml.

Sample code:

<com.iammert.library.ui.multisearchviewlib.MultiSearchView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>     
Copy the code
multiSearchView.setSearchViewListener(object : MultiSearchView.MultiSearchViewListener{
    override fun onItemSelected(index: Int, s: CharSequence){}override fun onTextChanged(index: Int, s: CharSequence){}override fun onSearchComplete(index: Int, s: CharSequence){}override fun onSearchItemRemoved(index: Int){}})Copy the code

Custom styles:

  <! -- Search Text Style. -->
    <style name="SearchTextStyle">
        <! -- Custom values write to here for SearchEditText. -->
        <item name="android:focusable">true</item>
        <item name="android:focusableInTouchMode">true</item>
        <item name="android:enabled">true</item>
        <item name="android:hint">Search</item>
        <item name="android:imeOptions">actionSearch</item>
        <item name="android:textSize">18sp</item>
        <item name="android:maxLength">15</item>
        <item name="android:inputType">textCapSentences</item>
        <item name="android:textColorHint"># 80999999</item>
        <item name="android:textColor"># 000</item>
    </style>
Copy the code

Then, you should set the style to app: searchTextStyle under MultiSearchView.

Github address: github.com/iammert/Mul…

3. CalendarView

CalendarView is a highly customizable calendar component library, recycleView.

It has the following features:

  • Single or range selection
  • Weekly or monthly calendar mode
  • Date of boundary
  • Custom calendar view
  • Horizontal or vertical scrolling mode
  • Fully customizable view

The library’s documentation is also comprehensive and contains many examples. In addition, there is a sample application that shows all of the library’s capabilities.

It is written in pure Kotlin and released under an MIT license. This is a good choice if you need to use the calendar view in your application.

Note: The library uses the java.time classes through the Java 8+ API for backward compatibility, as these classes were added in Java 8.

Therefore, you need to add the following configuration to your app’s build.gradle:

android {
  defaultConfig {
    // Required ONLY when setting minSdkVersion to 20 or lower
    multiDexEnabled true
  }

  compileOptions {
    // Flag to enable support for the new language APIs
    coreLibraryDesugaringEnabled true
    // Sets Java compatibility to Java 8
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

dependencies {
  coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:<latest-version>'
}
Copy the code

Making: github.com/kizitonwose…

4. Bubble Navigation

FloatingTopBarActivity TopBarActivity
BottomBarActivity EqualBottomBarActivity

Bubble Navigation is a lightweight library that makes it easy to create beautiful Navigation bars with a large number of custom options.

It has many unusual features:

  • Two types of NavigationViews for different use cases:

    • BubbleNavigationConstraintView (support spreadspread, inside, and the packed moss)

    • BubbleNavigationLinearView (allowing evenly, weight or the packed mode)

  • Highly customizable

  • You can add little red dots with BubbleToggleView to create new UI components, not just navigation

Example:

<com.gauravk.bubblenavigation.BubbleNavigationConstraintView
        android:id="@+id/top_navigation_constraint"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="380dp"
        android:background="@color/white"
        android:elevation="4dp"
        android:padding="12dp"
        app:bnc_mode="spread">

        <com.gauravk.bubblenavigation.BubbleToggleView
            android:id="@+id/c_item_rest"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:bt_active="true"
            app:bt_colorActive="@color/search_active"
            app:bt_colorInactive="@color/search_inactive"
            app:bt_icon="@drawable/ic_restaurant"
            app:bt_shape="@drawable/transition_background_drawable_restaurant"
            app:bt_title="@string/restaurant"
            app:bt_padding="@dimen/internal_padding"
            app:bt_titlePadding="@dimen/title_padding" />

         <! -- Add more child items here - max upto 5 -->
    
    </com.gauravk.bubblenavigation.BubbleNavigationConstraintView>
Copy the code

Github documentation is complete, with many examples. For more usage and properties, go to Github.

Github:github.com/gauravk95/b…

5. FabFilter

This is an interesting project, not a directly usable library, but a sample application that demonstrates advanced UI animation with and without MotionLayout.

For detailed implementation details, see the Medium article series:

“Complex UI/Animations on Android”

“Complex UI/Animations on Android — featuring MotionLayout”

Github:github.com/nikhilpanju…

6.android-showcase

Android-showcase is a great open source project that is a showcase application that shows how to develop an APP using Kotlin and the latest Jetpack technology stack.

The project brings you a range of best practices, tools and solutions:

  • 100% Kotlin
  • (Feature modules, clean Architecture, model-view-viewModel, model-view-Intent)
  • Android Jetpack components
  • In single Activity mode, use Navigation

After reading this project, you will be inspired in modularity, Clean architecture, testing, setting up CI/CD tools, and more. Thanks to the author for open source.

Github:github.com/igorwojda/a…

7. Croppy

Croppy is an Android image cropping library.

It has many powerful features:

  • Double refers to zoom
  • Cut to any size
  • Cut in proportion to length and width
  • Displays the cropped Bitmap
  • Automatic center cutting
  • Full animation experience

See Github for more details.

Making: github.com/lyrebirdstu…

8. RubberPicker

A cool and fun SeekBar animation library.

The RubberPicker library contains RubberSeekBar and RubberRangePicker, inspired by Cuberto’s iOS RubberRangePicker.

Example:

Configuration in the layout file

<com.jem.rubberpicker.RubberSeekBar
  .
  app:minValue="20"
  app:maxValue="80"
  app:elasticBehavior="cubic"
  app:dampingRatio="0.3"
  app:stiffness="300"
  app:stretchRange="24dp"
  app:defaultThumbRadius="16dp"
  app:normalTrackWidth="4dp"
  app:highlightTrackWidth="8dp"
  app:normalTrackColor="#AAAAAA"
  app:highlightTrackColor="#BA1F33"
  app:defaultThumbInsideColor="#FFF"
  app:highlightDefaultThumbOnTouchColor="#CD5D67"/>

<! -- Similar attributes can be applied for RubberRangePicker as well-->
<com.jem.rubberpicker.RubberRangePicker
  .
  app:minValue="0"
  app:maxValue="100"
  app:elasticBehavior="linear"
  app:dampingRatio="0.4"
  app:stiffness="400"
  app:stretchRange="36dp"
  app:defaultThumbRadius="16dp"
  app:normalTrackWidth="4dp"
  app:highlightTrackWidth="8dp"
  app:normalTrackColor="#AAAAAA"
  app:highlightTrackColor="#BA1F33"
  app:defaultThumbInsideColor="#CFCD5D67"
  app:highlightDefaultThumbOnTouchColor="#CD5D67"/>
Copy the code

Or, dynamically configure in code:

val rubberSeekBar = RubberSeekBar(this)
rubberSeekBar.setMin(20)
rubberSeekBar.setMax(80)
rubberSeekBar.setElasticBehavior(ElasticBehavior.CUBIC)
rubberSeekBar.setDampingRatio(0.4 F)
rubberSeekBar.setStiffness(1000F)
rubberSeekBar.setStretchRange(50f)
rubberSeekBar.setThumbRadius(32f)
rubberSeekBar.setNormalTrackWidth(2f)
rubberSeekBar.setHighlightTrackWidth(4f)
rubberSeekBar.setNormalTrackColor(Color.GRAY)
rubberSeekBar.setHighlightTrackColor(Color.BLUE)
rubberSeekBar.setHighlightThumbOnTouchColor(Color.CYAN)
rubberSeekBar.setDefaultThumbInsideColor(Color.WHITE)

val currentValue = rubberSeekBar.getCurrentValue()
rubberSeekBar.setCurrentValue(currentValue + 10)
rubberSeekBar.setOnRubberSeekBarChangeListener(object : RubberSeekBar.OnRubberSeekBarChangeListener {
    override fun onProgressChanged(seekBar: RubberSeekBar, value: Int, fromUser: Boolean) {}
    override fun onStartTrackingTouch(seekBar: RubberSeekBar) {}
    override fun onStopTrackingTouch(seekBar: RubberSeekBar){}})//Similarly for RubberRangePicker
val rubberRangePicker = RubberRangePicker(this)
rubberRangePicker.setMin(20)... rubberRangePicker.setHighlightThumbOnTouchColor(Color.CYAN)val startThumbValue = rubberRangePicker.getCurrentStartValue()
rubberRangePicker.setCurrentStartValue(startThumbValue + 10)
val endThumbValue = rubberRangePicker.getCurrentEndValue()
rubberRangePicker.setCurrentEndValue(endThumbValue + 10)
rubberRangePicker.setOnRubberRangePickerChangeListener(object: RubberRangePicker.OnRubberRangePickerChangeListener{
    override fun onProgressChanged(rangePicker: RubberRangePicker, startValue: Int, endValue: Int, fromUser: Boolean) {}
    override fun onStartTrackingTouch(rangePicker: RubberRangePicker, isStartThumb: Boolean) {}
    override fun onStopTrackingTouch(rangePicker: RubberRangePicker, isStartThumb: Boolean){}})Copy the code

See Github for more details.

Github:github.com/Chrisvin/Ru…

9. Switcher

A cool Switcher animation library, is really too cute, I have written a special article about it:

Cool! I’ve never seen a Switcher with a bomb like that

It was inspired by Oleg Frolov’s design on Dribble.

Making: github.com/bitvale/Swi…

10. StfalconImageViewer

StfalconImageViewer is an image viewing library that is simple and customizable. It includes a full-screen image viewer with shared image transition support, pinching and zooming, and swiping gestures to close gestures.

Github documentation explains how to use each feature. Also worth noting: the library is compatible with all the most popular image processing libraries (e.g. Picasso, Glide, etc.).

All configurable items are as follows:

StfalconImageViewer.Builder<String>(this, images, ::loadImage)
            .withStartPosition(startPosition)
            .withBackgroundColor(color)
            //.withBackgroundColorResource(R.color.color)
            .withOverlayView(view)
            .withImagesMargin(R.dimen.margin)
            //.withImageMarginPixels(margin)
            .withContainerPadding(R.dimen.padding)
            //.withContainerPadding(R.dimen.paddingStart, R.dimen.paddingTop, R.dimen.paddingEnd, R.dimen.paddingBottom)
            //.withContainerPaddingPixels(padding)
            //.withContainerPaddingPixels(paddingStart, paddingTop, paddingEnd, paddingBottom).withHiddenStatusBar(shouldHideStatusBar) .allowZooming(isZoomingAllowed) .allowSwipeToDismiss(isSwipeToDismissAllowed) .withTransitionFrom(targeImageView) .withImageChangeListener(::onImageChanged) .withDismissListener(::onViewerDismissed)  .withDismissListener(::onViewerDismissed)Copy the code

See Github for more details.

Making: github.com/stfalcon-st…

11. Broccoli

Broccoli is a show View Loading library, also known as a skeleton screen, which displays a placeholder when content is loaded.

The library with a very smooth animation effect, you can use RecyclerView together, waiting for the load of content, no longer boring.

Example:

Broccoli broccoli = new Broccoli();

//add the default style placeholder
broccoli.addPlaceholders('activity'.'view_id'.'view_id'); 

or 
//add the default style placeholder
broccoli.addPlaceholders('view1'.'view2'.'view3'); 

or 

//add the custom style placeholder
broccoli.addPlaceholder(new PlaceholderParameter.Builder()
                        .setView('view')
                        .setAnimation('scaleAnimation');
                        .setDrawable(DrawableUtils.createRectangleDrawable(placeHolderColor, 0))
                        .build()); 

or
//add the custom style placeholder with gradient animation
broccoli.addPlaceholder(new PlaceholderParameter.Builder()
                        .setView('view')
                        .setDrawable(new BroccoliGradientDrawable(Color.parseColor("#DDDDDD"),
                            Color.parseColor("#CCCCCC"), 0.1000.new LinearInterpolator())
                        .build()); 
broccoli.show();
Copy the code

See Github for more.

Making: github.com/samlss/Broc…

12. Orbit MVI

Model-view-intent (MVI) framework for Kotlin and Android. It was inspired by Jake Wharton, RxFeedback, and Mosby’s “Managing State with RxJava”.

According to ReadMe:

Orbit provides the smallest possible structure around your Redux implementation to make it easy to use, but you can still use the power of RxJava.

A Redux system might look like this:

data class State(val total: Int = 0)

data class AddAction(val number: Int)

sealed class SideEffect {
    data class Toast(val text: String) : SideEffect()
}

class CalculatorViewModel : OrbitViewModel<State, SideEffect> (State(), {

    perform("addition")
        .on<AddAction>()
        .sideEffect { post(SideEffect.Toast("Adding ${event.number}")) }
        .reduce {
            currentState.copy(currentState.total + event.number)
        }

    ...
})
Copy the code

Activity/fragment:

// Example of injection using koin, your DI system might differ
private val viewModel by viewModel<CalculatorViewModel>()

override fun onCreate(a){... addButton.setOnClickListener { viewModel.sendAction(AddAction) } }override fun onStart(a) {
    viewModel.connect(this, ::handleState, ::handleSideEffect)
}

private fun handleState(state: State){... }private fun handleSideEffect(sideEffect: SideEffect) {
    when (sideEffect) {
        is SideEffect.Toast -> toast(sideEffect.text)
    }
}
Copy the code

See Github for details.

Making: github.com/babylonheal…

13. IndicatorScrollView

IndicatorScrollView IndicatorScrollView

The library adds logic to NestedScrollView so that it can change dynamically to respond to indicators as it scrolls.

The README file contains all the information needed to start the project, such as how to use IndicatorScrollView, IndicatorView, and IndicatorItem. It is currently available as version 1.0.2 under the Apache 2.0 license. It supports API 16 and later.

The documentation sample is detailed, but see Github for more information.

Making: github.com/skydoves/In…

14. Cyanea

Cyanea is an Android theme engine library.

It allows you to change app themes dynamically. It has many built-in themes such as:

  • Theme.Cyanea.Dark
  • Theme.Cyanea.Dark.LightActionBar
  • Theme.Cyanea.Dark.NoActionBar
  • Theme.Cyanea.Light
  • Theme.Cyanea.Light.DarkActionBar
  • Theme.Cyanea.Light.NoActionBar

See Github for more details.

Making: github.com/jaredrummle…

15. Android MotionLayout Carousel

This is an example project that shows how to use MotionLayout to implement a cool rotation diagram.

The documentation is almost nonexplanatory, but if you’ve been exploring MotionLayout lately, this is a good example.

Making: github.com/faob-dev/Mo…

conclusion

These are the open source project recommendations of this issue. If you have fun, interesting and powerful open source projects, you can also recommend them to Seeger, welcome to leave a comment in the comment section.

The article was first published on the public account: “Technology TOP”, there are dry articles updated every day, you can search wechat “technology TOP” first time to read, reply [mind map] [interview] [resume] yes, I prepare some Android advanced route, interview guidance and resume template for you