Status Update
Comments
al...@gmail.com <al...@gmail.com> #2
I guess hidden should just be defined. Meaning, right now, hidden should just defined as "whether this fragment was hidden as part of a transaction". Hidden is not equivalent with visibility. I think that's where the confusion comes from.
el...@gmail.com <el...@gmail.com> #3
We have passed this to the development team and will update this issue with more information as it becomes available.
al...@googlemail.com <al...@googlemail.com> #4
Yeah, I'm seeing this issue as well, currently this is the workaround that I've come up with:
// This method is called when hide()/show() methods are called on the transaction. Unfortunately Android doesn't
// propagate it to the child fragments (even though their visibility is affected by the parent visibility), so we
// do it manually.
override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden)
childFragmentManager.fragments.forEach { it.onHiddenChanged(hidden) }
}
// This method is called when hide()/show() methods are called on the transaction. Unfortunately Android doesn't
// propagate it to the child fragments (even though their visibility is affected by the parent visibility), so we
// do it manually.
override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden)
childFragmentManager.fragments.forEach { it.onHiddenChanged(hidden) }
}
ma...@gmail.com <ma...@gmail.com> #5
@4 That actually won't technically fix as isHidden() will technically mismatch with the state passed into the child fragment. Each child fragment legitimately needs to have their state set to hidden.
de...@antonsmirnov.name <de...@antonsmirnov.name> #6
Yeah, I realized that as I kept working further on it. Nevermind that solution, it doesn't work.
ha...@gmail.com <ha...@gmail.com> #7
@6 I don't know what the ramifications are, but when you iterate, you can save the "currentState" and then hide them all via a transaction. When restoring to visible, restore to the original state.
cs...@gmail.com <cs...@gmail.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 02290cddca3d5e4dc94e2c5f77a6728ad970b204
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Oct 07 13:11:45 2021
Dispatch onHiddenChanged to child fragments
When a parent fragment is hidden all of its children will automatically
be hidden, but we never call onHiddenChanged on any of the children.
We should dispatch onHiddenChanged down parent's entire hierarchy and
ensure that `isHidden()` also considers the parent's state.
RelNote: "Parent fragments will now dispatch `onHiddenChanged()` down
their entire hierarchy before launching their own call back."
Test: added test
Bug: 77504618
Change-Id: Iedc201ab435cb963e81bc02d203d4d37ff827e01
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
https://android-review.googlesource.com/1850016
Branch: androidx-main
commit 02290cddca3d5e4dc94e2c5f77a6728ad970b204
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Oct 07 13:11:45 2021
Dispatch onHiddenChanged to child fragments
When a parent fragment is hidden all of its children will automatically
be hidden, but we never call onHiddenChanged on any of the children.
We should dispatch onHiddenChanged down parent's entire hierarchy and
ensure that `isHidden()` also considers the parent's state.
RelNote: "Parent fragments will now dispatch `onHiddenChanged()` down
their entire hierarchy before launching their own call back."
Test: added test
Bug: 77504618
Change-Id: Iedc201ab435cb963e81bc02d203d4d37ff827e01
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
au...@gmail.com <au...@gmail.com> #9
This has been fixed internally and will be available in the Fragment 1.4.0-beta01
release.
Description
Android is quickly becoming a full-blown O.S, a desktop replacement,
the need for Printing abstraction model arises.
Why ?
To avoid the need to install device-specific drivers as we do on
Windows PCs for every client, and for every printer model we intend to
print on.
Also today, without common printer abstraction layer, when upgrading
an OS, you may be required to purchase a new printer, and upgrading a
printer may force you to upgrade an OS.
Today Android devices *do not* support printers at all. (excluding the
Samsung Galaxy SIII proprietary feature, that can print to certain Samsung
Printers.)
There are two printing abstraction layers in existence, that I know of:
1. Google Cloud Print (supported by Chrome browser and Chrome OS, but
not by Android)
This idea is very innovative: "Google Cloud Printer"-enabled device is
a printer, that just connects to your GMail account, and let's you
print from anywhere on any of your printers.
The benefits of the Google model, is that it is really simple and a
conceptual innovative ! The downside, is that if the Internet is down,
you can't print at all. :(
2. Windows 8 model (supported by Windows RT and 8)
Windows RT is similar to Android in the concept, that there is no way
to install 3rd party printer drivers on after-market devices
(post-purchase).
So Microsoft went in and developed a brand new abstraction layer model
for their Windows 8 and RT systems. Previous versions of Windows
(XP/Vista/7) never had an abstraction layer, but Win 8 does !
This idea is great, because it bring the familiar LAN-based printer
sharing, but uses abstraction layer.
Windows 8 / RT using a class ID to speak single super-language to all
new printers.
The benefits of this Microsoft model, is that it is
offline-compatible, and works even if the Internet is down ! (which
happens quite a lot in my home)
3. Add Printer API & common GUI to allow Android programs to use printers.
I would like to request to add both printing models to Android.
(in GNU/Linux, the CUPS model is completely broken, just like in
Windows XP/7, because it does require specific drivers all the time...
Related issue: "
-Alexey Eromenko "Technologov", 27.Nov.2012.