[android-developers] Re: TextView within ListView not visible (but still clickable) since upgrading to Android M.

2016-11-21 Thread Jorge Antonio Muñoz Herbas
I'm not sure but, do you checked the styles and colors? probably the 
Textview is redered but is not visible for its color.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1fbc4f68-8077-4c39-b9c9-23b5280d29da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Textview not scrolling marquee in lollipop version and above

2016-07-14 Thread thepooja93


On Wednesday, July 13, 2016 at 4:29:30 PM UTC+5:30, thepo...@gmail.com 
wrote:
>
>
>
> down votefavorite 
> 
>
> Textview text marquee are scolling in pre lolliop versions but not support 
> for lollipop and after that..please help me . following are code for xml 
> and added code in java also setselected(true). Please Reply.
>
> Thanks.
>  Following are code fro that.
>
>
>  android:layout_width="match_parent"
> android:layout_height="wrap_content"
> android:textAppearance="?android:attr/textAppearanceLarge"
> android:id="@+id/textView1"
> android:layout_gravity="center_horizontal"
> android:ellipsize="marquee"
> android:singleLine="true"
> android:layout_marginTop="-12dp"
> android:marqueeRepeatLimit="marquee_forever"
> android:scrollHorizontally="true"
> android:textColor="@color/white"
> android:background="#00AEEF"
> android:focusable="true"
> android:focusableInTouchMode="true"
> android:fadingEdge="horizontal"
> android:freezesText="true"
>/>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ede14d9a-3144-4714-9751-83d983b29d89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: TextView maxLines based on height

2014-02-13 Thread Ankur Avlani

 Hi All,

 I am designing an native custom article view in android.  My requirement
 is such that I have a long text which i need to break into pages.  I can
 find out the total height of my TextView, how do i calculate the max
 visible lines for the view based on the height?

 I know Paint.breakText will do for me, but its very slow.  Please have a
 look at the following code snippet:

 public static int getTextLineCountForHeight(String text, int maxWidth,
 float textSize, Typeface typeface, int maxHeight) {
  TextPaint paint = new TextPaint(Paint.LINEAR_TEXT_FLAG |
 Paint.SUBPIXEL_TEXT_FLAG);
 paint.setTextSize(textSize);
  paint.setTypeface(typeface);

 int lineCount = 0;

 int index = 0;
  int length = text.length();
 Rect bounds = new Rect();
 bounds.setEmpty();
  while(index  length - 1) {
 bounds.setEmpty();
 index += paint.breakText(text, index, length, true, maxWidth, null);
  lineCount++;
 paint.getTextBounds(Py, 0, 2, bounds);
 if((int)Math.floor(lineCount * bounds.height())=maxHeight){
  return lineCount;
 }

 }

  return lineCount;
 }

 textView.getHeight()/textView.getLineHeight() doesnt give me the correct
visible lines.

Can someone please suggest me some faster was to achieve my requirement.

 Any help is highly appreciated.

 -Ankur.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: TextView vs Button

2013-02-26 Thread Lew
skink wrote:


 Seshu wrote: 
   I have one textview [sic] and one button [sic]. i [sic] know the 
 purpose of both 

 views but if i [sic] used background image and displayed text on both 
 then 

 both r [sic] looking same only. Is there any particular point which 

 differentiate them. 

 


 you'll answer your question by yourself when you see the source code 
 of Button.java, just use good, old uncle Google 

 Never mind the source. You shouldn't have to read source to figure out how 
to use an API.

From the Javadocs: 

http://developer.android.com/reference/android/widget/Button.html
Represents a push-button widget. Push-buttons can be pressed, or clicked, 
by the user to perform an action.
... instead of applying an 
OnClickListenerhttp://developer.android.com/reference/android/view/View.OnClickListener.html
 to 
the button in your activity, you can assign a method to your button in the 
XML layout, using the 
android:onClickhttp://developer.android.com/reference/android/R.attr.html#onClick
 attribute.

http://developer.android.com/reference/android/widget/TextView.html
Displays text to the user and optionally allows them to edit it. 

Seems like points to differentiate them are already revealed.

-- 
Lew

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: TextView vs Button

2013-02-26 Thread Nobu Games
Well, a look at the source code reveals that Seshu has a point. There is 
virtually no difference between a Button and a TextView:

public class Button extends TextView {
 public Button(Context context) {
 this(context, null);
 }

 public Button(Context context, AttributeSet attrs) {
 this(context, attrs, com.android.internal.R.attr.buttonStyle);
 }

 public Button(Context context, AttributeSet attrs, int defStyle) {
 super(context, attrs, defStyle);
 }
 }



On Tuesday, February 26, 2013 8:24:53 PM UTC-6, Lew wrote:

 skink wrote:


 Seshu wrote: 
   I have one textview [sic] and one button [sic]. i [sic] know the 
 purpose of both 

  views but if i [sic] used background image and displayed text on both 
 then 

  both r [sic] looking same only. Is there any particular point which 

  differentiate them. 

  


 you'll answer your question by yourself when you see the source code 
 of Button.java, just use good, old uncle Google 

 Never mind the source. You shouldn't have to read source to figure out 
 how to use an API.

 From the Javadocs: 

 http://developer.android.com/reference/android/widget/Button.html
 Represents a push-button widget. Push-buttons can be pressed, or 
 clicked, by the user to perform an action.
 ... instead of applying an 
 OnClickListenerhttp://developer.android.com/reference/android/view/View.OnClickListener.html
  to 
 the button in your activity, you can assign a method to your button in the 
 XML layout, using the 
 android:onClickhttp://developer.android.com/reference/android/R.attr.html#onClick
  attribute.

 http://developer.android.com/reference/android/widget/TextView.html
 Displays text to the user and optionally allows them to edit it. 

 Seems like points to differentiate them are already revealed.

 -- 
 Lew



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: TextView vs Button

2013-02-26 Thread Seshu
Thanks to all.
   Now my doubt was cleared.

On Feb 27, 8:28 am, Nobu Games dev.nobu.ga...@gmail.com wrote:
 Well, a look at the source code reveals that Seshu has a point. There is
 virtually no difference between a Button and a TextView:

 public class Button extends TextView {







      public Button(Context context) {
          this(context, null);
      }

      public Button(Context context, AttributeSet attrs) {
          this(context, attrs, com.android.internal.R.attr.buttonStyle);
      }

      public Button(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
      }
  }

 On Tuesday, February 26, 2013 8:24:53 PM UTC-6, Lew wrote:

  skink wrote:

  Seshu wrote:
        I have one textview [sic] and one button [sic]. i [sic] know the
  purpose of both

   views but if i [sic] used background image and displayed text on both
  then

   both r [sic] looking same only. Is there any particular point which

   differentiate them.

  you'll answer your question by yourself when you see the source code
  of Button.java, just use good, old uncle Google

  Never mind the source. You shouldn't have to read source to figure out
  how to use an API.

  From the Javadocs:

 http://developer.android.com/reference/android/widget/Button.html
  Represents a push-button widget. Push-buttons can be pressed, or
  clicked, by the user to perform an action.
  ... instead of applying an 
  OnClickListenerhttp://developer.android.com/reference/android/view/View.OnClickListe...
   to
  the button in your activity, you can assign a method to your button in the
  XML layout, using the 
  android:onClickhttp://developer.android.com/reference/android/R.attr.html#onClick
   attribute.

 http://developer.android.com/reference/android/widget/TextView.html
  Displays text to the user and optionally allows them to edit it. 

  Seems like points to differentiate them are already revealed.

  --
  Lew

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: TextView vs Button

2013-02-25 Thread skink


Seshu wrote:
 Hi All,
  I have one textview and one button. i know the purpose of both
 views but if i used background image and displayed text on both then
 both r looking same only. Is there any particular point which
 differentiate them.
 Thanks for all,


 Thanks and Regards,
 S.Seshu

you'll answer your question by yourself when you see the source code
of Button.java, just use good, old uncle Google

pskink

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: textview and autolink=web question

2012-11-29 Thread Mike Adams
Any thoughts on this? I don't care if you answer my question. I'm curious
about why leaving the app forces a refresh that the links show but in run
time if they dont leave the app and multi task, they just dont show.

On Sun, Nov 25, 2012 at 10:03 PM, Mike Adams adams...@gmail.com wrote:

 I am calling invalidate on the text view after adding text (the text comes
 in from kind of a chat server, actually its a game server but for this
 purpose its a text view for your chat on the server).  Still even with
 tv.invalidate(), when something like http://www.google.com is added its
 not hyperlinked. But when i back out of the app , open another app, then
 come back, suddenly it is a blue link and it even works i can touch to open
 the browser.  I need to duplicate what is happening with code to force it
 to refresh the text view and make links appear as links if i can without
 the user having to do something clunky like leave the program and come back.


 On Sun, Nov 25, 2012 at 10:59 AM, Mike Adams adams...@gmail.com wrote:

 I have a textview set up with the following xml:

 TextView
 android:id=@+id/tv
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:editable=false
 android:background=#00
 android:typeface=monospace
 android:textSize=14sp
 android:autoLink=web   /

 I initially didn't think android:autoLink=web worked because i was
 writing http links to the console and they were not linked. But i noticed
 the other day if i backed out of the program and opened another app then
 came back to this program, the links that wrote as plain text suddenly
 appeared hyperlinked. How can i force it to display them as hyperlinks on
 first pass?  Seems it could be some kind of refresh or repaint issue.

 Mike




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: textview and autolink=web question

2012-11-25 Thread Mike Adams
I am calling invalidate on the text view after adding text (the text comes
in from kind of a chat server, actually its a game server but for this
purpose its a text view for your chat on the server).  Still even with
tv.invalidate(), when something like http://www.google.com is added its not
hyperlinked. But when i back out of the app , open another app, then come
back, suddenly it is a blue link and it even works i can touch to open
the browser.  I need to duplicate what is happening with code to force it
to refresh the text view and make links appear as links if i can without
the user having to do something clunky like leave the program and come back.

On Sun, Nov 25, 2012 at 10:59 AM, Mike Adams adams...@gmail.com wrote:

 I have a textview set up with the following xml:

 TextView
 android:id=@+id/tv
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:editable=false
 android:background=#00
 android:typeface=monospace
 android:textSize=14sp
 android:autoLink=web   /

 I initially didn't think android:autoLink=web worked because i was
 writing http links to the console and they were not linked. But i noticed
 the other day if i backed out of the program and opened another app then
 came back to this program, the links that wrote as plain text suddenly
 appeared hyperlinked. How can i force it to display them as hyperlinks on
 first pass?  Seems it could be some kind of refresh or repaint issue.

 Mike



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView textSize unknown during Constrcutor (Jellybean)?

2012-07-16 Thread Piren
Just wanted to add some information that might be relevant:
My project is compiled against Google API 7, minSDK is 7 and target SDK is 
8.

On Sunday, July 15, 2012 5:54:35 PM UTC+3, Piren wrote:

 Hi

 I've noticed Jellybean is having a different behavior when it comes to 
 creating TextViews. 
 I have a class that extends Widget.TextView, up until API 16 the textSize 
 was already known after you initialize your class using TextView's 
 constructors (at least on APIs 7-15)

 Why is this no longer true on API 16? is that a bug or on purpose?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView ellipsize marquee on Ice Cream Sandwich

2012-05-03 Thread Martin Brabham
Yuvi,
 I was wondering if you ever found a solution to this issue.  Also do 
you have an example of how you were able to get this to work in the 
activities?  I have tried overriding the value with reflection, and I still 
have the same issue.

On Tuesday, December 20, 2011 2:45:16 AM UTC-8, Yuvi wrote:

 Hey there,

 I found something strange about ellipsize=marquee on my Galaxy 
 Nexus...or better...it doesn't work. Instead of seeing nice fading edges at 
 the end of the word (when the word doesn't fit the view of course), you get 
 the normal dots (...).
 After some digging through the ICS source code I found, in the 
 ViewConfiguration class, this (which enables/disables the fading edge for 
 marquee):

 mFadingMarqueeEnabled = 
 res.getBoolean(com.android.internal.R.bool.config_ui_enableFadingMarquee);

 For some reason on the Galaxy Nexus (Android 4.0.1) this is actually 
 false. Do you have any idea on why is that?
 I also tried with Android 4.0.3 on the Nexus S, with the same results.

 As a test, I tried using Reflection to force the value 
 of mFadingMarqueeEnabled to true. And while it does work in my own 
 Activities, in doesn't work on AppWidgets (and that's where I'm actually 
 using this).

 Do you know if it's actually possible somehow to change the boolean value 
 of com.android.internal.R.bool.config_ui_enableFadingMarquee? (I believe 
 not... :( )

 On the emulator (tested both with Android 4.0 and 4.0.3) this is actually 
 set to true.


 If you have an ICS device could you check if fading edges work for you? (a 
 quick way to check this is to place on your homescreen an app with a long 
 name - e.g. News  Weather - and see if it shows .. at the end of the 
 name, or if it fades nicely).


 Thank you,
 Cheers,
 Yuvi



 -- 
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget 
 to quickly access your favorite apps and contacts!)
 http://www.droidahead.com/apps/launchx/ http://android.yuvalsharon.net

  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView ellipsize marquee on Ice Cream Sandwich

2012-05-03 Thread Vijayalaxmi Arakeri
Hi All,

i wanted to install firefox on my 4.0 emulateor, could anyone please help
me step by step ? I gone through googling but couldn't do as suggested.

Thanks in advance.

Thanks,
Vijaya

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView ellipsize marquee on Ice Cream Sandwich

2012-05-03 Thread Romain Guy
Just use android:requiresFadingEdge instead of hacking into the
framework... Note that fading edges may be very costly when hardware
rendering is enabled.
On May 3, 2012 2:36 AM, Martin Brabham martin.brab...@redrobotlabs.com
wrote:

 Yuvi,
  I was wondering if you ever found a solution to this issue.  Also do
 you have an example of how you were able to get this to work in the
 activities?  I have tried overriding the value with reflection, and I still
 have the same issue.

 On Tuesday, December 20, 2011 2:45:16 AM UTC-8, Yuvi wrote:

 Hey there,

 I found something strange about ellipsize=marquee on my Galaxy
 Nexus...or better...it doesn't work. Instead of seeing nice fading edges at
 the end of the word (when the word doesn't fit the view of course), you get
 the normal dots (...).
 After some digging through the ICS source code I found, in the
 ViewConfiguration class, this (which enables/disables the fading edge for
 marquee):

 mFadingMarqueeEnabled = res.getBoolean(com.android.**
 internal.R.bool.config_ui_**enableFadingMarquee);

 For some reason on the Galaxy Nexus (Android 4.0.1) this is actually
 false. Do you have any idea on why is that?
 I also tried with Android 4.0.3 on the Nexus S, with the same results.

 As a test, I tried using Reflection to force the value
 of mFadingMarqueeEnabled to true. And while it does work in my own
 Activities, in doesn't work on AppWidgets (and that's where I'm actually
 using this).

 Do you know if it's actually possible somehow to change the boolean value
 of com.android.internal.R.**bool.config_ui_**enableFadingMarquee? (I
 believe not... :( )

 On the emulator (tested both with Android 4.0 and 4.0.3) this is actually
 set to true.


 If you have an ICS device could you check if fading edges work for you?
 (a quick way to check this is to place on your homescreen an app with a
 long name - e.g. News  Weather - and see if it shows .. at the end of
 the name, or if it fades nicely).


 Thank you,
 Cheers,
 Yuvi



 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a
 widget to quickly access your favorite apps and contacts!)
 http://www.droidahead.com/**apps/launchx/http://android.yuvalsharon.net

   --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Textview gravity resets

