Questions tagged [dynamiclayout]

An Android text layout class for laying out text that can be edited.

The Android documentation is here.

16 questions
1
vote
1 answer

Bitmap doesn't get drawn on canvas-android

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…
1
vote
0 answers

DynamicLayout adding extra space

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…
Rami Jemli
  • 2,550
  • 18
  • 31
1
vote
1 answer

Android Layout: meaning of getLineBaseline, getLineDescent, getLineAscent, getLineBottom, getLineTop

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…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
0
votes
1 answer

How can I block EditText layout reflow when adding spans?

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…
0
votes
0 answers

Button stopped generating View

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…
0
votes
0 answers

How to get dynamic created EditText Data in fragment?

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…
Moin Khan
  • 674
  • 2
  • 9
  • 27
0
votes
1 answer

EditText lagging with time - Android

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) …
0
votes
1 answer

Constraint Set problem, Unable to figure out issue

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…
0
votes
1 answer

No view found for id "bla bla bla" for grammatically created framlayout

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…
0
votes
3 answers

Android TextView: how can I change layout dynamically as text is typed

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…
0
votes
1 answer

I want to design a screen which will show different number of videos on same screen based on certain condition

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…
0
votes
1 answer

Achieving a dynamic ScrollView via refreshing (or not) the fragment

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…
Matt Strom
  • 698
  • 1
  • 4
  • 23
0
votes
1 answer

How to handle dynamically inflated layout content (Same Layout inflated multiple times)

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…
Rocket
  • 11
  • 1
  • 5
0
votes
1 answer

What is the display parameter in DynamicLayout

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, …
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
-1
votes
1 answer

Android; Dynamic buttons layout

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…
1
2