Category "android-jetpack"

How to select all items listed in Recyclerview using androidx.recyclerview.selection?

I am using androidx.recyclerview.selection for selecting items in a RecyclerView. I am trying to build an edit fragment in which it pre-populates the old views

Duplicate class com.google.android.a.a found in modules?

I tried adding Installreferrer to my app after adding it to gradle, when rebuilding the app. I'm getting this error. Duplicate class com.google.android.a.a foun

Jetpack Compose Place every question in it's own screen

I have a JSON data looking like this questions: [ { id: "1", question_type: "FREE_TEXT", answer_type: "SINGLE_LINE_TEXT", question_text: "what's your name?", op

Sending an ID or an object as String to the next screen in Jetpack Compose?

I have 30 users displayed in a LazyColumn. On user click, I navigate forward to UserDetailsScreen. My question, is it better to pass the ID of the user and crea

Type 'State<List<User>?>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate

I'm trying to get a value from LiveData with observeAsState in jetpack compose, but I get a weird error Type 'State<List?>' has no method 'getValue(Nothi

Manually clearing an Android ViewModel?

Edit: This question is a bit out of date now that Google has given us the ability to scope ViewModel to navigation graphs. The better approach (rather than tryi

TextField is hiding under the keyboard when focused

I have a problem with TextField that is hiding under the keyboard, I've found the answers for the similar question here, but they are not helping me in my case.

ViewPager2 crash

I am using Advance Navigation Component with BottomNavigationView. In one tab I have ViewPager2. When I clicked on the tab for the first time, it worked fine. A

How to align title at layout center in TopAppBar?

TopAppBar( backgroundColor = Color.Transparent, elevation = 0.dp, modifier= Modifier.fillMaxWidth(), navigationIcon = {

Set Drawable instance to Image in Jetpack Compose

In Jetpack Compose, who can tell me is there a way to assign a Drawable Object to the Image compose view? I took the apps installed on an Android device. I get

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