[android-developers] Save getCallingPackage() in onSaveInstanceState. is this necessary?

2013-06-24 Thread NoraBora
In Facebook-Android SDK 3.0.1, there is LoginActivity.
In LoginActivity, callingPackage is get from getCallingPackage() and
save it through onSaveInstanceState and restore from savedInstanceState in 
onCreate().
https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/LoginActivity.java

I wonder if this is even necessary.
>From my test, Activity.getCallingPackage() is still available after process 
is killed and restored.
so it seems I don't have to save callingPackage to bundle at all.

-- 
-- 
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.




Re: [android-developers] Re: Call glGetShaderPrecisionFormat before GLSurfaceView created

2013-06-17 Thread NoraBora
I haven't found workaround so until then I wanted to disable the feature
from ui.
Could you be more specific about 10-bits-mediump fragment precision
workaround?
I'm interested.


2013/6/17 a1 

>
> My app is using some graphic filter with GLSurfaceView & OpenGL API
>> and I recently found my algorithm depends on shader precision.
>>
>> Now I want to my app to show the GLSurfaceView only if the device
>> supports proper shader precision.
>>
>
> But what's your issues exactly? I'm guessing you have a problem with mali
> 10 bits mediump fragment precision, but depending on usage and model this
> may be workaround (eg. mali-t604 supports fragment highp).
>
> --
> Bart
>
> --
> --
> 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 a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/rqh379btofQ/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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.




Re: [android-developers] Call glGetShaderPrecisionFormat before GLSurfaceView created

2013-06-17 Thread NoraBora
That's a clever trick. I'll try that. Thank you.
2013. 6. 17. 오후 4:01에 "Romain Guy" 님이 작성:

> You don't have to use a GLSurfaceView. You could create your own OpenGL
> context, using a 1x1 pbuffer window surface, to be able to call
> glGetShaderPrecisionFormat(). Just make sure you don't do this on the UI
> thread to not conflict with Android's UI renderer.
>
>
> On Sun, Jun 16, 2013 at 11:36 PM, NoraBora  wrote:
>
>> My app is using some graphic filter with GLSurfaceView & OpenGL API
>> and I recently found my algorithm depends on shader precision.
>>
>> Now I want to my app to show the GLSurfaceView only if the device
>> supports proper shader precision.
>> but It seems is...I can't use glGetShaderPrecisionFormat until
>> GLSurfaceView.onSurfaceCreated.
>> Adding GLSurfaceView and change visibility to gone, invisible doesn't
>> help.
>>
>> Is there any way around? or this is just impossible?
>>
>> --
>> --
>> 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.
>>
>>
>>
>
>
>
> --
> 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
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/rqh379btofQ/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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] Call glGetShaderPrecisionFormat before GLSurfaceView created

2013-06-16 Thread NoraBora
My app is using some graphic filter with GLSurfaceView & OpenGL API
and I recently found my algorithm depends on shader precision.

Now I want to my app to show the GLSurfaceView only if the device supports 
proper shader precision.
but It seems is...I can't use glGetShaderPrecisionFormat until 
GLSurfaceView.onSurfaceCreated.
Adding GLSurfaceView and change visibility to gone, invisible doesn't help.

Is there any way around? or this is just impossible?

-- 
-- 
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.




Re: [android-developers] Re: SurfaceView#setZOrderMediaOverlay(true) not working as expected

2013-05-22 Thread NoraBora
I though z-order of SurfaceViews is nothing to do(and not guaranted) with 
order of layout.addView(SurfaceView).
but this seems to have something to do with the order of the addView().
For example,

// v2 should be on top of v1
SurfaceView v1;
GLSurfaceView v2;

// Case 1 : always v2 is on top of v1
v2.setZOrderMediaOverlay(true)
parent.addView(v1);
parent.addView(v2);

// Case 2 : sometimes v2 is on top of v1
v2.setZOrderMediaOverlay(true)
parent.addView(v2);
parent.addView(v1);

Does setZOrderMediaOverlay(true) only works if it is the last child?


2011년 9월 8일 목요일 오전 3시 29분 22초 UTC+9, Dianne Hackborn 님의 말:
>
> This is used by the standard launcher for its apps list, so it works 
> correctly.
>
> I regret making it public because it really violates the intended 
> semantics of SurfaceView.
>
> On Wed, Sep 7, 2011 at 9:57 AM, Shri >wrote:
>
>> I have subclassed SurfaceView and call #setZOrderMediaOverlay in the
>> constructor. So it is getting called before the SurfaceView is
>> attached to the window. But it still does not work consistently.
>>
>> By "it is too bad we made that API public.", do you mean that there
>> are known issues with using this API? It would be good to know how
>> much to rely on it so we can look at alternatives. Since it only
>> misbehaves occasionally, its never clear if a change in the code has
>> actually fixed the problem or not.
>>
>> Thanks
>> Shri
>>
>> On Jul 27, 12:43 pm, Dianne Hackborn  wrote:
>> > Well it is too bad we made that API public. :p
>> >
>> > You can use "adb shell dumpsys window" to see the windows in the window
>> > manager, to see how your windows have been Z-ordered.  Also be sure you 
>> are
>> > setting this property before the SurfaceView is attached to its window, 
>> and
>> > never changing it.
>> >
>> >
>> >
>> > On Tue, Jul 26, 2011 at 10:51 PM, Shri  wrote:
>> > > I am occasionaly seeing this on Nexus S Gingerbread MR1 as well. Is
>> > > this a bug in setZOrderMediaOverlay?
>> >
>> > > On Jul 13, 2:09 pm, Shri  wrote:
>> > > > I have a small screen camera preview being shown on top of a larger
>> > > > video (see layout at the end). I use
>> > > > SurfaceView#setZOrderMediaOverlay(true) on the small camera preview,
>> > > > and this works most of the time. However, occasionally, the camera
>> > > > preview is not fully displayed. Only the part of it not blocked by 
>> the
>> > > > larger video view is displayed, while the 5dip black border *is* 
>> fully
>> > > > displayed on top of the large video.
>> >
>> > > > So it seems like SurfaceView#setZOrderMediaOverlay(true) is not
>> > > > working as expected. My understanding of the API is that it 
>> guarantees
>> > > > that the SurfaceView will be displayed on top of other SurfaceViews.
>> >
>> > > > I do not want to use #setZOrderOnTop as I do want to overlap the
>> > > > camera preview with some icons, and using #setZOrderOnTop(true) 
>> would
>> > > > cause the camera preview to display on top of the overlay icons.
>> >
>> > > > Any idea why #setZOrderMediaOverlay(true) misbehaves occasionally? I
>> > > > am on Honeycomb MR1 on Motorola Xoom.
>> >
>> > > > Thanks,
>> > > > Shri
>> >
>> > > > http://schemas.android.com/apk/res/
>> > > > android"
>> > > >   android:orientation="horizontal"
>> > > >   android:layout_width="match_parent"
>> > > >   android:layout_height="match_parent">
>> >
>> > > > > > > >   android:id="@+id/some_video"
>> > > >   android:layout_width="match_parent"
>> > > >   android:layout_height="match_parent" />
>> >
>> > > > 
>> > > > > > > >   android:id="@+id/camera_preview_and_overlays"
>> > > >   android:layout_width="100dip"
>> > > >   android:layout_height="50dip" >
>> > > >   
>> > > >   > > > > android:id="@+id/camera_preview"
>> > > > android:layout_width="match_parent"
>> > > > android:layout_height="match_parent"/>
>> > > >   > > > > android:id="@+id/overlay_icon"
>> > > > android:layout_width="match_parent"
>> > > > android:layout_height="match_parent"/>
>> >
>> > > > 
>> > > > 
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Android Developers" group.
>> > > To post to this group, send email to 
>> > > android-d...@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
>> >
>> > --
>> > Dianne Hackborn
>> > Android framework engineer
>> > hack...@android.com
>> >
>> > Note: please don't send private questions to me, as I don't have time to
>> > provide private support, and so won't reply to such e-mails.  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 p

Re: [android-developers] How to control the SurfaceView's z-order

2013-05-22 Thread NoraBora
Oh, the answer is here.
https://groups.google.com/forum/?fromgroups#!msg/android-developers/nDNQcceRnYA/ps9wTBfXIyEJ
Never mind :)

