Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28503] Android: ScrollableView UI does not render any more (10.0.1 regression)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-08-05T16:33:49.000+0000
Affected Version/sRelease 10.0.1
Fix Version/sRelease 10.0.2
ComponentsAndroid
Labelsandroid, regression, scrollableview
ReporterHans Knöchel
AssigneeJoshua Quick
Created2021-07-05T08:41:33.000+0000
Updated2021-08-05T16:33:49.000+0000

Description

I still need to pinpoint the exact cause of the issue, but our home screen scrollable-view does not render any more when using the 10.0.1 build. It seems to work sometimes but fails sporadically. -Note: This is an unreleased version, so it's not critical and can be fixed prior to the release.- Just noticed that 10.0.1 was released yesterday. Then this should really be fixed timely :-)

Comments

  1. Joshua Quick 2021-07-07

    [~hknoechel], I did notice a regression and wrote it up here: [TIMOB-28504] Not sure if this is your issue, but it's the only bug I've found.
  2. Hans Knöchel 2021-07-29

    This is still an issue with latest 10_0_X. It is reproducible in our project (I think both you and Gary have access).
  3. Michael Gangolf 2021-07-29

    Have the same issue with 10.0.1.GA and 10.1.0. Looks like addView is not working 10.0.0.GA: !https://www.migaweb.de/ti_102.png! 10.0.1.GA: !https://www.migaweb.de/ti_101.png! using:
       $.view_scroller.addView(view_home.getView());
       $.view_scroller.addView(view_friends.getView());
       $.view_scroller.addView(view_planer.getView());
       $.view_scroller.addView(view_events.getView());
       $.view_scroller.addView(view_places.getView());
       
    Tried insertViewsAt too but still nothing
  4. Gary Mathews 2021-07-29

    I'm attempting to create a reproducible test case, but can't reproduce the issue
       const win = Ti.UI.createWindow({ layout: 'vertical' });
       const btn = Ti.UI.createButton({ title: 'LOAD' })
       const sv = Ti.UI.createScrollableView({});
       
       function view (primary, secondary) {
       	const a = Ti.UI.createView({ backgroundColor: primary });
       	const b = Ti.UI.createView({
       		backgroundColor: secondary,
       		width: '50%',
       		height: '50%'
       	});
       
       	a.add(b);
       
       	return a;
       }
       
       btn.addEventListener('click', _ => {
       	sv.addView(view('red', 'blue'));
       	sv.addView(view('orange', 'purple'));
       	sv.addView(view('green', 'yellow'));
       
       	win.add(sv);
       });
       
       win.add(btn);
       win.open();
       
    How is the scrollableView nested, are the views added before its parent view is visible?
  5. Joshua Quick 2021-07-30

    I'm able to reproduce this issue via [~hknoechel] app. I haven't figured out how to reproduce this issue via my own Classic app project yet. So, I had to rig [~hknoechel] Titanium app to be debuggable with the "titanium_mobile" SDK and Android _Studio (don't ask me how; it took me an hour and it was a pain to set up :P )_. The issue is that views added after creation, but before the native view is created, can cause all of the added views to be removed when displayed. This is because the proxy is set up to add views via methods (ie: addView(), setViews(), etc.)... but the native view still reads the "views" property which will be empty/null and end up remove all native child views that were already created. https://github.com/appcelerator/titanium_mobile/blob/c7453230993e5d6a5a9cab3461737f8f58e86622/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollableView.java#L385-L387
  6. Joshua Quick 2021-07-30

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12989
  7. Michael Gangolf 2021-07-30

    -not tested the PR yet- but a simple timeout to wait until the window is open worked so I guess your fix is correct - but I'll test it soon! *Update:* PR works fine in my app Still would be interested in the Studio debug SDK ;)
  8. Ewan Harris 2021-08-05

    Test code:
       const win = Ti.UI.createWindow({ layout: 'vertical' });
       const sv = Ti.UI.createScrollableView({ views: undefined });
       
       function view (primary, secondary) {
       	const a = Ti.UI.createView({ backgroundColor: primary });
       	const b = Ti.UI.createView({
       		backgroundColor: secondary,
       		width: '50%',
       		height: '50%'
       	});
        
       	a.add(b);
        
       	return a;
       }
       sv.addView(view('red', 'blue'));
       sv.addView(view('orange', 'purple'));
       sv.addView(view('green', 'yellow'));
       win.add(sv);
       
       win.open();
       
  9. Ewan Harris 2021-08-05

    Merged to master and 10_0_X

JSON Source