diff --git a/files/ReleaseNotes.txt b/files/ReleaseNotes.txt index 32c7a1012..85408ec83 100644 --- a/files/ReleaseNotes.txt +++ b/files/ReleaseNotes.txt @@ -1,3 +1,36 @@ +DS 2.66 +- Removed docs auto-update (need more testing). + +DS 2.65b2 +- Removed Premium signup email box, to improve app privacy. +- Modified Premium subs description. +- Updated Hybrid/AppBar and Drawer template. +- Fixed docs back button issues after removing plugins or func params popup. +- Fixed issue with Hybrid UI docs not being available till app restart. +- Fixed issue with landscape display height not taking account of status bar. +- Add more app demos on fresh install (not just 'Hello World'). +- Removed MUI link from main docs page (deprecated). +- Removed CreateCloudStore from Premium docs page (deprecated). + +DS 2.65b1 +- Added 'Bound' class, auto-binds methods of classes that extend it. +- Fixed Notification 'No Permissions' issue for < API33. +- Enabled docs to be updated via a plugin. +- Fixed version code on AABs not matching version name. +- Updated Docs, including new full text search facility and app types info. +- Enabled Hybrid by default (not just in experiments mode). +- Added app.SetErrorFilter( regex ) to allow filtering out certain errors (useful for nodejs apps). +- Fixed app icons not showing up at startup on slow devices. +- Added obj.Resize() to resize a control after device rotation (keeps original width/height ratios). +- Added 'AutoSize' option to all layouts - Resizes itself and child controls after device rotation. +- Fixed app.DisplayWidth() reporting wrong size with SoftNav and status bar visible. +- Prevented webview 'UseBrowser' option taking affect during redirects. +- Added web.SetUseBrowser( urlFilter ) method for fine control over urls that open a browser. +- Docs are no longer chopped off at bottom on device IDE. +- Removed full screen notification sample (now restricted on Android). +- Enhanced app.Check/GetPermission() to support individual "android.permission.*" strings. +- Added app.GetShortcuts() method, returns list of shortcuts associated with current app. + DS 2.64b2 - Fixed missing callback on app.LoadScript() when using cfg.Node. - Added USB Drive SAF support + Updated 'Storage Access' sample. diff --git a/files/app.js b/files/app.js index ce7c1cceb..1a105f4cc 100644 --- a/files/app.js +++ b/files/app.js @@ -94,12 +94,14 @@ function DsApp() /*#app*/ this.GetMediaFile = function( appName,ext ) { return prompt( "#", "App.GetMediaFile(\f"+appName+"\f"+ext ); } /*#app*/ this.KillApp = function( procId ) { prompt( "#", "App.KillApp("+procId ); } /*#app*/ this.CreateShortcut = function( name,iconFile,file,options ) { prompt( "#", "App.CreateShortcut(\f"+name+"\f"+iconFile+"\f"+file+"\f"+options ); } + /*#app*/ this.GetShortcuts = function() { var s = prompt( "#", "App.GetShortcuts(" ); if(s.length) return JSON.parse(s); else return null; } /*#app*/ this.GetBuildNum = function() { return parseInt( prompt( "#", "App.GetBuildNum(" )); } /*#app*/ this.GetOSVersion = function() { return parseInt( prompt( "#", "App.GetBuildNum(" )); } /*#app*/ this.GetModel = function() { return prompt( "#", "App.GetModel(" ); } /*#app*/ this.IsTablet = function() { return prompt( "#", "App.IsTablet(" )=="true"; } /*#app*/ this.IsChrome = function() { return prompt( "#", "App.IsChrome(" )=="true"; } /*#app*/ this.IsTV = function() { return prompt( "#", "App.IsTV(" )=="true"; } + /*#app*/ this.SetErrorFilter = function( filter ) { prompt( "#", "App.SetErrorFilter(\f"+filter ); } /*#app*/ this.SetOnError = function( callback ) { prompt( "#", "App.SetOnError(\f"+_Cbm(callback) ); } /*#app*/ this.SetOnDebug = function( callback ) { prompt( "#", "App.SetOnDebug(\f"+_Cbm(callback) ); } /*#app*/ this.SetOnKey = function( callback ) { prompt( "#", "App.SetOnKey(\f"+_Cbm(callback) ); } @@ -588,6 +590,7 @@ Obj = function( id, typeId ) /*#obj*/ self.AdjustColor = function( hue,sat,bright,cont ) { prompt( self.id, "Obj.AdjustColor(\f"+hue+"\f"+sat+"\f"+bright+"\f"+cont ); } /*#obj*/ self.SetPosition = function( left,top,width,height,options ) { prompt( self.id, "Obj.SetPosition(\f"+left+"\f"+top+"\f"+width+"\f"+height+"\f"+options ); self._left = left; self._top = top;} /*#obj*/ self.SetSize = function( width,height,options ) { prompt( self.id, "Obj.SetSize(\f"+width+"\f"+height+"\f"+options ); } + /*#obj*/ self.Resize = function() { prompt( self.id, "Obj.Resize(\f"); } /*#obj*/ self.GetWidth = function( options ) { return parseFloat(prompt( self.id, "Obj.GetWidth(\f"+options )); } /*#obj*/ self.GetHeight = function( options ) { return parseFloat(prompt( self.id, "Obj.GetHeight(\f"+options )); } /*#obj*/ self.GetAbsWidth = function() { return parseInt(prompt( self.id, "Obj.GetAbsWidth(" )); } @@ -1054,6 +1057,7 @@ function Web( id ) /*#web*/ obj.SetUserCreds = function( name,password ) { prompt( obj.id, "Web.SetUserCreds(\f"+name+"\f"+password ); } /*#web*/ obj.SimulateKey = function( keyName,modifiers,pause ) { prompt( obj.id, "Web.SimulateKey(\f"+keyName+"\f"+modifiers+"\f"+pause ); } /*#web*/ obj.SetRedirect = function( urlFrom, urlTo ) { prompt( obj.id, "Web.SetRedirect(\f"+urlFrom+"\f"+urlTo ); } + /*#web*/ obj.SetUseBrowser = function( urlFilter ) { prompt( obj.id, "Web.SetUseBrowser(\f"+urlFilter ); } /*#web*/ obj.SetTouchMode = function( mode ) { prompt( obj.id, "Web.SetTouchMode(\f"+mode ); } /*#web*/ obj.SetOnTouch = function( callback ) { prompt( obj.id, "Web.SetOnTouch(\f"+_Cbm(callback) ); } /*#web*/ obj.SetOnUrl = function( callback ) { prompt( obj.id, "Web.SetOnUrl(\f"+_Cbm(callback) ); } @@ -1633,10 +1637,10 @@ function Usb( id ) /*#usb*/ obj.Write = function( txt,encoding ) { prompt( obj.id, "Usb.Write(\f"+txt+"\f"+encoding ); } /*#usb*/ obj.SetOnReceive = function( callback ) { prompt( obj.id, "Usb.SetOnReceive("+_Cbm(callback) ); } /*#usb*/ obj.SetDTR = function( onOff ) { prompt( obj.id, "Usb.SetDTR(\f"+onOff ); } - /*#usb*/ obj.GetDTR = function( onOff ) { return prompt( obj.id, "Usb.GetDTR(" )=="true"; } + /*#usb*/ obj.GetDTR = function() { return prompt( obj.id, "Usb.GetDTR(" )=="true"; } /*#usb*/ obj.SetRTS = function( onOff ) { prompt( obj.id, "Usb.SetRTS(\f"+onOff ); } - /*#usb*/ obj.GetRTS = function( onOff ) { return prompt( obj.id, "Usb.GetRTS(" )=="true"; } - /*#usb*/ obj.GetCD = function( onOff ) { return prompt( obj.id, "Usb.GetCD(" )=="true"; } + /*#usb*/ obj.GetRTS = function() { return prompt( obj.id, "Usb.GetRTS(" )=="true"; } + /*#usb*/ obj.GetCD = function() { return prompt( obj.id, "Usb.GetCD(" )=="true"; } /*#usb*/ obj.SetMaxRead = function( bytes ) { prompt( obj.id, "Usb.SetMaxRead(\f"+bytes ); } /*#usb*/ obj.SetMaxWrite = function( bytes ) { prompt( obj.id, "Usb.SetMaxWrite(\f"+bytes ); } /*#usb*/ obj.SetTimeout = function( ms ) { prompt( obj.id, "Usb.SetTimeout(\f"+ms ); } @@ -1768,6 +1772,21 @@ function Wpr( id ) return obj; } +Bound = class +{ + constructor() { + this.bindMethods(this); + } + bindMethods( ctx ) { + var meths = Object.getOwnPropertyNames(Object.getPrototypeOf(ctx)) + for (var m in meths) { + var f = ctx[meths[m]]; + ctx[meths[m]] = f.bind(ctx); + f._ctx = ctx; f._nohash = true; //<-- for DS callbacks. + } + } +} + I = function( func ) { if( func ) func._nohash=true; return func; } M = function( ctx, func ) { if( func ) { func._nohash=true; func._ctx=ctx } return func; } TW = function(txt,size) { return app.GetTextBounds(txt,size,0,null).width; } diff --git a/files/markup/en/MUI/AddAlert.js b/files/markup/en/MUI/AddAlert.js index 080849c28..8c5d7d1c5 100644 --- a/files/markup/en/MUI/AddAlert.js +++ b/files/markup/en/MUI/AddAlert.js @@ -10,5 +10,9 @@ * @param {str_col} color * @returns obj */ - - \ No newline at end of file + + + + +// ------------- SAMPLES ------------- + diff --git a/files/markup/en/MUI/CreateButtonContained.js b/files/markup/en/MUI/CreateButtonContained.js index 3bea31117..21f48f8c5 100644 --- a/files/markup/en/MUI/CreateButtonContained.js +++ b/files/markup/en/MUI/CreateButtonContained.js @@ -75,6 +75,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonElegant.js b/files/markup/en/MUI/CreateButtonElegant.js index eda2903de..831e6cbc5 100644 --- a/files/markup/en/MUI/CreateButtonElegant.js +++ b/files/markup/en/MUI/CreateButtonElegant.js @@ -76,6 +76,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonFlat.js b/files/markup/en/MUI/CreateButtonFlat.js index 7a1cf73a2..dfe2798b9 100644 --- a/files/markup/en/MUI/CreateButtonFlat.js +++ b/files/markup/en/MUI/CreateButtonFlat.js @@ -77,6 +77,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonOutlined.js b/files/markup/en/MUI/CreateButtonOutlined.js index 6d8144283..7a8b6e4b7 100644 --- a/files/markup/en/MUI/CreateButtonOutlined.js +++ b/files/markup/en/MUI/CreateButtonOutlined.js @@ -75,6 +75,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonRaised.js b/files/markup/en/MUI/CreateButtonRaised.js index e537174b3..32690c72f 100644 --- a/files/markup/en/MUI/CreateButtonRaised.js +++ b/files/markup/en/MUI/CreateButtonRaised.js @@ -77,6 +77,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonRaisedO.js b/files/markup/en/MUI/CreateButtonRaisedO.js index d3235579e..d0fa2ddcc 100644 --- a/files/markup/en/MUI/CreateButtonRaisedO.js +++ b/files/markup/en/MUI/CreateButtonRaisedO.js @@ -77,6 +77,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonRound.js b/files/markup/en/MUI/CreateButtonRound.js index e00b9bff2..c38a260e9 100644 --- a/files/markup/en/MUI/CreateButtonRound.js +++ b/files/markup/en/MUI/CreateButtonRound.js @@ -77,6 +77,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonRoundO.js b/files/markup/en/MUI/CreateButtonRoundO.js index bb6426184..ff0fd868c 100644 --- a/files/markup/en/MUI/CreateButtonRoundO.js +++ b/files/markup/en/MUI/CreateButtonRoundO.js @@ -77,6 +77,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateButtonToggle.js b/files/markup/en/MUI/CreateButtonToggle.js index e7a596607..f95d892bf 100644 --- a/files/markup/en/MUI/CreateButtonToggle.js +++ b/files/markup/en/MUI/CreateButtonToggle.js @@ -79,6 +79,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateFAB.js b/files/markup/en/MUI/CreateFAB.js index b7e7b7e74..a852c3655 100644 --- a/files/markup/en/MUI/CreateFAB.js +++ b/files/markup/en/MUI/CreateFAB.js @@ -34,12 +34,13 @@ */ -/** ### GetIcon - * Returns the icon. +/** ### GetIcon ### + * Returns the icon. * $$ fab.GetIcon() $$ * @returns str-Material icon font */ + /** @extern Animate */ /** @extern ClearFocus */ @@ -159,4 +160,4 @@ def OnClick(): app.ShowPopup("You clicked FAB") */ - + \ No newline at end of file diff --git a/files/markup/en/MUI/CreateFABElegant.js b/files/markup/en/MUI/CreateFABElegant.js index e7e1e7aa3..5aefdda65 100644 --- a/files/markup/en/MUI/CreateFABElegant.js +++ b/files/markup/en/MUI/CreateFABElegant.js @@ -34,12 +34,13 @@ */ -/** ### GetIcon - * Returns the icon. +/** ### GetIcon ### + * Returns the icon. * $$ fab.GetIcon() $$ * @returns str-Material icon font */ + /** @extern Animate */ /** @extern ClearFocus */ @@ -158,4 +159,4 @@ def OnClick(): app.ShowPopup("You clicked FAB") */ - + \ No newline at end of file diff --git a/files/markup/en/MUI/CreateFABOutline.js b/files/markup/en/MUI/CreateFABOutline.js index a82c26799..f561bcc7b 100644 --- a/files/markup/en/MUI/CreateFABOutline.js +++ b/files/markup/en/MUI/CreateFABOutline.js @@ -35,12 +35,13 @@ */ -/** ### GetIcon - * Returns the icon. +/** ### GetIcon ### + * Returns the icon. * $$ fab.GetIcon() $$ * @returns str-Material icon font */ + /** @extern Animate */ /** @extern ClearFocus */ @@ -159,4 +160,4 @@ def OnClick(): app.ShowPopup("You click FAB") */ - + \ No newline at end of file diff --git a/files/markup/en/MUI/CreateList.js b/files/markup/en/MUI/CreateList.js index 50c3eccdc..a42ee40c6 100644 --- a/files/markup/en/MUI/CreateList.js +++ b/files/markup/en/MUI/CreateList.js @@ -169,6 +169,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateRadio.js b/files/markup/en/MUI/CreateRadio.js index d607361bb..7d69ef763 100644 --- a/files/markup/en/MUI/CreateRadio.js +++ b/files/markup/en/MUI/CreateRadio.js @@ -181,6 +181,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH1.js b/files/markup/en/MUI/CreateTextH1.js index cf7ec778a..ebe3d543d 100644 --- a/files/markup/en/MUI/CreateTextH1.js +++ b/files/markup/en/MUI/CreateTextH1.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH2.js b/files/markup/en/MUI/CreateTextH2.js index 021a91de6..95277698d 100644 --- a/files/markup/en/MUI/CreateTextH2.js +++ b/files/markup/en/MUI/CreateTextH2.js @@ -124,6 +124,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH3.js b/files/markup/en/MUI/CreateTextH3.js index c18e68bcd..dfae9444e 100644 --- a/files/markup/en/MUI/CreateTextH3.js +++ b/files/markup/en/MUI/CreateTextH3.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH4.js b/files/markup/en/MUI/CreateTextH4.js index b019aa22c..0452125f8 100644 --- a/files/markup/en/MUI/CreateTextH4.js +++ b/files/markup/en/MUI/CreateTextH4.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH5.js b/files/markup/en/MUI/CreateTextH5.js index edc56a86c..c62c24128 100644 --- a/files/markup/en/MUI/CreateTextH5.js +++ b/files/markup/en/MUI/CreateTextH5.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextH6.js b/files/markup/en/MUI/CreateTextH6.js index 562417d3b..41d4c9491 100644 --- a/files/markup/en/MUI/CreateTextH6.js +++ b/files/markup/en/MUI/CreateTextH6.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextJumbo.js b/files/markup/en/MUI/CreateTextJumbo.js index cdc22a428..de6200f34 100644 --- a/files/markup/en/MUI/CreateTextJumbo.js +++ b/files/markup/en/MUI/CreateTextJumbo.js @@ -122,6 +122,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextParagraph.js b/files/markup/en/MUI/CreateTextParagraph.js index 33764f26e..11cc5c0c2 100644 --- a/files/markup/en/MUI/CreateTextParagraph.js +++ b/files/markup/en/MUI/CreateTextParagraph.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/CreateTextSecondary.js b/files/markup/en/MUI/CreateTextSecondary.js index ee7f5d2cf..590ac3e9c 100644 --- a/files/markup/en/MUI/CreateTextSecondary.js +++ b/files/markup/en/MUI/CreateTextSecondary.js @@ -123,6 +123,8 @@ /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/MUI/fonts.js b/files/markup/en/MUI/fonts.js index b3cdabda1..3da26e37b 100644 --- a/files/markup/en/MUI/fonts.js +++ b/files/markup/en/MUI/fonts.js @@ -16,7 +16,3 @@ MUI uses the free Roboto font family downloaded from /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateNotification.js b/files/markup/en/app/CreateNotification.js index 392f63e66..6fe5679b2 100644 --- a/files/markup/en/app/CreateNotification.js +++ b/files/markup/en/app/CreateNotification.js @@ -1,17 +1,17 @@ -// ------------- HEADER SECTION ------------- +// ------------- HEADER SECTION ------------- /** # CreateNotification # * @abbrev ntf * @brief Returns a new Notification object - * - * $$ ntf = app.CreateNotification(options) $$ + * + * $$ ntf = app.CreateNotification(options) $$ * @param {str_com} options Ongoing,AutoCancel,FullScreen,NoVibrate,Low:priority * @returns dso-Notification */ -// ------------- LONG DESCRIPTION ------------- +// ------------- LONG DESCRIPTION ------------- /** @Description The Notification object can be used to put messages in the notification drawer. The “AutoCancel” **option** will automatically dismiss the notificatin if the user touches it. “FullScreen” tries to create a larger notification on the screen. And “OnGoing” makes the Notification closeable by your app only. @@ -27,7 +27,7 @@ If you use more than one notification, **app.GetNotifyId** can be used to check -// ------------- VISIBLE METHODS & PROPERTIES ------------- +// ------------- VISIBLE METHODS & PROPERTIES ------------- /** @extern Batch */ @@ -57,7 +57,7 @@ If you use more than one notification, **app.GetNotifyId** can be used to check /** ### Notify ### * Send the notification to the user. * $$ ntf.Notify(id) $$ - * @param {str} id + * @param {str} id */ @@ -65,7 +65,7 @@ If you use more than one notification, **app.GetNotifyId** can be used to check * @brief Set a large image in the notification * Set an image which will be displayed bigger than usual. * $$ ntf.SetLargeImage(image) $$ - * @param {str_ptf} image + * @param {str_ptf} image */ @@ -73,18 +73,18 @@ If you use more than one notification, **app.GetNotifyId** can be used to check * @brief Activate device notification LEDs * Activate the device notification LEDs. * $$ ntf.SetLights(color, onMs, offMs) $$ - * @param {str_col} color - * @param {num_mls} onMs - * @param {num_mls} offMs + * @param {str_col} color + * @param {num_mls} onMs + * @param {num_mls} offMs */ /** ### SetMessage ### * Set notification texts. * $$ ntf.SetMessage(ticker, title, text, extra) $$ - * @param {str} ticker - * @param {str} title - * @param {str} text + * @param {str} ticker + * @param {str} title + * @param {str} text * @param {str} extra Add multiline text in your notification. */ @@ -101,7 +101,7 @@ If you use more than one notification, **app.GetNotifyId** can be used to check * @brief Set a small image icon * Set a small image in your notification. * $$ ntf.SetSmallImage(image) $$ - * @param {str_ptf} image + * @param {str_ptf} image */ @@ -109,7 +109,7 @@ If you use more than one notification, **app.GetNotifyId** can be used to check // ------------- SAMPLES ------------- - + /** @sample Notification function OnStart() @@ -127,9 +127,9 @@ function cancel() app.ShowPopup( "Notification cancelled" ); } */ - - - + + + /** @sample Python Notification from hybrid import ui @@ -147,5 +147,5 @@ def cancel(): notify.Cancel("testID") app.ShowPopup("Notification cancelled") */ - - + + \ No newline at end of file diff --git a/files/markup/en/app/CreateScroller.js b/files/markup/en/app/CreateScroller.js index 5cbc06655..d55cbe907 100644 --- a/files/markup/en/app/CreateScroller.js +++ b/files/markup/en/app/CreateScroller.js @@ -133,6 +133,8 @@ To add other controls to your scroller you need to put them in a scroller [layou /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateSeekBar.js b/files/markup/en/app/CreateSeekBar.js index 7c2264e91..7bd34182b 100644 --- a/files/markup/en/app/CreateSeekBar.js +++ b/files/markup/en/app/CreateSeekBar.js @@ -83,6 +83,8 @@ Use the SetOnChange method to define a function you want to be called when the S /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateShortcut.js b/files/markup/en/app/CreateShortcut.js index 6e95aa176..8b60c0cc7 100644 --- a/files/markup/en/app/CreateShortcut.js +++ b/files/markup/en/app/CreateShortcut.js @@ -5,6 +5,8 @@ * @brief Creates a Home-Screen shortcut to an app * This method creates a shortcut of an app on your home screen - referencing to a js file runnable with DS. * Note: since Android 9 this method prompts a system dialog + * + * See also: @GetShortcuts * $$ app.CreateShortcut(name, iconFile, file, options) $$ * @param {str} name * @param {str_ptf} iconFile diff --git a/files/markup/en/app/CreateSpinner.js b/files/markup/en/app/CreateSpinner.js index 91c6a6989..321078238 100644 --- a/files/markup/en/app/CreateSpinner.js +++ b/files/markup/en/app/CreateSpinner.js @@ -94,6 +94,8 @@ Use the **SelectItem** method to select a particular item in code. /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateSwitch.js b/files/markup/en/app/CreateSwitch.js index 7195609ff..4d811034d 100644 --- a/files/markup/en/app/CreateSwitch.js +++ b/files/markup/en/app/CreateSwitch.js @@ -90,6 +90,8 @@ You can get the state of the switch at any time using the **GetChecked** method. /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateTabs.js b/files/markup/en/app/CreateTabs.js index 1e0acf982..f184a3703 100644 --- a/files/markup/en/app/CreateTabs.js +++ b/files/markup/en/app/CreateTabs.js @@ -103,6 +103,8 @@ Then you canuse it as every normal layout:dso-"CreateLayout" control /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ @@ -196,7 +198,7 @@ Then you canuse it as every normal layout:dso-"CreateLayout" control @sample Basic function OnStart() { - lay = app.CreateLayout( "linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "linear", "VCenter,FillXY" ); var tabs = app.CreateTabs( "Tab 1,Tab 2,Tab 3", 0.8, 0.8, "VCenter" ); lay.AddChild( tabs ); @@ -210,7 +212,7 @@ function OnStart() tab1 = tabs.GetLayout( "Tab 3" ); tab1.SetBackGradient( "blue", "red", "", "left-right" ); - app.AddLayout( lay ); + app.AddLayout( lay ); } */ diff --git a/files/markup/en/app/CreateText.js b/files/markup/en/app/CreateText.js index e3193a4e2..734a5f87a 100644 --- a/files/markup/en/app/CreateText.js +++ b/files/markup/en/app/CreateText.js @@ -140,6 +140,8 @@ You can also set a background image/pattern or background gradient for the Text /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ @@ -213,13 +215,13 @@ You can also set a background image/pattern or background gradient for the Text @sample Single line function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - txt = app.CreateText( "Hello" ); - txt.SetTextSize( 22 ); - lay.AddChild( txt ); + txt = app.CreateText( "Hello" ); + txt.SetTextSize( 22 ); + lay.AddChild( txt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } */ @@ -229,15 +231,15 @@ function OnStart() @sample Multi line function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - txt = app.CreateText( "Hello\nWorld", 0.8, 0.2, "Multiline" ); - txt.SetTextSize( 12 ); - txt.SetTextColor( "#ff6666ff" ); - txt.SetBackColor( "#ffffffff" ); - lay.AddChild( txt ); + txt = app.CreateText( "Hello\nWorld", 0.8, 0.2, "Multiline" ); + txt.SetTextSize( 12 ); + txt.SetTextColor( "#ff6666ff" ); + txt.SetBackColor( "#ffffffff" ); + lay.AddChild( txt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } */ @@ -247,14 +249,14 @@ function OnStart() @sample Ellipsize function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - txt = app.CreateText( "The quick brown fox jumps over the lazy dog", 0.75 ); - txt.SetTextSize( 28 ); - txt.SetEllipsize( "end" ); - lay.AddChild( txt ); + txt = app.CreateText( "The quick brown fox jumps over the lazy dog", 0.75 ); + txt.SetTextSize( 28 ); + txt.SetEllipsize( "end" ); + lay.AddChild( txt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } */ diff --git a/files/markup/en/app/CreateTextEdit.js b/files/markup/en/app/CreateTextEdit.js index bab5e0f81..9914285ea 100644 --- a/files/markup/en/app/CreateTextEdit.js +++ b/files/markup/en/app/CreateTextEdit.js @@ -202,6 +202,8 @@ You can also set a background image/pattern or background gradient for the List /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ @@ -302,22 +304,22 @@ You can also set a background image/pattern or background gradient for the List @sample Using OnChange function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - edt = app.CreateTextEdit( "Edit me", 0.8, 0.3 ); - edt.SetOnChange( edt_OnChange ); - lay.AddChild( edt ); + edt = app.CreateTextEdit( "Edit me", 0.8, 0.3 ); + edt.SetOnChange( edt_OnChange ); + lay.AddChild( edt ); - txt = app.CreateText( "", 0.8, 0.3 ); - txt.SetMargins( 0, 0.02, 0, 0 ); - lay.AddChild( txt ); + txt = app.CreateText( "", 0.8, 0.3 ); + txt.SetMargins( 0, 0.02, 0, 0 ); + lay.AddChild( txt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } function edt_OnChange() { - txt.SetText( edt.GetText() ); + txt.SetText( edt.GetText() ); } */ @@ -327,14 +329,14 @@ function edt_OnChange() @sample Blue on White function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - edt = app.CreateTextEdit( "Hello", 0.8, 0.4 ); - edt.SetTextColor( "#ff6666ff" ); - edt.SetBackColor( "#ffffffff" ); - lay.AddChild( edt ); + edt = app.CreateTextEdit( "Hello", 0.8, 0.4 ); + edt.SetTextColor( "#ff6666ff" ); + edt.SetBackColor( "#ffffffff" ); + lay.AddChild( edt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } */ @@ -344,14 +346,14 @@ function OnStart() @sample Password function OnStart() { - lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); + lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); - edt = app.CreateTextEdit( "", 0.8, 0.4, "Password,Singleline" ); + edt = app.CreateTextEdit( "", 0.8, 0.4, "Password,Singleline" ); edt.SetHint( "Password" ); edt.SetOnEnter( edt_OnEnter ); - lay.AddChild( edt ); + lay.AddChild( edt ); - app.AddLayout( lay ); + app.AddLayout( lay ); } function edt_OnEnter() diff --git a/files/markup/en/app/CreateToggle.js b/files/markup/en/app/CreateToggle.js index 0db7e97b9..75f785685 100644 --- a/files/markup/en/app/CreateToggle.js +++ b/files/markup/en/app/CreateToggle.js @@ -92,6 +92,8 @@ You can get the state of the toggle button at any time using the **GetChecked** /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateVideoView.js b/files/markup/en/app/CreateVideoView.js index 1fd7827a0..a8843dc80 100644 --- a/files/markup/en/app/CreateVideoView.js +++ b/files/markup/en/app/CreateVideoView.js @@ -122,6 +122,8 @@ If the video cannot be played, the OnError callback function will be called. Use /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ diff --git a/files/markup/en/app/CreateWebView.js b/files/markup/en/app/CreateWebView.js index 325412926..3c1227764 100644 --- a/files/markup/en/app/CreateWebView.js +++ b/files/markup/en/app/CreateWebView.js @@ -209,6 +209,8 @@ If you need to, you can use the **Execute** method to execute JavaScript code wi /** @extern SetBackAlpha */ +/** @extern Resize */ + /** @extern SetBackColor */ /** @extern SetBackGradient */ @@ -341,6 +343,14 @@ If you need to, you can use the **Execute** method to execute JavaScript code wi */ +/** ### SetUseBrowser ### + * @brief Define which URLs open in browser + * Gives control over which URLs open a browser when clicked by the user. + * $$ web.SetUseBrowser(urlFilter) $$ + * @param {str} urlFilter + */ + + /** ### SetUserAgent ### * @brief Set/Add custom user agent * Defines a custom user agent or add to the default one @@ -436,11 +446,11 @@ function OnStart() { lay = app.CreateLayout( "linear", "VCenter,FillXY" ); - web = app.CreateWebView( 0.8, 0.8 ); - web.SetBackColor( "#00000000" ); - lay.AddChild( web ); + web = app.CreateWebView( 0.8, 0.8 ); + web.SetBackColor( "#00000000" ); + lay.AddChild( web ); - app.AddLayout( lay ); + app.AddLayout( lay ); html = "
" + " " + @@ -448,7 +458,7 @@ function OnStart() " Hello World!
" + "
"; - web.LoadHtml( html, "file:///Sys/" ); + web.LoadHtml( html, "file:///Sys/" ); } */ diff --git a/files/markup/en/app/GetMacAddress.js b/files/markup/en/app/GetMacAddress.js index 1055ad153..4abaeae2b 100644 --- a/files/markup/en/app/GetMacAddress.js +++ b/files/markup/en/app/GetMacAddress.js @@ -4,7 +4,7 @@ /** # GetMacAddress # * @brief Get devices MAC address * Returns the alphanumeric **M**edia-**A**ccess-**C**ontrol address of the device. Style should be “00:00:00:00:00:00”. The individual numbers can have hexadecimal values between 00 and FF. - * $$ app.GetMacAddress() $$ + * $$ app.GetMacAddress() $$ * @returns str */ @@ -14,7 +14,7 @@ // ------------- SAMPLES ------------- - + /** @sample Show MAC Address function OnStart() @@ -23,9 +23,9 @@ function OnStart() app.ShowPopup( mac ); } */ - - - + + + /** @sample Python Show MAC Address from native import app @@ -34,4 +34,5 @@ def OnStart(): mac = app.GetMacAddress() app.ShowPopup(mac) */ - + + \ No newline at end of file diff --git a/files/markup/en/app/GetMediaFile.js b/files/markup/en/app/GetMediaFile.js index ebc844028..fe23f2443 100644 --- a/files/markup/en/app/GetMediaFile.js +++ b/files/markup/en/app/GetMediaFile.js @@ -4,11 +4,11 @@ /** # GetMediaFile # * @brief Get a path to an unambiguous media file * Returns a file path to a unique media file matching the format “/storage/emulated/0/Pictures/[**folder**]/**YYYYMMDD**_**hhmmSSsss**[**ext**]”. The folder for this file will be created automatically. - * + * * See Also: @CreateImage, @CreateCameraView - * $$ app.GetMediaFile(folder, ext) $$ - * @param {str:app name} folder - * @param {str} ext + * $$ app.GetMediaFile(folder, ext) $$ + * @param {str:app name} folder + * @param {str} ext * @returns str_pth */ @@ -18,7 +18,7 @@ // ------------- SAMPLES ------------- - + /** @sample Get Media File function OnStart() @@ -27,9 +27,9 @@ function OnStart() app.Alert( path ); } */ - - - + + + /** @sample Python Get Media File from native import app @@ -38,4 +38,5 @@ def OnStart(): path = app.GetMediaFile("Hello World", ".png") app.Alert(path) */ - + + \ No newline at end of file diff --git a/files/markup/en/app/GetPermission.js b/files/markup/en/app/GetPermission.js index 6be97422e..ace84f876 100644 --- a/files/markup/en/app/GetPermission.js +++ b/files/markup/en/app/GetPermission.js @@ -4,7 +4,7 @@ /** # GetPermission # * * $$ app.GetPermission(type, callback) $$ - * @param {str_com} type Camera|ExtSDcard|External|Internal|Network|Notify|Storage|Overlay|SMS|Location|Calendar|Body|Contacts|Record|Phone|Biometric|Accounts|License|usb\: + * @param {str_com} type Camera|ExtSDcard|External|Internal|Network|Notify|Storage|Overlay|SMS|Location|Calendar|Body|Contacts|Record|Phone|Biometric|Accounts|License|android.permission.\*|usb\: * @param {fnc_json} callback {"pNames":["ungranted"],"pTypes":["str_com||str_uri"]} */ @@ -13,6 +13,7 @@ /** @Description GetPermission accepts a list of 'dangerus' classified permissions and returns a list of ungranted permissions in the **callback** function, or in case of only “ExtSDCard” the path URI of the user-selected folder. +You can also test for individual “android.permission.\*” strings. See Also: @CheckPermission @RemovePermission @ListPermissions */ diff --git a/files/markup/en/app/GetShortcuts.js b/files/markup/en/app/GetShortcuts.js new file mode 100644 index 000000000..9f0573c6c --- /dev/null +++ b/files/markup/en/app/GetShortcuts.js @@ -0,0 +1,42 @@ +// ------------- HEADER SECTION ------------- + + +/** # GetShortcuts # + * @brief Get associated app shortcuts + * Returns list of shortcuts associated with current app. Might return null when the feature is not supported. + * + * See also: @CreateShortcut + * $$ app.GetShortcuts() $$ + * @returns lst +*/ + + + + +// ------------- SAMPLES ------------- + + + +/** +@sample Show Shortcuts +function OnStart() +{ + var list = app.GetShortcuts(); + if (list == null) app.Alert( "Unsupported" ); + else app.Alert( list, "" ); +} + */ + + + +/** +@sample Python Show Shortcuts +from native import app + +def OnStart(): + list = app.GetShortcuts() + if list == null: app.Alert( "Unsupported" ) + else: app.Alert( list, "" ) + */ + + \ No newline at end of file diff --git a/files/markup/en/app/SendIntent.js b/files/markup/en/app/SendIntent.js index a17d90638..f7cc5d662 100644 --- a/files/markup/en/app/SendIntent.js +++ b/files/markup/en/app/SendIntent.js @@ -1,22 +1,22 @@ -// ------------- HEADER SECTION ------------- +// ------------- HEADER SECTION ------------- /** # SendIntent # - * - * $$ app.SendIntent(packageName, className, action, category, uri, type, extras, options, callback) $$ - * @param {str} packageName - * @param {str} className + * + * $$ app.SendIntent(packageName, className, action, category, uri, type, extras, options, callback) $$ + * @param {str} packageName + * @param {str} className * @param {str} action android.intent.action.* * @param {str} category android.intent.category.* - * @param {str_uri} uri - * @param {str_mim} type + * @param {str_uri} uri + * @param {str_mim} type * @param {lst} extras [{ name:str, type:str-"string|float|int|long|bool|list|file|uri|keydown|keyup", value:str }] * @param {str_com} options Result:expect a result to be passed to the callback function,ClearTask * @param {fnc_json} callback {"pNames":["resultCode","data"],"pTypes":["num_int--1|0|1","obj-{ action:string, type:str, data:string, flags:integer, extras:object }"]} */ -// ------------- LONG DESCRIPTION ------------- +// ------------- LONG DESCRIPTION ------------- /** @Description Intens can be used to perform an operation between different applications or activities. _It is basically a passive data structure holding an abstract description of an action to be performed_. diff --git a/files/markup/en/app/SendMail.js b/files/markup/en/app/SendMail.js index 8886c6ebf..5b3b8d70d 100644 --- a/files/markup/en/app/SendMail.js +++ b/files/markup/en/app/SendMail.js @@ -1,20 +1,20 @@ -// ------------- HEADER SECTION ------------- +// ------------- HEADER SECTION ------------- /** # SendMail # * @brief Open the EMail app and autofill fields - * - * $$ app.SendMail(address, subject, body, attach, type, options) $$ - * @param {str} address - * @param {str} subject - * @param {str} body - * @param {str_pth} attach - * @param {str_mim} type + * + * $$ app.SendMail(address, subject, body, attach, type, options) $$ + * @param {str} address + * @param {str} subject + * @param {str} body + * @param {str_pth} attach + * @param {str_mim} type * @param {str} options SendTo */ -// ------------- LONG DESCRIPTION ------------- +// ------------- LONG DESCRIPTION ------------- /** @Description Send an EMail to someone using the default mail application. The passed argumets will be auto-filled. @@ -39,7 +39,7 @@ See Also: @SendSMS, @SendFile // ------------- SAMPLES ------------- - + /** @sample Example function OnStart() @@ -48,9 +48,9 @@ function OnStart() app.SendMail( "myfriend@gmail.com", "MySubject", "Hello", "/sdcard/Hello.png" ); } */ - - - + + + /** @sample Python Example from native import app @@ -59,4 +59,5 @@ def OnStart(): app.CopyFile("/Sys/Img/Hello.png", "/sdcard/Hello.png") app.SendMail("myfriend@gmail.com", "MySubject", "Hello", "/sdcard/Hello.png") */ - + + \ No newline at end of file diff --git a/files/markup/en/app/SetErrorFilter.js b/files/markup/en/app/SetErrorFilter.js new file mode 100644 index 000000000..8ff32028a --- /dev/null +++ b/files/markup/en/app/SetErrorFilter.js @@ -0,0 +1,40 @@ +// ------------- HEADER SECTION ------------- + + +/** # SetErrorFilter # + * @brief Filter/ignore certain errors + * Allow filtering out certain errors for nodejs apps. + * $$ app.SetErrorFilter(regex) $$ + * @param {str} regex regex pattern +*/ + + + + +// ------------- SAMPLES ------------- + + + +/** +@sample Filter Errors +function OnStart() +{ + app.SetErrorFilter( "Uncaught Error: My Custom Error.*" ); + throw Error( "My Custom Error" ); + app.Alert( "Error was ignored" ); +} + */ + + + +/** +@sample Python Filter Errors +from native import app + +def OnStart(): + app.SetErrorFilter( "Uncaught Error: My Custom Error.*" ) + raise Error( "My Custom Error" ) + app.Alert( "Error was ignored" ) + */ + + \ No newline at end of file diff --git a/files/markup/en/app_base.js b/files/markup/en/app_base.js index 299fa839e..41789e84a 100644 --- a/files/markup/en/app_base.js +++ b/files/markup/en/app_base.js @@ -215,6 +215,13 @@ */ +/** ### Resize + * @name Resize + * @brief resize a control after device rotation + * Resize a control after device rotation by keeping the original width/height ratios. + */ + + /** ### SetFontFile * @name SetFontFile * @brief Change the used font diff --git a/files/markup/en/gfx/CreateTexture.js b/files/markup/en/gfx/CreateTexture.js index b508f3ce6..6e38e407c 100644 --- a/files/markup/en/gfx/CreateTexture.js +++ b/files/markup/en/gfx/CreateTexture.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/data.js b/files/markup/en/gfx/data.js index 71459c915..11f968c9a 100644 --- a/files/markup/en/gfx/data.js +++ b/files/markup/en/gfx/data.js @@ -9,7 +9,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/height.js b/files/markup/en/gfx/height.js index 4433d0570..a5c83b06f 100644 --- a/files/markup/en/gfx/height.js +++ b/files/markup/en/gfx/height.js @@ -9,7 +9,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/isReady.js b/files/markup/en/gfx/isReady.js index cf155af26..bc1ef9331 100644 --- a/files/markup/en/gfx/isReady.js +++ b/files/markup/en/gfx/isReady.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/keyDown.js b/files/markup/en/gfx/keyDown.js index 0cd99cb5a..e4b15e972 100644 --- a/files/markup/en/gfx/keyDown.js +++ b/files/markup/en/gfx/keyDown.js @@ -9,7 +9,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/keyState.js b/files/markup/en/gfx/keyState.js index 407c49727..86ffc3242 100644 --- a/files/markup/en/gfx/keyState.js +++ b/files/markup/en/gfx/keyState.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/multiTouch.js b/files/markup/en/gfx/multiTouch.js index 68034054b..7dd3e4d28 100644 --- a/files/markup/en/gfx/multiTouch.js +++ b/files/markup/en/gfx/multiTouch.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/objects.js b/files/markup/en/gfx/objects.js index fb416a336..6cfba183e 100644 --- a/files/markup/en/gfx/objects.js +++ b/files/markup/en/gfx/objects.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/version.js b/files/markup/en/gfx/version.js index 681a9da8d..98132392e 100644 --- a/files/markup/en/gfx/version.js +++ b/files/markup/en/gfx/version.js @@ -10,7 +10,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/gfx/width.js b/files/markup/en/gfx/width.js index 9f6ac19c4..dc9864cc5 100644 --- a/files/markup/en/gfx/width.js +++ b/files/markup/en/gfx/width.js @@ -9,7 +9,3 @@ */ - - -// ------------- SAMPLES ------------- - diff --git a/files/markup/en/intro/99 Release Notes.md b/files/markup/en/intro/99 Release Notes.md index a24bf9c3d..aa91082c4 100644 --- a/files/markup/en/intro/99 Release Notes.md +++ b/files/markup/en/intro/99 Release Notes.md @@ -1,5 +1,18 @@ +### DS 2.67b1 (15-Dec 2023) +- Fixed bug stopping background services from running. +- Fixed bug stopping some plugins from working (eg. BLEBeacon) +- Fixed issue renaming of python apps in device IDE. +- Fixed Python apps with spaces in the name. +- Fixed Python APK building. +- Fixed node.Execute() atob2 is not defined bug. +- Disabled banner animation when in premium. +- Added new forum extension to device IDE. + +## DS 2.66 (02-Dec 2023) +- Removed docs auto-update (need more testing). + ### DS 2.65b2 (30-Nov 2023) - Removed Premium signup email box, to improve app privacy. - Modified Premium subs description. @@ -18,6 +31,7 @@ - Fixed version code on AABs not matching version name. - Updated Docs, including new full text search facility and app types info. - Enabled Hybrid by default (not just in experiments mode). +- Added app.SetErrorFilter( regex ) to allow filtering out certain errors (useful for nodejs apps). - Fixed app icons not showing up at startup on slow devices. - Added obj.Resize() to resize a control after device rotation (keeps original width/height ratios). - Added 'AutoSize' option to all layouts - Resizes itself and child controls after device rotation. @@ -142,7 +156,7 @@ - Removed troublesome bytecode file. ### DS 2.60b1 (28-Feb-2023) -- Added FLA\_MUTABLE to app.SetInForeground() and others to stop API 31 error. +- Added FLAG\_MUTABLE to app.SetInForeground() and others to stop API 31 error. - Added app.GetIsBatteryOptimized() detects if app is being optimized. - Added app.ShowBatterySettings() show user battery optimization settings. - Added foreground location service support for Android 10+. diff --git a/files/markup/en/ui/addText.js b/files/markup/en/ui/addText.js index b7b55ba95..0905b7c1d 100644 --- a/files/markup/en/ui/addText.js +++ b/files/markup/en/ui/addText.js @@ -423,4 +423,150 @@ class Main extends App } */ + + +/** +@sample Python Basic text control +class Main extends App + onStart() + # Create a full screen layout with objects vertically centered. + this.main = ui.addLayout("main", "Linear", "VCenter,FillXY") + + t = "This is the sample text to be displayed." + + # Add a text control to the main layout + this.txt = ui.addText(this.main, t) + + # You can also add a callback handler when the text control is touch + this.txt.setOnTouch( this.onTouch ) + + onTouch() + ui.showPopup( "You touched the text!" ) + */ + + + +/** +@sample Python Heading variants +class Main extends App + onStart() + # Create a full screen layout with objects vertically centered. + this.main = ui.addLayout("main", "Linear", "VCenter,FillXY") + + t = "Lorem ipsum dolor sit amet, consectetur" + + # Heading ranges from H1 to H6 + + this.h1 = ui.addText( this.main, "Heading 1", "H1" ) + + this.h2 = ui.addText( this.main, "Heading 2", "H2" ) + + this.h3 = ui.addText( this.main, "Heading 3", "H3" ) + + this.h4 = ui.addText( this.main, "Heading 4", "H4" ) + + this.h5 = ui.addText( this.main, "Heading 5", "H5" ) + + this.h6 = ui.addText( this.main, "Heading 6", "H6" ) + */ + + + +/** +@sample Python Other variants +class Main extends App + onStart() + # Create a full screen layout. + this.main = ui.addLayout( "main", "Linear", "VCenter", 1, 1 ) + + t = "Lorem ipsum dolor sit amet, consectetur" + + this.text = ui.addText( this.main, t, "body1" ) + + this.text = ui.addText( this.main, t, "body2" ) + + this.text = ui.addText( this.main, t, "subtitle1" ) + + this.text = ui.addText( this.main, t, "subtitle2" ) + + this.text = ui.addText( this.main, t, "overline" ) + + this.text = ui.addText( this.main, t, "button" ) + + this.text = ui.addText( this.main, t, "caption" ) + */ + + + +/** +@sample Python Alignments and colors +class Main extends App + onStart() + # Create a full screen layout. + this.main = ui.addLayout( "main", "Linear", "VCenter,FillXY") + this.main.setChildMargins(0, 0.05) + + t = "Lorem ipsum dolor sit amet, consectetur adipiscing elit" + + # Default is left + this.txt1 = ui.addText( this.main, t, "body1,Left", 0.9 ) + this.txt1.backColor = "#e0e0e0" + + # Center and color primary + this.txt2 = ui.addText( this.main, t, "body1,Center,Primary", 0.9 ) + this.txt2.backColor = "#e0e0e0" + + # Right and color secondary + this.txt3 = ui.addText( this.main, t, "body1,Right,Secondary", 0.9) + this.txt3.backColor = "#e0e0e0" + + # Bottom, Center with a textSecondary color + this.txt4 = ui.addText( this.main, t, "body1,Center,Bottom,TextSecondary", 0.9, 0.1) + this.txt4.backColor = "#e0e0e0" + */ + + + +/** +@sample Python Icons +class Main extends App + onStart() + # Create a full screen layout with objects vertically centered. + this.main = ui.addLayout("main", "Linear", "VCenter,FillXY") + this.main.setChildMargins(0, 0.05) + + # Add a settings icon + this.txt1 = ui.addText(this.main, "settings", "Icon") + this.txt1.setOnTouch( this.onTouch ) + + # Add a camera icon + ui.addText(this.main, "add_a_photo", "Icon,TextSecondary") + + # Add a heart icon + ui.addText(this.main, "favorite", "Icon,Secondary") + + # Add an android icon + ui.addText(this.main, "android", "Icon,Primary") + + onTouch() + ui.showPopup( "You touch the icon!" ) + */ + + + +/** +@sample Python Html formatted text +class Main extends App + onStart() + # Create a full screen layout with objects vertically centered. + this.main = ui.addLayout("main", "Linear", "VCenter,FillXY") + + # Html formatted string + t = 'This text is formatted as html.

This is a heading with color.

' + t += 'You can also add italize text as well as text with styles.' + + # Add text control to the main layout by passing `Html` option + this.txt = ui.addText(this.main, t, "html") + */ + \ No newline at end of file