2013년 5월 22일 수요일 오후 5시 8분 25초 UTC+9, NoraBora 님의 말:
>
> Hello, Dianne Hackborn.
> Is this 'multiple surfaceview' still not-recommended?
>
> I'm making Filter camera app with 1 SurfaceView(camera) and 1 
> GLSurfaceView(filter) targeting Froyo and higher.
> but their z-order are sometimes changed.
>
> I know TextureView is introduced but it is much higher than Froyo.
>
> 2009년 3월 24일 화요일 오전 2시 32분 18초 UTC+9, Dianne Hackborn 님의 말:
>>
>> I strongly recommend against using multiple surface views in a window.  
>> The way surface view is implemented is that a separate surface is created 
>> and Z-ordered behind its containing window, and transparent pixels drawn 
>> into the rectangle where the SurfaceView is so you can see the surface 
>> behind.  We never intended to allow for multiple surface views.
>>
>> On Mon, Mar 23, 2009 at 2:12 AM, hurri  wrote:
>>
>>>
>>> Hi,
>>> I created a RelativeLayout which has 2 SurfaceView. The layout looks
>>> like below
>>> >>  android:layout_width="wrap_content"
>>>  android:layout_height="wrap_content">
>>>  >> android:layout_width="wrap_content"
>>> android:layout_height="wrap_content"
>>> android:layout_centerInParent="true"
>>>  >
>>>  >> android:layout_width="120dip"
>>> android:layout_height="90dip"
>>> android:layout_alignBottom="@id/main"
>>> android:layout_alignRight="@id/main"
>>>  >
>>> 
>>>
>>> It seems that the main surface is always above on pip surface even put
>>> the pip definiation before the main. So how can i change the z-order
>>> to bring the pip to front.
>>>
>>>
>>>
>>
>>
>> -- 
>> Dianne Hackborn
>> Android framework engineer
>> hac...@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
--- 
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.




Re: [android-developers] How to control the SurfaceView's z-order

2013-05-22 Thread NoraBora
Hello, Dianne Hackborn.
Is this 'multiple surfaceview' still not-recommended?

I'm making Filter camera app with 1 SurfaceView(camera) and 1 
GLSurfaceView(filter) targeting Froyo and higher.
but their z-order are sometimes changed.

I know TextureView is introduced but it is much higher than Froyo.

2009년 3월 24일 화요일 오전 2시 32분 18초 UTC+9, Dianne Hackborn 님의 말:
>
> I strongly recommend against using multiple surface views in a window.  
> The way surface view is implemented is that a separate surface is created 
> and Z-ordered behind its containing window, and transparent pixels drawn 
> into the rectangle where the SurfaceView is so you can see the surface 
> behind.  We never intended to allow for multiple surface views.
>
> On Mon, Mar 23, 2009 at 2:12 AM, hurri  wrote:
>
>>
>> Hi,
>> I created a RelativeLayout which has 2 SurfaceView. The layout looks
>> like below
>> >  android:layout_width="wrap_content"
>>  android:layout_height="wrap_content">
>>  > android:layout_width="wrap_content"
>> android:layout_height="wrap_content"
>> android:layout_centerInParent="true"
>>  >
>>  > android:layout_width="120dip"
>> android:layout_height="90dip"
>> android:layout_alignBottom="@id/main"
>> android:layout_alignRight="@id/main"
>>  >
>> 
>>
>> It seems that the main surface is always above on pip surface even put
>> the pip definiation before the main. So how can i change the z-order
>> to bring the pip to front.
>>
>>
>>
>
>
> -- 
> Dianne Hackborn
> Android framework engineer
> hac...@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
--- 
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.




Re: [android-developers] Re: handler.removeMessages(0) removes all runnable added by handler.post().

2013-04-12 Thread NoraBora
Yes, that's what I mean. What I didn't know was that
Even though I never set 'what' value to 0 in handler.post(new Runnable()),
The runnable is removed. (The doc didn't say default value of 'what' is
0!!!)



2013/4/12 bob 

> That code does not remove the 0th Message.
>
>
> It removes all messages that have a "what" value of 0.
>
>
> The "what" is apparently an id associated with the messages (not
> necessarily unique) :
>
>
> <https://lh4.googleusercontent.com/-NFUf7VOHEOU/UWgawLxDSKI/AW0/8AjbjmNtl_Y/s1600/what.png>
>
>
>
> Thanks.
>
>
>
> On Thursday, April 11, 2013 8:20:06 PM UTC-5, NoraBora wrote:
>>
>> Sometimes you use a handler as a member variable and use it for
>> sendMessages(), removeMessage(), post().
>> I just found out something.
>>
>> Say you call these
>> handler.sendMesssage(0) // 1
>> handler.post(new Runnable()) // 2
>> handler.post(new Runnable()) // 3
>>
>> and call this
>> handler.removeMessage(0)
>>
>> then this will remove 2, 3 as well as 1
>> because removeMessage/hasMessage doesn't check runnable and posted
>> message's what value is 0 by default.
>>
>> Some people could think this as a bug but it's too late to change such a
>> basic api so
>> I think documentation should mention this.
>>
>  --
> --
> 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 a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/9kiGk35F-Ik/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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] handler.removeMessages(0) removes all runnable added by handler.post().

2013-04-11 Thread NoraBora
Sometimes you use a handler as a member variable and use it for 
sendMessages(), removeMessage(), post().
I just found out something.

Say you call these
handler.sendMesssage(0) // 1 
handler.post(new Runnable()) // 2
handler.post(new Runnable()) // 3 

and call this
handler.removeMessage(0)

then this will remove 2, 3 as well as 1
because removeMessage/hasMessage doesn't check runnable and posted 
message's what value is 0 by default.

Some people could think this as a bug but it's too late to change such a 
basic api so
I think documentation should mention this.

-- 
-- 
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] In IAB v3, can I use getBuyIntent() to check purchase?

2013-01-30 Thread NoraBora
I'm testing IAB v3 and found that if I tried to buy a product I already 
bought,
getBuyIntent() returns with the response code 
BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED.
This would be much easier than getPurchase() to check a productId because 
getPurchase() returns all list.

Can I use this to check if a productId is already purchased or not?
Is there no harm to call getBuyIntent() many times without call 
startIntentSenderForResult()?

-- 
-- 
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] Using Service without startService(), bindService()?

2012-10-31 Thread NoraBora
I'm looking at the In-app Billing example and found something interesting.
(http://developer.android.com/guide/google/play/billing/billing_integrate.html#billing-download)

I have known that Service must be started with startService() or 
bindService(),
but in the example BillingService is made by BillingService() constructor 
which I've never seen before.

In the BillingService.java I found the comment "on behalf of the 
application" and attachBaseContext().
I guess maybe this is the reason? (I don't fully understand what 
attachBaseContext() does, but the name tells me.)
Please give me some explanation.

BTW, is using Service() constructor permitted / encouraged by any means?
This seems to me like   Activity myActivity = new MyActivity() :(

-- 
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: Setting Translucent Theme from Java

2010-06-18 Thread NoraBora
set the Translucent theme in the AndroidManifest.xml and use
setTheme().

It seems strange but it works.

To enable translucent is only possible in manifest. I guess.

To disable translucent is possible in manifest and java code.

Also remember that setTheme() has to be before super.onCreate();

On Jun 16, 10:37 pm, droidsan  wrote:
> Depending on an extra value of the Intent that starts my Activity the
> Activity should show up withtranslucentor solid background.
> Therefore, I use the following code in my Activity's onCreate method:
>
>     if (getIntent().getBooleanExtra("transparent", false)) {
>                 setTheme(android.R.style.Theme_Translucent);
>         }
>         else {
>                 setTheme(android.R.style.Theme_Black);
>         }
>
>         setContentView(R.layout.main);
>
> However, with this code the background of my Activity never 
> becomestranslucent, even if setTheme(android.R.style.Theme_Translucent) is
> called. (The same code works well when using themes that only set font
> sizes).
>
> I assume that the background for my Activity is already set during
> inflation of the Activity and that setContentView only puts my View
> (i.e. R.layout.main) on top of this background.
>
> Is there a way to change translucency of my Activity from Java code?
>
> Thanks for your help.
>
> Droidsan.

-- 
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: 'Avoiding memory leaks' article in android blog

2010-04-12 Thread NoraBora

On Apr 11, 11:23 am, Streets Of Boston 
wrote:
>
> If all it OK, you should only have on activity (the new one) and the
> old one should be a candidate for garbage collection. But sBackground
> is (indirectly) still referencing the old activity and it will not be
> garbage collected.

but when a new activity is created setBackgroundDrawable() is called
in onCreate(),
which means sBackground is now referencing the new created activity,
not the old one any more.
Then the old one should be a candidate for gc. shouldn't it...?

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] 'Avoiding memory leaks' article in android blog

2010-04-10 Thread NoraBora
I just read the article 'Avoiding memory leaks' in android blog
written by Romain Guy.
http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html

According to the article, the below code has memory leak when rotating
because the static drawable has a reference to Activity.


private static Drawable sBackground;

@Override
protected void onCreate(Bundle state) {
  super.onCreate(state);

  TextView label = new TextView(this);
  label.setText("Leaks are bad");

  if (sBackground == null) {
sBackground = getDrawable(R.drawable.large_bitmap);
  }
  label.setBackgroundDrawable(sBackground);

  setContentView(label);
}


I understand sBackground has a reference to TextView, and the TextView
has a reference to Activity.
I know when a device is rotated, Activity is destroyed and created
again.

but I think when a new Activity is created, sBackground setCallback a
new TextView and the TextView has reference to the new Activity.

Then the old TextView and the old Activity is not refered by
sBackground so they can be garbage-collected.
which means this code has no memory-leaks.

Please correct me. Any help is appreciated.

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: Scrollbar Thumb Color

2010-03-04 Thread NoraBora
I didn't know there are android:scrollbarThumbVertical. Thanks, social
hub.

I tested with android:scrollbarThumbVertical="@drawable/icon" in
ListView

and the scrollbar thumb changed successfully except the width of the
thumb is unchanged.


On Mar 2, 11:43 pm, social hub  wrote:
> there are some drawables i guess I am not sure whether it solves your issue
>
> android:scrollbarThumbHorizontal
> Since: API Level
> <http://developer.android.com/guide/appendix/api-levels.html#level>
>
> Defines the horizontal scrollbar thumb drawable.
>
> Must be a reference to another resource, in the form "@[+][*package*:]*type*
> :*name*" or to a theme attribute in the form "?[*package*:][*type*:]*name*".
>
> This corresponds to the global attribute resource symbol
> scrollbarThumbHorizontal<http://developer.android.com/reference/android/R.attr.html#scrollbarT...>
> .
>  Related Methods
>   android:scrollbarThumbVertical
> Since: API Level
> <http://developer.android.com/guide/appendix/api-levels.html#level>
>
> Defines the vertical scrollbar thumb drawable.
>
> Must be a reference to another resource, in the form "@[+][*package*:]*type*
> :*name*" or to a theme attribute in the form "?[*package*:][*type*:]*name*".
>
> This corresponds to the global attribute resource symbol
> scrollbarThumbVertical<http://developer.android.com/reference/android/R.attr.html#scrollbarT...>
> .
>  Related Methods
>   android:scrollbarTrackHorizontal
> Since: API Level
> <http://developer.android.com/guide/appendix/api-levels.html#level>
>
> Defines the horizontal scrollbar track drawable.
>
> Must be a reference to another resource, in the form "@[+][*package*:]*type*
> :*name*" or to a theme attribute in the form "?[*package*:][*type*:]*name*".
>
> This corresponds to the global attribute resource symbol
> scrollbarTrackHorizontal<http://developer.android.com/reference/android/R.attr.html#scrollbarT...>
> .
>  Related Methods
>   android:scrollbarTrackVertical
> Since: API Level
> <http://developer.android.com/guide/appendix/api-levels.html#level>
>
> Defines the vertical scrollbar track drawable.
>
> Must be a reference to another resource, in the form "@[+][*package*:]*type*
> :*name*" or to a theme attribute in the form "?[*package*:][*type*:]*name*".
>
> This corresponds to the global attribute resource symbol
> scrollbarTrackVertical<http://developer.android.com/reference/android/R.attr.html#scrollbarT...>
> .
>
> On Mon, Mar 1, 2010 at 10:44 PM, NoraBora  wrote:
> > AFAIK, you cannot change the scroll bar colors.
>
> > On Feb 25, 3:20 am, sriram  wrote:
> > > Hi All,
>
> > > Can the application customize the scroll bar colors like the thumb
> > > color/image or the background color image.
>
> > > For example I am using a ListView on a device. Now the scrollbar seems
> > > to appear in white because I see the imageviewgets truncated on the
> > > left.
> > > The same does not happen on the emulator where the scrollbar is
> > > visible.
>
> > > Thanks...
>
> > > I have posted couple of questions, but have not recived even one
> > > answer... atleast for this one can I get one response may be even from
> > > the admin banning from posting :)
>
> > --
> > 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: How to use setBounds in android.

