Author name: Laura Prata

Kotlin collections and mutability
Articles, Tutorial

Kotlin Mutable and Immutable Collections

In this article I would like to emphasise over a few options that we have when working with data structure and more precisely with collections in a mutable and immutable fashion. So let’s start with a few of them and see their mutability state. But first, what makes a list mutable or immutable? Immutable Collections

, , , ,
Tutorial

Android Simple Section RecylerView

In this tutorial I will create a simple Sectioned RecyclerView that will show 2 sections and a few items in each section and how to move an item from one section to another. Note: For RecyclerView I used AndroidX imports and not android.support.v7.widget.RecyclerView Setup We need to import the recycler view from AndroidX. The build.gradle

, , , ,
Solutions

Android Squared CardView

Recently, I had to add a perfect squared CardView and I wanted to achieve this without hardcoding its width and height. I happily discovered the power of ConstraintLayout. And so this is how I managed to create a perfect square which should work on every dimension. Heres some sample code that I used to create

, , ,
Solutions, Tutorial

Xamarin Forms: ActivityIndicator Size

We all will need at some point to show an activity indicator when our app has to perform lenghty data processing operations or when we have to wait for our app to load content. In Xamarin Forms we can use in a xaml file this property called ActivityIndicator. Below is the result of the above

, , ,
Tutorial

Xamarin Forms: Circle With Label No Renderer

In your application you might need to create a Circle image with a text inside it or just a simple circle that needs different colors for status for example. In this case we can use a Frame and add CornerRadius property like this: As you can see, there are more properties added like HasShadow or

, , , , ,
Uncategorized

Xamarin Forms: Label LineBreakMode

You can set a LineBreakMode attribute to a Label that can have the following values: TailTruncation HeadTruncation MiddleTruncation CharacterWrap WordWrap NoWrap TailTruncation If you have a text that is to large to fit the width of your label, you can use the attribute called LineBreakMode=TailTruncation. This will display a text with “…” at the end

Solutions, Tutorial

Kotlin RecyclerView with Click Listener

Create a RecyclerView in Android with Kotlin – A Step-by-Step Guide In today’s tutorial we’ll learn how to create a RecyclerView in Kotlin for Android with items that are clickable. This approach, distinct from the traditional ListView, offers a more dynamic and flexible way to display a scrollable list. Read on to discover how to

Solutions, Tutorial

ListView with ViewHolder in Kotlin

In this post we will create a ListView with ViewHolder adapter but we will write the code in Kotlin. For creating xml files for ListView and list items, follow the steps from this post. Next, you have to create a new Kotlin class for the adapter. Name the new created file MyCustomAdapter MyCustomAdapter.kt import android.content.Context import

Tutorial

Kotlin – for, while, if, when

Control flow: for, while, if, when This post is for beginners who want to start learning Kotlin language and already know Java. We will show simple examples of for, while, if, when in both languages, in parallel, for an easier understanding. We will use Log.e in order to print string messages, as from our point of view,

, , , , , , , , , , ,
Snippets, Solutions

Android Show HTML Bulleted List from strings.xml

If you search on the internet about how to show a bulleted list from strings.xml using HTML tags, most of the answers will say that you should use a WebView, or to use the bullet symbol directly, or other alternatives. And on some posts I even read that you can’t use <li> tag from HTML

, ,
Scroll to Top