Questions tagged [android-layout]

A layout defines the visual structure for a user interface, such as the UI for an activity, fragment or app widget.

19,140 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18 votes
2 answers
2k views

Is it possible to always show the action bar when using adjustPan as soft input mode?

In my application I have a ListView with a footer that contains a custom view with an EditText inside. At the top sits an action bar. The activity currently uses SOFT_INPUT_ADJUST_RESIZE (adjustResize)...
fejd's user avatar
  • 2,545
17 votes
0 answers
838 views

LinearLayout: showDividers="middle" not working on RTL layout direction

So I have this LinearLayout where I use dividers to add some spacing between the items: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:...
gonçalo's user avatar
  • 171
15 votes
2 answers
1k views

Action Bar Icon hidden after SearchView expands

I want the icon beside the SearchView (the "cloud") stays visible even when the SearchView expands. This works properly for tablets but doesn't work in case of smaller devices like Nexus 5. I have ...
iZBasit's user avatar
  • 1,313
14 votes
1 answer
2k views

ViewBinding - Different Flavor Layout Resource

I have a flavor that contains the same layout resource that is in my main source set. This is so it overrides the main one with the flavor specific one. I have done this in many places and it works ...
StuStirling's user avatar
  • 15.6k
14 votes
1 answer
3k views

Android RatingBar vector icon is not showing

I have a layout where I want to show RatingBar for user. I'm using my own custom icons instead of default stars. My Problem is that the icons are on vector format and when I use them I get strange ...
David's user avatar
  • 3,055
13 votes
2 answers
5k views

Forcing adjustPan in activity containing ScrollView

My layout looks like this: <RelativeLayout> <RelativeLayout> </RelativeLayout> <ViewFlipper> <ScrollView> <LinearLayout> ...
Undroid's user avatar
  • 151
13 votes
2 answers
3k views

How to display countdown timer on status bar in android, like time display?