2012-04-03 Thread Kostya Vasilyev
Ok, understood.

fill_parent refers to the parent's width. Perhaps the text view's parent
changes its width?

An easy way to find out is to temporarily assign bright, solid, distinct
background colors to views in your hierarchy.

-- K

3 апреля 2012 г. 4:24 пользователь adev enric...@gmail.com написал:

 I understand what you are saying, but I am saying that it does not
 work.
 For the textview:
 layout_width=fill_parent
 gravity=right|center_vertical

 It still does not work.
 It looks fine until the ad loads.



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Textview gravity resets

2012-04-03 Thread adev
the parent is a tablerow, then a tablelayout, then linear layout
(relative)
so I have width set to fill_parent set to all.

I actually do have it colored already inorder to have a border
the size does not seem to change.

I think the strange part is that this does not happen til after the
adview loads.
at first, I thought it was due to the height changing, but I tried
fixing the height of the adview and that did not change anything.

On Apr 3, 5:05 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Ok, understood.

 fill_parent refers to the parent's width. Perhaps the text view's parent
 changes its width?

 An easy way to find out is to temporarily assign bright, solid, distinct
 background colors to views in your hierarchy.

 -- K

 3 апреля 2012 г. 4:24 пользователь adev enric...@gmail.com написал:







  I understand what you are saying, but I am saying that it does not
  work.
  For the textview:
  layout_width=fill_parent
  gravity=right|center_vertical

  It still does not work.
  It looks fine until the ad loads.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-04-02 Thread adev
It is set to wrap_content, I have tried match_parent and fill_parent
but there is no difference.

After the adview loads, everything APPEARS Left.
However, if I programmatically look at the gravity attribute of the
textview, the gravity is still set to right|center_vertical

On Apr 2, 5:04 am, Kostya Vasilyev kmans...@gmail.com wrote:
 There is - layout_width=wrap_content on the text view.

 2 апреля 2012 г. 7:30 пользователь adev enric...@gmail.com написал:







  I've tried dynamically changing each text view, but nothing happens
  when I change it.
  Is there anything thing else that would cause a text view to APPEAR to
  be left justified eventhough gravity is still set to RIGHT?

  On Apr 1, 9:54 am, adev enric...@gmail.com wrote:
   The adview and admob is all in the XML.
   I do not have any code related to it.
   So that is not dynamic.
   However, it seems that the height of the adview is not determined
   until the ad is loaded.
   When I start the app, the adview height seems to be zero, then after
   one or two seconds, it appears and the rest of the layout resizes to
   fit.
   This is when the gravity is reset.
   I couldn't figure out how to have a preset height.

   On Apr 1, 1:52 am, Narendra Singh Rathore nsr.curi...@gmail.com
   wrote:

On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:
 Sure I can reset the gravity on all of them in code, but that defeats
 the purpose of using the XML.

No, not at all. Just reset the gravity of only the TextView in code.
  You
need not to reset the gravity of all of them, as you are facing the
  problem
only because of TextView's gravity.

 I'd like to know the cause of the issue I'm seeing now and solve it.

The cause of issue might be that, your adview is being loaded
  dynamically,
hence you have to resolve the matter dynamically through code.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group. To post to this group, send email 
  toandroid-develop...@googlegroups.com
  To unsubscribe from this group, send email 
  toandroid-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-04-02 Thread adev
I understand what you are saying, but I am saying that it does not
work.
For the textview:
layout_width=fill_parent
gravity=right|center_vertical

It still does not work.
It looks fine until the ad loads.



On Apr 2, 8:49 am, Kostya Vasilyev kmans...@gmail.com wrote:
 If your text view is set to wrap_content, its width will match the text it
 contains, and so, by definition, changing android:gravity will have no
 effect (this is true for single-line text, but let's keep things simple for
 the sake of discussion).

 What you want is one of:

 android:layout_width=fill_parent
 android:gravity=right

 or

 android:layout_width=wrap_content
 android:layout_gravity=right

 Note the use of layout_gravity in the second case, pushing the view itself
 to the right. That's for a vertical linear layout - for relative layout,
 use android:layout_alignParentRight=true.

 -- K

 2 апреля 2012 г. 16:24 пользователь adev enric...@gmail.com написал:







  It is set to wrap_content, I have tried match_parent and fill_parent
  but there is no difference.

  After the adview loads, everything APPEARS Left.
  However, if I programmatically look at the gravity attribute of the
  textview, the gravity is still set to right|center_vertical

  On Apr 2, 5:04 am, Kostya Vasilyev kmans...@gmail.com wrote:
   There is - layout_width=wrap_content on the text view.

   2 апреля 2012 г. 7:30 пользователь adev enric...@gmail.com написал:

I've tried dynamically changing each text view, but nothing happens
when I change it.
Is there anything thing else that would cause a text view to APPEAR to
be left justified eventhough gravity is still set to RIGHT?

On Apr 1, 9:54 am, adev enric...@gmail.com wrote:
 The adview and admob is all in the XML.
 I do not have any code related to it.
 So that is not dynamic.
 However, it seems that the height of the adview is not determined
 until the ad is loaded.
 When I start the app, the adview height seems to be zero, then after
 one or two seconds, it appears and the rest of the layout resizes to
 fit.
 This is when the gravity is reset.
 I couldn't figure out how to have a preset height.

 On Apr 1, 1:52 am, Narendra Singh Rathore nsr.curi...@gmail.com
 wrote:

  On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:
   Sure I can reset the gravity on all of them in code, but that
  defeats
   the purpose of using the XML.

  No, not at all. Just reset the gravity of only the TextView in
  code.
You
  need not to reset the gravity of all of them, as you are facing the
problem
  only because of TextView's gravity.

   I'd like to know the cause of the issue I'm seeing now and solve
  it.

  The cause of issue might be that, your adview is being loaded
dynamically,
  hence you have to resolve the matter dynamically through code.

--
You received this message because you are subscribed to the Google
Groups Android Developers group. To post to this group, send 
emailtoandroid-develop...@googlegroups.com
To unsubscribe from this group, send email 
toandroid-developers+unsubscr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group. To post to this group, send email 
  toandroid-develop...@googlegroups.com
  To unsubscribe from this group, send email 
  toandroid-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-04-01 Thread adev
The adview and admob is all in the XML.
I do not have any code related to it.
So that is not dynamic.
However, it seems that the height of the adview is not determined
until the ad is loaded.
When I start the app, the adview height seems to be zero, then after
one or two seconds, it appears and the rest of the layout resizes to
fit.
This is when the gravity is reset.
I couldn't figure out how to have a preset height.

On Apr 1, 1:52 am, Narendra Singh Rathore nsr.curi...@gmail.com
wrote:
 On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:
  Sure I can reset the gravity on all of them in code, but that defeats
  the purpose of using the XML.

 No, not at all. Just reset the gravity of only the TextView in code. You
 need not to reset the gravity of all of them, as you are facing the problem
 only because of TextView's gravity.



  I'd like to know the cause of the issue I'm seeing now and solve it.

 The cause of issue might be that, your adview is being loaded dynamically,
 hence you have to resolve the matter dynamically through code.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-04-01 Thread adev
Also, even if I did do it dynamically, how do I know when to do it?
I would need to trigger the gravity code to run after the ad has been
loaded or when the gravity gets changed.
Is there a way to trigger off one of these events?

On Apr 1, 9:54 am, adev enric...@gmail.com wrote:
 The adview and admob is all in the XML.
 I do not have any code related to it.
 So that is not dynamic.
 However, it seems that the height of the adview is not determined
 until the ad is loaded.
 When I start the app, the adview height seems to be zero, then after
 one or two seconds, it appears and the rest of the layout resizes to
 fit.
 This is when the gravity is reset.
 I couldn't figure out how to have a preset height.

 On Apr 1, 1:52 am, Narendra Singh Rathore nsr.curi...@gmail.com
 wrote:







  On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:
   Sure I can reset the gravity on all of them in code, but that defeats
   the purpose of using the XML.

  No, not at all. Just reset the gravity of only the TextView in code. You
  need not to reset the gravity of all of them, as you are facing the problem
  only because of TextView's gravity.

   I'd like to know the cause of the issue I'm seeing now and solve it.

  The cause of issue might be that, your adview is being loaded dynamically,
  hence you have to resolve the matter dynamically through code.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-04-01 Thread adev
I've tried dynamically changing each text view, but nothing happens
when I change it.
Is there anything thing else that would cause a text view to APPEAR to
be left justified eventhough gravity is still set to RIGHT?

On Apr 1, 9:54 am, adev enric...@gmail.com wrote:
 The adview and admob is all in the XML.
 I do not have any code related to it.
 So that is not dynamic.
 However, it seems that the height of the adview is not determined
 until the ad is loaded.
 When I start the app, the adview height seems to be zero, then after
 one or two seconds, it appears and the rest of the layout resizes to
 fit.
 This is when the gravity is reset.
 I couldn't figure out how to have a preset height.

 On Apr 1, 1:52 am, Narendra Singh Rathore nsr.curi...@gmail.com
 wrote:







  On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:
   Sure I can reset the gravity on all of them in code, but that defeats
   the purpose of using the XML.

  No, not at all. Just reset the gravity of only the TextView in code. You
  need not to reset the gravity of all of them, as you are facing the problem
  only because of TextView's gravity.

   I'd like to know the cause of the issue I'm seeing now and solve it.

  The cause of issue might be that, your adview is being loaded dynamically,
  hence you have to resolve the matter dynamically through code.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview gravity resets

2012-03-31 Thread adev
Sure I can reset the gravity on all of them in code, but that defeats
the purpose of using the XML.

I'd like to know the cause of the issue I'm seeing now and solve it.

On Mar 31, 2:17 pm, Narendra Singh Rathore nsr.curi...@gmail.com
wrote:
 On Sat, Mar 31, 2012 at 4:24 AM, adev enric...@gmail.com wrote:

  How can I avoid this in xml

 Why don't you try to do this in your activity/java file (dynamically)? I
 think that will solve your problem.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Textview gravity resets

2012-03-31 Thread Narendra Singh Rathore
On Sun, Apr 1, 2012 at 8:01 AM, adev enric...@gmail.com wrote:

 Sure I can reset the gravity on all of them in code, but that defeats
 the purpose of using the XML.

No, not at all. Just reset the gravity of only the TextView in code. You
need not to reset the gravity of all of them, as you are facing the problem
only because of TextView's gravity.



 I'd like to know the cause of the issue I'm seeing now and solve it.


The cause of issue might be that, your adview is being loaded dynamically,
hence you have to resolve the matter dynamically through code.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView scroll in an activity.

2012-02-07 Thread Put_tiMe
Ok, I got it to work.
I HAD to add a scroll view to the text view.
 
ScrollView 
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:orientation=vertical
 android:isScrollContainer=true
 android:scrollbars=vertical|horizontal
 android:scrollbarStyle=outsideOverlay 
 
TextView
android:layout_width=wrap_content
android:layout_height=wrap_content
android:inputType=text|textMultiLine
android:scrollHorizontally=false
/TextView
 
And for the word wrap to work, see the attributes for TextView above.
 
 
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Textview Instead of ImageView

2011-11-25 Thread warenix
magznumber contorls what to show in your switch statement.
Make sure the value of it is 2 if you want to show text.
Use debugger or logcat to find out the values at runtime.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Textview Issue?

2011-11-25 Thread Navindian
When case is 2, it is not showing TextView but when it is case1, it is
showing image properly. The question here is how to show textview on the
other fragment when clicked on the list on the other link.

On Fri, Nov 25, 2011 at 10:38 PM, Navindian navind...@gmail.com wrote:

 PFA screenshot.

 On Click of a link, I am able to show the image.
 I wish to show the text instead.



 *switch*(magznumber){

 *case* 1:

 i.setImageResource(R.drawable.
 *efymag*);

 *break*;

 *case* 2:

 textViewObject.setText(text);

 *break*;

 }

 Please comment by looking at the above code. case 2 is not showing the
 text. The following link will help you understanding.


 http://androidcookbook.com/Recipe.seam;jsessionid=40151FCD26222877E151C3EEFB406EED?recipeId=1160recipeFrom=ViewTOC


 Thanks
 navind


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Textview Issue?

2011-11-25 Thread skink


Navindian wrote:
 When case is 2, it is not showing TextView but when it is case1, it is
 showing image properly. The question here is how to show textview on the
 other fragment when clicked on the list on the other link.

 On Fri, Nov 25, 2011 at 10:38 PM, Navindian navind...@gmail.com wrote:

  PFA screenshot.
 
  On Click of a link, I am able to show the image.
  I wish to show the text instead.
 
 
 
  *switch*(magznumber){
 
  *case* 1:
 
  i.setImageResource(R.drawable.
  *efymag*);
 
  *break*;
 
  *case* 2:
 
  textViewObject.setText(text);
 
  *break*;
 
  }
 
  Please comment by looking at the above code. case 2 is not showing the
  text. The following link will help you understanding.
 
 
  http://androidcookbook.com/Recipe.seam;jsessionid=40151FCD26222877E151C3EEFB406EED?recipeId=1160recipeFrom=ViewTOC
 
 
  Thanks
  navind
 

what the hell are you talking about?

nobody is gonna answer such misty and vague questions

pskink

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView -- text transformation

2011-11-01 Thread TreKing
On Mon, Oct 31, 2011 at 11:08 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Maybe you misunderstood me.  I am looking for a way for the TextView
 to draw the text differently based on my markups.


Ohhh - Yeah, my idea won't work then =P . And I haven't tried
anything like that so IDK.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView -- text transformation

2011-11-01 Thread Miguel Morales
Make it a custom webview and use html?
There's also spannable which lets you define things like clickable links in
text.  I believe it also supports html formatting.

