All Questions
Tagged with kotlin android-layout
1,210
questions
0
votes
1
answer
23
views
Android square screen how to use portrait layout?
I need to adapt a square screen(1200px * 1200px, 160dpi), use context.resources.configuration.orientation found out it's a landscape orientation. How do I force a portrait layout?
I've already tried ...
0
votes
2
answers
41
views
layout doesn't appear in activity_main of my app
i've a problem with my app.
Today i've upgrade my android studio to the last version.
I've runned my app on my phone, but in the activity_main.xml the include layout (that contains a new ActionBar) ...
0
votes
1
answer
27
views
How to make a floating NavigationView in Android
I want to replicate the menu that Google has in its applications, but I don't know if there is a component like NavigationView and DrawerLayout that allows this menu to be made but that is not fixed ...
0
votes
0
answers
19
views
uneven raws in recyclerview using gridlayout manager Android kotlin
The problem is I am trying to design a layout with two columns and no rows or uneven rows this is my current design my current design and this is what I want to achieve expected design.
This is my ...
0
votes
0
answers
22
views
How to change the order or RecyclerView items in GridLayoutManager?
I have written my own implementation of GridLayoutManager to display specific given number of rows and columns of RecyclerView.
The problem is, that the items are being rendered in a top-to-bottom ...
1
vote
1
answer
58
views
BottomNavigationView height issue - Icons not centered properly
I'm having an issue with my BottomNavigationView where the icons are not vertically centered. In the Android Studio preview, everything looks perfect, but when I run the app on an emulator, the height ...
0
votes
1
answer
55
views
Why aren't we using ConstraintLayout in Jetpack compose as much as we did in XML?
I've been reviewing codes and I realized we don't use ConstraintLayout as often as we did in XML.
In XML we were encouraged to use ConstraintLayout due to the performance concerns instead of those ...
0
votes
0
answers
37
views
How to create sub directory in res>layout folder in android studio?
I am using kotlin and kotlin DSL
I want to create sub directory under layout directory. So that I can manage my layouts
more effieciently.
There are many layout files, so it is such a mess to manage ...
1
vote
0
answers
29
views
Snackbar shown at top of screen appears cut off
I am using CookieBar2 to display a cookie bar at the top of the screen:
CookieBar.build(this@AppAdActivity)
.setTitle("TITLE")
.setMessage("MESSAGE")
.setDuration(10000)...
0
votes
1
answer
80
views
How to create a custom view with a linear gradient border in Android?
I am trying to create a custom view in Android that has a linear gradient border with rounded corners, similar to the one shown in these image:
I've written the following custom view class in Kotlin,...
0
votes
0
answers
15
views
Using three different DrawerLayouts
I am trying to use 3 diferent side menus and for that 3 layouts one for each and a menu for each layout, but only the layout in the activity_main is working when i run the app.the other two when i ...
0
votes
1
answer
32
views
BottomNavigationView only shows 1 icon at a time and only when the space containing the (invisible) icon is clicked
Kotlin Android app has a BottomNavigationView on the initial fragment. When the app is run the first icon of 5 in the view shows but the remaining icons/labels only show when that (blank) part of the ...
0
votes
1
answer
20
views
LayoutParams weight works unexpectedly
I'm trying to create LinearLayout with 2 children LinearLayouts. I can't use XML and should make this programmatically.
For parent I apply:
LayoutParams(MATCH_PARENT, WRAP_CONTENT, 1f)
1st child:
...
0
votes
1
answer
55
views
How to force the app to open in custom "minimum width"
so i have my phone that is set to "minimum width of" 384dp (in developers options), what i want to do is to open my android studio app like if the phone had its minimum width of 478dp.
is ...
0
votes
1
answer
39
views
Adding ListViewItem from text changed event in Kotlin
If the user types in ListViewItem text: "Add new item" I want to add a new item.
This is my code so far:
class DataModel internal constructor(
var checked: Boolean,
var itemDesc: ...