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
2
votes
4 answers

Can I create a reusable component in an Android XML layout?

This is a simple question of code efficiency, while I'm learning more about layouts. I'm creating a grid of checkboxes, and each one has the same attributes for the most part. Each checkbox has 8 attributes, 5 of which are the same for each one. Can…
Aaron Warnecke
  • 171
  • 1
  • 1
  • 8
2
votes
1 answer

Difference between disabling package vs disabling activity using package manager

The following answer shows an example of disabling an activity. But in few places I've seen disabling package completely. Disabling activity PackageManager pm = getPackageManager(); pm.setComponentEnabledSetting(new ComponentName(this, …
2
votes
2 answers

Custom Listener for Compound component

I wrote a compound component and was adding a custom listener to react. Inside the class for the compound component which uses an xml file. public class VerticalCounterBlock extends LinearLayout { public interface VerticalCounterBlockListener…
1
vote
1 answer

Android Jetpack Compose Grid looking view

My screen is divided into 3 main parts, currently (I guess that probably there is a better approach): First part is showing data. It's divided into 9 almost identical items which to show different live(regular changing data). They are now in 3…
1
vote
0 answers

While setting Minimum date for one year calendar is showing hidden date in the calendar header

I set a minimum date to the DatePicker (#setMinDate) and though dates before the minDate are not displayed, there's a bug that if i change the year to past year (with same date as current day), and press OK, the date chosen is a date before the…
1
vote
4 answers

Android Navigation - Hide action bar for loading/splash screen?

I am wondering if there is a good pattern/method for hiding the action bar for splash/loading screens?? I understand the pattern isn't great, but we are retrofitting an existing app that uses patterns like this. Regardless, this would seem like a…
1
vote
1 answer

Action is not generated in FragmentDirections when Fragment is used in a second nav graph

FragmentA is used in nav_graph_first and all the respective action methods/navigations are created in FragmentADirections but when FragmentA is used in nav_graph_second additional navigations are not generated in FragmentADirections. Why? Is this a…
1
vote
1 answer

Android - compare between button background to Resource

I'm trying to compare between button background to resource file. For exmaple, I have button BUTTON
1
vote
2 answers

Android Fragment isAdded returns false and getActivity is null after posting thread in the onResume method

So i am using Navigation in my main activity of my app and i have a fragment which is my start navigation fragment. In this fragment, after it is created, in my presenter i post a thread to fetch data from the network. After data have been fetched,…
1
vote
1 answer

AutoSizeTextTypeUniform not working on samsung

I have a simple layout containing some views. This TextView has android:layout_width="match_parent" android:layout_height="wrap_content" The autosizing is set programmatically like so.. if (Utils.isOreoOrGreater()) { …
Kyle
  • 695
  • 6
  • 24
1
vote
0 answers

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1af09f8 in tid 4357

And here it is the error trace.... 2019-05-16 10:08:52.266 4469-4469/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 2019-05-16 10:08:52.266 4469-4469/? A/DEBUG: Build fingerprint:…
zapotec
  • 2,628
  • 4
  • 31
  • 53
1
vote
0 answers

Hiding other apps from mine - how to?

I want to make an application that can hide others, such as: https://play.google.com/store/apps/details?id=com.thinkyeah.apphider I have this code, but it only works to hide my own app: PackageManager p = getPackageManager(); ComponentName…
1
vote
0 answers

Enforce creation and execution of activities in the current Android process

Let's assume that there are 3 activities namely ActivityA, ActivityB and ActivityC. The…
1
vote
0 answers

unable to start Custom Component "AppCompatEditText" class

I am trying to create a custom AppCompactEditText, which I have created. I also created a sample app to test my custom component. However, When I call/input my custom edit text from the xml of sample app, It crashes and gives an error…
1
vote
1 answer

Can not remove entity from Room

I have LoggedInUserEntity and UserRecentSearch where the last one has foreignKeys to LoggedInUserEntity. When I want to delete LoggedInUserEntity it is possible if only no UserRecentSearch are in database. How do i delete? @Query("DELETE FROM…