Questions tagged [android-layout]

18198 questions
1

votes
1

answer
24

Views

Why does this layout take long (60 sec) to show with two recyclerviews?

This layout takes around 60 seconds to show up on screen but scrolling is fast as soon as it is done. The app freezes whilst this happens and works okay as soon as the the items of the lists show up on screen.I am loading around 400 contacts for the one list and around 10 for the second.This could v...
Alexandre Juca
1

votes
0

answer
263

Views

Changing MasterDetail Height With A Custom Renderer

I am currently trying to change the height of the default MasterDetailPage using the material design with FormsAppCompatActivity. Basically I got the custom renderer to work, but I am trying to resize it dynamically based on toolbar size. The reason being is that different devices have differen...
bob
1

votes
1

answer
395

Views

Dimension folder for samsung galaxy s8 plus

Can anybody help me on what will be the dimension folder to design the screen for samsung galaxy s8 plus. It's size and resolution is 6.2-inch; 2,960x1,440 pixels. I am not able to understand the dimension file it's accessing. Currently, I am using SDP and SSP for the project. In other devices, appl...
Sneha Sarkar
1

votes
0

answer
2.8k

Views

Permission dialog for “Modify System Settings”

Application requires the following permissions 1- Camera 2- Allow modify system settings User easily allow and deny the camera permission via permission dialog. User gets confused on 'Allow modify system settings' because instead of a permission dialog a screen is appeared (Image Attached Below)....
MGD
1

votes
1

answer
19

Views

Android View's .onMeasure side effect

I'm having an issue where .measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) somehow alters the view's state. I've set up a view which listens to the onClick event and performs the .measure. Note that when I perform this directly in onCreate, it does not occur. I expe...
Erik Lilja
1

votes
1

answer
38

Views

ViewPager in RelativeLayout consumes full Height (Tabs)

I am working with AndroidStudio 3.0 and I am creating a TabbedActivity with Fragments using Java. For realizing the following design: sketch i sourrounded the ViewPager with a RelativeLayout in order to display a static content object (TextView) below the ViewPager. For this I am using the attrib...
blaner0
1

votes
1

answer
1.1k

Views

How to add “show more” button at the end of RecyclerView?

This is the screen I have to create: The problem is this '>' icon at the end of the list. I'm not sure if it has to be above the list, like floating button or should it be a part of last item in the list (like frame layout with image above image)? Not really sure. I'll post my layouts and adapter a...
user8789149
1

votes
0

answer
194

Views

Toolbar in MapFragment sits underneath status bar

Seems to be a unique case compared to other similar situations, but I have a map fragment within a FrameLayout that has a 'translucent' toolbar and status bar (darker, transparent color). I put in the top container android:fitsSystemWindows='false' as suggested in other posts, and that works in my o...
NotThatDroid
1

votes
0

answer
25

Views

runtime pdf generation in android without storing in external and internal memory

I am making a billing app where i have to show my all bill into the PDF format for that i don't want to store my generated PDF into internal or external memory , so is this possible to generate PDF at runtime without storing inside my phone memory or SD-CARD
1

votes
1

answer
49

Views

How to maintain size of different values folders for different screen sizes

different folders like values-small, values-large, values-normal, values-xlarge, how to place dimension for different folders. My dimension file like:please see my dimension file Now how to place these dimension in different values folders.
Rahul pal
1

votes
1

answer
47

Views

Nest layouts programmatically

I have already added one layout to another using code, but in this particular case I can not get it to work for me. If you add them with an include in the xml files it works correctly, it tries to replicate in code the include of the .xml files. The layouts are these: Parent layout (parent.xml): Fir...
Jose
1

votes
1

answer
48

Views

Events in multiple nested layouts fields (OnClickListener)

