views:

17

answers:

0
+1  Q: 

TextSwitcher bug

Hello,

i have a problem with the TextSwitcher. In my app i have 3 Textswitcher with wrap_content (width and higth) inside an LinearLayout!

Each TextSwitcher is declared with an in and outAnimation. My problem: When the text is switch the first time, i have spaces between the elements! like: 1.23 45 678 but it has to: 1.2345678 without spaces

when the text switches the second or 3. time the spaces are gone. I cant imagine why there are spaces?? There is no other Element, no padding, no margin.

maybie the reason is the ViewFactory: ViewFactory for the middle part switche:

public View makeView() {
  TextView t = new TextView(SmartTraderFxTrading.this);
  t.setTextColor(Color.BLACK);
  t.setTypeface(null, Typeface.BOLD);
  t.setTextSize(26f);
  return t;
 }

an for the switcher left and right from the middle part:

    public View makeView() {
  TextView t = new TextView(this);
  t.setTextColor(Color.DKGRAY);
  t.setTextSize(20f);
  return t;
 }

but i can change everything, the spaces are always there after the first switch, and also maybie after the second.

Is it a bug? Please help!

EDIT: Problem solved! The problem is that the Text befor has more digits as after! So the TextSwitcher has a larger width and after redraw of the activitie it wraps the TS.