Category "android-jetpack"

Jetpack Compose - Column - Gravity center

I'm creating a layout with Jetpack Compose and there is a column. I would like center items inside this column: Column(modifier = ExpandedWidth) { Tex

How can i add a Toolbar in Jetpack Compose?

I need to add a Toolbar in my Android application with a List like below. I am using Jetpack Compose to create the UI. Below is the composable function i am usi

How to draw a circular image in Android Jetpack Compose?

Let's say I have a rectangular avatar image like the one below, how can I force it to be drawn as a circle in Jetpack Compose?

How to show keyboard with Jetpack Compose?

How can I slide in the keyboard? I tried: val keyboardController: SoftwareKeyboardController? = LocalSoftwareKeyboardController.current keyboardController?.sh

How to create an instance of Room Dao or Repository or Viewmodel in GlanceAppWidget class using Jetpack Compose

I am trying to load list of data in App Widget using jetpack compose and i have stored in Room Local database, how i can retrive the data in GlanceAppWidget cla

Jetpack Compose: Custom TextField design

In general, most components in Jetpack Compose seem to be very easy to customize. However, the same cannot be said for the TextField. For example, say that I wa

how to get viewModel by viewModels? (fragment-ktx)

I am working with Single viewModel for the Activity and all of it's fragment. So to initialise viewmodel if have to write this setup code in onActivityCreated

Room database - edit entities

I have a question. I edited my Room entity from this: @Entity(tableName = "users") public class User { public User(String username, String email, String passwo

Room database - edit entities

I have a question. I edited my Room entity from this: @Entity(tableName = "users") public class User { public User(String username, String email, String passwo

How to add/remove characters inside TextField?

I have a Room database with a table that holds users. Each user has an ID and a name. My goal is to change the name of the user based on the ID. Here is what I

Android: no start destination defined via app:startDestination for x.x.x:id/nav_graph

In the nav_graph even though I have used, I get warning project level gradle: // Top-level build file where you can add configuration options common to all

Android Jetpack Navigation - Custom Action with Drawer Item

I am using the new Jetpack Android Navigation in combination with a Drawer Layout. Everything is working as expected when using the same IDs in the Drawer XML i

What is the Jetpack Compose equivalent of RecyclerView or ListView?

In Jetpack Compose, how can I display a large list of data while laying out only the visible items, instead of composing and laying out every item on the initia

State of nested Fragments is lost when returned to same tab in 'Navigation Architecture Component'

I'm exploring the the 'Navigation Architecture Component' concept which introduced in Google I/O 2018 last month. Let say I have an activity with a bottom nav

Does Android Jetpack Compose support Toolbar widget?

I'd like to use Toolbar with Jetpack Compose. Does it have such a Composable component?

Do I still need to use traditional way to implement Preferences Settings Screen in Jetpack Compose?

At present I use Jetpack Compose in my Android Studio project. I find many projects still to use traditional way to implement a Preferences Settings Screen afte

Jetpack Compose navigate for result

I'm using the Jetpack Navigation library with the Compose version. I'm setting up navigation like it's shown here I want to be able to navigate from screen A to

How to upgrade an Android project to Java 11

I am using the latest Android Studio Arctic Fox 2020.03.01 Canary 8 and AGP 7, and I want to convert my project to use Java 11. Apparently just doing the follow

How to know if Text is visible on Jetpack Compose?

I have a scrollable screen and I would like to do action when a specific text appears/disappears in that screen. Is there any way to do that? Thanks

How to show ellipsis (three dots) at the end of a Text line in Android Jetpack Compose?

Whether I use androidx.compose.foundation.text.BasicText or androidx.compose.material.Text, if there isn't enough space for a text it wraps to the next line, fo