Questions tagged [android-components]

The Material Components for Android library helps developers execute Material Design

This tag is for questions about the Material Components for Android.
The Material Components for Android help developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Android apps.

Material Components for Android is a drop-in replacement for Android's Design Support Library.

52 questions
1
vote
1 answer

SQL delete where NOT IN doesn't work

I am using room dao from Android Components. What i need: insert list, but before - delete all Data from db whose id is different from id from the new list. here is my simple Data class: class Data{ String id; //unique for each data class …
Andriy Antonov
  • 1,360
  • 2
  • 15
  • 29
1
vote
0 answers

android mvvm room database deep structure

I am a beginner in android.I am trying to develop an app with new android MVVM Architecture. With reference to google sample code of GitHub below: https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample I am…
Amar Ubhe
  • 101
  • 6
1
vote
1 answer

How to save POJO with the Relation annotation in Room Peristence Library?

I am currently playing with Room in order to compare it with Realm and I already have so many question about the best way to do things. In my sample app, I have a really simple model in which one a Person can have Cats and Dogs. Here the java…
rolandl
  • 1,769
  • 1
  • 25
  • 48
1
vote
1 answer

Why Android Service was made as an another application components?

As for the other application components like activities,Intent, Broadcast Receiver, i can understand their use case but whatever use case of Service is written in the documentation can be achieved using simple Java class having static members…
1
vote
1 answer

How to deal with the third party component dependencies conflict with react native or other component?

Now I am writing a android app with react native 0.13.2, and I want to use some third party components. but those components might be developed base on react native 0.16.0 or other version of react native. For example: My android app is based on…
0
votes
0 answers

To snap each item in a vertical RecyclerView to the top of the screen

I used vertical recyclerView with snap helper. Everything is ok. but i want to constraint each item to top of screen instead of center of screen. val snapHelper = LinearSnapHelper() snapHelper.attachToRecyclerView(binding.mainRcv) In this code,…
kadirgun
  • 151
  • 1
  • 6
0
votes
2 answers

Android Java: How to get component in a custom view? (Trying to access components via findByViewId and get null)

Trying to access components via findByViewId and get null The problem is in this line: (I cannot connect my viewxml to the class) // HERE I GET NULL **_addButton = context.findViewById(R.id.buttonAdd);** I have an activity: with this…
0
votes
0 answers

Android - imageView.background.setTint() changes color of background drawable throughout the application

We have an imageView whose background has a vector asset drawable(ic_star.xml). When I change the background tint of this imageView programatically with a custom color like below, it causes to change the color of imageViews on other pages using this…
tugceaktepe
  • 195
  • 1
  • 2
  • 17
0
votes
2 answers

How to set toolbar title from fragment using Navigation UI Component

I have an activity with a toolbar from a default layout in Android Studio and I can easily change the title in the toolbar through the following method: Bundle bundle = new Bundle(); bundle.putString("toolbarTitle", "A new title"); …
Shadow
  • 4,168
  • 5
  • 41
  • 72
0
votes
3 answers

BottomNavigationView background color with opacity not working properly

I've implemented BottomNavigationView with navigation graph. while setting a solid colour in navigationView as a background, it's working fine but when I set background colour with opacity it's not working properly. Here is my gradle…
0
votes
2 answers

Android Two Way Databinding working only one way

I have ViewModel: class MyViewModel : ViewModel(){ private val _user = MutableLiveData("") val user: LiveData = _user fun onBtnClick(){ Log.i("MyViewModel", "user: ${_user.value}") } } I connected it with fragment…
0
votes
1 answer

Android - Cycling through Images component

I'm looking for a component like this: If you have used Tinder, i want something like when you view a profile, how you can cycle through their pictures. I'm pretty sure i can implement this manually, but was wondering if something already exists,…
AskQuestions
  • 173
  • 6
0
votes
1 answer

What triggers LiveData onChanged()?

I'm using Room and in the Dao I have this method: LiveData> getAllBooks(); In MainActivity I have subscribed to that method from the ViewModel. Changes to the data trigger the onChanged() callback: viewModel.getAllBooks() …
dfasdflskladf
  • 101
  • 1
  • 6
0
votes
1 answer

kotlin-android-extensions stop working if lifecycle-extensions is included in gradle

After adding the Android lifecycle component to my project with the following line: implementation("androidx.lifecycle:lifecycle-extensions:$lifecycleVersion") in my app's build.gradle.kts file all the import kotlinx.android.synthetic stop working,…
0
votes
2 answers

Compose a button to use in various parts of my project

I've a button and i need to use this same button with same proprieties in all my projects and i want to create a component to just call this component and if i need to change my button, change in just one class do change all the uses. I have this…