Category "android-layout"

Svg not visible in device but visible in android xml

I have used SVG's for these icons, the icons are visible in xml but not visible in device . following is my code : ` <LinearLayout

How to build a horizontal ListView with RecyclerView

I need to implement a horizontal listview in my Android application. I did a bit of research and came across How can I make a horizontal ListView in Android? an

How can I change default dialog button text color in android 5

I have many alert dialogs in my app. It is a default layout but I am adding positive and negative buttons to the dialog. So the buttons get the default text col

How to remove ripple effect from MaterialCardVew?

How can I disable touch ripple effect of MaterialCardView? Setting clickable attribute to false or playing with foreground and background attributes had no effe

Fragments show before Views finish rendering in Android

I have a problem in my Android app: lately, when I switch between fragments, their layout shows as XML before children views are shown correctly. For example, i

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

When using Immersive Mode with dialogs, nav. bar reappears and resizes my layout

I'm using Immersive Mode in my app when it's running on Android 4.4+. (http://developer.android.com/training/system-ui/immersive.html) My activity indeed shows

Error when trying to use a PieChart (hellocharts) on an Activity

I'm trying to use the external library "hellocharts" in my project. I have linked the library to my project already, but when the activity that has the chart st

How to achieve click effect on ShapeableImageView, min api 21 without nesting view

Is there a better way to achieve click effect on ShapeableImageView with recent release of Material components v1.2.0 I do not want to use foreground property a

Material Date Picker title is out of place

I'm having this weird issue when using MaterialDatePicker. While it works, the title and current date are not displaying as they should. Any ideas on what is ha

ScrollView does not show content when its constrained by "Match-constrains" inside a layout

I have a ScrollView inside my Constrained layout which contains another constrained layout, the view does not show its content if I set its height to "Match-Con

Android: set just one padding of textview programmatically

I want to set the top padding of a textview programmatically. I know you can do this with the method setPadding(). But the problem is that this method requires

Set View Width Programmatically

I am trying to set the width and height of a view in code to show an ad for a free app I am working on. All of the UI is done in XML with the exception of this

Unnecessary padding in CardView?

I have implemented CardView in my app and everything works fine except there is a little padding around the image if I put radius to the card. It appears like

TabLayout gravity center is not working

I have a TabLayout, where I want the tabs to be displayed in the center of the screen. Below is the XML for my TabLayout. <android.support.design.widget.Tab

Get specific drawable from state list drawable

I have a state list drawable, and i want to get a specific drawable from the state list drawable: <?xml version="1.0" encoding="utf-8"?> <selector xml

Add padding on view programmatically

I am developing Android v2.2 app. I have a Fragment. In the onCreateView(...) callback of my fragment class, I inflate an layout to the fragment like below: @Ov

Android layouts - Most efficent way to achieve what i'm after

I've been doing a bit of searching around for ways to achieve what i'm after but haven't been able to find much. Basically i'm going to use this as a "home" sc

centrally align icons in gridview

I want the icons to be centrally placed on the screen with proper alignment. What are the parameters I need to set? I have tried android:gravity and android:lay

RelativeLayout is taking fullscreen for wrap_content

Why does FOOBARZ get layed out all the way at the bottom when no elements are layout_height="fill_parent" in other words, all elements are wrap_content for heig