On Tue, Nov 1, 2011 at 5:13 AM, TreKing treking...@gmail.com wrote:

 On Mon, Oct 31, 2011 at 11:08 PM, Zsolt Vasvari zvasv...@gmail.comwrote:

 Maybe you misunderstood me.  I am looking for a way for the TextView
 to draw the text differently based on my markups.


 Ohhh - Yeah, my idea won't work then =P . And I haven't tried
 anything like that so IDK.


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView -- text transformation

2011-11-01 Thread Kostya Vasilyev

Or perhaps try something out with this:

http://developer.android.com/reference/android/text/style/MetricAffectingSpan.html

The classes that affect character-level text formatting in a way that 
changes the width or height of characters extend this class


Or this:

http://developer.android.com/reference/android/text/style/ReplacementSpan.html

-- Kostya

01.11.2011 16:17, Miguel Morales ?:

Make it a custom webview and use html?
There's also spannable which lets you define things like clickable 
links in text.  I believe it also supports html formatting.


On Tue, Nov 1, 2011 at 5:13 AM, TreKing treking...@gmail.com 
mailto:treking...@gmail.com wrote:


On Mon, Oct 31, 2011 at 11:08 PM, Zsolt Vasvari
zvasv...@gmail.com mailto:zvasv...@gmail.com wrote:

Maybe you misunderstood me.  I am looking for a way for the
TextView
to draw the text differently based on my markups.


Ohhh - Yeah, my idea won't work then =P . And I haven't
tried anything like that so IDK.


-
TreKing http://sites.google.com/site/rezmobileapps/treking -
Chicago transit tracking app for Android-powered devices


-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/, 
http://www.youtube.com/user/revoltingx

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en 


--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView -- text transformation

2011-11-01 Thread Zsolt Vasvari
Ok, thanks.  Will check it out.

On Nov 1, 8:31 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Or perhaps try something out with this:

 http://developer.android.com/reference/android/text/style/MetricAffec...

 The classes that affect character-level text formatting in a way that
 changes the width or height of characters extend this class

 Or this:

 http://developer.android.com/reference/android/text/style/Replacement...

 -- Kostya

 01.11.2011 16:17, Miguel Morales ?:





  Make it a custom webview and use html?
  There's also spannable which lets you define things like clickable
  links in text.  I believe it also supports html formatting.

  On Tue, Nov 1, 2011 at 5:13 AM, TreKing treking...@gmail.com
  mailto:treking...@gmail.com wrote:

      On Mon, Oct 31, 2011 at 11:08 PM, Zsolt Vasvari
      zvasv...@gmail.com mailto:zvasv...@gmail.com wrote:

          Maybe you misunderstood me.  I am looking for a way for the
          TextView
          to draw the text differently based on my markups.

      Ohhh - Yeah, my idea won't work then =P . And I haven't
      tried anything like that so IDK.

      
  ---­--
      TreKing http://sites.google.com/site/rezmobileapps/treking -
      Chicago transit tracking app for Android-powered devices

      --
      You received this message because you are subscribed to the Google
      Groups Android Developers group.
      To post to this group, send email to
      android-developers@googlegroups.com
      mailto:android-developers@googlegroups.com
      To unsubscribe from this group, send email to
      android-developers+unsubscr...@googlegroups.com
      mailto:android-developers%2bunsubscr...@googlegroups.com
      For more options, visit this group at
     http://groups.google.com/group/android-developers?hl=en

  --
  ~ Jeremiah:9:23-24
  Android 2D MMORPG:http://solrpg.com/,
 http://www.youtube.com/user/revoltingx
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Kostya Vasilyev- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView -- text transformation

2011-10-31 Thread Zsolt Vasvari
Maybe you misunderstood me.  I am looking for a way for the TextView
to draw the text differently based on my markups.

On Nov 1, 10:57 am, TreKing treking...@gmail.com wrote:
 On Mon, Oct 31, 2011 at 9:37 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
  What I want to do is have an EditText (or TextView) where I want to do a
  text replacement for display purposes only.

  Any ideas?

 Off the cuff, I'd say MapString, String, original string being first,
 display string being second.

 ---­--
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textView Clears on Rotation

2011-10-12 Thread T.Chow
may be help: http://android-er.blogspot.com/2011/09/onsaveinstancestate-and.html


On Oct 8, 4:45 am, King Salamon msalamon.comcast@gmail.com
wrote:
 Please can anyone give me a full coding example for getting data to persist
 after the device is rotated. All of my textView fields go back to zero when
 the device is rotated. I understand that the activity is destroyed and then
 recreated due to configuration change, and I think that using
 onSavedInstanceState somehow might resolve the issue--but I need a more
 detailed explanation with full code please. HELP!!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textView Clears on Rotation

2011-10-10 Thread King Salamon
This does not work for textView

see Kostya's post above
 And IIRC, TextView by default doesn't save or restore state even if
there is an ID


On Oct 8, 11:14 pm, decode decode.develo...@gmail.com wrote:
 Give an id to your textview. Android system should handle it...

 On Oct 9, 8:35 am, Studio LFP studio@gmail.com wrote:







  Thanks for the link there. I've read that a couple of times and understand
  the uses.

  Is there a set of documentation that tells what is automatically saved off
  if you don't use the configChanges option? I know a little by catching it
  here and there on these groups, but I haven't located a full list yet.

  Steven
  Studio LFPhttp://www.studio-lfp.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textView Clears on Rotation

2011-10-10 Thread King Salamon
Thank you everyone for the great insight on this issue. I tried the
simple -down and dirty workaround by adding
android:configChanges=orientation|keyboardHidden
to the activity tag in the manifest. This did in fact work as the data
persisted after rotation.

However, as many have pointed out, this is not really a viable, long
term solution, and a better fix would be to store the data either
using shared preferences, a database, a file, or the onSaved instance
method.

Unfortunately, I cannot seem to get any of these to work! Can anyone
provide a code sample with a very simple example -perhaps just one
textview element that can keep its data using one of the above
methods?

Thanks in advance

On Oct 9, 11:24 am, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Oct 9, 2011 at 10:59 AM, Studio LFP studio@gmail.com wrote:
  3. Special consideration now has to be taken with AsyncTasks since they are
  linked to the UI and need to be stopped, location of processing saved and
  restarted

 False. Special consideration may be required but they do not need to
 be stopped and restarted.

 http://stackoverflow.com/questions/3821423/background-task-progress-d...

  4. Special consideration for threading, but not quite as much as AsyncTasks

 False.

 If the thread has interaction with the UI, you need to deal with the
 thread the same way you deal with the AsyncTask. If the thread has no
 interaction with the UI, an equivalent AsyncTask would also not
 require any additional work.

  5. Special consideration needs to be taken for the things saved in the
  bundle so you don't leak the previous context.

 False.

 There is nothing you can put in a Bundle that can leak a Context. This
 is by definition -- a Bundle has to be able to be passed across
 process boundaries, and a Context cannot be passed across process
 boundaries.

 Now, had you written things returned by
 onRetainNonConfigurationInstance(), that *is* an issue.

  With configChanges:

  1. Layout may need to be changed on rotation
  2. Other unknown issues

 It's not just screen rotations and it's not just layouts. If the user
 changes their locale and comes back to your running app, that's a
 configuration change. If the user drops their device into a car dock,
 that's a configuration change. If the user removes the device from the
 car dock, that's a configuration change. And so on.

 You also forgot about your options menus and perhaps others. And, not
 only do you have to deal with this for each and every resource you are
 using today, but also for each and every resource you add in the
 future. And for each and every new configuration change that appears
 in the future (averaging one new one per Android release).

  With the resources being automatically swapped out by Android, a simple
  refresh on screen elements would pick up a new language if you needed to
  support that.

 Not necessarily. Many applications have strings beyond those wired
 into a layout resource, which if cached would need to be reloaded.
 Options menus are cached if the user opened the menu before. Drawables
 get cached. And so on.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: textView Clears on Rotation

2011-10-10 Thread Kostya Vasilyev

Setting

android:freezesText=true

in the layout XML forces a TextView to save its content. The view needs 
to have an ID as well.


-- Kostya

10.10.2011 17:48, King Salamon пишет:

Thank you everyone for the great insight on this issue. I tried the
simple -down and dirty workaround by adding
android:configChanges=orientation|keyboardHidden
to the activity tag in the manifest. This did in fact work as the data
persisted after rotation.

However, as many have pointed out, this is not really a viable, long
term solution, and a better fix would be to store the data either
using shared preferences, a database, a file, or the onSaved instance
method.

Unfortunately, I cannot seem to get any of these to work! Can anyone
provide a code sample with a very simple example -perhaps just one
textview element that can keep its data using one of the above
methods?

Thanks in advance


--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textView Clears on Rotation

2011-10-10 Thread King Salamon
Excellent --this works! Thanks

On Oct 10, 9:54 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Setting

 android:freezesText=true

 in the layout XML forces a TextView to save its content. The view needs
 to have an ID as well.

 -- Kostya

 10.10.2011 17:48,KingSalamonпишет:









  Thank you everyone for the great insight on this issue. I tried the
  simple -down and dirty workaround by adding
  android:configChanges=orientation|keyboardHidden
  to the activity tag in the manifest. This did in fact work as the data
  persisted after rotation.

  However, as many have pointed out, this is not really a viable, long
  term solution, and a better fix would be to store the data either
  using shared preferences, a database, a file, or the onSaved instance
  method.

  Unfortunately, I cannot seem to get any of these to work! Can anyone
  provide a code sample with a very simple example -perhaps just one
  textview element that can keep its data using one of the above
  methods?

  Thanks in advance

 --
 Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: textView Clears on Rotation

2011-10-09 Thread Kostya Vasilyev


09.10.2011 2:41, Studio LFP ?:

*TreKing, Kostya, Romain Guy,*

I do understand what you guys are saying, so I am listening, but it 
seems to be a contradiction since it seems most of the internal 
applications use it, including quite a few that Google themselves send 
with the devices. Maybe they aren't, but based on the speed of the 
rotate and the way the screen looks, I'm pretty sure they are.


[snip]


That's where those methods pointed out by TreKing come into play, as an 
optimization.


And here is a blog post written by Romain Guy that covers this in more 
detail:


http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html

Those are optimizations for the common cases.

The manifest attribute is fine, too, as long as 1) one understands that 
it's also an optimization 2)  the code can handle the general case, 
where the activity gets recreated and 3) the layout is the same for all 
orientations.




It seems like there are so many times where this is useful and being 
used, yet people seem to be trying to tell people that it is wrong, 
incorrect, you are a horrible person and coder for using this.


To me, it's wrong to mix up the concepts of here is how you fix this 
problem and this is an optimization you can make.


