3,280 questions
0 votes
0 answers
77 views
View in WindowManager Flickers on Animated Height Change with `WRAP_CONTENT`
I am trying to create a system overlay using WindowManager. This overlay contains a ComposeView which, in turn, hosts a Composable that animates its height. My WindowManager.LayoutParams for the view'...
0 votes
1 answer
89 views
Visibility Attribute and onclick event not working in Kotlin custom view (Android)
I created a custom view in Kotlin for Android called CardButtonView. However, when I use this view, the visibility attribute is not respected. For example, if I set android:visibility="gone" ...
1 vote
0 answers
60 views
Accessibility on android custom view not working
I have a custom view , which extends ViewGroup, i.e CustomViewGrouup. There I am adding some ImageView. When user will click on some specific rectangular area on the CustomViewGroup, then I need to ...
0 votes
0 answers
27 views
How to create custom View for TextInputEditText?
Let's have TextInputLayout and TextInputEditText, which looks like this: <com.google.android.material.textfield.TextInputLayout android:id="@+id/input_variable_text_input" ...
0 votes
2 answers
60 views
How to fix the missing required view with ID in the custom View
I want to create a custom view based on com.google.android.material.slider.RangeSlider. It works on a physical device, but fails in the XML preview from Android Studio. I've tried rebuilding, clearing ...
1 vote
1 answer
147 views
How to implement custom shape with half circle clip on the sides with with Jetpack Compose?
So I need to implement similar shape in Jetpack Compose I'm trying it with the following code but for now with no luck: fun clippedCardShape(clipRadius: Float = 30f): Shape { return object : ...
0 votes
0 answers
29 views
The animation for the custom view does not play
There is a task to create a custom ViewGroup widget to which you can add only two child elements. Both are centered horizontally, the first one should be placed on the upper border of the parent ...
0 votes
0 answers
45 views
Get last non-empty text line in StaticLayout
I'm using this StaticLayout.Builder in Android. val staticLayout = StaticLayout.Builder.obtain(fullText, 0, fullText.length, textPaint, containerWidth).build() I want to be able to ...
1 vote
1 answer
45 views
How to create a custom EditText with a blinking red background for setting errors in Android Kotlin?
I want to create a custom EditText in Android that shows a blinking red background when there is an error. The idea is to visually indicate to the user that input is invalid. Here is what I have tried ...
1 vote
0 answers
104 views
Android Canvas.drawPoint method draws nothing
I'm doing some work with Canvas.drawPoint(float, float, Paint), but I found a strange thing: this method doesn't work. At first, I thought it was a problem with my code, so I wrote a simple test code: ...
1 vote
0 answers
28 views
Android custom image with diagonal
I want to create a layout like this. It has 2 images with a diagonal running across the 2 images. Below is my xml layout. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http:...
-1 votes
1 answer
78 views
Is there a way to store a vector graphic in the app's package and load it on runtime into a canvas?
I want to build an app where you can draw ancient hieroglyphs on a canvas in a custom view. I have to provide over 1000 hieroglyphs in vector graphic format (for scaling mirroring etc.). The provided ...
2 votes
4 answers
239 views
Prevent GridLayout column width from stretching as if there were other columns
I have a programmatically created GridLayout that renders time slots within a specific day (such as an appointment time). At a maximum, each row should have 4 evenly spaced even width items, and at a ...
-1 votes
1 answer
127 views
Build the ios Messages Chat Bubble(with bottom right and left tail ) in Android
I want to build the iOS-like Messages chat bubble in Android using the custom view class this is the code that I use to create the rounded corner rectangle and it will be based on the height and ...
0 votes
1 answer
28 views
Android Studio Custom View Coordinates are offset
I'm working on an app in Android Studio that lets the user visualize a family tree. For the profiles of the family members, I created the custom view PersonCard: public class PersonCard extends ...