View binding Delegation

Since Kotlin Android Extensions, including Kotlin synthetics, is deprecated we forced to use View Binding. To find out how to Migrate from Kotlin synthetics to Jetpack view binding follow the link.

When you are done, you will find yourself with additional boilerplate code in each fragment. Inspired by this article Simple one-liner ViewBinding in Fragments and Activities with Kotlin I’ve created a little bit modified version of the fragment one-line view binding solution.

Keep Reading

Kotlin logging library – First Medium post

I’m happy to share with you my new article at @AT&T Israel R&D Center Medium blog >>> https://bit.ly/2Noc2SO
The default logging solution is minimal, and I believe that most of us have already written a wrapper class and copied it from project to project.
Originally I created my Logging library in Java and recently I converted it to Kotlin. Now I want to share it with you.

Kotlin DSL tutorial (simplified)

If you are reading this, I assume that you have reached the same point as I have in the past and you decided to dig a little bit and understand what Kotlin DSL is all about.

Upon googling it, I found the following post that explains this topic pretty well. If you wonder why this post exists, it’s because here I’ll try to explain the same topic with the same code example, but in a more detailed manner. I decided to do so because it took me a while to understand it myself and I’d like to simplify it for you.

The whole solution is available in the following file: Github

Keep Reading

Mock final classes on Kotlin

internal class Foo {
    internal fun bar(x: Int, y: Int, zip: Zip) = x + y + zip.doIt()
}
internal class Zip {
    internal fun doIt() = 0
}

When we have two classes like above and try to mock Zip class like below:

Keep Reading

Windows batch file – Short tutorial + Run tests from multiple modules

Let’s start with some batch basics. If you are already familiar with them skip this section.

  • @echo off – Should be added at the top of your batch script to prevent printing all commands.
  • echo Some text Output: “Some text”
  • echo. – Empty line
  • set /a index=0 – Set numeric variable
  • echo Index is %index% – Output: “Index is 0”
  • Rem It is a comment
  • :: It is a comment too
  • echo Some text>> test.txt – Write “Some text” to test.txt file.
Keep Reading

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