To me it's also wrong to forget about the general case, i.e. other 
config changes and the out of memory killer (and maybe more cases I 
can't think of right now).


YMMV.



Steven
Studio LFP
http://www.studio-lfp.com


On Saturday, October 8, 2011 4:34:14 PM UTC-5, Romain Guy (Google) wrote:

*TreKing,*

If you choose to ignore a well documented feature given to us
by the Android team, that's your prerogative. As for the rest
of us, we'll decide when we prefer to use one feature over
another.


He makes a good point. Solving this issue by requesting to
handle orientation changes yourself just masks the problem (unless
you request to handle *all* configuration changes in which case
you make more work for yourself.) Handling orientation changes
yourself also has a lot of side effects (if you want to have a
different layout in landscape and portrait you now need to deal
with it manually.)

-- 
Romain Guy

Android framework engineer
roma...@android.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en 


--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-09 Thread Studio LFP
I'm compiling a list of things that need to happen in both cases. So far it 
looks like a lot bigger challenge to not use the android:configChanges than 
to use it.

I've read the optimization post plenty of times and do understand it, but 
I'd like to get the big picture for the usages of both to be able to decide 
which is better in certain cases.

Here's a few of the issues I'm trying to find good solutions to when *not*using 
configChanges:

1. Window states are not saved. ListView scroll locations, ExpandedListView 
drop-downs and scroll locations, ScrollView locations, etc.
2. OpenGL VBOs and textures loaded into memory get destroyed and have to be 
reprocessed and copied back into memory along with the GLSurfaceView state 
information
3. Special consideration now has to be taken with AsyncTasks since they are 
linked to the UI and need to be stopped, location of processing saved and 
restarted
4. Special consideration for threading, but not quite as much as AsyncTasks
5. Special consideration needs to be taken for the things saved in the 
bundle so you don't leak the previous context. This could get tricky because 
I'm sure a lot of people pass a context to objects or blend data and view 
objects

*With* configChanges:

1. Layout may need to be changed on rotation
2. Other unknown issues

With the resources being automatically swapped out by Android, a simple 
refresh on screen elements would pick up a new language if you needed to 
support that. That also includes any images that might be swapped over, but 
as I have to refresh the state of my windows even when it isn't rotated, 
this is already written in the base application anyways.

To me it's also wrong to forget about the general case, i.e. other config 
 changes and the out of memory killer (and maybe more cases I can't think of 
 right now). 


This part did catch my eye and it is what I was wondering. Is there 
something that the configChanges does to cause internal issues because it is 
bugged? All of the configuration changes are fairly straight forward and 
documented, but if there is some issue internally, would be nice to know.

In an effort for this discussion not to go to waste, I'm trying to get the 
full picture compiled together on what has to happen on both so that I can 
get a post on my site or somewhere to help others. I know we all see this 
question fly by on this group (and on other help areas) all the time, so I 
figure a post of the compiled pros and cons of each would be helpful.

Anyone that would like to toss in additional information about the things 
you have to deal with on either occasion (using configChanges or not), 
please do so and I will compile it for us for future reference.

Steven
Studio LFP
http://www.studio-lfp.com



On Sunday, October 9, 2011 4:47:03 AM UTC-5, Kostya Vasilyev wrote:

  
 09.10.2011 2:41, Studio LFP пишет: 

 *TreKing, Kostya, Romain Guy,*

 I do understand what you guys are saying, so I am listening, but it seems 
 to be a contradiction since it seems most of the internal applications use 
 it, including quite a few that Google themselves send with the devices. 
 Maybe they aren't, but based on the speed of the rotate and the way the 
 screen looks, I'm pretty sure they are.

 [snip]


 That's where those methods pointed out by TreKing come into play, as an 
 optimization.

 And here is a blog post written by Romain Guy that covers this in more 
 detail:


 http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html

 Those are optimizations for the common cases.

 The manifest attribute is fine, too, as long as 1) one understands that 
 it's also an optimization 2)  the code can handle the general case, where 
 the activity gets recreated and 3) the layout is the same for all 
 orientations.


 It seems like there are so many times where this is useful and being used, 
 yet people seem to be trying to tell people that it is wrong, incorrect, 
 you are a horrible person and coder for using this.


 To me, it's wrong to mix up the concepts of here is how you fix this 
 problem and this is an optimization you can make.

 To me it's also wrong to forget about the general case, i.e. other config 
 changes and the out of memory killer (and maybe more cases I can't think of 
 right now). 

 YMMV.


 Steven
 Studio LFP
 http://www.studio-lfp.com


 On Saturday, October 8, 2011 4:34:14 PM UTC-5, Romain Guy (Google) wrote: 

  *TreKing,*

 If you choose to ignore a well documented feature given to us by the 
 Android team, that's your prerogative. As for the rest of us, we'll decide 
 when we prefer to use one feature over another.


  He makes a good point. Solving this issue by requesting to handle 
 orientation changes yourself just masks the problem (unless you request to 
 handle *all* configuration changes in which case you make more work for 
 yourself.) Handling orientation changes yourself also has a lot of side 
 effects (if you want to have a different 

Re: [android-developers] Re: textView Clears on Rotation

2011-10-09 Thread Mark Murphy
On Sun, Oct 9, 2011 at 10:59 AM, Studio LFP studio@gmail.com wrote:
 3. Special consideration now has to be taken with AsyncTasks since they are
 linked to the UI and need to be stopped, location of processing saved and
 restarted

False. Special consideration may be required but they do not need to
be stopped and restarted.

http://stackoverflow.com/questions/3821423/background-task-progress-dialog-orientation-change-is-there-any-100-working/3821998#3821998

 4. Special consideration for threading, but not quite as much as AsyncTasks

False.

If the thread has interaction with the UI, you need to deal with the
thread the same way you deal with the AsyncTask. If the thread has no
interaction with the UI, an equivalent AsyncTask would also not
require any additional work.

 5. Special consideration needs to be taken for the things saved in the
 bundle so you don't leak the previous context.

False.

There is nothing you can put in a Bundle that can leak a Context. This
is by definition -- a Bundle has to be able to be passed across
process boundaries, and a Context cannot be passed across process
boundaries.

Now, had you written things returned by
onRetainNonConfigurationInstance(), that *is* an issue.

 With configChanges:

 1. Layout may need to be changed on rotation
 2. Other unknown issues

It's not just screen rotations and it's not just layouts. If the user
changes their locale and comes back to your running app, that's a
configuration change. If the user drops their device into a car dock,
that's a configuration change. If the user removes the device from the
car dock, that's a configuration change. And so on.

You also forgot about your options menus and perhaps others. And, not
only do you have to deal with this for each and every resource you are
using today, but also for each and every resource you add in the
future. And for each and every new configuration change that appears
in the future (averaging one new one per Android release).

 With the resources being automatically swapped out by Android, a simple
 refresh on screen elements would pick up a new language if you needed to
 support that.

Not necessarily. Many applications have strings beyond those wired
into a layout resource, which if cached would need to be reloaded.
Options menus are cached if the user opened the menu before. Drawables
get cached. And so on.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread TreKing
On Fri, Oct 7, 2011 at 3:59 PM, Studio LFP studio@gmail.com wrote:

 Add this to your activity tag in the AndroidManifest.xml

 android:configChanges=orientation|keyboardHidden

 That will fix you up


That will hide the issue until the app is destroyed / recreated via some
other means - like being put in the background and being returned to later.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Studio LFP
*TreKing,*

This is true, but he didn't ask about that.  He just asked about a way for 
an EditText to keep the text it has on a rotate.

The easiest and fastest way to solve that particular problem is the 
configChanges XML attribute.

You'll note that I said their may be a need for other options if they needed 
it to do additional things other than just handle a rotate. There is no need 
to code complicated functions to do something simple. Fix it the simplest 
way possible and then add to it if other things arise.


*King Salamon,*

You can review this documentation to understand more about how to save the 
state in an Activity:

http://developer.android.com/guide/topics/fundamentals/activities.html#SavingActivityState


Steven
Studio LFP
http://www.studio-lfp.com


On Saturday, October 8, 2011 2:13:01 AM UTC-5, TreKing wrote:

 On Fri, Oct 7, 2011 at 3:59 PM, Studio LFP studi...@gmail.com wrote:

 Add this to your activity tag in the AndroidManifest.xml

 android:configChanges=orientation|keyboardHidden

 That will fix you up


 That will hide the issue until the app is destroyed / recreated via some 
 other means - like being put in the background and being returned to later.


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread TreKing
On Sat, Oct 8, 2011 at 12:00 PM, Studio LFP studio@gmail.com wrote:

 *TreKing,*

 This is true, but he didn't ask about that.


LOL - so since he didn't ask for for a method that covers the case I
mentioned, it's OK to give him a limited solution?


 He just asked about a way for an EditText to keep the text it has on a
 rotate.


What people ask on this list is usually very different from the problem
they're actually having.


 The easiest and fastest way to solve that particular problem is the
 configChanges XML attribute.


Easiest and fastest, but technically incorrect. He's probably asking
specifically about rotate because that's also the easiest and fastest way to
see the issue. But, as I mentioned, it's not the only way and the OP should
be completely aware of that before going with a strategy that will only hide
the problem in one particular scenario.

You'll note that I said their may be a need for other options if they needed
 it to do additional things other than just handle a rotate.


You mentioned the case of different layouts which doesn't cover the case of
leaving the app, waiting a while, and coming back to it (AFAIK). There are
probably others.


 There is no need to code complicated functions to do something simple. Fix
 it the simplest way possible and then add to it if other things arise.


Sure, but if the simplest way possible is known to have issues, you're not
really doing the OP any favors, are you? Now he'll waste time fixing it the
simplest way, then eventually having to come back and fix it the right way.
Why not have him do it the right way from get-go if you can? It's not like
using the save and restore methods is that complicated.

IMHO, the configChanges attributes are for use when you know exactly what
you're doing with them and why. Using them to get around saving / restoring
state is a fragile kludge for people that can't figure out how to do it
correctly. People should be encouraged to figure out how to do this the
right way so it works in every scenario and not use what amounts to a hack
to solve the most common instance of configuration change.

And I say all this because I've seen way to many people ask about this exact
scenario in this group.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Studio LFP
*TreKing,*

If you choose to ignore a well documented feature given to us by the Android 
team, that's your prerogative. As for the rest of us, we'll decide when we 
prefer to use one feature over another.


*King Salamon*,

As stated previously, regardless of which way you choose to do it (neither 
is correct or incorrect), just read up on the things you need to handle 
to make them work like you need them to.

If you really want to save a state long-term, I would suggest you also look 
at SharedPreferences:

http://developer.android.com/reference/android/content/SharedPreferences.html

You aren't guaranteed your state will still be there even if you do save it 
in a bundle. You should treat the state of your application as volatile at 
all times. If a state or piece of data is really important to keep around, 
commit it to disk immediately via the SharedPreferences or another method 
like a custom file, database, etc.. Devices are constantly switching states 
even when we don't want them to. Battery dying, being dropped, locking up, 
and tons of others things make sure the mobile environment is never 
guaranteed, so write accordingly.

Steven
Studio LFP
http://www.studio-lfp.com

 
On Saturday, October 8, 2011 3:02:34 PM UTC-5, TreKing wrote:

 On Sat, Oct 8, 2011 at 12:00 PM, Studio LFP studi...@gmail.com wrote:

 *TreKing,*

 This is true, but he didn't ask about that.


 LOL - so since he didn't ask for for a method that covers the case I 
 mentioned, it's OK to give him a limited solution?
  

 He just asked about a way for an EditText to keep the text it has on a 
 rotate.


 What people ask on this list is usually very different from the problem 
 they're actually having.
  

 The easiest and fastest way to solve that particular problem is the 
 configChanges XML attribute.


 Easiest and fastest, but technically incorrect. He's probably asking 
 specifically about rotate because that's also the easiest and fastest way to 
 see the issue. But, as I mentioned, it's not the only way and the OP should 
 be completely aware of that before going with a strategy that will only hide 
 the problem in one particular scenario.

 You'll note that I said their may be a need for other options if they 
 needed it to do additional things other than just handle a rotate.


 You mentioned the case of different layouts which doesn't cover the case of 
 leaving the app, waiting a while, and coming back to it (AFAIK). There are 
 probably others.
  

 There is no need to code complicated functions to do something simple. Fix 
 it the simplest way possible and then add to it if other things arise.


 Sure, but if the simplest way possible is known to have issues, you're 
 not really doing the OP any favors, are you? Now he'll waste time fixing it 
 the simplest way, then eventually having to come back and fix it the right 
 way. Why not have him do it the right way from get-go if you can? It's not 
 like using the save and restore methods is that complicated.

 IMHO, the configChanges attributes are for use when you know exactly what 
 you're doing with them and why. Using them to get around saving / restoring 
 state is a fragile kludge for people that can't figure out how to do it 
 correctly. People should be encouraged to figure out how to do this the 
 right way so it works in every scenario and not use what amounts to a hack 
 to solve the most common instance of configuration change.

 And I say all this because I've seen way to many people ask about this 
 exact scenario in this group.


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices

  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread TreKing
On Sat, Oct 8, 2011 at 4:02 PM, Studio LFP studio@gmail.com wrote:

 *TreKing,*

 If you choose to ignore a well documented feature given to us by the
 Android team, that's your prerogative. As for the rest of us, we'll decide
 when we prefer to use one feature over another.


Which well documented feature? This one?
http://developer.android.com/guide/topics/manifest/activity-element.html#config

And I quote:
*Note:* Using this attribute should be avoided and used only as a
last-resort. Please read Handling Runtime
Changeshttp://developer.android.com/guide/topics/resources/runtime-changes.html
for
more information about how to properly handle a restart due to a
configuration change.

It really seems to me that you're the one ignoring some important details.
You are advising the OP to use this solution to solve his state problem
which is clearly documented as not being the correct thing to do.

So, If you choose to ignore a well documented feature given to us by the
Android team, that's your prerogative. As for the rest of us, we'll decide
when we prefer to use the correct solution over a kludge.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Romain Guy

 *TreKing,*

 If you choose to ignore a well documented feature given to us by the
 Android team, that's your prerogative. As for the rest of us, we'll decide
 when we prefer to use one feature over another.


He makes a good point. Solving this issue by requesting to handle
orientation changes yourself just masks the problem (unless you request to
handle *all* configuration changes in which case you make more work for
yourself.) Handling orientation changes yourself also has a lot of side
effects (if you want to have a different layout in landscape and portrait
you now need to deal with it manually.)

-- 
Romain Guy
Android framework engineer
romain...@android.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Kostya Vasilyev
The user changing the language is a config change (likely rare, except 
for developers testing localization, but still).


Possibly more commonplace, docking (and undocking), is a config change.

Back to the original topic: Andorid automatically saves and restores 
those views that have an ID. If a view has the default ID value of -1 
(either not assigned in XML or not set in code), it's state is not saved.


And IIRC, TextView by default doesn't save or restore state even if 
there is an ID. Setting android:freezesText=true in XML or calling 
setFreezesText(true) from code is supposed to force saving, but I've 
never tried it myself.



   public voidsetFreezesText(boolean freezesText)

Since:API Level 1 
http://developer.android.com/guide/appendix/api-levels.html#level1


Control whether this text view saves its entire text contents when 
freezing to an icicle, in addition to dynamic state such as cursor 
position. By default this is false, not saving the text. Set to true if 
the text in the text view is not being saved somewhere else in 
persistent storage (such as in a content provider) so that if the view 
is later thawed the user will not lose their data.



-- Kostya

09.10.2011 1:25, TreKing ?:


And I quote:
*Note:* Using this attribute should be avoided and used only as a 
last-resort. Please read Handling Runtime Changes 
http://developer.android.com/guide/topics/resources/runtime-changes.html for 
more information about how to properly handle a restart due to a 
configuration change.


It really seems to me that you're the one ignoring some important 
details. You are advising the OP to use this solution to solve his 
state problem which is clearly documented as not being the correct 
thing to do.


--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Studio LFP
*TreKing, Kostya, Romain Guy,*

I do understand what you guys are saying, so I am listening, but it seems to 
be a contradiction since it seems most of the internal applications use it, 
including quite a few that Google themselves send with the devices. Maybe 
they aren't, but based on the speed of the rotate and the way the screen 
looks, I'm pretty sure they are.

There are other issue like when using OpenGL and putting a game in landscape 
only mode. If the device is in portrait when it is launched, you are going 
to get a instance of your application in portrait just to be destroyed at an 
arbitrary time after launch to be remade into a landscape. Is there a good 
way to know this is coming so you don't do a lot of expensive instructions 
just to have to do them again?

Also, what about times where a particular activity may take a bit of time to 
setup properly and the users tilts the device slight, but doesn't mean to 
rotate it, and it rotates. They immediately rotate it back causing yet 
another reload for a simple whoops. Not to mention clearing the location of 
ListView scrolls and the likes which causes the user to have to find 
specific items again. I catch myself doing that all the time.

Not only that, but with a lot of devices having slide out game pads and 
keyboards. This becomes a lifesaver to not have to deal with a stream of 
destroy/remake when the hardware is being pulled out and put back. I've 
watched people look at a text, spin the device, drop the keyboard out, type 
a reply and do the first two steps in reverse. That would equal three 
destroy/remakes on pulling the keyboard out and two destroy/remakes on 
putting the keyboard back in ( I dealt with this with myself and people I 
know with the Droid/2/3).

It seems like there are so many times where this is useful and being used, 
yet people seem to be trying to tell people that it is wrong, incorrect, 
you are a horrible person and coder for using this.

Steven
Studio LFP
http://www.studio-lfp.com


On Saturday, October 8, 2011 4:34:14 PM UTC-5, Romain Guy (Google) wrote:

 *TreKing,*

 If you choose to ignore a well documented feature given to us by the 
 Android team, that's your prerogative. As for the rest of us, we'll decide 
 when we prefer to use one feature over another.


 He makes a good point. Solving this issue by requesting to handle 
 orientation changes yourself just masks the problem (unless you request to 
 handle *all* configuration changes in which case you make more work for 
 yourself.) Handling orientation changes yourself also has a lot of side 
 effects (if you want to have a different layout in landscape and portrait 
 you now need to deal with it manually.)

 -- 
 Romain Guy
 Android framework engineer
 roma...@android.com



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread TreKing
On Sat, Oct 8, 2011 at 5:41 PM, Studio LFP studio@gmail.com wrote:

 I do understand what you guys are saying, so I am listening, but it seems
 to be a contradiction since it seems most of the internal applications use
 it, including quite a few that Google themselves send with the devices.
 Maybe they aren't, but based on the speed of the rotate and the way the
 screen looks, I'm pretty sure they are.


There are things you can do improve the speed of destroy / recreate, like
using static or singleton objects to hold data or use
onRetatinLastConfigurationInstance.

See this blog post:
http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: textView Clears on Rotation

2011-10-08 Thread Studio LFP
Thanks for the link there. I've read that a couple of times and understand 
the uses.

Is there a set of documentation that tells what is automatically saved off 
if you don't use the configChanges option? I know a little by catching it 
here and there on these groups, but I haven't located a full list yet.

Steven
Studio LFP
http://www.studio-lfp.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: textView Clears on Rotation

2011-10-08 Thread decode
Give an id to your textview. Android system should handle it...



On Oct 9, 8:35 am, Studio LFP studio@gmail.com wrote:
 Thanks for the link there. I've read that a couple of times and understand
 the uses.

 Is there a set of documentation that tells what is automatically saved off
 if you don't use the configChanges option? I know a little by catching it
 here and there on these groups, but I haven't located a full list yet.

 Steven
 Studio LFPhttp://www.studio-lfp.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textView Clears on Rotation

2011-10-07 Thread Studio LFP
Add this to your activity tag in the AndroidManifest.xml

android:configChanges=orientation|keyboardHidden

That will fix you up unless you have some other specifics set like different 
XML layouts for portrait and landscape. If you do, you may want to use the 
bundle or just change the view dynamically from the onConfigurationChange 
event you'll get from that attribute.

Steven
Studio LFP
http://www.studio-lfp.com


On Friday, October 7, 2011 3:45:39 PM UTC-5, King Salamon wrote:

 Please can anyone give me a full coding example for getting data to persist 
 after the device is rotated. All of my textView fields go back to zero when 
 the device is rotated. I understand that the activity is destroyed and then 
 recreated due to configuration change, and I think that using 
 onSavedInstanceState somehow might resolve the issue--but I need a more 
 detailed explanation with full code please. HELP!!


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Textview from thread

2011-09-13 Thread Kristoffer
Thanks.

Its now up and running with Handler

On 10 Sep, 12:53, HideCheck hidech...@gmail.com wrote:
 You need to use the Handler.

 http://developer.android.com/reference/android/os/Handler.html

 Handler handler = new Handler();

 ex)
  public void run() {

         handler.post(new Runnable() {

                         public void run() {
                                 textview.setText(xxx);

                         }
                 });

 }
 }

 2011/9/10 Kristoffer kris.isak.v...@gmail.com:



  Hello.

  I have been searching for answer how to update a textview from another
  thread, i have found several answer that point to using Handler but
  i dont know how i should implement that in my code, maybe you could
  point it out for me.

  Iam checking if the user is logged in or not to Twitter,
  here is my code.

  SettingsActivity.java

  public void updateLoginStatus() {
                 Thread f = new Thread() {
                 public void run() {

                         final TextView loginStatus = (TextView)
  findViewById(R.id.loginstatus);
                         loginStatus.setText(Logged into Twitter :  +
  TwitterUtils.isAuthenticated(prefs));

                 }

             };
             f.start();
         }

  and here is the code in TwitterUtils.java

  public static boolean isAuthenticated(SharedPreferences prefs) {

                 String token = prefs.getString(OAuth.OAUTH_TOKEN, );
                 String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, 
  );

                 AccessToken a = new AccessToken(token,secret);
                 Twitter twitter = new TwitterFactory().getInstance();
                 twitter.setOAuthConsumer(Constants.CONSUMER_KEY,
  Constants.CONSUMER_SECRET);
                 twitter.setOAuthAccessToken(a);

                 try {
                         twitter.getAccountSettings();
                         return true;
                 } catch (TwitterException e) {
                         return false;
                 }
         }

  any good idees?
  Thanks

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview from thread