2010-03-01 Thread NoraBora
Button class does not have setBounds().

setBounds() is for Drawable.
http://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds%28int,%20int,%20int,%20int%29

What are you trying to achieve with setBounds?

On Feb 24, 10:39 pm, rajesh chandrasekaran
 wrote:
> hi All,
>
>    How to use setBounds in android.
>
> This is my code,but i am getting the error
>
> Button button1 = (Button) findViewById(R.id.button_1);
> button1.setBounds(87, 90, 34, 98);
>
> please give me the corect solution.
>
> Thanks
> C.Rajesh

-- 
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: Scrollbar Thumb Color

2010-03-01 Thread NoraBora
AFAIK, you cannot change the scroll bar colors.

On Feb 25, 3:20 am, sriram  wrote:
> Hi All,
>
> Can the application customize the scroll bar colors like the thumb
> color/image or the background color image.
>
> For example I am using a ListView on a device. Now the scrollbar seems
> to appear in white because I see the imageviewgets truncated on the
> left.
> The same does not happen on the emulator where the scrollbar is
> visible.
>
> Thanks...
>
> I have posted couple of questions, but have not recived even one
> answer... atleast for this one can I get one response may be even from
> the admin banning from posting :)

-- 
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: getContextMenuInfo() returns null on sub-menu MenuItems

2010-02-21 Thread NoraBora
Are you using this code?

AdapterContextMenuInfo info = (AdapterContextMenuInfo)
item.getMenuInfo();

For ExpandableListView, you have to use ExpandableListContextMenuInfo.

On Feb 20, 9:06 am, TreKing  wrote:
> Folks,
>
> I have an ExpandableListView with a registered context menu (loaded from an
> resource file). When an item is selected I use the getMenInfo() function to
> get the ContextMenuInfo associated with the context menu for the clicked
> item to determine the index of the group and / or child that was clicked.
>
> Now, this works great if the item selected is part of the main context menu.
> However, if the item selected is part of a sub-menu, getMenuInfo() returns
> null. This seems wrong. Why wouldn't you be able to get the menu info from a
> sub-menu?
>
> I am getting around this by saving the menu info off when it's created, but
> this seem hacky. Is this a bug, intended behavior, or am I just missing
> something obvious? Has anyone gotten this to work like this?
>
> Thanks.
>
> -
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking

-- 
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: question regarding pv player

2010-02-21 Thread NoraBora
No. MediaPlayer.java uses PV Player internally.

On Feb 20, 2:32 am, zeeshan  wrote:
> Hi Dear,
>
> is PV player API available at Android application level?

-- 
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: Simple Cursor Adapter - Listview Example

2010-02-18 Thread NoraBora
See ApiDemos in SDK

On Feb 16, 9:33 pm, "Sasikumar.S"  wrote:
> Hi,
>
> Any simple cursor adapter with listview example ?
>
> --
> Thanks & Regards
> Sasikumar.S

-- 
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: rotate progress bar

2010-02-18 Thread NoraBora
To use vertical progressbar, you have to make your own widget
extending View, not ProgressBar.

the source of ProgressBar widget may help.

On Feb 16, 6:24 am, Jonathan  wrote:
> HI, I am extending the normal android.widget.ProgressBar. I want to
> make it vertical. This is my current onDraw Method
>
>         @Override
>         protected synchronized void onDraw(Canvas canvas) {
>
>                 canvas.save();
>                  canvas.rotate(90);
>                 canvas.translate(0,-50);
>                 super.onDraw(canvas);
>                 canvas.restore();
>         }
>
> This rotates it fine, however I am having alot of sizing issues. It
> seems as though I have to set the width and the height of the control
> to be the same thing or else I run into alot of clipping issues.
> Basically, I want to have a progress bar that, once rotated, is 50dip
> wide and fills the screen vertically. Can anyone think of a way to do
> this?
>
> Also, it doesn't seem to be actually drawing the progress properly,
> but I will revisit that once I get the clipping sorted out.
>
> Thanks
>
> Jon

-- 
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: Deprecated Absolute layout ?

2010-02-18 Thread NoraBora
AFAIK, AbsoluteLayout does not support variable screen size like WVGA.

On Feb 16, 6:59 am, "Mina Samyhttp://android-pro.blogspot.com";
 wrote:
> Hi all
> the absolute layout class is deprecated
> but still can write it in code and it works.
> will there be any problems if I use this class ? will the application
> work correctly after I deploy it on a phone ?
> 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: How can I align an ImageView to the right of the Parent?

2010-02-10 Thread NoraBora
It seems to me in the 2nd ImageView
android:layout_toRightOf="@id/text"
and
android:layout_alignParentRight="true"
conflict each other.
try removing android:layout_toRightOf="@id/text"

On Feb 10, 11:28 pm, n179911  wrote:
> Thanks. But I want android framework to align my ImageView with its
> parent for me. Instead of adjust it myself pixel by pixel.
>
> On Wed, Feb 10, 2010 at 6:24 AM, Narendra Bagade
>
>  wrote:
> > use android:layout_marginLeft  or
> > android:paddingLeft
>
> > Narendra
>
> > On Wed, Feb 10, 2010 at 7:47 PM, n179911  wrote:
>
> >> Basically, I want:
>
> >> ---
> >> | ImageView |  TextView fill up the rest            | ImageView |
>
> >> ---
>
> >> How can I do that?
>
> >> I have put 'android:layout_alignParentRight="true"' in my 2nd
> >> ImageView, but that does not align to the right of the parent.
> >> Any idea please?
>
> >> On Tue, Feb 9, 2010 at 2:23 PM, n179911  wrote:
> >> > Hi,
>
> >> > I have the following l relative layout, which I want an Image to the
> >> > left and an Image to the right, then the rest is filled by TextView.
> >> > But I can't get the last image to align right of the parent. I have
> >> > added 'android:layout_alignParentRight="true"' but it does not work.
>
> >> > Any idea please?
> >> > Thank you.
>
> >> >  >> > xmlns:android="http://schemas.android.com/apk/res/android";
> >> >        android:layout_width="fill_parent"
> >> > android:layout_height="?android:attr/listPreferredItemHeight"
> >> >        android:padding="6dip">
>
> >> >         >> >            android:layout_width="wrap_content"
> >> >                android:layout_height="fill_parent"
> >> >                android:layout_alignParentTop="true" />
>
> >> >         >> >            android:layout_width="wrap_content"
> >> >            android:layout_height="wrap_content"
> >> >            android:layout_alignWithParentIfMissing="true"
> >> >            android:layout_toRightOf="@id/icon"
> >> >            android:layout_alignParentTop="true" />
>
> >> >         >> >        android:id="@+id/button1"
> >> >        android:layout_width="wrap_content"
> >> >        android:layout_height="wrap_content"
> >> >        android:layout_toRightOf="@id/text"
> >> >        android:layout_alignParentRight="true"
> >> >        android:layout_alignParentTop="true"
> >> >        android:src="@drawable/icon" />
>
> >> > 
>
> >> --
> >> 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
>
> > --
> > Regards,
>
> > Narendra B
> > 9632382960,
> > Bangalore.
>
> > --
> > 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: How to change color of button borders