I am making an app which allows the user to pick a date and time. Once the date and time are reached,it will display an animation on the screen. Before its time, it will just show countdown time (like ...
Vidya Sagar's user avatar
13 votes
1 answer
3k views

Put appbarLayout on bottom of screen

Question Is it possible to put a AppBarLayout on the bottom of your screen? Problem I'm trying to put a bar on the bottom of my screen that scrolls away when I'm scrolling down and appears when I'm ...
Robin Bruneel's user avatar
12 votes
1 answer
842 views

Android rotating text: I use dynamiclayout.draw(canvas) but it doesn't animate along the path, and can't use canvas.drawTextOnPath(dynamiclayout)

I'm using my own version of https://github.com/mdg-iitr/RotatingText in order to show a rotating text widget. A video is available in this GitHub, allowing you to see the animation. The idea is to set ...
JarsOfJam-Scheduler's user avatar
12 votes
4 answers
4k views

Issues recreating a material design lists with leave behind in Android

I'd like to recreate the Material Design list: controls in Android inside a sliding panel. I'm making use of: com.android.support:appcompat-v7 com.android.support:support-v4 com.android.support:...
Daniel Friesen's user avatar
12 votes
0 answers
1k views

Android Widget looking exactly like a Launcher Icon

I am having a hard time with widgets. Reading from http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#cellstable there is the following table: 1 cell - 40dp 2 cell - 110dp ....
Ferran Negre's user avatar
  • 3,732
12 votes
1 answer
5k views

Expanding/Collapsing CardView with click or swipe gesture (Android)?

I'm looking for a solution to this that will allow me to expand a cardview to see more information and then easily collapse it. Google Keep has examples of cards like this. Anyone know how they do ...
sanic's user avatar
  • 2,065
12 votes
1 answer
10k views

How to center&left&right align the ActionBar icons in Android

hi there I want align a set of icons in toolbar like below picture. I googled and after some change I have: mainActivity.xml ... <include android:id="@+id/tool_bar_bottom" layout="@...
partiz's user avatar
  • 1,206
12 votes
2 answers
21k views

Android scale animation to specified size

I'm trying to animate my View to a specified size. I have a LinearLayout that is divided into a grid of 3 rows and 3 columns. So I have 9 LinearLayouts as squares. I am trying to scale the square to ...
blessanm86's user avatar
  • 31.5k
11 votes
1 answer
288 views

Android StackScrollLayout

I need help creating a Layout like the one Android uses to render notifications inside it's notification Panel. Basically what happens at the end of the view when notifications don't fit the screen ...
Alex Newman's user avatar
  • 1,369
11 votes
1 answer
2k views

How to disable/suppress IDEA "Rendering problems" warnings

IDEA keeps raising a popup with message "Rendering Problems Missing styles. Is the correct theme chosen for this layout? …" Yes, everything is correct, IDEA just doesn't see some symbols ...
Display Name's user avatar
  • 8,042
11 votes
1 answer
5k views

Customizing Android ScrollView's Vertical Scrollbar

I need to customize ScrollView so it will look like in the picture: I already successfully customized the Thumb and the Track, but I don't know how to add Arrows like in the picture I provided. Here ...
EvZ's user avatar
  • 11.9k
11 votes
3 answers
2k views

How to create a layout that's split diagonally and the two halves are clickable?

I need to create a layout that's split the screen diagonally into two parts with different colors as their background.Something like this: How can I achieve this?
Anshul's user avatar
  • 7,914
10 votes
1 answer
1k views

Marshmallow RelativeLayout behaves strange with alignBaseline

On Android 6.0 Marshmallow the positioning of an EditText in relation to an ImageView in a RelativeLayout with the attributes baseline and layout_alignBaseline does not work anymore. The behaviour can ...
Michael Greifeneder's user avatar
10 votes
2 answers
11k views

How to set height of actionbar tabs for android

Basically, I want to change the height of the tabs in actionbars. This questions has been asked several times on stackoverflow, for example: ActionBar tabs height I have tried most of the solutions ...
user2459179's user avatar
10 votes
6 answers
2k views

Is it possible to make ActionBar tabs height higher than ActionBar height? If so, how?

I'm using ActionBarSherlock In a similar question about ActionBar tabs height, I used: <style name="YourTheme" parent="@android:style/Theme.Holo"> <item name="android:actionBarStyle">@...
wlays's user avatar
  • 197
9 votes
0 answers
2k views

Jetpack Compose Rendering Problem: ComposeView

I'm trying to use ComposeView in XML layout file and application works fine, but I'm getting rendering trouble in preview. If there's no way to fix this problem, can I just ignore somehow (via tools ...
deorsum fluens's user avatar
9 votes
3 answers
2k views

how to use multiple expandablelistview inside scrollview android?

I want to set 3 expandablelistview in single screen i want to add multiple expandablelistview XmlLayout //this is my scorllview <ScrollView xmlns:android="http://schemas.android.com/apk/res/...
Vanraj Ghed's user avatar
  • 1,261
9 votes
4 answers
8k views

Horizontal Recycler View inside ViewPager not scrolling

The Problem I have a horizontal RecyclerView inside a NestedScrollView which is inside a ViewPager. Now when I try to scroll the RecyclerView, sometimes it scrolls, but sometimes only the ViewPager ...
Mayr Technologies's user avatar
9 votes
0 answers
1k views

Persistent BottomSheet peekHeight and STATE_COLLAPSED not drawing properly on Activity start

I have a CoordinatorLayout with a custom view and a persistent bottom sheet. I have disabled hiding for the bottom sheet and want to show the top couple of views in a LinearLayout in the collapsed ...
RScottCarson's user avatar
9 votes
1 answer
1k views

Android - Error inflating text view

I know there are a bunch of similar questions on stackoverflow. But none of these solve my problem. It's not about theme settings nor resource not found. And I didn't load large images in this layout(...
Kimi Chiu's user avatar
  • 2,103
9 votes
1 answer
1k views

Not working Notifydatasetchange on RecyclerView with center selection Horizontal Scrollview?

Auto Scrolling is issue & also move to some specific position using code is difficult. I am making two recyclerView dependent to each other with the Horizontal Scroll and center selection. So my ...
KDOSHI's user avatar
  • 309
9 votes
0 answers
702 views

Android Scrolling Activity Toolbar Subtitle not showing

I am setting Toolbar subtitle like : Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getExtra(); getSupportActionBar().setSubtitle("subtitle"); It is working ...
Arun kumar's user avatar
  • 1,894
9 votes
1 answer
835 views

Using same Android binding class from 2 different layouts

I am trying to display data from the same class in two different layouts using Android's data binding. The layouts are used to inflate the views in a ListView. I already have it functioning for one, ...
Will Molter's user avatar
9 votes
0 answers
2k views

Change NumberPicker fading edge value or change alpha of top/bottom text

Is there a way to increase the fading edge or change top/bottom text alpha of number picker? I was able to extend NumberPicker class and change alpha of number picker wheel but once I start scrolling ...
Alex's user avatar
  • 1,062
9 votes
0 answers
573 views

animateLayoutChanges not animate removing back arrow from Toolbar

I have CoordinatorLayout with AppBarLayout and Toolbar inside it: CoordinatorLayout - AppBarLayout - Toolbar animateLayoutChanges=true Nice. And I use this code to hide/show back arrow ...
Alexandr's user avatar
  • 3,879
9 votes
1 answer
835 views

How to preview Custom Font Android Studio (using Calligraphy)

Currently I'm using the Calligraphy library to use custom fonts, it's awesome https://github.com/chrisjenx/Calligraphy But i can't preview the new fonts, is there any way to preview the custom fonts ...
Jonnathan Ng's user avatar
9 votes
1 answer
2k views

CoordinatorLayout doesn't work with NestedScrollView inside Fragment in ViewPager

I have an Activity with next layout Activity layout <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout android:id="@+id/issue_browse_app_bar_layout" ...
Danila's user avatar
  • 111
9 votes
0 answers
2k views

NestedScrollView canScrollVertically returning false for specific sized content

Context In my top Header, I have a button that let a second TextView to be View.Visible or View.Gone. My ViewPager content have a particular size to demo my problem, reproducible on Nexus 5. Problem ...
Vincent D.'s user avatar
9 votes
1 answer
2k views

How to map a list of list to RecyclerView

I am trying to map a List<List<Object>> to a RecyclerView in Android, but the result is totally messed up. For example, I have a list of list like this (just for explaining, not my real ...
CrackThisRay's user avatar
9 votes
0 answers
342 views

prevent resolveRtlPropertiesIfNeeded

I trying to improve the speed of an app - traceview revealed a lot of resolveRtlPropertiesIfNeeded calls. Anyone knows how to get rid of them? I tried android:supportsRtl="false" in the manifest, but ...
ligi's user avatar
  • 39k
9 votes
1 answer
5k views

Scrollable EditText inside ScrollView

I searched all posts regarding to this subject but still I could not find any solution. I have one big layout and it is scrollable with ScrollView and it has also EditText with scrollable . If I try ...
Winston's user avatar
  • 1,800
9 votes
2 answers
4k views

Relative translation in property animation in xml

Currently I have an ImageView that extends the length of the device and is scaled by 3. Obviously, the sides are cropped outside the screen. I want the animation to start with the left-side of the ...
DeeV's user avatar
  • 35.9k
9 votes
1 answer
2k views

What is the difference between android:uses-permission and uses-permission?

What is the difference between these two syntaxes. android:uses-permission and uses-permission. For example: <android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" ...
MiJo's user avatar
  • 569
9 votes
1 answer
850 views

Adding library with resources to aosp package

I am working with AOSP and I want to make my own library and use it in app (from packages/app/ ). My library has only one class: import android.app.Fragment; import android.os.Bundle; import android....
Ov3r1oad's user avatar
  • 1,057
9 votes
4 answers
3k views

How to cenralize last uneven row in GridView in android?

I have a GridView , which displays pictures of alphabets what happens is , every time in the last row there are less no of alphabets. and the last row is left aligned , which doesn't look good so I ...
Hussain Akhtar Wahid 'Ghouri''s user avatar
9 votes
2 answers
1k views

android:layout_weight="33" how does gone->visible visible->gone effect this?

android layouts use a layout_weight. I am aiming for 1/3 for all components but sometimes the footer is literally set to gone, and then visible. How does the weight calculation work when setting from ...
Android Developer's user avatar
9 votes
1 answer
3k views

Android customize stackview

I"m trying to customize the StackView widget to look a little bit different. The stackview default order and view is this : And i"m trying to get to something more like this : Any help will be ...
shimiDroid's user avatar
8 votes
0 answers
813 views

setOnApplyWindowInsetsListener() is not applying padding and calling 2 times

I'm calling setOnApplyWindowInsetsListener to add padding/margin for my views. My XML contains android:fitsSystemWindows="true" setOnApplyWindowInsetsListener after being called 2 times (on second ...
Nikita Lapin's user avatar
8 votes
1 answer
2k views

MotionLayout: Click and Touch not working in view with transition in motion scene (Youtube player like UI)

I have a Youtube video player like view, where I have a list which on click, plays a video in the next screen. I have added Motionscene to the video view so while dragging down, the video view ...
Poyyamozhi Ramakrishnan's user avatar
8 votes
0 answers
1k views

Android Pie edittext does not adjustPan/resize while typing

On Android PIE I have an Activity with several Edittext views inside a linear layout, and using SOFT_INPUT_ADJUST_PAN. While I am typing with soft keyboard on an Edittext the text is not displayed. ...
Filipe Madureira's user avatar
8 votes
0 answers
1k views

Is there a layout configuration qualifier for picture-in-picture (pip) mode layouts

I have implemented pip for my app. I note that in the Picture-in-picture support documentation it is suggested that android:configChanges= "screenSize|smallestScreenSize|screenLayout|...
Simon Hutton's user avatar
  • 1,677
8 votes
0 answers
1k views

React Native : add fragment to mainactivity using Android Native Modules

I have a specific Android native library to integrate the camera features. The library provides the Fragment with the all it features. I just want to integrate that with Mainactivity in React Native ...
Praveen's user avatar
  • 90.6k
8 votes
0 answers
808 views

Cannot edit ConstraintLayout in Layout Editor

I'm trying to edit a ConstraintLayout in the layout manager in Android Studio 3.0. Unfortunately, I get the following error: The following classes could not be instantiated: - android.support....
Lasse Meyer's user avatar
  • 1,429
8 votes
0 answers
6k views

Full screen notification like in-coming call in android call app

I am working on video call android app.My challenge now is to implement full screen notification similar to android built in Call app when you have in-coming call. Currently Whenever i get a call the ...
sparks's user avatar
  • 491

1
2 3 4 5
383