Status Update
Comments
vf...@valeo.com <vf...@valeo.com> #2
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
pi...@gmail.com <pi...@gmail.com> #3
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
ma...@skynet4.com <ma...@skynet4.com> #4
ka...@gmail.com <ka...@gmail.com> #5
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
[Deleted User] <[Deleted User]> #6
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
al...@eu.averydennison.com <al...@eu.averydennison.com> #7
I'll attach the project directly so you can test it yourself, and if it is the problem with Fragments, then let's open the issue for Fragments..
t2...@woolworths.com.au <t2...@woolworths.com.au> #8
ld...@gmail.com <ld...@gmail.com> #9
Branch: androidx-master-dev
commit c53170c58309d7370d63d5386e83fce4cee02ba2
Author: jbwoods <jbwoods@google.com>
Date: Wed Jun 26 17:58:38 2019
Avoid grandchild Fragment animations running during parent Fragment transactions
Follow-up to aosp/951635. Child fragment views are not destroyed when the parent
is animated, but grandchild fragment views are.
This change checks up the ancestor hierarchy to ensure fragment views
will not be destroyed if any of its ancestors are being removed.
Test: Added unit Test
BUG: 116675313
Change-Id: Ie65ae2fb150340b51bb0362cfa84f320ee2e8c7e
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
am...@gmail.com <am...@gmail.com> #10
ab...@cusdk8.org <ab...@cusdk8.org> #11
me...@gmail.com <me...@gmail.com> #12
st...@gmail.com <st...@gmail.com> #13
Provide a 1 line caption in 15 words capturing key details. Start with introducing it like "This image" -
so...@gmail.com <so...@gmail.com> #14
la...@netic.dk <la...@netic.dk> #15
ai...@gmail.com <ai...@gmail.com> #16
At the moment I use a mouse-over event on my sidebar AND a timer function to constantly monitor the current sheet.
It would be so much better if there were a trigger on sheet change.
Thanks
in...@gsuitescript.com <in...@gsuitescript.com> #17
re...@comvation.com <re...@comvation.com> #18
[Deleted User] <[Deleted User]> #19
em...@inmar.com <em...@inmar.com> #20
vn...@gmail.com <vn...@gmail.com> #21
ma...@gmail.com <ma...@gmail.com> #22
[Deleted User] <[Deleted User]> #23
tl...@gmail.com <tl...@gmail.com> #24
lm...@bulley.com <lm...@bulley.com> #25
da...@gmail.com <da...@gmail.com> #26
nu...@gmail.com <nu...@gmail.com> #27
[Deleted User] <[Deleted User]> #28
cr...@gmail.com <cr...@gmail.com> #29
so...@gmail.com <so...@gmail.com> #30
so...@gmail.com <so...@gmail.com> #31
[Deleted User] <[Deleted User]> #32
ed...@gmail.com <ed...@gmail.com> #33
yo...@gmail.com <yo...@gmail.com> #34
mg...@gmail.com <mg...@gmail.com> #35
jc...@gmail.com <jc...@gmail.com> #36
[Deleted User] <[Deleted User]> #37
za...@gmail.com <za...@gmail.com> #38
rt...@googlemail.com <rt...@googlemail.com> #39
pe...@gosford.kwikkopy.com.au <pe...@gosford.kwikkopy.com.au> #40
ot...@gmail.com <ot...@gmail.com> #41
gr...@velvet-dps.tech <gr...@velvet-dps.tech> #42
I think the reason this is not a simple update: What is the "Active Sheet" when there are multiple collaborators in the doc? But, all the tools are provided to handle:
On your script hooks, use Session.getActiveUser().getEmail()
and SpreadsheetApp.getActive().getActiveSheet().getSheetId()
. Then keep a dictionary in CacheService
or Properties
that maps user-email to active-sheet. In subsequent executions, if this value changes, then you know which user has changed tabs.
do...@gmail.com <do...@gmail.com> #43
ka...@gmail.com <ka...@gmail.com> #44
sc...@iolani.org <sc...@iolani.org> #45
[Deleted User] <[Deleted User]> #46
ja...@google.com <ja...@google.com> #47
Hello! Thanks for your feedback.
This request has been submitted to the appropriate team.
Cheers!
le...@airliquide.com <le...@airliquide.com> #48
lu...@gmail.com <lu...@gmail.com> #49
ka...@gmail.com <ka...@gmail.com> #51
However there is one thing that does not work for me. I would like to activate a specific cell when switching tabs. For some reason the function SpreadsheetApp.setActiveRange(activeRange) does not work within onSelectionChange(e). Interestingly, the functionality of SpreadsheetApp.setActiveRange(activeRange) does work when used within onOpen(e). Any idea on why that is the case?
is...@google.com <is...@google.com>
sh...@gmail.com <sh...@gmail.com> #52
dl...@gmail.com <dl...@gmail.com> #53
function saveActiveSheet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var actsheet = ss.getActiveSheet();
// The onSelectionChange() function executes in a separate thread
// which does not use any script global variables, so use the
// PropertiesService to maintain the user global state.
var userProperties = PropertiesService.getUserProperties();
userProperties.setProperty('ACTIVE_SHEET', actsheet.getSheetName());
}
function onSheetChange(e) {
// Do anything needed after a new sheet/tab selection
}
function onSelectionChange(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
// Get current sheet name and compare to previously saved sheet
var currentactsheet = ss.getActiveSheet();
var currentactsheetname = currentactsheet.getSheetName();
var userProperties = PropertiesService.getUserProperties();
var actsheetname = userProperties.getProperty('ACTIVE_SHEET');
if (currentactsheetname !== actsheetname) { // New sheet selected
saveActiveSheet();
onSheetChange(e); // Call custom sheet change trigger
}
// Do anything needed when a different range is selected on the same sheet
else {
var range = e.range;
}
}
function onOpen(e) {
saveActiveSheet();
}
an...@gmail.com <an...@gmail.com> #54
ra...@gmail.com <ra...@gmail.com> #55
bw...@gmail.com <bw...@gmail.com> #56
bo...@szeto.app <bo...@szeto.app> #57
ro...@gillandroy.com <ro...@gillandroy.com> #58
ja...@celbux.com <ja...@celbux.com> #59
Please add this trigger! 2 years since a Google employee has said anything about this, and there is no assignee. Very sad
je...@gmail.com <je...@gmail.com> #60
al...@gmail.com <al...@gmail.com> #61
vi...@gmail.com <vi...@gmail.com> #62
jh...@gmail.com <jh...@gmail.com> #63
Any updates on this?
an...@gmail.com <an...@gmail.com> #64
kr...@contractors.roche.com <kr...@contractors.roche.com> #65
wi...@widescreenmusic.com <wi...@widescreenmusic.com> #66
ma...@gmail.com <ma...@gmail.com> #67
jp...@google.com <jp...@google.com>
ph...@roche.com <ph...@roche.com> #68
mu...@gmail.com <mu...@gmail.com> #69
te...@gmail.com <te...@gmail.com> #70
Want to refresh the add on sidebar when the sheet tab changes.
Since OnSelectionChange is simple trigger, it doesn't allow running showSidebar function.
Description
I want bound script to event "user changed sheet". But there is no such trigger to bound to..
What is the purpose of this new feature?
I can than run sume functions when user move to another sheet tab. for eg. set active cell to last row, so user dont have to always scroll down.
What existing Apps Script services would this affect?
Goohle sheets, google apps script
Please provide any additional information below:
There is some workaround with use of sidepanel (checking in loop which sheet is opened):