Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28012] iOS 14: Expose new APIs in Ti.UI.ScrollableView to customize indicator

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-09-08T16:26:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.2.0
ComponentsiOS
LabelsscrollableView
ReporterVijay Singh
AssigneeVijay Singh
Created2020-07-10T19:12:10.000+0000
Updated2020-09-08T16:26:34.000+0000

Description

In iOS 14, Apple has introduced new APIs to customize indicator image in UIPageControl. https://developer.apple.com/documentation/uikit/uipagecontrol/3577679-preferredindicatorimage?language=objc https://developer.apple.com/documentation/uikit/uipagecontrol/3577680-setindicatorimage?language=objc Expose these APIs in titanium sdk . New APIs- Property -
Ti.ScrollableView.preferredIndicatorImage = image;
Function -
Ti.ScrollableView.setIndicatorImageForPage(image, pageNo);

Comments

  1. Vijay Singh 2020-07-17

    PR - https://github.com/appcelerator/titanium_mobile/pull/11825 Test Case - 1. After launch all page indicator should show 'backward' image. 2. On click of first view, all page indicator should show 'forward ' image. 3. On click of second view, second page indicator should show 'folder' icon image. 4. On click of third view, If 'image0.png' exists in resources file third page indicator will show this image otherwise default image that is dot.
       var win = Ti.UI.createWindow({
       	extendSafeArea: false,
               backgroundColor: 'black'
       });
       
       var view1 = Ti.UI.createView({ backgroundColor:'#123' });
       var view2 = Ti.UI.createView({ backgroundColor:'#246' });
       var view3 = Ti.UI.createView({ backgroundColor:'#48b' });
       
       var image = Ti.UI.iOS.systemImage('backward');
       var scrollableView = Ti.UI.createScrollableView({
         views:[view1,view2,view3],
         showPagingControl:true,
         preferredIndicatorImage: image
       });
       
       win.add(scrollableView);
       win.open();
       
       view1.addEventListener('click', function(e){
       	image = Ti.UI.iOS.systemImage('forward');
       	scrollableView.preferredIndicatorImage = image;
       });
       
       view2.addEventListener('click', function(e){
       	image = Ti.UI.iOS.systemImage('folder.fill');
           scrollableView.setIndicatorImageForPage(image, 1);
       });
       
       view3.addEventListener('click', function(e){
       	image = 'image0.png';
           scrollableView.setIndicatorImageForPage(image, 2);
       });
       
  2. Samir Mohammed 2020-08-26

    FR Passed, waiting on Jenkins build and 9_3_X port.
  3. Samir Mohammed 2020-09-08

    *Closing ticket*. Fix verified in SDK version 9.2.0.v20200908050955, and 9.3.0.v20200908051946. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/11825

JSON Source