[android-developers] FragmentManager restoring Fragments in wrong order

2013-08-21 Thread DH
Came across this issue and posted a repro case to this android issue:
http://code.google.com/p/android/issues/detail?id=31116#c4

Basically the fragment manager can restore fragments in a different order 
as how fragments were added before saving state.
This has implications with the z order of fragments, where the fragment 
that is supposed to be on top is restored to be behind other fragments.

Anyone came across this issue before, or is there something I'm missing?

Thanks,
David.

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


[android-developers] Re: fragment transactions in onLoadFinished()

2011-11-11 Thread DH
I'm trying to display a DialogFragment and am facing the same problem.


How do you approach this?


My loader gets data from our server and I would like to display an
error dialog when for example a network problem occurs.

Thanks.
David.

On Sep 14, 11:17 pm, Dianne Hackborn  wrote:
> postDelayed is even worse.
>
> Just understand that if the activity's fragment state has already been
> saved, your code will need to correctly update it if it is later restarted
> from the state.
>
> On Wed, Sep 14, 2011 at 9:31 PM, Nikolay Elenkov
> wrote:
>
>
>
>
>
>
>
>
>
> > I have a simple activity with a list fragment on the left and a details
> > fragment on the right. Tapping a list item kicks off a loader which
> > gets some data over HTTP and delivers it in onLoadFinished().
> > That works fine, but I'd like to change the detail fragment at this
> > point. Calling FragmentTransaction.commit() results in an
> > IllegalStateException, as explained in the docs [1].
> > FragmentTransaction.commitAllowingStateLoss() seems to
> > work, but feels wrong. What would be the right/preferred way
> > to do this? postDealyed()?
>
> > 1.
> >http://developer.android.com/reference/android/app/LoaderManager.Load...
> > ,
> > 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
>
> --
> 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] How to determine fragment restored from backstack

2011-10-31 Thread DH
Hi all,

I have been researching this topic for the past couple days and have
not found a solution yet, also on stackoverflow
http://stackoverflow.com/questions/7919681/how-to-determine-fragment-restored-from-backstack
so here goes:

How do you determine a fragment is being restored from the backstack?
I'm using the compatibility library and a ListFragment inside a
FragmentActivity. When an item inside ListFragment is selected, a new
Fragment is started to replace the ListFragment which is added to the
backstack.

Now when the ListFragment is loaded, it will load data to populate the
list.
It does this inside onActivityCreated, load if savedInstanceState is
null, otherwise restore the saved data to adapter.

What the problem is when the ListFragment is restored from the
backstack, savedInstanceState is always null, and onSaveInstanceState
was never called when adding to backstack.

So how do you find out a fragment is being restored from backstack?
What happens when a fragment is put into the backstack, does it retain
its data while its views are destroyed?



Also I noticed this says
http://developer.android.com/reference/android/app/Fragment.html#onSaveInstanceState(android.os.Bundle)

Note however: this method may be called at any time before
onDestroy(). There are many situations where a fragment may be mostly
torn down (such as when placed on the back stack with no UI showing),
but its state will not be saved until its owning activity actually
needs to save its state.

So onSaveInstanceState is a no go here...

-- 
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: Live Wallpaper canvas gradient banding

2011-04-20 Thread DH
Thanks Dianne, that solved my png banding issue.