2011-09-11 Thread nadam
I would use an AsyncTask for that, but Handler works too. Both are
explained with examples here:
http://www.vogella.de/articles/AndroidPerformance/article.html#concurrency

On 10 Sep, 12:23, Kristoffer kris.isak.v...@gmail.com wrote:
 Hello.

 I have been searching for answer how to update a textview from another
 thread, i have found several answer that point to using Handler but
 i dont know how i should implement that in my code, maybe you could
 point it out for me.

 Iam checking if the user is logged in or not to Twitter,
 here is my code.

 SettingsActivity.java

 public void updateLoginStatus() {
                 Thread f = new Thread() {
                 public void run() {

                         final TextView loginStatus = (TextView)
 findViewById(R.id.loginstatus);
                         loginStatus.setText(Logged into Twitter :  +
 TwitterUtils.isAuthenticated(prefs));

                 }

             };
             f.start();
         }

 and here is the code in TwitterUtils.java

 public static boolean isAuthenticated(SharedPreferences prefs) {

                 String token = prefs.getString(OAuth.OAUTH_TOKEN, );
                 String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, );

                 AccessToken a = new AccessToken(token,secret);
                 Twitter twitter = new TwitterFactory().getInstance();
                 twitter.setOAuthConsumer(Constants.CONSUMER_KEY,
 Constants.CONSUMER_SECRET);
                 twitter.setOAuthAccessToken(a);

                 try {
                         twitter.getAccountSettings();
                         return true;
                 } catch (TwitterException e) {
                         return false;
                 }
         }

 any good idees?
 Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView overlaps Imageview

2011-08-13 Thread RIV
Thats becoz you have put the ImageView  and Textviews in
RelativeLayout.
Put them in linearLayout or use android:alignparentbottom=true for
ImageView.

On Aug 13, 1:00 pm, Goutom goutom.sust@gmail.com wrote:
 Hi All

 In my xml layout TextView overlaps ImageView.I need to prevent it.

 -

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
     android:layout_width=fill_parent android:layout_height=fill_parent
     android:fitsSystemWindows=true android:layout_weight=1
     android:orientation=vertical 

     RelativeLayout android:layout_width=wrap_content
         android:layout_height=wrap_content android:background=#b4b4b4
         android:fitsSystemWindows=true

         LinearLayout android:orientation=vertical
             android:layout_alignParentLeft=true
             android:layout_width=wrap_content
 android:layout_height=wrap_content
             android:paddingLeft=5dip

             TextView android:id=@+id/pio_navi_org_name
                 android:textSize=20sp android:textStyle=bold
 android:textColor=#00
                 android:text= android:layout_width=wrap_content
                 android:layout_height=wrap_content /

             TextView android:id=@+id/pio_navi_org_add
                 android:textColor=#00 android:textSize=17sp
                 android:textStyle=bold android:text=
 android:layout_width=wrap_content
                 android:layout_height=wrap_content /

             TextView android:id=@+id/pio_navi_org_website
                 android:textColor=#00 android:textSize=17sp
                 android:textStyle=bold android:text=
 android:layout_width=wrap_content
                 android:layout_height=wrap_content /
         /LinearLayout

         ImageView android:layout_alignParentRight=true
             android:paddingTop=6dip android:src=@drawable/orgpeople
             android:scaleType=fitXY android:layout_height=40dip
             android:layout_width=45dip/

     /RelativeLayout

     ListView android:id=@+id/list_pio
         android:layout_width=fill_parent
 android:layout_height=wrap_content
         android:layout_weight=1 android:paddingBottom=0dip
         android:dividerHeight=1dip /

 /LinearLayout

 ---

 Any solution?

 Regards
 RiskyCoder

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread Zsolt Vasvari
Maybe because it IS a box?

http://www.fileformat.info/info/unicode/char/2399/index.htm



On Jun 20, 8:25 pm, dashman erjdri...@gmail.com wrote:
 i'm setting some text into textview

 .setText( \u2399 );

 not working - shows up as a box.

 help!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread Zsolt Vasvari
In any case, most likely the Droid font doesn't include a glyph for
that code point.

On Jun 20, 8:31 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 Maybe because it IS a box?

 http://www.fileformat.info/info/unicode/char/2399/index.htm

 On Jun 20, 8:25 pm, dashman erjdri...@gmail.com wrote:



  i'm setting some text into textview

  .setText( \u2399 );

  not working - shows up as a box.

  help!- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread dashman
 Maybe because it IS a box?


i'm not an imbecile...at least yet.

http://www.alanwood.net/unicode/miscellaneous_technical.html


any help on unicode glyphs available on androids.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: textview and unicode

2011-06-20 Thread Kostya Vasilyev
Ok, maybe I am an imbecile, but it looks like a box to me on that page.

And here too:

http://www.fileformat.info/info/unicode/char/2399/index.htm

-- Kostya

2011/6/20 dashman erjdri...@gmail.com

  Maybe because it IS a box?
 

 i'm not an imbecile...at least yet.

 http://www.alanwood.net/unicode/miscellaneous_technical.html


 any help on unicode glyphs available on androids.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: textview and unicode

2011-06-20 Thread Zsolt Vasvari
That glyph isn't even in standard Windows fonts, so I'd say, no, the
Android font won't have it.


There is an app called Unicode Map, and it shows the square.  So you
are out of luck.  If you want to display it, you will need to use your
own font.

On Jun 20, 8:51 pm, dashman erjdri...@gmail.com wrote:
  Maybe because it IS a box?

 i'm not an imbecile...at least yet.

 http://www.alanwood.net/unicode/miscellaneous_technical.html

 any help on unicode glyphs available on androids.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread Yahel
As Zsolt and Kostya already told you Android won't have a font that
includes such special characters.

The one you seem to want to use looks like a printer thingy. If you
are trying to use unicode characters as icons then you'd better start
using Pngs for your icons. Including a font that would hold all of the
fancy characters in unicode up to #5000 will add at least 1-2 Mb to
the overall size of your app.

A png saved for web in 48x48 is less than 10 Ko. And you can use it as
the background of your text field.

Yahel


On 20 juin, 14:25, dashman erjdri...@gmail.com wrote:
 i'm setting some text into textview

 .setText( \u2399 );

 not working - shows up as a box.

 help!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread Zsolt Vasvari
While we are on the topic of missing glyphs -- are there plans for
adding the new symbol for Indian Rupee, code point 20B9?

http://en.wikipedia.org/wiki/Indian_rupee_sign

It's probably the only currency glyph still missing from Android and
since my app deals with currencies, it's now displaying a square.





On Jun 20, 10:09 pm, Yahel kaye...@gmail.com wrote:
 As Zsolt and Kostya already told you Android won't have a font that
 includes such special characters.

 The one you seem to want to use looks like a printer thingy. If you
 are trying to use unicode characters as icons then you'd better start
 using Pngs for your icons. Including a font that would hold all of the
 fancy characters in unicode up to #5000 will add at least 1-2 Mb to
 the overall size of your app.

 A png saved for web in 48x48 is less than 10 Ko. And you can use it as
 the background of your text field.

 Yahel

 On 20 juin, 14:25, dashman erjdri...@gmail.com wrote:



  i'm setting some text into textview

  .setText( \u2399 );

  not working - shows up as a box.

  help!- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: textview and unicode

2011-06-20 Thread Zsolt Vasvari
Actually, the glyph for code point 20b8 is missing also, which is a
new currency symbol also, but I am not suppprting it:

http://en.wikipedia.org/wiki/Kazakhstani_tenge



On Jun 21, 8:28 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 While we are on the topic of missing glyphs -- are there plans for
 adding the new symbol for Indian Rupee, code point 20B9?

 http://en.wikipedia.org/wiki/Indian_rupee_sign

 It's probably the only currency glyph still missing from Android and
 since my app deals with currencies, it's now displaying a square.

 On Jun 20, 10:09 pm, Yahel kaye...@gmail.com wrote:



  As Zsolt and Kostya already told you Android won't have a font that
  includes such special characters.

  The one you seem to want to use looks like a printer thingy. If you
  are trying to use unicode characters as icons then you'd better start
  using Pngs for your icons. Including a font that would hold all of the
  fancy characters in unicode up to #5000 will add at least 1-2 Mb to
  the overall size of your app.

  A png saved for web in 48x48 is less than 10 Ko. And you can use it as
  the background of your text field.

  Yahel

  On 20 juin, 14:25, dashman erjdri...@gmail.com wrote:

   i'm setting some text into textview

   .setText( \u2399 );

   not working - shows up as a box.

   help!- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView looks great, but drawText() looks crummy !

2011-05-15 Thread RLScott
Thanks.  Now it looks great!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Textview background with text inside background image

2011-05-07 Thread ArcDroid
Never mind, didn't realize that android:padding=10dp does this by
applying this only to the text and not the background.

On May 7, 2:35 pm, ArcDroid jacobrjohn...@gmail.com wrote:
 Hello, I have a background image in my textview (like a chat bubble)
 and want to make the text inside the background image.  How Do i add
 padding to the text, but not the image?

 TextView android:id=@+id/text
                 android:layout_height=wrap_content
                 android:layout_width=wrap_content
                 android:background=@drawable/chatbubble
                  /

 Thanks,http://www.arcdroid.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView at the bottom of a Layout, like a status bar of sorts

2011-03-21 Thread Chris Stewart
I wanted to follow up on this question.  I got it working tonight by using
RelativeLayout.  The overall design is as such:

RelativeLayout
 -- LinearLayout
   -- Fragment A
   -- Fragment B
   -- Fragment C
 -- /LinearLayout
 -- RelativeLayout (with android:layout_alignParentBottom=true)
   -- TextView
 -- /RelativeLayout
/RelativeLayout

--
Chris Stewart
http://chriswstewart.com



On Mon, Mar 21, 2011 at 4:07 PM, Chris Stewart cstewart...@gmail.comwrote:

 I'm working on a Honeycomb app and I'd like to have a scrolling ticker at
 the bottom of the screen.  I did something similar with a phone app, where I
 effectively had a LinearLayout that took up the bottom of the screen and
 contained a TextView inside of it.  I attempted to reuse that code in this
 situation and couldn't get the Layout or TextView to display.  The only real
 differences here are the use of Android 3.0 and fragments in the layout
 file.

 Unfortunately I'm at work, so I'm unable to post the specific code in
 question.  But, I wanted to see if anyone has already encountered this while
 working with Android 3.0/fragments or if you've seen an example somewhere
 online I can explore for answers.

 --
 Chris Stewart
 http://chriswstewart.com



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView at the bottom of a Layout, like a status bar of sorts

2011-03-21 Thread Justin Anderson
Maybe it is just me, but what is the point of putting a LinearLayout inside
a RelativeLayout?  And for that matter, what is the point of having a
RelativeLayout inside another RelativeLayout that contains only a single
view?

I don't know really know what the requirements of your app, but you should
be able to achieve the same thing with just a single RelativeLayout and all
your other fragments/views inside of that...

One of the big advantages of RelativeLayout is that there is less need for
nesting layouts...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Mar 21, 2011 at 9:28 PM, Chris Stewart cstewart...@gmail.comwrote:

 I wanted to follow up on this question.  I got it working tonight by using
 RelativeLayout.  The overall design is as such:

 RelativeLayout
  -- LinearLayout
-- Fragment A
-- Fragment B
-- Fragment C
  -- /LinearLayout
  -- RelativeLayout (with android:layout_alignParentBottom=true)
