All Questions
Tagged with android-custom-view android-view
175 questions
0
votes
1
answer
244
views
Do I need to use "MeasureSpec.makeMeasureSpec" with "MeasureSpec.UNSPECIFIED" value?
Is there any difference between 2 measure function calls?
view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED)
view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), ...
1
vote
0
answers
160
views
How to implement a horizontal moving joystick, Android
How to implement a horizontal moving joystick, that can be moved from left to right.
The controller should return back to its initial position (center) on release,
Also, I should be able to fetch the ...
1
vote
2
answers
4k
views
Button with progress bar android
I am trying to create a custom button with progress bar inside of it in Android.
The button should have 2 states:
Normal and Loading.
In Normal state it should show a text while in Loading state it ...
1
vote
1
answer
710
views
Fake data to preview custom view
I'm writing custom view for charts. How does I can to pass fake data into view, when it is in edit mode? (I know about isInEditMode, but when I'm trying to pass data inside init block it crash preview)...
5
votes
1
answer
601
views
How to test the Custom view performance
I want to test my Custom component UI rendering performance. I used the following test case to check the rendering performance.
private long getLayoutTime(int layoutRes) {
final Context ...
1
vote
0
answers
112
views
How to show error for Custom View in XML Editor
I am developing an open source project. One of the components is a Custom View. I would like to show error in XML editor if some property is missing. Similar to what LinearLayout with multiple views ...
1
vote
1
answer
485
views
Drop shadow for arcs in canvas
I'm trying to develop a small custom view for my personal project. I'm facing a small trouble as to how to provide elevation effect or drop shadow effect for the view that I created.
It is a ...
0
votes
1
answer
158
views
Adding a Progress Bar to a loading image
I am trying to create a progress bar that will display while an image is downloading from a server. This image is loaded into a custom view. (I need it to be custom because I draw on the image.)
My ...
0
votes
2
answers
222
views
Get custom view embedded element
I am creating a custom view on the click of a button. The custom view is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
1
vote
2
answers
1k
views
Custom view with canvas draw in Recyclerview not working
I'm trying to draw an arc from one view to another (canvas drawing) inside recyclerview. So I added a custom view in recyclerview layout. But it's not getting drawn properly. It draws randomly for ...
0
votes
1
answer
763
views
Android Studio Custom View Issues
I am in desperate need of help. I have been trying to solve my issues out for days and I am losing any desire to carry on with my project. I just can't seem to understand, so please can you help me do ...
2
votes
1
answer
1k
views
Android: Abstract custom view and common layout inflation
So, I've done some research and it seems that view inflation within the init/constructor of an abstract base class is not really a best practice. I understand that's because the base class ...
0
votes
1
answer
29
views
How to Send Argument Through Super After Being Defined In Subclass?
I want to send attrs through the super into View. (as shown in the first line) But the IDE doesn't want to take it; I am missing something from my code.
class BoxDrawingView(context: Context): View(...
2
votes
0
answers
227
views
Custom View: during drag dynamically calculate and draw rectangle width towards the next rectangle
For instance, I have three rectangles (RectF) on a canvas.
The middle one has a different width than two others. Assume that I have all text and rectangle bounds already calculated and cached.
So, ...
0
votes
1
answer
45
views
Android: Rendering views (text and image) in a rich banner creating app?
I am working on a banner creating app where the user can create custom banners for any purpose. The banner will have text, icons, background, etc. The app needs to provide features such as
Text ...