To a father layout I am adding successive child layouts in the following way Parent layout (parent.xml) Child layout (child.xml) Layouts are nested in a function called createView(), in this function I explain my doubt private void createView() { LinearLayout parent = (LinearLayout) inflater.inflate...
Jose
1

votes
0

answer
42

Views

toolbar move up when keyboard appears android

Toolbar moves up when keyboard appears i don't know why i use adjustresize and adjustPan but problem remains same. chat screen app having issues with chat when i open keyboard toolbar movesup. Please check this code and point out mistake.when i user adjust nothing keyboard open but edittext remain...
Mobeen Javed
1

votes
0

answer
257

Views

How To Support Screen 1080 x 2160 (One plus 5 T) 401 PPi ?

I try various option for One Plus 5 like values-xhdpi values-xxhdpi drawable-xxhdpi but didn't reflect text size and drawable? So what should be the values folder for dimens file and drawable for resolution 1080 X 2160?
SANU
1

votes
1

answer
48

Views

Android Studio - How to inflate an xml layout containing a view that use percentage params

I am here because I would like to use multiple times the same cardView layout, changing simply some information contained in it and then adding it to a view contained in the main xml layout. The problem is that the view to which append the created cardViews is a PercentRelativeLayout, so I need to s...
Andrew1410
1

votes
1

answer
65

Views

Find the difference App layout not working

I want to create a find the difference in 2 images kind of app in Native Android. I have done this using a Custom view with 2 images side by side and finding the touch positions (X, Y) of the image and it kind of works. But as soon as I try it on a different device the (X, Y) changes. On one device...
1

votes
0

answer
56

Views

Android - only display tabs before and after the selected tab

I'm trying to have a tab layout like the CNN app, where the tab is centered and only the tabs before and after are shown, each cropped to show half of the text like this: cnn tabs I managed to always have the selected tab centered thanks to SO posts like link and currently the app looks like my tabs...
gapstarter
1

votes
0

answer
65

Views

ConstraintLayout too long xml

I have a constraintlayout with too many views (atleast 50+) in it. Now it is getting difficult to manage the xml code as it exceeds 1000 lines. I am trying to use tags to divide the code in multiple layouts as mentioned in this post but in tag it does not hold the constraints as views are depende...
Nouman Bhatti
1

votes
0

answer
144

Views

Android remove custom view from tablayout tab

I am currently working on tab layout. Almost i have done it. My scenario is at my 0 position i have used custom view which includes imageview and textview. My first tab at 0 position have some conditions. Which they are 1) At 0 index fragment i am calling API. so if there is no data then display no...
Piyush Gupta
1

votes
0

answer
182

Views

How to set no current Tab in TabLayout - Android?

when I create a TabLayout with a Viewpager, my first tab will be selected by default, when I start the app. What I want is, that when I start the app, that NO tab will be selected, only if I click one, it should be selected. Is there a way, how to realize it? EDIT: I have 2 tablayouts and 2 view...
IsWayne
1

votes
1

answer
52

Views

How to create timer button in android?

I want to ask, if there is a way to create a button, which will show, how much time you have, to make an action. Example: 0:60s after 60s, some action will happen, but the button will always show the time, which is 'left' until an action happens. Does any have some experience/tips for me? Thanks
IsWayne
1

votes
3

answer
61

Views

Change button color on 1st click and 2nd click revert to default

I want to create some buttons through java coding (already done this part). Then change the each and every button color on first click to GREEN and 2nd click to gray or revert to default color. My code till now. Java int number = 5; // number of buttons LinearLayout layout = (LinearLayout) findView...
Rahul
1

votes
1

answer
84

Views

Image pixel distort in ImageView Android

I am working with an application in which I have more work with images. I want to show profile pictures and Article images in my app. For article images I have tried scale type of ImageView to 'fitcenter or centercrop or fitxy' but nothing works fine. My image pixel's are distorted. I am using Glide...
D Developer
1

votes
2

answer
73

Views

Nested LinearLayout doesn't work in Android

I am trying to make layout like in the picture. Project picture I can only link it because I am new. When I run the code with just one LinearLayout it works fine. But when I make nested linear layout it shows an only white screen. And there are no errors. The code adds a score to teams according to...
Gandalf the Grey
1

votes
0

answer
228

Views

Custom TextInputLayout does not show in preview

I have custom textinputlayout in my login activity also in custom textinputlayout layout i have custom clearable edittext. I can't see my custom textinputlayout in my login activity screen's preview but it's shown when i run the app on device. Login Activity's xml CustomTextInputLayout public clas...
Emre Akcan
1

votes
0

answer
47

Views

Activity Closing After Multiple Clicks

Every time I run my app and I keep going to the next activity after clicking 15-16 times the next activity its says it is going to unfortunately close. I/art: Alloc sticky concurrent mark sweep GC freed 907(64KB) AllocSpace objects, 1(16KB) LOS objects, 0% free, 95MB/96MB, paused 701us total 8.300ms...
1

votes
0

answer
107

Views

