Picasso vs Glide vs Coil

Points of comparison:

  • Methods count
  • Size
  • GIF support

GitHub links and versions I used: Picasso, Glide, Coil. (2.71828, 4.9.0, 0.6.1)

Release date: Picasso and Glide were first released in 2013. And Coil is very young, released on 12 August 2019.

Methods count

How many methods each of them will add to your project (proguard enabled):

Keep Reading

Navigation Component: How to move the Drawer under the ToolBar?

Navigation Drawer Activity Template

Recently I was struggling with Navigation Component and succeded in solving some of its issues. I am happy to share with you the solutions I’ve found.

GitHub Repo: https://github.com/Pulimet/NavigationComponentSample

Create a project and select the template “Navigation Drawer Activity”. You will get the ToolBar, Drawer and navigation stuff for free as shown in the screenshot.

Now, let’s assume that we got a request to move the drawer under the ToolBar. We need to modify activity_main.xml for that.

Create vertical LinearLayout and make it wrapping DrawerLayout

Open app_bar_main.xml copy AppBarLayout and paste it as a first item in the previously created LinearLayout.

Also from the app_bar_main.xml get the include (content_main) and put it as a first child of DrawerLayout instead of existing include of app_bar_main.xml.

Delete app_bar_main.xml file

In v21\styles.xml – remove the line that makes status bar transparent.

Keep Reading

Gradle – How to open folder with generated APK?

android {
    applicationVariants.all { variant ->
        variant.outputs.all {
            def flavor = variant.productFlavors[0].name
            if (flavor == 'prod') { // Open folder for specific flavor
                variant.assemble.finalizedBy openFolderWithApk
            }
        }
    }

    task openFolderWithApk(type:Exec) {
        workingDir '../app/prod/release/' //Update flavor and buildType
        commandLine 'cmd', '/c', 'start .' //on windows
    }
}

Change output apk name using build.gradle

Output result:  AppNameProd4.1.2_050718.apk

android {
    applicationVariants.all { variant ->
        variant.outputs.all {
            def flavor = variant.productFlavors[0].name.capitalize()
            def version = variant.versionName
            def date = new Date()
            def formattedDate = date.format('ddMMyy')
            outputFileName = "AppName${flavor}${version}_${formattedDate}.apk"
        }
    }
}

Keep Reading

Dagger 2

Simple and funny tutorial about dependency injection library Dagger 2.

In other words, manually managing the dependency injection is like, mining the dragon glass — taking permission from the dragon queen and then forging them as weapons and then to go and fight with the White Walkers (hard dependency issues). Dagger 2 framework is like the valyrian swords — it’s been created by masters and all you need is to just wield it.

https://medium.com/@harivigneshjayapalan/dagger-2-for-android-beginners-introduction-be6580cb3edb