3,025 questions
0
votes
0
answers
36
views
When using Material 3's Dynamic Color feature, almost all text in my app becomes too faded
My goal is to make text with Dynamic Color enabled more bright and readable, like how it looks without the Dynamic Color. I know that I can set text color programmatically, but this is an approach, ...
0
votes
1
answer
60
views
Does enableEdgeToEdge() override windowOptOutEdgeToEdgeEnforcement flag?
I'm working with Android 15's edge-to-edge enforcement and need clarification on how enableEdgeToEdge() interacts with the windowOptOutEdgeToEdgeEnforcement theme attribute.
Setup
In my theme:
<...
1
vote
0
answers
79
views
Cannot place attributionTag anywhere in the manifest
Im having an issue where attributionTag not declared in manifest of com.my.package is appearing in my logcat when i play audio using the MediaPlayer.
Based on the Android documentation and other ...
2
votes
1
answer
73
views
How does VectorDrawable scaling affect rendering performance?
I’m trying to understand how VectorDrawable rendering works in Android in terms of performance.
Suppose I have a vector resource defined like this:
<vector
xmlns:android="http://schemas....
0
votes
0
answers
44
views
ConstraintLayout Flow is not wrapping views as expected
I'm maintaining legacy app which is still using XMLs and oldschool Views.
I have androidx.constraintlayout.helper.widget.Flow component which has constraint_reference ids to other Views.
Those other ...
0
votes
0
answers
38
views
Proguard Rules for jackson-dataformat-xml
I am implementing Jackson with this dependencies
implementation ('com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.18.2')
implementation 'javax.xml.stream:stax-api:1.0-2'
https://...
0
votes
0
answers
48
views
Why textview is not appearing on Gif when using Glide?
I have an ImageView, and below it, there is a TextView. Both are inside a ConstraintLayout.
The ImageView can display either a GIF or a normal image.
The TextView appears fine when I use a normal ...
0
votes
0
answers
26
views
How to change menu actionitem background Color?
Ok I feel like an idiot,
my menu action item has this dark color that does not even exist in my theme,
But my menu_item xml is setting it to be a tan color,
xmlns:app="http://schemas.android....
10
votes
3
answers
3k
views
windowSoftInputMode adjustResize doesn't work in target sdk 35
When I increased the target SDK of the app from 34 to 35, the windowSoftInputMode in adjustResize mode no longer worked. I have tested everything and found that it is only related to the target SDK. ...
0
votes
1
answer
81
views
Constraint layout Y position not matching the margin value
I'm facing some sort of trouble setting constraint on a view on runtime with a margin.
These are the y and margin coordinate when the view is displayed to the user
I set the margin like that :
...
1
vote
1
answer
133
views
Possibility on Migrating Old Huge Project into Jetpack Compose
So, I was developing this huge app back in 2020 or so, still using xmls and all of that, and then I'm out. Now, I want to continue working on that app, but I've seen things changed drastically with ...
0
votes
1
answer
60
views
Cannot display an image in Constraint Layout
I have this xml but the image is only shown when I hard the width and height of the image. I am not sure why the constraints as I provided in the code are not working.
<merge
xmlns:android=&...
6
votes
1
answer
4k
views
How NOT to create projects with Jetpack Compose using Android Studio
I can't create a normal project without jetpack-compose, it always includes its libraries and configurations in Android Studio, and the working project requires not using it.
I expected it to open ...
0
votes
0
answers
47
views
SVG Image doesn't show up when I use app:srcCompat but works fine when I use android:src
I downloaded and Added an SVG file to my Project's Drawable Directory. When I used it in my Layout with app:srcCompat, the Image doesn't get displayed. I even added the VectorDrawables....
-1
votes
1
answer
81
views
I want to make a Weekday Picker that will take all the space available according to the device
I want to create a Weekday Picker that will utilize all the available space on the device.
Here is what I have done till now. How can I make it adaptive? How can I improve its appearance?
This is my ...
0
votes
2
answers
95
views
Fatal Exception: android.content.res.Resources$NotFoundException: Drawable org.radarcns.detail:drawable/status_searching with resource ID #0x7f080130
I am getting the exception:
Fatal Exception: android.content.res.Resources$NotFoundException: Drawable org.radarcns.detail:drawable/status_searching with resource ID #0x7f080130
Caused by android....
0
votes
1
answer
80
views
MaterialAutoCompleteTextView automatically shows dropdown when changing theme
I'm using MaterialAutoCompleteTextView to display a dropdown list for selecting a theme.
xml:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/...
0
votes
1
answer
43
views
TextInput displaying too narrow on phones with a small screen size
In the following xml, 'message_entry' displays too narrow on a small screen (240 x 320), but displays fine on a larger screen (480 x 640).
<androidx.cardview.widget.CardView
android:id="@+...
0
votes
0
answers
38
views
How do I implement the UI as in the image below using constraint layout with XML in android studio?
how do I implement the below UI using constraint layout with xml in android studio?
1
vote
1
answer
66
views
Prevent Snackbar Overlap with FloatingActionButton in ConstraintLayout of Activity's Child Fragment
This is my current Setup:
I have a BaseActivity that registers the snackbar on the root layout (CoordinatorLayout):
<?xml version="1.0" encoding="utf-8"?>
<androidx....
1
vote
1
answer
67
views
Customise switch appearance in AndroidX preference activity
Summary: How do I customise/style the colour and appearance of AndroidX switch preferences?
Detail: Simplifying a bit, I have an Android app that uses the AndroidX preference classes. My preference ...
2
votes
1
answer
213
views
Per-app language preferences - get list of app's available language programmatically?
So based on https://developer.android.com/guide/topics/resources/app-languages#kotlin
we can use
android {
androidResources {
generateLocaleConfig = true
}
}
which automatically generates ...
0
votes
0
answers
676
views
How to create a iOS scrollable time picker in Android?
I need to implement a scrolling timepicker that should be as similar to this one as possible (it's an element from ios, to be frank).
Unfortunately, I haven't found such elements in material3.
I ...
0
votes
1
answer
314
views
java.lang.UnsupportedOperationException: Can't convert value at index 89 to dimension: type=0x4
The following exception caught in my application.
12-02 11:49:12.640 10039 940 940 E AndroidRuntime: FATAL EXCEPTION: main
12-02 11:49:12.640 10039 940 940 E AndroidRuntime: Process: com....
0
votes
0
answers
114
views
Error inflating class androidx.appcompat.widget.SearchView in Dialog
<style name="WallSearchView" parent="Widget.AppCompat.Light.SearchView">
<item name="colorControlActivated">@color/light_black</item>
&...
0
votes
1
answer
92
views
problem with displaying grid layout while app has different theme than system
i have a problem with my elements in Gridlayout which are not loading properly.
If my android app has a different theme than the system of my phone, elements are not visible.
I have normal grid layout ...
1
vote
1
answer
514
views
Why should we use Strings from XML with Jetpack Compose?
If the idea of Compose is to get rid of XML, why is it still recommended to use XML based Strings and String Resources?
object Strings {...}
object Sp {...}
object Dp {...}
In a .kt file sounds like ...
0
votes
1
answer
549
views
AAPT: error: style attribute attr/itemBackground after importing AAR to Flutter
I have an aar file which has to be imported into Flutter project. But when I imported into project, it requires lots of style files which I don't have any clue what to do at this point.
Execution ...
1
vote
1
answer
322
views
How to make a layout flexible in android XML
I have a horizontal arrangement of TextViews within a LinearLayout, and while the current layout works well on my device, I'm facing issues when the font size is increased, resulting in a messy ...
7
votes
1
answer
5k
views
Touch Target Size too small
I am currently facing an issue where Android Studio is suggesting to increase the touch target size for a button due to it being too small. Most recommendations online suggest setting minHeight to &...
-2
votes
1
answer
101
views
I am trying to run an app android studio giraffe version, keep getting error in layout bolded line is my error
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:...
0
votes
1
answer
12
views
when open software keyboard i see extra space bottom of CardView - android
I have bellow xml, but when open software keyboard i see extra space bottom of CardView:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget....
0
votes
1
answer
53
views
How to avoid cutting off views in a non-scrollable layout in Android devices below certain height
I have a constraint layout that cannot scroll, all the views have to be visible all the time. The problem that I have is that with devices of height 1920 or less, the UI gets really crowded and some ...
-1
votes
2
answers
58
views
Placing Two elements at the left of and at the right of parent relative layout in android xml
i want to two elements at the left side of relative layout and two elements at the right side of the same relative layout in android xml. i tried like below. it doesn't work.
My Xml
<androidx....
1
vote
1
answer
107
views
how do i close xml file in include tag on android kotlin
I want to close a xml file opened in the include tag while clicking the close button of the included xml file in kotlin. i tried like below. i was not able to close. could some one help me to do that ...
0
votes
0
answers
86
views
difference between wrapping EditText with TextInputLayout Vs wrapping TextInputEditText with TextInputLayout?
Want to know difference between
wrapping EditText with TextInputLayout Vs wrapping TextInputEditText with TextInputLayout ?. I tried using both, they worked same.
So which to use when ?
Searched on ...
0
votes
2
answers
35
views
How can I support various screen sizes of mobile phones for my App in Android that supports only portrait mode?
I am creating an App which which I want to make only for mobile phones and not the tablets. I understand I have to make layout folders and I have made following folders like
1)layout-sw320dp
2)layout-...
0
votes
0
answers
24
views
How to Make Androidx.CardView Work for API 28 and Above?
I have been using Androidx.CardView in various XML layout files in my Android app, and it has been working well for most Android versions. However, I recently noticed that it's not functioning ...
0
votes
1
answer
150
views
Letterbox a video preview within a box
I have a texture view that displays video from the camera. The texture view is constrained by a fixed-width framelayout on the right, with buttons. Its constrained on the bottom by another framelayout ...
0
votes
1
answer
395
views
Fragment exit animation is not triggered when pressing the back arrow or back button
New to Android development, so forgive me for a silly question.
I see others have asked similar questions but they seem pretty old and I struggle to relate the answers to my code.
I have a one ...
0
votes
2
answers
35
views
How to adjust buttons properly inside LinearLayout if text on first button is more then half of screen
I am working on a layout file which have one parent LinearLayout and inside it two buttons and goal is to adjust buttons alignment according to the text size of buttons for an example if text size of ...
0
votes
1
answer
44
views
How to set content in constraint layout in a fixed ratio android studio java?
My cardview is placed just below the ImageView in constraintlayout. I want cardview to start by overlapping the bottom 5 percent of the ImageView upto the content of the cardview.
Currently my layout ...
0
votes
0
answers
25
views
Can't get the EditText to be read only once a action has occured
So I have been trying to get This TextInputEditText to be read only once a description called "Service Call" is selected. Here's the code:
processViewModel.isServiceCall.observe(...
0
votes
1
answer
28
views
umano sothree.slidinguppanel.SlidingUpPanelLayout for bottom slideup panel height different for different phone screen szie
I am using umano sothree.slidinguppanel.SlidingUpPanelLayout for bottom slide up layout. I have set height for the umano panel layout as 400dp which match my phone small screen and design is correct....
0
votes
1
answer
337
views
Android - how to scale a view by a % of the display size?
I am working with Android studio and kotlin. My app has a HorizontalScrollView, which contains a LinearLayout with up to an infinite amount of strip_view.xml layouts (1 strip for each audio channel). ...
3
votes
1
answer
261
views
AccessibilityService is not able to read text from hybrid android application (i.e. flutter)
I'm trying to create an AccessibilityService which can read text from the user screen, it works well and I'm able to grab most of the texts from native Android applications. Still, when I tried it ...
0
votes
1
answer
77
views
Why does my Searchview doesn't display the queryHint in android using androidx?
I have a searchView in the Toolbar which also has Gridview elements. Everything works fine except the queryHint doesn't get displayed in the searchView. I have tried setting android:iconifiedByDefault=...
0
votes
0
answers
41
views
Why are my cards not getting displayed at the center of the screen in android using Recyclerview and cardview?
So, I am trying to display the overlapped cards at the center of the screen but for some reason my cards are getting displayed without any marginTop like this shown in the image
I want to display ...
1
vote
1
answer
92
views
BottomNavigation is overlapping FrameLayout content in DrawerLayout
Every bottom content in FrameLayout is getting hide behind bottomNavigation,
below is my code.....I am making an little complex app where it has both drawer layout and bottomnavigation and I am also ...
0
votes
1
answer
38
views
ExpandableListView not pushing the UI under it when expands
below is my XML code, I have multi expandable list view (5) each one with a different adapter, and all the views are inside the vertical scroll view.
but when clicking on the header of each expandable ...