I wish to load images from Gallery in my CustomView without altering their aspect ratio, and then I wish to draw on it.
I have a custom view which I added dynamically from MainActivity like this:
@Override
protected void onActivityResult(int…
I am using DynamicLayout to render a SpannableString but I am not able to precisely center the text.
It seems like there is some kind of offset at start that I can't get rid of.
Here is my implementation:
private Editable edit;
private DynamicLayout…
The documentation for the following methods of Layout (including StaticLayout, DynamicLayout, and BoringLayout) are very sparce.
getLineBaseline(int line)
getLineDescent(int line)
getLineAscent(int line)
getLineBottom(int line)
getLineTop(int…
I am trying to batch-add several thousand spans to a SpannableStringBuilder in an EditText (obtained via getText()).
This is slower than I would like. Profiling has shown that the vast majority of the time is being spent in DynamicLayout.reflow. Is…
I'm on a working on a project on Android Studio. Then I would like to implement a button that generate a view above him. And store it's text data in an ArrayList.
This is the java code:
addClassBtn.setOnClickListener((v)->{
View…
I am working on android application in which I am creating dynamic Layout on fragment. When user click on button to get data from layout element then I am getting null pointer exception error.
@Override
public View onCreateView(LayoutInflater…
I create app with SpannableString (BackgroundColorSpan, ForegroundColorSpan and StyleSpan). First time EditText work fine, but after 10-15 minutes, the EditText starts to freeze. I use profiler to see why input slow down (photo below)
…
I have extended ConstraintLayout and adding views programatically then setting constraint to each view. but some how its not working, only the first view is showing up. Unable to figure out where I went wrong.
addViews(){
titleInfoView = new…
I am creating a framelayout pro-grammatically. Then I create fragment pro-grammatically..Then I want to add the fragment to the framelayout.. this process is happens every time when I click the button. For the framelayout id and fragment tag I…
I need to set a button to "visible" or "gone" dynamically as user types on a TextView field. By using the statement below, I have been able to accomplish it when Enter is pressed, but that would be great if the button becomes visible or gone…
This is an iOS problem.
I want to design a screen which will show a video on full screen. After some time based on some backend condition if another video is available I have to show that by splitting the screen into two vertical halves. After some…
I want to create a UI where there are n amount of LinearLayout's all contained within a vertical ScrollView (each row will contain a couple items).
I also want this ScrollView to update if another fragment updates a value (shared through a…
I have a Linear layout and inside which there are few dropdown and text views,now i want to inflate the layout each time on click of "add more" button, below is the code for inflating the layout. the problem i am facing is to assign the id to each…
The DynamicLayout constructor has a base parameter and a display parameter, both of which are CharSequence. (StaticLayout, by comparison, lacks this.)
DynamicLayout (CharSequence base,
CharSequence display,
…
I have a list filled with values and a list with questions, some elements in the value list have more than 1 element, so for example
question[2] = Light
question[3] = Toppings
value[2] = on / off
value[3] = cheese / peppers / oranges / apples
(i…