-- TextView
  -- /RelativeLayout
 /RelativeLayout

 --
 Chris Stewart
 http://chriswstewart.com



 On Mon, Mar 21, 2011 at 4:07 PM, Chris Stewart cstewart...@gmail.comwrote:

 I'm working on a Honeycomb app and I'd like to have a scrolling ticker at
 the bottom of the screen.  I did something similar with a phone app, where I
 effectively had a LinearLayout that took up the bottom of the screen and
 contained a TextView inside of it.  I attempted to reuse that code in this
 situation and couldn't get the Layout or TextView to display.  The only real
 differences here are the use of Android 3.0 and fragments in the layout
 file.

 Unfortunately I'm at work, so I'm unable to post the specific code in
 question.  But, I wanted to see if anyone has already encountered this while
 working with Android 3.0/fragments or if you've seen an example somewhere
 online I can explore for answers.

 --
 Chris Stewart
 http://chriswstewart.com


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView at the bottom of a Layout, like a status bar of sorts

2011-03-21 Thread Chris Stewart
The only point is that's what I've found to work, nothing more.  Perhaps I'm
not doing it correctly, but it's like pulling teeth trying to get layouts to
work like I want them to, so when I find something that works I'm hard
pressed to sit there for hours trying to optimize it 100%.

--
Chris Stewart
http://chriswstewart.com



On Tue, Mar 22, 2011 at 12:42 AM, Justin Anderson magouyaw...@gmail.comwrote:

 Maybe it is just me, but what is the point of putting a LinearLayout inside
 a RelativeLayout?  And for that matter, what is the point of having a
 RelativeLayout inside another RelativeLayout that contains only a single
 view?

 I don't know really know what the requirements of your app, but you should
 be able to achieve the same thing with just a single RelativeLayout and all
 your other fragments/views inside of that...

 One of the big advantages of RelativeLayout is that there is less need for
 nesting layouts...

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware


 On Mon, Mar 21, 2011 at 9:28 PM, Chris Stewart cstewart...@gmail.comwrote:

 I wanted to follow up on this question.  I got it working tonight by using
 RelativeLayout.  The overall design is as such:

 RelativeLayout
  -- LinearLayout
-- Fragment A
-- Fragment B
-- Fragment C
  -- /LinearLayout
  -- RelativeLayout (with android:layout_alignParentBottom=true)
-- TextView
  -- /RelativeLayout
 /RelativeLayout

 --
 Chris Stewart
 http://chriswstewart.com



 On Mon, Mar 21, 2011 at 4:07 PM, Chris Stewart cstewart...@gmail.comwrote:

 I'm working on a Honeycomb app and I'd like to have a scrolling ticker at
 the bottom of the screen.  I did something similar with a phone app, where I
 effectively had a LinearLayout that took up the bottom of the screen and
 contained a TextView inside of it.  I attempted to reuse that code in this
 situation and couldn't get the Layout or TextView to display.  The only real
 differences here are the use of Android 3.0 and fragments in the layout
 file.

 Unfortunately I'm at work, so I'm unable to post the specific code in
 question.  But, I wanted to see if anyone has already encountered this while
 working with Android 3.0/fragments or if you've seen an example somewhere
 online I can explore for answers.

 --
 Chris Stewart
 http://chriswstewart.com


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView gravity off on Galaxy Tab?

2011-03-08 Thread Nikolay Elenkov
On Tue, Mar 8, 2011 at 1:08 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
 I'd use an integer resource to specify a padding.  You can leave it 0
 in the base implementation and override it in values-v8.  Or something
 along those lines, you get the idea...


Thanks for the idea. The problem is, it inconsistent even among froyo versions.
For example, the layout is off when running the Google APIs (Level 8) AVD,
but not with the Android 2.2 (Level 8) AVD. Those have the same build number,
so not clear what the difference is.

I'll just have to add a switch to disable the custom font I am afraid.
Some characters won't be displayed, but still a bit better, then a completely
jumbled layout.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView gravity off on Galaxy Tab?

2011-03-07 Thread Nikolay Elenkov
On Sun, Mar 6, 2011 at 12:40 PM, Nikolay Elenkov
nikolay.elen...@gmail.com wrote:

 It does seem it's a bug in 2.2, fixed in 2.3, but the closest relevant change
 I found says 'Fix bug 3061544 and some clipping errors.' and that's not
 too helpful.


Scratch that. The real issue is that StaticLayout.getLineTop() returns 0.
This is used for calculating the text height, in turn used to calculate
vertical offset inside the TextView. It looks like it is impossible to
workaround this without overriding TextView.onDraw() and drawing
the text myself (naturally I want to avoid this). Any other ideas on
how to monkey patch this on 2.2?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView gravity off on Galaxy Tab?

2011-03-07 Thread Zsolt Vasvari
I'd use an integer resource to specify a padding.  You can leave it 0
in the base implementation and override it in values-v8.  Or something
along those lines, you get the idea...

On Mar 8, 11:51 am, Nikolay Elenkov nikolay.elen...@gmail.com wrote:
 On Sun, Mar 6, 2011 at 12:40 PM, Nikolay Elenkov

 nikolay.elen...@gmail.com wrote:

  It does seem it's a bug in 2.2, fixed in 2.3, but the closest relevant 
  change
  I found says 'Fix bug 3061544 and some clipping errors.' and that's not
  too helpful.

 Scratch that. The real issue is that StaticLayout.getLineTop() returns 0.
 This is used for calculating the text height, in turn used to calculate
 vertical offset inside the TextView. It looks like it is impossible to
 workaround this without overriding TextView.onDraw() and drawing
 the text myself (naturally I want to avoid this). Any other ideas on
 how to monkey patch this on 2.2?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView gravity off on Galaxy Tab?

2011-03-05 Thread Hari Edo
Try setting the text value after setting the typeface?  It may
incorrectly
cache the measurement using the view's Paint's font, and not revise
that
measurement when the typeface is changed.

On Mar 5, 10:38 am, Nikolay Elenkov nikolay.elen...@gmail.com wrote:
 On Sat, Mar 5, 2011 at 1:10 PM, Nikolay Elenkov

 nikolay.elen...@gmail.com wrote:
  Hi,
  I have a TextView displaying a single character, centered inside the view.
  It works fine on all sort of devices, but on Galaxy Tab, the character is
  aligned with the top of the view and slightly clipped. I've reproduced it
  with the emulator, and tried all combination of gravity
  (center_vertical|center_horizontal, etc), with no success.

 OK, this only happens when I use a custom font. This same font works fine on
 other devices. Anything obvious I am missing? What I am doing is very simple:

 Typeface tf  = Typeface.createFromFile(my-font.ttf);
 myText.setTypeface(tf);

 There are no errors or warnings in logcat. I'm guessing the custom font 
 somehow
 is screwing up text drawing. Is there anyway I can get it redraw the
 text? I've tried
 with postInvalidate() and requestLayout() with no success.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView gravity off on Galaxy Tab?

2011-03-05 Thread Nikolay Elenkov
On Sun, Mar 6, 2011 at 2:23 AM, Hari Edo hari@gmail.com wrote:
 Try setting the text value after setting the typeface?  It may
 incorrectly
 cache the measurement using the view's Paint's font, and not revise
 that
 measurement when the typeface is changed.


Thanks. I had the same idea, but unfortunately it doesn't work. I've tried
setting the text in onStart() instead of in onCreate(), using postDelayed()
and combinations thereof.

It does seem it's a bug in 2.2, fixed in 2.3, but the closest relevant change
I found says 'Fix bug 3061544 and some clipping errors.' and that's not
too helpful.

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=commitdiff;h=abcbb1a1989e8c6adec607b3964dc187f5526e66

And then, of course, loading the font fails on Gingerbread fails
with the even more helpful 'native typeface cannot be made'

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView adjusts, ImageView stays static when keyboard pops up - How To?

2011-02-24 Thread TreKing
On Wed, Feb 23, 2011 at 1:36 PM, Matt M matthew.mag...@gmail.com wrote:

  Any ideas??


Do you have screen shots?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView adjusts, ImageView stays static when keyboard pops up - How To?

2011-02-23 Thread Matt M
 Any ideas??

On Feb 23, 1:04 am, Matt M matthew.mag...@gmail.com wrote:
 Hello,

 I have a TextView on top of an ImageView. When the keyboard pops up I
 want the TextView to shrink and adjust to the keyboard popping up
 (like normal) but I want the ImageView to stay static, thus I do not
 want the image to shrink.

 I tried using android:windowSoftInputMode=statePan manifest but this
 makes BOTH views static. I need the TextView dynamic, the ImageView
 static.

 Any help would be greatly appreciated!

 Matt.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView adjusts, ImageView stays static when keyboard pops up - How To?

2011-02-23 Thread Justin Anderson
I would try waiting at least a day before bumping your post...

On Wed, Feb 23, 2011 at 12:36 PM, Matt M matthew.mag...@gmail.com wrote:

  Any ideas??

 On Feb 23, 1:04 am, Matt M matthew.mag...@gmail.com wrote:
  Hello,
 
  I have a TextView on top of an ImageView. When the keyboard pops up I
  want the TextView to shrink and adjust to the keyboard popping up
  (like normal) but I want the ImageView to stay static, thus I do not
  want the image to shrink.
 
  I tried using android:windowSoftInputMode=statePan manifest but this
  makes BOTH views static. I need the TextView dynamic, the ImageView
  static.
 
  Any help would be greatly appreciated!
 
  Matt.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView length limit? How strange!

2011-02-16 Thread Jenus Dong
anybody?
Later I did some small testing in G3, I found that:
If there is a TextView in the activtiy layout, it can show more than 4096
characters, but when it owned by the item of listview, it just display
invisible.
If there is a TextView with wrap_content with property owned by the item of
listview, it will be cutted one line.


On Tue, Feb 15, 2011 at 2:17 PM, Jenus Dong jenus.ne...@gmail.com wrote:

 Hi, everyone.
 I having a ListView,  which has three TextView components in every item.
 One TextView possiblily display too long text, for example 5000 characters
 in Ascii code. The testing result is:
 G7 ,2.2 , it is ok. But when it running in G3, it just display space, no at
 all one character. So I just try and trial, when
 words.setText(ss.subSequence(0, 3653));
 it display all.
 when
 words.setText(ss.subSequence(0, 3654));
 it display none.

 The listview item layout is like:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=vertical 

 RelativeLayout
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=vertical
 android:background=@drawable/friendlist_friend_selector 

 TextView
 android:layout_height=wrap_content
 android:layout_width=wrap_content
 android:id=@+id/chat_item_words
 android:focusable=false
 android:text=a
 #android:maxLength=3653
 android:textColor=@android:color/black
 android:layout_marginLeft=10dp
 android:layout_marginRight=5dp
 android:layout_marginTop=10dp /

 TextView
 android:layout_height=wrap_content
 android:layout_width=wrap_content
 android:id=@+id/chat_item_name
 android:text=ALIDA:
 android:focusable=false
 android:layout_marginLeft=10dp
 android:layout_marginTop=10dp /

 TextView
 android:layout_height=wrap_content
 android:layout_width=wrap_content
 android:id=@+id/chat_item_date
 android:focusable=false
 android:text=08-18 22:03
 android:textSize=14sp
 android:textColor=@color/message_date
 android:layout_below=@+id/chat_item_words
 android:layout_alignParentRight=true
 android:layout_marginRight=10dp
 android:layout_marginTop=4dp /

 /RelativeLayout



 View
 android:layout_height=1dp
 android:layout_width=wrap_content
 android:background=@color/friendlist_friend_line /

 /LinearLayout

 So android:maxLength=3653,  it just works.
 I would appreciated if having some hints, thanks a lot.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView - how to make appended text visible?

2011-01-31 Thread Paul
You might also be able to scroll the text by restricting the ellipsize
the text by setting properties of the TextView to:

android:maxLines=1
android:scrollHorizontally=true

I do this with an EditText and it works perfectly.

Paul

On Jan 28, 7:54 pm, John Lussmyer johnlussm...@gmail.com wrote:
 I wrapped the TextView in a ScrollView (even though TextView is documented
 as handling it's own scrolling and doesn't need a ScrollView).
 This let me call the fullScroll( View.FOCUS_DOWN) method in the ScrollView
 to make the newest text visible.

 On Fri, Jan 28, 2011 at 11:35 AM, Tobiah t...@tobiah.org wrote:
  On 01/28/2011 09:50 AM, John Lussmyer wrote:

  I have a TextView that frequently has text appended from a service.
  I can append the text just fine, but how do I make the TextView scroll so
  the newly appended text is visible?
  Once the view fills, the new text is below the bottom edge.

  I haven't used it for Android, but usually there is a Scrollable container
  that lets you put things into it that are larger than the screen.  There
  must
  be such a widget... check the methods.  I imagine that you can set the
  scroll
  position  programmatically.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView with a top margin that is proportional to the height of the parent view

2011-01-29 Thread Kostya Vasilyev

John,

You can do this with LinearLayout and layout_weight attribute that it 
supports:


LinearLayout layout_height=fill_parent orientation=vertical
View
layout_height=0dp
layout_weight=20/
TextView
layout_height=0dp
layout_weight=80/
/LinearLayout

The top view acts as a spacer, taking up 20% of the screen height, and 
the TextView starts below that.


-- Kostya

29.01.2011 10:59, Jonathan Foley пишет:


Yes, but you'll have to do it at runtime as there is not a way to do
proportional layout as you describe in xml. To prevent a visible
transition from the xml size to the correct size, you'll probably want
to extend LinearLayout and override its onLayout(). You'll want to
layout your child textview within that and you'll want to use
getHeight() to get the height of the LinearLayout at runtime. I'd
suggest looking through the code of ListView or RelativeLayout to see
how children are measured and layout.

The other option would be to do this after everything is inflated. You
can override onFinishInflate of the LinearLayout and then adjust the
height of the TextView from there. You'll need to invalidate the
TextView after adjusting it's height.


Jonathan


On Jan 28, 9:48 pm, John Gabyjg...@gabysoft.com  wrote:

Is there a way to position text within a linear layout such that the
position of the text is proportional to the height, rather than a
fixed distance.  For example, I would like the text to be displayed
down from the top a distance equal to 20% of the height of the view.

Thanks.



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView with a top margin that is proportional to the height of the parent view

2011-01-29 Thread John Gaby
That works great.  Thanks!