On Feb 23, 6:05 am, Dianne Hackborn  wrote:
> The canvas drawing into the live wallpaper is not ; the default is 565,
> which yes will result in banding.  You can change the desired format with
> the SurfaceHolder API.
>
> http://developer.android.com/reference/android/view/SurfaceHolder.htm...)
> 
> On Tue, Feb 22, 2011 at 6:48 AM, allandt bik-elliott (thefieldcomic.com) <
>
>
>
>
>
>
>
>
>
> alla...@gmail.com> wrote:
> > the problem afaik is that the bitmap used in the canvas is argb_ which
> > has quite a shallow pool of colours to choose from and to get a decent
> > gradient you need argb_ or a decent amount of dithering - neither of
> > which i'm achieving
>
> > best
> > a
>
> > On 14 February 2011 23:13, Mark  wrote:
>
> >> I am also experiencing this issue. The code I am using to apply a gradient
> >> is as follows...
>
> >> Canvas DestinationCanvas = new Canvas();
> >> DestinationCanvas.setBitmap(DestinationBitmap);
> >>  //Gradient is going from very transparent black to fully black at the
> >> bottom
> >> GradientDrawable grad = new GradientDrawable(Orientation.TOP_BOTTOM, new
> >> int[]{0x0200, 0x2a00, 0x5b00, 0x9000, 0xc900,
> >> 0xcc00});
> >> grad.setBounds(0, 0, DestinationBitmap.getWidth(), RequiredHeight);
> >> grad.draw(DestinationCanvas);
>
> >> Calling grad.setDither(true) or setFilter(true) does not help.
>
> >> Regards,
> >> Mark England
>
> >> --
> >> 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
>
> --
> 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] Re: Detect OSK shown / hidden events

2010-12-13 Thread DH
>From my hours spent on the Nexus One, onConfigurationChanged does not
get called when the soft keyboard state is changed, I have resorted to
hooking into the on size changed for my content view. However I get
this annoying flickering issue since when one of my button is clicked,
I would hide the keyboard and let a textview become visible (a
placeholder for a listview in the future), this creates an issue where
the keyboard hiding would trigger a redraw with something, then the
textview visible event would again draw something different, causing a
flicker to happen.

It would be really nice to let us hook into when the keyboard
animation started and finished.



On Dec 1, 10:13 pm, Juhani  wrote:
> Hi Dianne,
>
> I have overridden the fullscreen mode by adding
> android:imeOptions="flagNoExtractUi" to my EditText.
>
> What we're trying to do (or to be exact what our designers demand) is
> that when clicking an EditText in the UI we will zoom it in nicely and
> smoothly. We have the animation nailed down (with translation matrix)
> but we're having big difficulties hooking in zoom in /o out animation
> starts so that it will work on all platforms (with or without HW
> keyboard) consistently. I would love to see a way top subscribe to
> HW / OS keyboard open or closing events more easily. Until now I
> haven't found any way of doing that. Configuration object seems to
> give same values regardless what the OSK state is. Am I doing
> something wrong? Or is what I'm trying to do simply impossible? In
> that case I should let our designers know that they should find an
> alternative approach.
>
> Cheers,
>  Juhani
>
> On Dec 1, 5:34 am, Dianne Hackborn  wrote:
>
> > There would be no purpose in showing an animation when your size doesn't
> > change, because what is happening is the IME is opening in full-screen mode
> > and completely covering your app.
>
>

-- 
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] Flickering with keyboard animation

2010-12-12 Thread DH
Hi all,
  I'm trying to pop up a view in place of the soft keyboard, so I add
a layout to my content view and set it to invisible when the soft
keyboard is shown, and then set the layout to be visible when I want
to hide the keyboard and display my view.
Problem right now is whenever I set my layout and view to visible and
the soft keyboard closing animation start to play, there is a visible
flicker that goes through the entire view.

Anyone know how to: control the soft keyboard closing animation?
Or possibly let only the layout animate and translate itself up while
the keyboard translates itself down?

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] EditText with multiple selections highlighting

2010-12-06 Thread DH
Hi,
  Trying to make an EditText capable of multiple regions of text
highlighting. (Like firefox Find->Highlight all)

Was thinking of using multiple selections in EditText, but after
browsing the source code of Selection, realised 1 CharSequence can
only have 1 Selection. Then looked at EditText to see if multiple
CharSequence can be added to EditText or TextView, no luck there.

Anyone got ideas on how to implement this?
I don't want copy the source code for EditText and TextView and hack
this capability in... It will become ugly very quick.

Cheers!

-- 
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] remap accelerometer coordinate system

2010-06-01 Thread DH
Hi,
  the remapCoordinateSystem method remaps the axis for sensor
readings, but I want to remap the coordinate system to any angle, for
example:

new coordinate system is say relative to earth's coordinate system, 20
degrees clockwise to earth's X axis, and 10 degrees to earth's Y axis,
while Z is derived from X and Y axis.

Any help is much appreciated!
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