How to use collapsing toolbar inside the sliding up panel?

I want to use the collapsing toolbar layout inside the sliding up panel as its child. When expanded could be able to also expand and collapse the collapsing toolbar. Note: Sliding up panel https://github.com/umano/AndroidSlidingUpPanel Edit: I want to achieve this -CHILD 1 main content -child 2 frag...
Vishal
1

votes
0

answer
206

Views

ScrollView Children and Accessibility

I'm developing a Calendar Application and I want to make it accessible for visually impaired users. The CalendarScreen has a ScrollView that has one child, a DayViewGroup, which contain and lays out EventViews. For each EventView I set the contentDescription. Everything is created and added programa...
Ian Christie
1

votes
1

answer
204

Views

Dynamic Buttons with Textview in Constraint Layout

Currently I am working (learning to use) with ConstraintLayout. Now I created a simple layout with 3 Buttons each line under each button I put a textview, currently I manually am adding the Buttons, but my question is how to dynamically create this layout from a json object or an Array. The layout:...
tigerel
1

votes
0

answer
39

Views

Strange edges on FAB

Strange edges appear when using floatingactionbutton on a device with api 19. When i put the elevation to 0 fixes the edges, but when i press the button the edges appear again. How can i fix this? Here my floatingactionbutton :
Nick
1

votes
1

answer
89

Views

Inflate and render a UI view by a downloaded xml string

I was interested in downloading the xml layout for UI views from a server and inflate that as an xml string. What I see in the doc though is: Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser re...
Jim
1

votes
0

answer
65

Views

TimeLine like iOS Path app

I want to make a timeline like this I tried to make it and its working for match_parent contents but for less there is no bottom line here is the picture and this is my XML code I use ConstraintLayout and I used match_constraint for bottom and top lines can anyone please help me to fix this problem?...
raza Amini
1

votes
1

answer
42

Views

The bottom and the top bar are loading each time I change the activity

I am using BottomNavigationViewEX and each time I click on one of the buttons of this bar, the whole page is loading , even the bottom and the top bar. This is the code I am using in each Activity : private void setupBottomNavigationView() { Log.d(TAG, 'setupBottomNavigationView: setting up BottomN...
Daniel Morena
1

votes
0

answer
2.2k

Views

Android Studio:Min SDK in my project

When I try to sync my project this message appears to me The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file. What should I do?
kalawy
1

votes
0

answer
497

Views

Android studio XML autocomplete not working properly

so today I stared at the code when suddenly XML editor (autocomplete) stop working properly. The problem is that when I type the first letter of some element it gives me a proper suggestion but when I start typing other letters it just stuck with the first one and when I confirm the suggestion it gi...
Patrick kačič
1

votes
0

answer
75

Views

Collapse header on scrolling without using CollapsingToolbarLayout

I'm trying to implement the same behaviour than the CollapsingToolbarLayout for a view above my recyclerview that collapses to a minimum height on downscrolling and restores to its normal height when the scroll reaches the top. This header is not a Toolbar, hence the custom view. I managed to do it,...
Araceli A.
1

votes
0

answer
54

Views

checkbox customize center align

I want to use checkbox in my android app. But because I want no text beside it so the checkbox square is aligned left. after some search and some changes I faced some thing strange: one centered square whose over lapping another left aligned square, checkbox over lapped. how can I hide smaller one a...
1

votes
0

answer
183

Views

White screen when transitioning between activities

I have two Activities: A and B. I would like activity B to slide up from the bottom of the screen and cover activity A. I am able to do this, however Activity B is a white screen until it has fully translated into its position, and only then does the content view load. Is there a way to load the act...
Shahbaz Sheikh
1

votes
3

answer
95

Views

Why does findViewById return null?

Why does my findViewById return null here swipeRefreshLayout = findViewById(R.id.swipeRefreshLayoutDashboard);? I already tried using .getRootView() and going down the hierarchy by myself, but without any success. Can you maybe help me? DashboardActivity.java package eu.niehus.app; import android.a...
Sven Niehus
1

votes
0

answer
156

Views

Constraint layout misbehaves after updates

When I use com.android.support.constraint:constraint-layout:1.0.2 I got following output. But when I update constraint layout to com.android.support.constraint:constraint-layout:1.1.0 I am getting following strange output. All my fields are gone. Don't know why. Anyway right now I am revert back t...
Gunaseelan

View additional questions