On Jan 29, 12:46 am, Kostya Vasilyev kmans...@gmail.com wrote:
 John,

 You can do this with LinearLayout and layout_weight attribute that it
 supports:

 LinearLayout layout_height=fill_parent orientation=vertical
 View
 layout_height=0dp
 layout_weight=20/
 TextView
 layout_height=0dp
 layout_weight=80/
 /LinearLayout

 The top view acts as a spacer, taking up 20% of the screen height, and
 the TextView starts below that.

 -- Kostya

 29.01.2011 10:59, Jonathan Foley пишет:





  Yes, but you'll have to do it at runtime as there is not a way to do
  proportional layout as you describe in xml. To prevent a visible
  transition from the xml size to the correct size, you'll probably want
  to extend LinearLayout and override its onLayout(). You'll want to
  layout your child textview within that and you'll want to use
  getHeight() to get the height of the LinearLayout at runtime. I'd
  suggest looking through the code of ListView or RelativeLayout to see
  how children are measured and layout.

  The other option would be to do this after everything is inflated. You
  can override onFinishInflate of the LinearLayout and then adjust the
  height of the TextView from there. You'll need to invalidate the
  TextView after adjusting it's height.

  Jonathan

  On Jan 28, 9:48 pm, John Gabyjg...@gabysoft.com  wrote:
  Is there a way to position text within a linear layout such that the
  position of the text is proportional to the height, rather than a
  fixed distance.  For example, I would like the text to be displayed
  down from the top a distance equal to 20% of the height of the view.

  Thanks.

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView with a top margin that is proportional to the height of the parent view

2011-01-28 Thread Jonathan Foley


Yes, but you'll have to do it at runtime as there is not a way to do
proportional layout as you describe in xml. To prevent a visible
transition from the xml size to the correct size, you'll probably want
to extend LinearLayout and override its onLayout(). You'll want to
layout your child textview within that and you'll want to use
getHeight() to get the height of the LinearLayout at runtime. I'd
suggest looking through the code of ListView or RelativeLayout to see
how children are measured and layout.

The other option would be to do this after everything is inflated. You
can override onFinishInflate of the LinearLayout and then adjust the
height of the TextView from there. You'll need to invalidate the
TextView after adjusting it's height.


Jonathan


On Jan 28, 9:48 pm, John Gaby jg...@gabysoft.com wrote:
 Is there a way to position text within a linear layout such that the
 position of the text is proportional to the height, rather than a
 fixed distance.  For example, I would like the text to be displayed
 down from the top a distance equal to 20% of the height of the view.

 Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView and ellipsize

2011-01-10 Thread Neilz
I found other people asking this on StackOverflow, it appears there is
a bug here with no fix.

There's a link to a potential solution: is it just me or is there
nothing there?

http://code.google.com/p/android-textview-multiline-ellipse/

On Jan 7, 12:04 am, D K dsp...@gmail.com wrote:
 On Thu, Jan 6, 2011 at 4:01 PM, TreKing treking...@gmail.com wrote:
  On Thu, Jan 6, 2011 at 5:27 PM, Neilz neilhorn...@gmail.com wrote:

  Nope, no joy unfortunately.

  Lame. What happens if you make it large enough for 4 lines? :-P

  -
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

   --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView and ellipsize

2011-01-10 Thread Kostya Vasilyev

10.01.2011 15:37, Neilz пишет:

I found other people asking this on StackOverflow, it appears there is
a bug here with no fix.

There's a link to a potential solution: is it just me or is there
nothing there?


http://code.google.com/p/android-textview-multiline-ellipse/source/browse/#svn%2Ftrunk


http://code.google.com/p/android-textview-multiline-ellipse/

On Jan 7, 12:04 am, D Kdsp...@gmail.com  wrote:

On Thu, Jan 6, 2011 at 4:01 PM, TreKingtreking...@gmail.com  wrote:

On Thu, Jan 6, 2011 at 5:27 PM, Neilzneilhorn...@gmail.com  wrote:

Nope, no joy unfortunately.

Lame. What happens if you make it large enough for 4 lines? :-P
-
TreKinghttp://sites.google.com/site/rezmobileapps/treking  - Chicago
transit tracking app for Android-powered devices
  --
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView and ellipsize

2011-01-10 Thread Neilz
Ah... thanks!

On Jan 10, 12:52 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 10.01.2011 15:37, Neilz пишет:

  I found other people asking this on StackOverflow, it appears there is
  a bug here with no fix.

  There's a link to a potential solution: is it just me or is there
  nothing there?

 http://code.google.com/p/android-textview-multiline-ellipse/source/br...







 http://code.google.com/p/android-textview-multiline-ellipse/

  On Jan 7, 12:04 am, D Kdsp...@gmail.com  wrote:
  On Thu, Jan 6, 2011 at 4:01 PM, TreKingtreking...@gmail.com  wrote:
  On Thu, Jan 6, 2011 at 5:27 PM, Neilzneilhorn...@gmail.com  wrote:
  Nope, no joy unfortunately.
  Lame. What happens if you make it large enough for 4 lines? :-P
  -
  TreKinghttp://sites.google.com/site/rezmobileapps/treking  - Chicago
  transit tracking app for Android-powered devices
    --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView setCompoundDrawables inconsistent size

2011-01-09 Thread Henrik Lindqvist
I set the drawable using xml android:drawableBottom so
setCompoundDrawablesWithIntrinsicBounds should be used. I've it now
also tried setting it programmatically, same result. I'am going back
to using nested LinearLayout's for label and button, this is to much
of a hassle.


On Jan 9, 4:04 am, Romain Guy romain...@android.com wrote:
 You should use setCompoundDrawablesWithIntrinsicBounds()

 On Sat, Jan 8, 2011 at 6:40 PM, Henrik Lindqvist henrik.lindqv...@gmail.com



  wrote:
  I'am trying to use TextView's setCompoundDrawables feature because i
  wan't a button with a label above it. I set android:drawableBottom to
  my button drawable, which is a layer-list with a button background,
  an icon and a toggle indicator.

  First app launch every thing looks nice, close app, launch again and
  the drawables seems to have lost their padding. If I close the app and
  wait a few more seconds, GC runs or something, then the buttons looks
  ok again.

  Does the drawables gets altered at first launch? Doesn't the TextView
  set the bounds on the drawables the second launch? Very inconsistent.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView and ellipsize

2011-01-06 Thread Neilz
Nope, no joy unfortunately.

On Jan 6, 11:16 pm, TreKing treking...@gmail.com wrote:
 On Thu, Jan 6, 2011 at 5:14 PM, Neilz neilhorn...@gmail.com wrote:
  Any ideas what's happening?

 No, but try 
 this:http://developer.android.com/reference/android/widget/TextView.html#a...

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView and ellipsize

2011-01-06 Thread TreKing
On Thu, Jan 6, 2011 at 5:27 PM, Neilz neilhorn...@gmail.com wrote:

 Nope, no joy unfortunately.


Lame. What happens if you make it large enough for 4 lines? :-P

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView and ellipsize

2011-01-06 Thread D K
On Thu, Jan 6, 2011 at 4:01 PM, TreKing treking...@gmail.com wrote:

 On Thu, Jan 6, 2011 at 5:27 PM, Neilz neilhorn...@gmail.com wrote:

 Nope, no joy unfortunately.


 Lame. What happens if you make it large enough for 4 lines? :-P


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView inner shadow

2010-12-18 Thread Stefan Klumpp
I'm also interested in that.

Anyone?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView visibility problem

2010-10-21 Thread Johnny
I'm not at home right now so I can't test it, maybe tomorrow: swap the
root linear layout for a relative layout. Move up the TextView, set
its alignBottom to the root RelativeLayout and set its height to
wrap_content. Then configure your inner RelativeLayout's alignBottom
to the TextView. Its height should be set to fill_parent. I could post
the code and some links tomorrow.

On Oct 20, 4:07 pm, sisko adeod...@gmail.com wrote:
 I had began with the layout_width set to wrap_content but it did not
 have the desired effect.
 I'll admit I don't fully understand the layout concepts so I'm
 experienting alot.

 Any good material that can bring me up to speed is welcome, please!

 On 19 Oct, 15:50, letlite letl...@gmail.com wrote:



  The default orientation for LinearLayout is horizontal. It looks odd
  that the last TextView view has android:layout_width=fill_parent.

  On Oct 18, 2:43 pm,siskoadeod...@gmail.com wrote:

   Hi guys,

   the code I pasted below works great with the exception of the last
   view - the textView.

   The TextView does not display:

   LinearLayout
           xmlns:android=http://schemas.android.com/apk/res/android;
           android:id=@+id/LinearLayout01
           android:background=@drawable/bkgrnd
   android:layout_height=fill_parent
   android:layout_width=fill_parent
           RelativeLayout
                   android:id=@+id/RelativeLayout01
                   android:layout_width=wrap_content
   android:layout_height=wrap_content
                           ImageView
                                   android:id=@+id/ImageView01
                                   android:layout_width=wrap_content
                                   android:layout_height=wrap_content
                                   android:background=@drawable/quizicon
                                   android:layout_alignParentLeft=true
                                   android:layout_alignParentTop=true
                           /ImageView
                           TextView
                                   android:id=@+id/TextView01
                                   android:layout_width=wrap_content
                                   android:layout_height=wrap_content
                                   android:text=@string/help
                                   android:layout_alignParentTop=true
                                   android:layout_centerHorizontal=true
                                   android:textSize=@dimen/menuxmlTitleSize
                                   
   android:textColor=@color/menuxmlTitleColor
                           /TextView
                           ImageView
                                   android:id=@+id/ImageView02
                                   android:layout_width=wrap_content
                                   android:layout_height=wrap_content
                                   android:background=@drawable/quizicon
                                   android:layout_alignParentRight=true
                                   android:layout_alignParentTop=true
                           /ImageView

   /RelativeLayout
   TextView
   android:text=@+id/TextView02
   android:id=@+id/TextView_HelpText
   android:layout_width=fill_parent
   android:layout_height=wrap_content
   /TextView
   /LinearLayout

   I had a similar problem which came down to an XML layout issue and I'm
   sure it's a similar issue here only I don't know how to resolve it.

   Can someone please help and tell me how I can get the TextView to
   display and perhaps more importantly, direct me to some good android
   xml layout material?

   Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView visibility problem

2010-10-20 Thread sisko
You are right.
When I move the TextView up it is squashed but visible.

Can you advice on how I can make it visible beneath the relative
layout

On 20 Oct, 03:22, metal mikey coref...@gmail.com wrote:
 It might be because the TextView is positioned offscreen. Try putting
 it prior to the RelativeLayout, if you can see it then then it's
 likely the RelativeLayout is pushing it offscreen when the TextView
 is placed after the RelativeLayout.

 On Oct 20, 10:07 am,siskoadeod...@gmail.com wrote:

  The following code is causing me problems as the last view, the
  TextView, does not display :

  LinearLayout
          xmlns:android=http://schemas.android.com/apk/res/android;
          android:id=@+id/LinearLayout01
          android:background=@drawable/bkgrnd
  android:layout_height=fill_parent
  android:layout_width=fill_parent
          RelativeLayout
                  android:id=@+id/RelativeLayout01
                  android:layout_width=wrap_content
  android:layout_height=wrap_content
                          ImageView
                                  android:id=@+id/ImageView01
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:background=@drawable/quizicon
                                  android:layout_alignParentLeft=true
                                  android:layout_alignParentTop=true
                          /ImageView
                          TextView
                                  android:id=@+id/TextView01
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:text=@string/help
                                  android:layout_alignParentTop=true
                                  android:layout_centerHorizontal=true
                                  android:textSize=@dimen/menuxmlTitleSize
                                  
  android:textColor=@color/menuxmlTitleColor
                          /TextView
                          ImageView
                                  android:id=@+id/ImageView02
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:background=@drawable/quizicon
                                  android:layout_alignParentRight=true
                                  android:layout_alignParentTop=true
                          /ImageView

  /RelativeLayout
  TextView
          android:text=@+id/TextView02
          android:id=@+id/TextView_HelpText
          android:layout_width=fill_parent
          android:layout_height=wrap_content
  /TextView

  /LinearLayout

  Can anyone offer suggestions as to why the TextView does not showup in
  the present format?
  Also, please suggest good online resourse(s) that can help me learn
  good Android XML layout techniques, please.

  Thanks :-)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView visibility problem

2010-10-20 Thread sisko
I had began with the layout_width set to wrap_content but it did not
have the desired effect.
I'll admit I don't fully understand the layout concepts so I'm
experienting alot.

Any good material that can bring me up to speed is welcome, please!

On 19 Oct, 15:50, letlite letl...@gmail.com wrote:
 The default orientation for LinearLayout is horizontal. It looks odd
 that the last TextView view has android:layout_width=fill_parent.

 On Oct 18, 2:43 pm,siskoadeod...@gmail.com wrote:

  Hi guys,

  the code I pasted below works great with the exception of the last
  view - the textView.

  The TextView does not display:

  LinearLayout
          xmlns:android=http://schemas.android.com/apk/res/android;
          android:id=@+id/LinearLayout01
          android:background=@drawable/bkgrnd
  android:layout_height=fill_parent
  android:layout_width=fill_parent
          RelativeLayout
                  android:id=@+id/RelativeLayout01
                  android:layout_width=wrap_content
  android:layout_height=wrap_content
                          ImageView
                                  android:id=@+id/ImageView01
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:background=@drawable/quizicon
                                  android:layout_alignParentLeft=true
                                  android:layout_alignParentTop=true
                          /ImageView
                          TextView
                                  android:id=@+id/TextView01
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:text=@string/help
                                  android:layout_alignParentTop=true
                                  android:layout_centerHorizontal=true
                                  android:textSize=@dimen/menuxmlTitleSize
                                  
  android:textColor=@color/menuxmlTitleColor
                          /TextView
                          ImageView
                                  android:id=@+id/ImageView02
                                  android:layout_width=wrap_content
                                  android:layout_height=wrap_content
                                  android:background=@drawable/quizicon
                                  android:layout_alignParentRight=true
                                  android:layout_alignParentTop=true
                          /ImageView

  /RelativeLayout
  TextView
  android:text=@+id/TextView02
  android:id=@+id/TextView_HelpText
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  /TextView
  /LinearLayout

  I had a similar problem which came down to an XML layout issue and I'm
  sure it's a similar issue here only I don't know how to resolve it.

  Can someone please help and tell me how I can get the TextView to
  display and perhaps more importantly, direct me to some good android
  xml layout material?

  Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: TextView visibility problem