2010-02-10 Thread NoraBora
You can make your own button background.
android:background="@drawable/your_resource"

On Feb 10, 12:03 am, umesh chalwetkar  wrote:
> Hi,
>
> I am beginner to android, I am trying to change the color of the borders of
> button using xml. Do you have any solution?
>
> Thanks,
> Umesh

-- 
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] How can I scroll ListView by pixel?

2010-02-07 Thread NoraBora
I have a ListView which has many TextViews.

Each TextView has different texts. They are usually 2 or more pages.

How can I scroll this ListView by pixel?


At first I thought scrollBy works but then it doesn't show the next
item.

Later I implemented with a few of dispatchTouchEvent(). but then I
have to create a MotionEvent everytime.


I believe there should be something.

-- 
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: Layout Highlight

2010-02-06 Thread NoraBora
Did you send me an email? I didn't get any.

Why don't you post the layout here?

On Feb 6, 1:40 pm, haric zhu  wrote:
> Have you got my layout file, and if you have any other problem about this
> issue, please email me:)
>
> 2010/2/6 NoraBora 
>
>
>
> > In 'list_selector_background'
>
> > you can set your default background image with no state
>
> > and set highlight image with state_pressed or state_focused.
>
> >http://developer.android.com/reference/android/widget/ImageButton.html
>
> > On Feb 5, 8:40 pm, "Sasikumar.S"  wrote:
> > > Thank U Haric.
>
> > > I got it.
>
> > > But one more thing is,
> > > I need to set a image to that Layout background.
> > > Then how can i set these background too...? Pls ?..
>
> > > On Fri, Feb 5, 2010 at 4:58 PM, haric zhu  wrote:
> > > > HI Sasikumar.S, you can set a xml file as it's background like ListView
> > > > default action
> > > > add this -->
> > > > android:background="@android:drawable/list_selector_background"
> > > > to your layout file
>
> > > > 2010/2/5 Sasikumar.S 
>
> > > >> Hi,
>
> > > >> Can any one know how to highlight when we touch the layout?
>
> > > >> In my program i'm adding adding a textview to Linear Layout.
> > > >> When user touchs the Linear Layout it should perform some action.
> > > >> Its all working.
> > > >> But when user touches the screen. Its not highlighting.
> > > >> So it is not looking good..
>
> > > >> Any one know how to highlight?..
>
> > > >> --
> > > >> Thanks & Regards
> > > >> Sasikumar.S
>
> > > >> --
> > > >> 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
>
> > > > --
> > > > Best Regards
>
> > > > Haric
>
> > > >  --
> > > > 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
>
> > > --
> > > Thanks & Regards
> > > Sasikumar.S
>
> > --
> > 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
>
> --
> Best Regards
>
> Haric

-- 
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: Layout Highlight

2010-02-05 Thread NoraBora
In 'list_selector_background'

you can set your default background image with no state

and set highlight image with state_pressed or state_focused.

http://developer.android.com/reference/android/widget/ImageButton.html

On Feb 5, 8:40 pm, "Sasikumar.S"  wrote:
> Thank U Haric.
>
> I got it.
>
> But one more thing is,
> I need to set a image to that Layout background.
> Then how can i set these background too...? Pls ?..
>
>
>
> On Fri, Feb 5, 2010 at 4:58 PM, haric zhu  wrote:
> > HI Sasikumar.S, you can set a xml file as it's background like ListView
> > default action
> > add this -->
> > android:background="@android:drawable/list_selector_background"
> > to your layout file
>
> > 2010/2/5 Sasikumar.S 
>
> >> Hi,
>
> >> Can any one know how to highlight when we touch the layout?
>
> >> In my program i'm adding adding a textview to Linear Layout.
> >> When user touchs the Linear Layout it should perform some action.
> >> Its all working.
> >> But when user touches the screen. Its not highlighting.
> >> So it is not looking good..
>
> >> Any one know how to highlight?..
>
> >> --
> >> Thanks & Regards
> >> Sasikumar.S
>
> >> --
> >> 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
>
> > --
> > Best Regards
>
> > Haric
>
> >  --
> > 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
>
> --
> Thanks & Regards
> Sasikumar.S

-- 
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: Draw clock like minute hand

2010-02-05 Thread NoraBora
There is a AnalogClock widget.

you can find the source useful.

On Feb 5, 12:37 am, Sonic  wrote:
> Hi all.
>
> Just a quick question, how would i go about implementing a clock like
> hand that rotates around a centre point to different positions
> depending on a value.
>
> e.g. I send it a value of 3, and it points to the 3'o'clock position
> of a circle.
>
>                 protected void onDraw(Canvas canvas)
>                 {
>                 Paint line = new Paint();
>                 line.setStrokeWidth(3);
>                 line.setColor(Color.BLUE);
>                 line.setStyle(Paint.Style.STROKE);
>                 canvas.drawLine(55, 155, 125, 15, line);
>
>                 }
>
> I have the following fully working so it draws the line, but i dont
> understand how i could get one end of the line to always rotate around
> the centre fixed position.
>
> Do you have any ideas?
>
> 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: Using StaticLayout with a canvas to draw text.

2010-02-05 Thread NoraBora
Maybe you can try canvas.translate() before draw.

On Feb 4, 2:05 pm, julz  wrote:
> Hi,
> I have figured out the static layout this far, but I have no idea how
> to make it display my text anywhere else but in the top left corner.
> StaticLayout layout =
> new StaticLayout(text, getTextPaint(), 140,
> android.text.Layout.Alignment.ALIGN_CENTER,(float)1.0, (float)0.0,
> true);
> layout.draw(canvas);
>
> Thanks for your help.
> Julz

-- 
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: 'SimpleCursorAdapter' symbol not found and related errors in notepad sample application.

2010-02-05 Thread NoraBora
Remove the first line. "import com.tutorials.R; "

or in Eclipse Ctrl+Shift+o, which is a short-cut for auto-import.

On Feb 4, 10:23 am, Swiftguy  wrote:
> Hello All,
>
> Im new to Android.
> Trying to run the 'notepad' application on my local system (building
> using ANT)
>
> Getting following errors... tried by best to sort this prob .. but
> unable to
>
> for the SimpleCursorAdapter symbol found error .. i even imported the
> base class file i.e 'import android.widget.CursorAdapter' ... but
> still the same error.
>
> Source code is listed below...
>
> kindly help me out...thanks in advance.
>
> -
> [javac] /home/vikram/java-android/android-sdk/vik-apps/devGuide/
> Notepadv1/src/com/tutorials /Notepadv1.java:69: cannot find symbol
>
>     [javac] symbol  : class SimpleCursorAdapter
> -
>  [javac] /home/vikram/java-android/android-sdk/vik-apps/devGuide/
> Notepadv1/src/com/tutorials/Notepadv1.java:37: cannot find symbol
>     [javac] symbol  : variable menu_insert
>     [javac] location: class com.tutorials.R.string
>     [javac]         menu.add(0, INSERT_ID, 0, R.string.menu_insert);
> -
>
> Notepadv1.java file
> 
>
> package apt.tutorials;
>
> import com.tutorials.R;
> import android.app.*;
> import android.os.Bundle;
> import android.view.Menu;
> import android.view.MenuItem;
> import android.content.ContentValues;
> import android.content.Context;
> import android.database.Cursor;
> import android.database.SQLException;
> import android.database.sqlite.SQLiteOpenHelper;
> import android.database.sqlite.SQLiteDatabase;
> import android.widget.CursorAdapter;
>
> public class Notepadv1 extends ListActivity {
>         private int mNoteNumber = 1;
>         private NotesDbAdapter mDbHelper;
>    public static final int INSERT_ID = Menu.FIRST;
>
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>         mDbHelper = new NotesDbAdapter(this);
>         mDbHelper.open();
>         fillData();
>     }
>
>     @Override
>     public boolean onCreateOptionsMenu(Menu menu) {
>         boolean result = super.onCreateOptionsMenu(menu);
>         menu.add(0, INSERT_ID, 0, R.string.menu_insert);
>         return result;
>     }
>
>     @Override
>    public boolean onOptionsItemSelected(MenuItem item) {
>         switch (item.getItemId()) {
>         case INSERT_ID:
>             createNote();
>             return true;
>         }
>
>         return super.onOptionsItemSelected(item);
>     }
>
>     private void createNote() {
>         String noteName = "Note " + mNoteNumber++;
>         mDbHelper.createNote(noteName, "");
>         fillData();
>     }
>
>         // Binding the layout text field to the Database Cursor
>
>                             private void fillData() {
>                                 // Get all of the notes from the
> database and create the item list
>                                 Cursor c = mDbHelper.fetchAllNotes();
>                                 startManagingCursor(c);
>
>                                 String[] from = new String[]
> { NotesDbAdapter.KEY_TITLE };
>                                 int[] to = new int[] { R.id.text1 };
>
>                                 // Now create an array adapter and set
> it to display using our row
>                                 SimpleCursorAdapter notes = new
> SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);
>                                 setListAdapter(notes);
>                             }
>
> }
>
> -
>
> res/layout/main.xml
> 
>
> 
> http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
>     >
>           android:layout_width="wrap_content"
>         android:layout_height="wrap_content"/>
>
>            android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:text="@string/no_notes"/>
> 
>
> --
> notes_row.xml
> =
> 
>      xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="wrap_content"
>     android:layout_height="wrap_content"/>

-- 
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, visi

[android-developers] Re: Problem with expandable list view

2010-02-02 Thread NoraBora
I had a "cannot-click-item" problem with ListView.

In my case the "android:inputType" in TextView was the problem.

You should try removing attributes in text2.

Maybe start with 'android:numeric="integer"'?

On Jan 30, 4:33 am, tikky  wrote:
> I have an expandable list view, where the child view is a custom
> layout consisting of 2 text views within a RelativeLayout as follows:
> 
> http://schemas.android.com/apk/res/android";
>     android:id="@android:id/text1"
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content"
>     android:paddingLeft="?android:attr/
> expandableListPreferredItemPaddingLeft"
>     android:textAppearance="?android:attr/textAppearanceMedium"
>     android:gravity="center_vertical"
> />
> http://schemas.android.com/apk/res/android";
>     android:id="@+id/text2"
>     android:layout_height="fill_parent"
>     android:layout_width="wrap_content"
>     android:textAppearance="?android:attr/textAppearanceSmall"
>     android:layout_alignParentRight="true"
>     android:layout_centerInParent="true" android:numeric="integer"
> android:text="@string/text2"/>
> 
>
> However, when I click on the child view the onChildClick() is not
> getting called.
>
> If I remove the second text view text2 above, then it works fine and
> onChildClick() is called.
>
> Can anyone help me identify the problem here?
> This is the outline of my code:
>
>                         ExpandableListView list = (ExpandableListView) 
> findViewById
> (R.id.expandableListView);
>                         list.setVisibility(View.VISIBLE);
>                         Cursor groupCursor = 
> managedQuery(Category.CONTENT_URI,
> null, null, null, Items.DEFAULT_SORT_ORDER);
>                         // Set up our adapter
>                         mAdapter = new ShoppingListAdapter(groupCursor,
>                                         ShoppingListActivity.this,
>                                 R.layout.categories_list,//
> android.R.layout.simple_expandable_list_item_1,
>                                 R.layout.items_list,//
> android.R.layout.simple_expandable_list_item_1,
>                                 
> //android.R.layout.simple_list_item_multiple_choice,
>                                 new String[] {Category.NAME}, // Name for 
> group
> layouts
>                                 new int[] {android.R.id.text1},
>                                 new String[] {Items.NAME}, // Number for child
> layouts
>                                 new int[] {android.R.id.text1});
>                         list.setAdapter(mAdapter);
>
>                         list.setOnChildClickListener(new 
> OnChildClickListener(){
>
>                                         public boolean 
> onChildClick(ExpandableListView parent, View v,
> int groupPosition, int childPosition, long id) {
>                                                 // TODO Auto-generated method 
> stub
>                                                 showEditQuantityDialog();
>
>                                                 return true;
>                                         }
>                                });
>                      }
>
>     public class ShoppingListAdapter extends SimpleCursorTreeAdapter{
>
>         private String mItemsProjection[] = new String[] {
>                         Items._ID, Items.NAME
>         };
>         private static final String ITEMS_SELECTION = Items.CATEGORY_ID +
> "=?";
>
>         public ShoppingListAdapter(Cursor cursor, Context context, int
> groupLayout,
>                         int childLayout, String[] groupFrom, int[] groupTo, 
> String[]
> childrenFrom,
>                         int[] childrenTo) {
>                 super(context, cursor, groupLayout, groupFrom, groupTo,
> childLayout, childrenFrom,
>                                 childrenTo);
>
>         }
>
>         @Override
>         protected Cursor getChildrenCursor(Cursor groupCursor) {
>                 // Given the group, we return a cursor for all the children
> within that group
>                 Long groupId = groupCursor.getLong
> (groupCursor.getColumnIndexOrThrow(Category._ID));
>                 String strGroupId = Long.toString(groupId);
>                 String[] selectionArgs = new String[] { strGroupId };
>
>                 // The returned Cursor MUST be managed by us, so we use
> Activity's helper
>                 // functionality to manage it for us.
>                 return managedQuery(Items.CONTENT_URI, mItemsProjection,
> ITEMS_SELECTION, selectionArgs, Items.DEFAULT_SORT_ORDER);
>         }
>     }

-- 
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: docs for shape xml syntax

2010-02-02 Thread NoraBora
a little info here.

http://developer.android.com/intl/fr/reference/android/graphics/drawable/ShapeDrawable.html

On Jan 30, 1:22 am, jotobjects  wrote:
> I did find a handful of examples in samples/ApiDemos/res/drawable.
> The xml files in that directory are all examples of using  and
> related xml elements.
>
> Some of this is mentioned in the javadocs for
> android.graphics.drawable.  Some xml elements like  and
>  are not documented anywhere that I know of.  The attributes
> for  are listed in GradientDrawable but then these apparently
> are also the attributes for  according some of the examples.
>
> So I guess it is at least supported as part of the API, even if you
> have to reverse engineer it to figure out the features.
>
> On Jan 29, 5:59 am, Flying Coder  wrote:
>
> > Docs for this would be awesome!
>
> > Nedrow:  thanks for the link -- that was very helpful.
>
> > Steve
>
> > On Jan 28, 10:31 pm, jotobjects  wrote:
>
> > > Thanks - this sure looks like it might be useful if there was more
> > > documentation :(
>
> > > On Jan 28, 3:38 pm, Nerdrow  wrote:
>
> > > > Not a lot of good, workable documentation about this.  This helped me
> > > > out a lot:http://escomic.net/217
>
> > > > On Jan 27, 3:59 pm, jotobjects  wrote:
>
> > > > > Where is there information about the syntax of  xml files.
> > > > > These can be used to define 2D graphics as I understand it.  There are
> > > > > few spotty examples in the samples directory but that is all I have
> > > > > found.

-- 
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: how to use style

2010-02-02 Thread NoraBora
 is a StateListDrawable.

This may help
http://developer.android.com/intl/fr/reference/android/graphics/drawable/StateListDrawable.html


On Jan 29, 5:32 pm, saad bouchehboun  wrote:
> yes , but no explicite speking about selectors !! whiche alow
> custuming list views
>
> On 29 jan, 05:09, NoraBora  wrote:
>
> > Have you looked at ApiDemos?
>
> > It has lots of useful code examples.
>
> > On Jan 26, 7:07 am, saad bouchehboun  wrote:
>
> > > hy ,
>
> > > I need to use list selector , xml syntax , to custum my listview , can
> > > you help me find his full documentation .

-- 
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: how to use style

2010-01-28 Thread NoraBora
Have you looked at ApiDemos?

It has lots of useful code examples.

On Jan 26, 7:07 am, saad bouchehboun  wrote:
> hy ,
>
> I need to use list selector , xml syntax , to custum my listview , can
> you help me find his full documentation .

-- 
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: code problem

2010-01-28 Thread NoraBora
If you want to show a splash screen.

http://www.anddev.org/simple_splash_screen_-_alternative-t815.html

You can get more info if you search with "splash screen" in this
group.

On Jan 25, 11:51 pm, "ho(AO4)"  wrote:
> hi
> I want to ask   how can i solve it if i create  "setContentView(new
> AnimationView(this));"    and i need to go the another page but used "
> setContentView(R.layout.main);"
>
> setContentView(new AnimationView(this));
>
>         new Thread()
>         {
>           public void run()
>           {
>             try
>             {
>               sleep(5000);
>             }
>             catch (Exception e)
>             {
>               e.printStackTrace();
>             }
>             finally
>             {
>                      setContentView(R.layout.main);
>             }
>           }
>         }.start();
>     }

-- 
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: ViewAnimator?

2010-01-27 Thread NoraBora
You can see the examples of ViewFlipper or ViewSwitcher in ApiDemos.