2010-10-20 Thread Julie Andrews
On Wed, Oct 20, 2010 at 6:37 PM, sisko adeod...@gmail.com wrote:

 I had began with the layout_width set to wrap_content but it did not
 have the desired effect.
 I'll admit I don't fully understand the layout concepts so I'm
 experienting alot.

 Any good material that can bring me up to speed is welcome, please!

 On 19 Oct, 15:50, letlite letl...@gmail.com wrote:
  The default orientation for LinearLayout is horizontal. It looks odd
  that the last TextView view has android:layout_width=fill_parent.
 
  On Oct 18, 2:43 pm,siskoadeod...@gmail.com wrote:
 
   Hi guys,
 
   the code I pasted below works great with the exception of the last
   view - the textView.
 
   The TextView does not display:
 
   LinearLayout
   xmlns:android=http://schemas.android.com/apk/res/android;
   android:id=@+id/LinearLayout01
   android:background=@drawable/bkgrnd
   android:layout_height=fill_parent
   android:layout_width=fill_parent
   RelativeLayout
   android:id=@+id/RelativeLayout01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   ImageView
   android:id=@+id/ImageView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:background=@drawable/quizicon
   android:layout_alignParentLeft=true
   android:layout_alignParentTop=true
   /ImageView
   TextView
   android:id=@+id/TextView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=@string/help
   android:layout_alignParentTop=true
   android:layout_centerHorizontal=true
  
 android:textSize=@dimen/menuxmlTitleSize
  
 android:textColor=@color/menuxmlTitleColor
   /TextView
   ImageView
   android:id=@+id/ImageView02
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:background=@drawable/quizicon
   android:layout_alignParentRight=true
   android:layout_alignParentTop=true
   /ImageView
 
   /RelativeLayout
   TextView
   android:text=@+id/TextView02
   android:id=@+id/TextView_HelpText
   android:layout_width=fill_parent
   android:layout_height=wrap_content
   /TextView
   /LinearLayout
 
   I had a similar problem which came down to an XML layout issue and I'm
   sure it's a similar issue here only I don't know how to resolve it.
 
   Can someone please help and tell me how I can get the TextView to
   display and perhaps more importantly, direct me to some good android
   xml layout material?
 
   Thanks.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Julie
http://tradinglogically.blogspot.com http://tradinglogically.blogspot.com
http://vikitionary.blogspot.com
http://gandhi-the-man-of-millenium.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: TextView visibility problem

2010-10-20 Thread Julie Andrews
This group is so helpful

On Wed, Oct 20, 2010 at 6:30 PM, sisko adeod...@gmail.com wrote:

 You are right.
 When I move the TextView up it is squashed but visible.

 Can you advice on how I can make it visible beneath the relative
 layout

 On 20 Oct, 03:22, metal mikey coref...@gmail.com wrote:
  It might be because the TextView is positioned offscreen. Try putting
  it prior to the RelativeLayout, if you can see it then then it's
  likely the RelativeLayout is pushing it offscreen when the TextView
  is placed after the RelativeLayout.
 
  On Oct 20, 10:07 am,siskoadeod...@gmail.com wrote:
 
   The following code is causing me problems as the last view, the
   TextView, does not display :
 
   LinearLayout
   xmlns:android=http://schemas.android.com/apk/res/android;
   android:id=@+id/LinearLayout01
   android:background=@drawable/bkgrnd
   android:layout_height=fill_parent
   android:layout_width=fill_parent
   RelativeLayout
   android:id=@+id/RelativeLayout01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   ImageView
   android:id=@+id/ImageView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:background=@drawable/quizicon
   android:layout_alignParentLeft=true
   android:layout_alignParentTop=true
   /ImageView
   TextView
   android:id=@+id/TextView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=@string/help
   android:layout_alignParentTop=true
   android:layout_centerHorizontal=true
  
 android:textSize=@dimen/menuxmlTitleSize
  
 android:textColor=@color/menuxmlTitleColor
   /TextView
   ImageView
   android:id=@+id/ImageView02
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:background=@drawable/quizicon
   android:layout_alignParentRight=true
   android:layout_alignParentTop=true
   /ImageView
 
   /RelativeLayout
   TextView
   android:text=@+id/TextView02
   android:id=@+id/TextView_HelpText
   android:layout_width=fill_parent
   android:layout_height=wrap_content
   /TextView
 
   /LinearLayout
 
   Can anyone offer suggestions as to why the TextView does not showup in
   the present format?
   Also, please suggest good online resourse(s) that can help me learn
   good Android XML layout techniques, please.
 
   Thanks :-)

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Julie
http://tradinglogically.blogspot.com http://tradinglogically.blogspot.com
http://vikitionary.blogspot.com
http://gandhi-the-man-of-millenium.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: TextView visibility problem

2010-10-20 Thread DanH
Ah, how do you handle a problem like Maria??

On Oct 20, 9:40 am, Julie Andrews julieonli...@gmail.com wrote:
 This group is so helpful



 On Wed, Oct 20, 2010 at 6:30 PM, sisko adeod...@gmail.com wrote:
  You are right.
  When I move the TextView up it is squashed but visible.

  Can you advice on how I can make it visible beneath the relative
  layout

  On 20 Oct, 03:22, metal mikey coref...@gmail.com wrote:
   It might be because the TextView is positioned offscreen. Try putting
   it prior to the RelativeLayout, if you can see it then then it's
   likely the RelativeLayout is pushing it offscreen when the TextView
   is placed after the RelativeLayout.

   On Oct 20, 10:07 am,siskoadeod...@gmail.com wrote:

The following code is causing me problems as the last view, the
TextView, does not display :

LinearLayout
        xmlns:android=http://schemas.android.com/apk/res/android;
        android:id=@+id/LinearLayout01
        android:background=@drawable/bkgrnd
android:layout_height=fill_parent
android:layout_width=fill_parent
        RelativeLayout
                android:id=@+id/RelativeLayout01
                android:layout_width=wrap_content
android:layout_height=wrap_content
                        ImageView
                                android:id=@+id/ImageView01
                                android:layout_width=wrap_content
                                android:layout_height=wrap_content
                                android:background=@drawable/quizicon
                                android:layout_alignParentLeft=true
                                android:layout_alignParentTop=true
                        /ImageView
                        TextView
                                android:id=@+id/TextView01
                                android:layout_width=wrap_content
                                android:layout_height=wrap_content
                                android:text=@string/help
                                android:layout_alignParentTop=true
                                android:layout_centerHorizontal=true

  android:textSize=@dimen/menuxmlTitleSize

  android:textColor=@color/menuxmlTitleColor
                        /TextView
                        ImageView
                                android:id=@+id/ImageView02
                                android:layout_width=wrap_content
                                android:layout_height=wrap_content
                                android:background=@drawable/quizicon
                                android:layout_alignParentRight=true
                                android:layout_alignParentTop=true
                        /ImageView

/RelativeLayout
TextView
        android:text=@+id/TextView02
        android:id=@+id/TextView_HelpText
        android:layout_width=fill_parent
        android:layout_height=wrap_content
/TextView

/LinearLayout

Can anyone offer suggestions as to why the TextView does not showup in
the present format?
Also, please suggest good online resourse(s) that can help me learn
good Android XML layout techniques, please.

Thanks :-)

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Juliehttp://tradinglogically.blogspot.comhttp://tradinglogically.blogspot.comhttp://vikitionary.blogspot.comhttp://gandhi-the-man-of-millenium.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView visibility problem

2010-10-19 Thread letlite
The default orientation for LinearLayout is horizontal. It looks odd
that the last TextView view has android:layout_width=fill_parent.

On Oct 18, 2:43 pm, sisko adeod...@gmail.com wrote:
 Hi guys,

 the code I pasted below works great with the exception of the last
 view - the textView.

 The TextView does not display:

 LinearLayout
         xmlns:android=http://schemas.android.com/apk/res/android;
         android:id=@+id/LinearLayout01
         android:background=@drawable/bkgrnd
 android:layout_height=fill_parent
 android:layout_width=fill_parent
         RelativeLayout
                 android:id=@+id/RelativeLayout01
                 android:layout_width=wrap_content
 android:layout_height=wrap_content
                         ImageView
                                 android:id=@+id/ImageView01
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:background=@drawable/quizicon
                                 android:layout_alignParentLeft=true
                                 android:layout_alignParentTop=true
                         /ImageView
                         TextView
                                 android:id=@+id/TextView01
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:text=@string/help
                                 android:layout_alignParentTop=true
                                 android:layout_centerHorizontal=true
                                 android:textSize=@dimen/menuxmlTitleSize
                                 android:textColor=@color/menuxmlTitleColor
                         /TextView
                         ImageView
                                 android:id=@+id/ImageView02
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:background=@drawable/quizicon
                                 android:layout_alignParentRight=true
                                 android:layout_alignParentTop=true
                         /ImageView

 /RelativeLayout
 TextView
 android:text=@+id/TextView02
 android:id=@+id/TextView_HelpText
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 /TextView
 /LinearLayout

 I had a similar problem which came down to an XML layout issue and I'm
 sure it's a similar issue here only I don't know how to resolve it.

 Can someone please help and tell me how I can get the TextView to
 display and perhaps more importantly, direct me to some good android
 xml layout material?

 Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView visibility problem

2010-10-19 Thread metal mikey
It might be because the TextView is positioned offscreen. Try putting
it prior to the RelativeLayout, if you can see it then then it's
likely the RelativeLayout is pushing it offscreen when the TextView
is placed after the RelativeLayout.

On Oct 20, 10:07 am, sisko adeod...@gmail.com wrote:
 The following code is causing me problems as the last view, the
 TextView, does not display :

 LinearLayout
         xmlns:android=http://schemas.android.com/apk/res/android;
         android:id=@+id/LinearLayout01
         android:background=@drawable/bkgrnd
 android:layout_height=fill_parent
 android:layout_width=fill_parent
         RelativeLayout
                 android:id=@+id/RelativeLayout01
                 android:layout_width=wrap_content
 android:layout_height=wrap_content
                         ImageView
                                 android:id=@+id/ImageView01
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:background=@drawable/quizicon
                                 android:layout_alignParentLeft=true
                                 android:layout_alignParentTop=true
                         /ImageView
                         TextView
                                 android:id=@+id/TextView01
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:text=@string/help
                                 android:layout_alignParentTop=true
                                 android:layout_centerHorizontal=true
                                 android:textSize=@dimen/menuxmlTitleSize
                                 android:textColor=@color/menuxmlTitleColor
                         /TextView
                         ImageView
                                 android:id=@+id/ImageView02
                                 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:background=@drawable/quizicon
                                 android:layout_alignParentRight=true
                                 android:layout_alignParentTop=true
                         /ImageView

 /RelativeLayout
 TextView
         android:text=@+id/TextView02
         android:id=@+id/TextView_HelpText
         android:layout_width=fill_parent
         android:layout_height=wrap_content
 /TextView

 /LinearLayout

 Can anyone offer suggestions as to why the TextView does not showup in
 the present format?
 Also, please suggest good online resourse(s) that can help me learn
 good Android XML layout techniques, please.

 Thanks :-)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView visibility problem

2010-10-18 Thread Bret Foreman
I just tried the hierarchyviewer and I'm getting the following
exception as soon as I click Request Layout. I restarted the server
and it didn't make any difference.

Exception in thread AWT-EventQueue-0 java.lang.NullPointerException
at
com.android.hierarchyviewer.ui.Workspace.requestLayout(Workspace.java
:1018)
at
com.android.hierarchyviewer.ui.action.RequestLayoutAction.actionPerfo
rmed(RequestLayoutAction.java:40)
at javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown
Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView height not collapsing

2010-10-10 Thread Tim S
Duh, I missed that somehow.  Thanks!


On Oct 6, 9:00 pm, TreKing treking...@gmail.com wrote:
 On Thu, Sep 30, 2010 at 2:25 PM, Tim S taschmidt1...@gmail.com wrote:
  How exactly do you get them to go away without removing them altogether?

 http://developer.android.com/reference/android/view/View.html#GONE

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView setCompoundDrawables how to scale

2010-10-06 Thread jotobjects
On Oct 6, 10:33 am, Romain Guy romain...@android.com wrote:
 Instead of calling setCompoundDrawablesWithIntrinsicBounds(), just use
 setCompoundDrawables() and set your own bounds.

Thanks - notice that my post indicated setBounds() was a solution.

To scale and retain the aspect ratio I did the following.  This gets
the job done :-) but is there a simpler method?

static public Drawable scaleDrawable(Drawable drawable, int width, int
height)
{
  int wi = drawable.getIntrinsicWidth();
  int hi = drawable.getIntrinsicHeight();
  int dimDiff = Math.abs(wi - width) - Math.abs(hi - height);
  float scale = (dimDiff  0) ? width/(float)wi : height/
(float)hi;
  Rect bounds = new Rect(0, 0, (int)(scale*wi), (int)(scale*hi));
  drawable.setBounds(bounds);
  return drawable;
}



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: TextView resets its location after an animation

2010-09-20 Thread ClarkBattle
The answer is that it needs to have animation.setFillAfter( true ); in
order to persist the animation after its end.  Strange that this is
not true by default.

On Sep 17, 3:09 pm, ClarkBattle clarkbat...@gmail.com wrote:
 Ive tried several interpolators and many different values.  It always
 resets.  RELATIVE_TO_PARENT is not appropriate for this app.  I have a
 small textView that just needs to shrink to a small strip on the side
 of the screen when swiped, exposing another text view below it.
 Thanks though.

 On Sep 17, 12:55 pm, Tommy droi...@gmail.com wrote:

  I haven't worked to much with animations but the ones I have that slide in
  from the right look like this:

  Animation inFromRight = new TranslateAnimation(
                          Animation.RELATIVE_TO_PARENT,  +1.0f,
  Animation.RELATIVE_TO_PARENT,  0.0f,
                          Animation.RELATIVE_TO_PARENT,  0.0f,
  Animation.RELATIVE_TO_PARENT,   0.0f
                          );
                          inFromRight.setDuration(600);
                          inFromRight.setInterpolator(new
  AccelerateInterpolator());

  maybe try to copy and paste that into your app and see if it changes
  anything. They look almost the same to me except for some numbers and
  AccelerateInterpolator that I use. Let me know if it works if you
  copy/paste it.

  Tommy

  Android Mobile Phone Application Developer
  Database Administrator
  .net Web Specialist

  -Original Message-
  From: android-developers@googlegroups.com

  [mailto:android-develop...@googlegroups.com] On Behalf Of ClarkBattle
  Sent: Friday, September 17, 2010 3:37 PM
  To: Android Developers
  Subject: [android-developers] TextView resets its location after an
  animation

  I am using a Translate animation on a text view.

                  TranslateAnimation animation = new
  TranslateAnimation(
                           TranslateAnimation.RELATIVE_TO_SELF, 0.0f,
                           TranslateAnimation.RELATIVE_TO_SELF, 0.8f,
                           TranslateAnimation.RELATIVE_TO_SELF, 0f,
                           TranslateAnimation.RELATIVE_TO_SELF, 0f );

                  animation.setDuration( ANIMATION_DURATION );
                  animation.setInterpolator( new
  DecelerateInterpolator() );

                  myTextView.startAnimation( animation );

  This works in that it slides the text view to the right.  However,
  when the animation is complete it puts the text view right back where
  it started!  I was under the impression tat the view should remain
  where the animation left it.  Why does this happen?

  Thanks

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group 
  athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


  1   2   3   >