On Jan 24, 5:46 am, Duey Oxburger  wrote:
> Lads,
>
> When my game fires up I'm trying to fade from my company logo to my
> splash page... basically fade from one image to the other.  I'm trying
> to use ViewAnimator to do this, but I'm confused about how to properly
> hook this up to my main.xml file.  I've enclosed my main.xml file and
> my .java file as well.  If some of you more experienced guru's have a
> moment and wouldn't mind having a quick peak, it'd be much
> appreciated!:
>
> ---
> main.xml:
>
> 
> http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
>     >
>
>          android:layout_width="wrap_content"
>     android:layout_height="wrap_content"
>         android:inAnimation="@drawable/ti_splash_logo"
> />
>          android:layout_width="wrap_content"
>     android:layout_height="wrap_content"
>         android:outAnimation="@drawable/ti_presents"
> />
>
> 
> ---
>
> .java:
>
> package com.tybon.fe;
>
> import android.app.Activity;
> import android.content.Context;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.ViewAnimator;
> import android.widget.FrameLayout;
> import android.view.ViewGroup;
> import android.widget.ViewSwitcher.ViewFactory ;
>
> public class AMBUSH extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>     }
>
> }
>
> --
>
> thx,
>
> D

-- 
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: Orientation change crash in tab activity with list activity.

2010-01-25 Thread NoraBora
"Using ListActivity & ExpandableListActivity at the same in one tab
activity."
is just an example of crash in tabs.

The crash still happens when you use ListView and ExpandableListView
as the contents of the tabs, not activities.

Another example here. (I modified tabs1.xml from ApiDemos.)











On Jan 21, 5:50 pm, "Mark Murphy"  wrote:
> > This means we cannot use ListActivity & ExpandableListActivit at the
> > same in one tab activity.
>
> Presumably not, if your analysis is correct, and I suspect it is.
>
> To get the visual effect you want, use ListView and ExpandableListView as
> the contents of the tabs, not activities. Then, you can provide them with
> unique widget IDs. You will save memory, save CPU time, save battery life,
> reduce the odds that you will encounter a StackOverflowException for
> having too complicated of a UI, and solve this problem, all at the same
> time.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html

-- 
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] Orientation change crash in tab activity with list activity.

2010-01-21 Thread NoraBora
When views with different type have same id and screen orientation
changes,

either
java.lang.ClassCastException: android.view.AbsSavedState$1  or
java.lang.IllegalArgumentException: Wrong state class -- expecting
View State
will occur. (depends on the view's order)

Because View.dispatchRestoreInstanceState() checks id only.

You may wonder why anyone would make views with different type to have
same id.

But it can happen when you use tab activity.

Imagine you have tab activity with two children activity.

Tab1 is ListActivity and Tab2 is ExpandableListActivity.

Both activity have id of "@android:id/list" but the type of view is
different.

This means we cannot use ListActivity & ExpandableListActivit at the
same in one tab activity.

or can we?

Please correct me if I'm wrong... hopefully :)
-- 
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: horizentally center aligned

2010-01-18 Thread NoraBora
I guess this is because of the LinearLayout's
android:layout_width="fill_parent".
If width is fill_parent, it can't be horizontally centered.
You can see that if you give background color to the LinearLayout.
Try android:layout_width="wrap_content".

Or change LinearLayout's android:layout_gravity="center_horizontal" to
android:gravity="center_horizontal".  (I'm not sure of this one.)

On Jan 15, 9:38 pm, Sunny Aujla  wrote:
> What happens when the orientation changes?  It looks fine to me, should stay
> center aligned.
>
> On Fri, Jan 15, 2010 at 10:33 AM, Kumar Bibek  wrote:
> > This is ok. Doesn't this work??
>
> > Kumar Bibek
>
> > On Jan 15, 2:19 pm, Jags  wrote:
> > > i have this layout
>
> > >          > > android:orientation="horizontal"
> > >                 android:layout_height="wrap_content"
> > > android:layout_width="fill_parent"
> > >                 android:layout_gravity="center_horizontal">
> > >                  > android:id="@+id/
> > > viewEvtsDone"
> > >                         android:layout_width="wrap_content"
> > android:text="Delete">
> > >                  > android:id="@+id/
> > > viewEvtsCancel"
> > >                         android:layout_width="wrap_content"
> > android:text="Cancel">
> > >         
>
> > > I want these 2 buttons always appear centr aligned in the
> > > linearlayout. I dont want to use hard coded values (as it is upsetting
> > > the positions when orientation changes)
>
> > > How can i make it possible ? or is it not possible ?
>
> > > regards
>
> > --
> > 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: ImageView in ListActivity

2010-01-12 Thread NoraBora
Shouldn't the orientation be "vertical"?

On Jan 12, 4:01 am, Brion Emde  wrote:
> You've got the ListView height set to fill_parent, which will fill the
> parent.
>
> I think you've got to add layout_weight="1" on your ImageView, so it
> will inform the layout that it wants space too.
>
> On Jan 11, 8:14 am, Marwal  wrote:
>
> > Hi,
>
> > I have an ListActivity that I wan't to add a logo to at the top above
> > the list but I'm unsuccessful. This is what my layout looks like at
> > the moment.
>
> > 
> >  >     xmlns:android="http://schemas.android.com/apk/res/android";
> >     android:orientation="horizontal"
> >     android:layout_width="fill_parent"
> >     android:layout_height="fill_parent">
> >      >         android:id="@+id/logo"
> >         android:layout_width="fill_parent"
> >         android:layout_height="wrap_content" />
> >      >         android:id="@android:id/list"
> >         android:layout_width="fill_parent"
> >         android:layout_height="fill_parent"
> >         android:drawSelectorOnTop="false">
> >     
> >      >         android:id="@+id/empty"
> >         android:layout_width="fill_parent"
> >         android:layout_height="fill_parent"
> >         android:text="@string/list_empty" />
> > 
>
> > Then I add an drawable to the ImageView logo in onCreate. I've managed
> > to show either the ListView or the ImageView but never both of them in
> > the same LinearLayout.
>
> > Is it possible to add other views together with a ListView?
>
> > /Martin
-- 
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: How To show Progress Bar in Tab Activity

2010-01-07 Thread NoraBora
Try TabHost.TabSpec.setIndicator(View view)

and access the indicator view.

On Jan 6, 2:29 pm, RamaMohan  wrote:
> Hi,
> I am having a tab Activity with 5 tabs with intents.the classes are
> used to load data from internet source.I need to show display progress
> bar while clicking each tab until it completes the data loading. or
> how to show a progress bar for a finite time after clicking the tab .
>
> If any one Knows this solution ,please send me the answer.
>
> Thanks in Advance,
> Ram
-- 
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: Nested TabWidget ?

2010-01-06 Thread NoraBora
Method 1.

tab content can be an activity.

so you can have another tabwidget (@android:id/tabs) in that activity.


Method 2.

You don't have to use TabActivity to use tabs.

All TabActivity does is to match tab widget to predefined ids such as
tabs, tabcontents.

Without using TabActivity, you can still match the ids and call
TabHost's setup() to add tabs.

Although I couldn't find the example that uses tabs without
TabActivity. I've done it once.

See http://developer.android.com/reference/android/widget/TabHost.html


On Jan 3, 9:22 am, mrqzzz  wrote:
> Hello.
> I am new to Android. I just started with the layout examples and i was
> wondering how to get nested TabWidgets (a TabWidget inside a tab of
> another TabWidget).
> I noticed that android:id="@android:id/tabs" of one TabWidget might
> conflict with the other... or am i missing something?
>
> Thanks,
> Marcus.
-- 
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: Simple animation with 2 images, how??

2009-12-19 Thread NoraBora
Android provides easier way to implement animation.

http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

On Dec 17, 12:37 am, jdekeij  wrote:
> Hi,
>
> I try to write an simple animation by using a handler.However whatever
> I try it does not function asynch which causes only the last image in
> the sequence being displayed.
>
> m_show_first = true;
> mHandler.postDelayed(new Runnable() {
>             public void run() {
>                 invalidate();
>             }
>             },2);
>
> In the ondraw () I check the boolean and show the first image and flip
> the m_show_first back to false. After this I again do a
>
> mHandler.postDelayed(new Runnable() {
>             public void run() {
>                 invalidate();
>             }
>             },2);
>
> However it seems that all painting is done after the handler is
> completely done, meaning that the second image is shown and not the
> first.
>
> I also tried the message handler implementation from the Snake sample
> but also here not with the expected result.
>
> Can anyone give me an idea to show an image for a short definable
> period and switch back to the original image?
>
> Thanks in advance
> Jasper

-- 
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: ExpandableListView change background for child items

2009-12-19 Thread NoraBora
See the default android music player.

http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/ArtistAlbumBrowserActivity.java

SimpleCursorTreeAdapter constructor has group layout and child layout.

for example,
group layout is here
http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=res/layout-finger/track_list_item_group.xml

child layout is here
http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=res/layout-finger/track_list_item_child.xml

you can set different background, text style or whatever you want.


On Dec 15, 6:34 am, "droidin.net"  wrote:
> I'm using ExpandableListView in my app and one of the complains is
> that when expanded it's hard to visually distinguish where the child
> item ends and next group item begins. So I would like to change
> background of the child list item to the different shade. Brutal
> attempts that I've made so far were based on directly changing
> background color and text of the elements inside the child view item
> but that leads to loss of hovers and highlights. So my question is -
> what is a good strategy to achieve the above? I tried styles and
> selectors but what really bums me out - that if I change one thing
> then I need to add selectors for all combinations of focus/enabled
> etc. when all I'm trying to do it to overwrite a single thing. Is
> there a way to inherit parent style and set just a background for non-
> focused, enabled child item?

-- 
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: Typo in android developer resource site. 2

2009-12-19 Thread NoraBora
OK. I posted in http://code.google.com/p/android/issues/detail?id=5536


On Dec 18, 11:29 pm, Mark Murphy  wrote:
> NoraBorawrote:
> > I found another typo in android developer resource site.
>
> >http://developer.android.com/resources/faq/commontasks.html
>
> > Selecting, Highlighting, or Styling Portions of Text
>
> > id="@+id/styled_welcome_message">We are so glad
> > to see you.
>
> > should be
>
> > We are so glad
> > to see you.
>
> Please post bug reports, including documentation bug reports, 
> tohttp://b.android.com. Thanks!
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

-- 
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] Typo in android developer resource site. 2

2009-12-18 Thread NoraBora
I found another typo in android developer resource site.

http://developer.android.com/resources/faq/commontasks.html

Selecting, Highlighting, or Styling Portions of Text

id="@+id/styled_welcome_message">We are so glad
to see you.

should be

We are so glad
to see you.

-- 
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] Typo in android developer resource site.

2009-12-18 Thread NoraBora
I found a typo in android developer resource site.

http://developer.android.com/resources/faq/commontasks.html

Returning a Result from a Screen

// Listen for results.
protected void onActivityResult(int requestCode, int resultCode,
Intent data){
// See which child activity is calling us back.
switch (resultCode) {<--  this should be requestCode.
case CHOOSE_FIGHTER:
...
...
}

-- 
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] set chlidDivider in ExpandableListView

2009-12-15 Thread NoraBora
This is my ExpandableListView



When I execute this in emulator, green(childDivider color) is all over
the place.

It seems if childDivider is ColorDrawable, it has no bound.

Is this a bug or intented?

-- 
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: Specifying SeekBar colors in layout file ...

2009-12-01 Thread NoraBora
You don't have to make any subclasses.

make your_progress_horizontal.xml under drawable directory and

use it in your_layout.xml like this.



On Dec 2, 6:57 am, Mark Rosenberg 
wrote:
> Thanks for the example. Still not clear on how to proceed. Can I
> override the stuff in Android's built-in progress_horizontal.xml? Do I
> create an replacement layer-list? If so, how do I tie it into my
> SeekBar XML declaration? Or should I be looking at building my own
> ProgressBar subclass?
>
> On Nov 30, 6:32 pm, Romain Guy  wrote:
>
> > Hi,
>
> > You can see how we do it in the standard version of 
> > Android:http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > Note however that changing the colors of the thumb will require to
> > provide new images. You won't be able to do that just from XML.
>
> > On Mon, Nov 30, 2009 at 6:29 PM, Mark Rosenberg
>
> >  wrote:
> > > Seems to me that I should be able to set the colors of the SeekBar
> > > thumb, slider, and progress bar in my layout xml file. However, I
> > > don't see relevant attributes for these SeekBar components. I only
> > > want to change the colors, not replace any images being used for the
> > > thumb, etc. What am I missing?
>
> > > --
> > > 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
>
> > --
> > 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: GK: How to generate "android.jar" using open source platform.

2009-12-01 Thread NoraBora
After you build the whole source,
you can find mydroid/out/target/common/obj/JAVA_LIBRARIES/
android_stubs_current_intermediates/javalib.jar
it is same as android.jar. just rename and use it.

or just 'make sdk'.

On Dec 1, 6:22 pm, Jack Ganesh  wrote:
> Hi All,
>
> Can any one provide me  the steps to generate "android.jar" using open
> source platform code.
>
> Cheers,
> Ganesh

-- 
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: scope of member variables in ViewGroup , AdapterView, AbsSpinner etc..

2009-11-30 Thread NoraBora
You are absolutely right. protected is same as public in that case.

I thought only the Android SDK user.

Thank you for correcting me & quick answer.


On Dec 1, 2:57 pm, Dianne Hackborn  wrote:
> From this perspective, protected is EXACTLY the same as public.  Third party
> apps can directly whack the value of the variable, at any time, without the
> framework having any opportunity to do anything about it.
>
> If there is a feature you need that isn't available in the public APIs, then
> file a feature request.  There will be no direct access to member variables
> for apps to hack around the current implementation of the framework. (And
> directly modifying mButtonResource is a perfect example of why it would be a
> huge problem to allow this -- what if other member variables in the future
> need to be set to match this?  If you directly modify this, you could
> completely break on a future version of the platform where the framework
> doesn't have an opportunity to update its internal state appropriately.)
>
>
>
> On Mon, Nov 30, 2009 at 8:39 PM, NoraBora  wrote:
> > I agree that Direct access to member variable is very bad.
>
> > but how about protected?
>
> > If all the variables are protected, people can extend and make their
> > widget much more easily.
>
> > For example I wanted to change the image alignment of RadioButton,
>
> > so I tried to make MyRadioButton extends RadioButton(actually
> > CompoundButton) and override onDraw..
>
> > but mButtonResource is private so MyRadioButton can't get access to
> > it.
>
> > I think this discourages people from making custom widgets.
>
> > On Dec 1, 8:47 am, Dianne Hackborn  wrote:
> > > It does, because it means the application can change it at any time,
> > without
> > > the framework knowing this has happened.  Direct access to member
> > variables
> > > is bad bad bad for maintenance.
>
> > > On Mon, Nov 30, 2009 at 2:50 PM, Taf  wrote:
> > > > I'm not sure how 'hiding' the member vars in something like
> > > > AdapterView makes it easier to maintain the platform. AdapterView just
> > > > extends ViewGroup, so it would be straight forward for me to implement
> > > > a copy of AdapterView just by extending ViewGroup, and then i could
> > > > whack away at anything i wanted to. It seems to me that hiding the
> > > > member vars in something like AdapterView doesn't give many advantages
> > > > and just makes it harder to reuse existing code. Well anyhow, that's
> > > > how it looks from over here.. :)
>
> > > > On Nov 30, 9:52 pm, Dianne Hackborn  wrote:
> > > > > Member variables are implementation details.  Exposing them for
> > > > applications
> > > > > to whack away on them as they want would make it much more difficult
> > to
> > > > > maintain the platform.
>
> > > > > On Mon, Nov 30, 2009 at 1:41 PM, Taf  wrote:
> > > > > > OK a better example would be:
>
> > > > > > boolean mInLayout = false;
>
> > > > > > in AdapterView, this has no get or set function so it can only be
> > > > > > accessed by classes in the same package such as Gallery with it's
> > > > > > onLayout function:
>
> > > > > >   protected void onLayout(boolean changed, int l, int t, int r, int
> > > > > > b) {
> > > > > >        super.onLayout(changed, l, t, r, b);
>
> > > > > >        /*
> > > > > >         * Remember that we are in layout to prevent more layout
> > > > > > request from
> > > > > >         * being generated.
> > > > > >         */
> > > > > >        mInLayout = true;
> > > > > >        layout(0, false);
> > > > > >        mInLayout = false;
> > > > > >    }
>
> > > > > > I want to create a similar class to Gallery, but because my classes
> > > > > > are not in the same package i cannot access mInLayout. even though
> > I
> > > > > > extend AbsSpinner and hence AdapterView,
>
> > > > > > so should mInLayout  be protected? If it was i could then access it
> > > > > > and write a similar custom class to Gallery..
>
> > > > > > On Nov 30, 9:01 pm, Taf  wrote:
> > > > > > > Hi,
>
> > > > > > > I was just trying to extend the AbsSpinner Class, to create my
> &g

[android-developers] Re: scope of member variables in ViewGroup , AdapterView, AbsSpinner etc..

2009-11-30 Thread NoraBora
I agree that Direct access to member variable is very bad.

but how about protected?

If all the variables are protected, people can extend and make their
widget much more easily.

For example I wanted to change the image alignment of RadioButton,

so I tried to make MyRadioButton extends RadioButton(actually
CompoundButton) and override onDraw..

but mButtonResource is private so MyRadioButton can't get access to
it.

I think this discourages people from making custom widgets.

On Dec 1, 8:47 am, Dianne Hackborn  wrote:
> It does, because it means the application can change it at any time, without
> the framework knowing this has happened.  Direct access to member variables
> is bad bad bad for maintenance.
>
>
>
> On Mon, Nov 30, 2009 at 2:50 PM, Taf  wrote:
> > I'm not sure how 'hiding' the member vars in something like
> > AdapterView makes it easier to maintain the platform. AdapterView just
> > extends ViewGroup, so it would be straight forward for me to implement
> > a copy of AdapterView just by extending ViewGroup, and then i could
> > whack away at anything i wanted to. It seems to me that hiding the
> > member vars in something like AdapterView doesn't give many advantages
> > and just makes it harder to reuse existing code. Well anyhow, that's
> > how it looks from over here.. :)
>
> > On Nov 30, 9:52 pm, Dianne Hackborn  wrote:
> > > Member variables are implementation details.  Exposing them for
> > applications
> > > to whack away on them as they want would make it much more difficult to
> > > maintain the platform.
>
> > > On Mon, Nov 30, 2009 at 1:41 PM, Taf  wrote:
> > > > OK a better example would be:
>
> > > > boolean mInLayout = false;
>
> > > > in AdapterView, this has no get or set function so it can only be
> > > > accessed by classes in the same package such as Gallery with it's
> > > > onLayout function:
>
> > > >   protected void onLayout(boolean changed, int l, int t, int r, int
> > > > b) {
> > > >        super.onLayout(changed, l, t, r, b);
>
> > > >        /*
> > > >         * Remember that we are in layout to prevent more layout
> > > > request from
> > > >         * being generated.
> > > >         */
> > > >        mInLayout = true;
> > > >        layout(0, false);
> > > >        mInLayout = false;
> > > >    }
>
> > > > I want to create a similar class to Gallery, but because my classes
> > > > are not in the same package i cannot access mInLayout. even though I
> > > > extend AbsSpinner and hence AdapterView,
>
> > > > so should mInLayout  be protected? If it was i could then access it
> > > > and write a similar custom class to Gallery..
>
> > > > On Nov 30, 9:01 pm, Taf  wrote:
> > > > > Hi,
>
> > > > > I was just trying to extend the AbsSpinner Class, to create my own
> > > > > custom widget. But the problem is that some of the member variables
> > > > > have a a default scope, so I can't access them just by extending the
> > > > > class (they can only be access directly by classes in the same
> > > > > package). Some are ok as they have getters and setters , but there is
> > > > > the odd  member variable that doesn't , so i simply can't access them
> > > > > because my new custom widget in not in the same package. An example
> > of
> > > > > such a member variable is mSelectedPosition   in AdapterView.
>
> > > > > Would it not be better if these vars were to have a protected scope
> > > > > rather than the default scope, it would then be easier to extend
> > these
> > > > > classes to make custom widgets outside of the package of these
> > > > > classes.
>
> > > > --
> > > > 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 > cr...@googlegroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  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
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All suc

[android-developers] Re: Specifying SeekBar colors in layout file ...

2009-11-30 Thread NoraBora
I wanted to change not only color but the images of bar & thumb.

and I found something strange...

please see this link.
http://groups.google.com/group/android-developers/browse_thread/thread/24db6bc2b790eb96/2b4651ec6ed925f0

I posted 2 weeks ago but it seems very few are interested in
customizing SeekBar.


On Dec 1, 11:32 am, Romain Guy  wrote:
> Hi,
>
> You can see how we do it in the standard version of 
> Android:http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> Note however that changing the colors of the thumb will require to
> provide new images. You won't be able to do that just from XML.
>
> On Mon, Nov 30, 2009 at 6:29 PM, Mark Rosenberg
>
>
>
>  wrote:
> > Seems to me that I should be able to set the colors of the SeekBar
> > thumb, slider, and progress bar in my layout xml file. However, I
> > don't see relevant attributes for these SeekBar components. I only
> > want to change the colors, not replace any images being used for the
> > thumb, etc. What am I missing?
>
> > --
> > 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
>
> --
> 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: Density independence for GradientDrawable

2009-11-30 Thread NoraBora
change android:innerRadius to 150px.

when you use dp, android will automatically resize from 160dpi to
target dpi.

On Nov 30, 7:12 am, mgpc  wrote:
> Hi,
>
> I'm trying to work with the (wonderfully undocumented) android
> gradient drawables in a way that's independent of screen density. No
> luck so far.
>
> This is the gradient drawable that I'm using:
>
>          android:startColor="#"
>       android:centerColor="#FF"
>       android:endColor="#FF"
>       android:innerRadius="150dp"
>       android:gradientRadius="350"
>    />
>
> It looks fine on a standard HTC Dream screen, but the scaling is wrong
> on the higher-density Droid screen. (I tried it both on the emulator
> and the hardware)
>
> If I try to change it to
>
>       android:gradientRadius="350dp"
>
> I get the following error:
>
> Dimension types not allowed (at 'gradientRadius'  with value '350dp').
>
> The relevant documentation, is, ahem, a little light on 
> detail:http://developer.android.com/reference/android/graphics/drawable/Grad...
>
> Any idea what's going on here. Why can units not be specified for
> gradientRadius? Is there a way to specify a denisty-independent
> gradientRadius from the XML file? Or have I misunderstood what
> gradientRadius is doing?
>
> Any help appreciated.
> Thanks,
> Mark

-- 
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: ImageButton handling of transparent src pngs

2009-11-29 Thread NoraBora
try  android:background="@null"

On Nov 28, 4:12 pm, Mark Rosenberg 
wrote:
> ImageButton doesn't honor the transparency of my android:src png. My
> src image is a rounded rectangle, with the remaining portion of the
> bounding rectangle set to be transparent. When the button is
> displayed, what should be transparent is a dark shadowy color. The
> images I'm using are OK, and display the proper transparency when
> shown in a browser. android:background="@android:color/transparent"
> doesn't have any effect. Or do I need to subclass ImageView directly
> to get the desired handling of the src image transparency?

-- 
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] layout_gravity="center_horizontal" affects below widgets?

2009-11-22 Thread NoraBora
I wrote main.xml like below.


http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">







I found Button02 is also horizontally centered because of Button01.

If I remove the layout_gravity in Button01, Button02 is not centered
either.

This is same for SDK 1.5 ~ 2.0.

Why does Button01's layout_gravity affect Button02? Bug or
intentional?


-- 
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: pressed image not showing !

2009-11-19 Thread NoraBora
I had a same problem.

I think the order is somewhat important.(I don't understand why the
order matters, though. maybe a bug?)

Have a look at the default button and change the order like this.

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/drawable/button_inset.xml



On Nov 19, 11:25 pm, Jags  wrote:
> having done that, I figured out I only need my buttons be focussed on
> touch not by center or 5way nav buttons, is there a way to do that ?
>
> On Nov 19, 8:13 pm, Jags  wrote:
>
> > it seems it is not working with imagebuttons but working with buttons
>
> >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > Jagat
>
> > On Nov 19, 5:49 pm, Jags  wrote:
>
> > > 
> > > http://schemas.android.com/apk/res/android";>
> > >          
> > >          
> > >          
> > > 
>
> > > i wrote this in btnattr.xml file in drawale.
>
> > > and in my main.xml i wrote
> > >  > >                         android:layout_width="80px" 
> > > android:layout_height="80px"
> > > android:src="@drawable/btnattr"
> > >                         android:scaleType="fitXY" 
> > > android:layout_marginLeft="20dip"
> > >                         android:layout_marginTop="20dip" 
> > > android:background="@android:color/
> > > transparent">
>
> > > when the application is run, the image1 is displayed, expected.
>
> > > but when i press the button image2 is not displayed ! where am I going
> > > wrong ?
>
> > > Thanks for helping
>
> > > regards
> > > Jagat

-- 
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: Autohide Scrollbar in ListView

2009-11-18 Thread NoraBora
Thank you for reply.

Would you tell me which part in 2.0 supports this feature?

I should check that part.

On Nov 17, 1:49 pm, Dianne Hackborn  wrote:
> This is not a standard part of the Android UI, though support for this kind
> of behavior was introduced in 2.0 (but not used in ListView since that is
> not the standard behavior for it).
>
>
>
> On Mon, Nov 16, 2009 at 6:43 PM, NoraBora  wrote:
> > How can I autohide scrollbar in ListView?
>
> > I thought there would be an autohide attribute for ListView but there
> > isn't.
>
> > What I want to do is
>
> > scrollbar is hidden at first
>
> > when I touch the listview, scrollbar appears
>
> > 2~3 seconds after the touch off, scrollbar disappears again.
>
> > What is the easiest way to do this?
>
> > --
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  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] Autohide Scrollbar in ListView

2009-11-16 Thread NoraBora
How can I autohide scrollbar in ListView?

I thought there would be an autohide attribute for ListView but there
isn't.

What I want to do is

scrollbar is hidden at first

when I touch the listview, scrollbar appears

2~3 seconds after the touch off, scrollbar disappears again.

What is the easiest way to do this?

-- 
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] SeekBar bug or intended?

2009-11-16 Thread NoraBora
I made a SeekBar like below.



All images in progress_horizontal2.xml & seek_thumb2.xml have 64px
height.

I expected that progressBar & thumbs are nicely vertically centered at
(80-64)/2 px y-pos.
(I put 80px at layout_height is for wider touch area)

But what I saw is the progressbar a few pixel below the thumb.

I looked into the AbsSeekBar.java and found that the default maxHeight
value is 48px(why?) so progressbar moved down (64-48)/2 px in
onSizeChanged().

I was surprised that the default maxHeight value is not Math.max
(progressbar's height, thumb's height).

Is there any reason for this or just a bug?

-- 
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