Skip to content

Commit

Permalink
Version 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
XojoGermany committed Jun 27, 2024
1 parent 76287bd commit 2c33962
Show file tree
Hide file tree
Showing 18 changed files with 993 additions and 53 deletions.
4 changes: 3 additions & 1 deletion AndroidDesignExtensions.xojo_project
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Type=Mobile
RBProjectVersion=2024.01
RBProjectVersion=2024.02
MinIDEVersion=20190200
OrigIDEVersion=20230200
Class=App;App.xojo_code;&h000000001ED647FF;&h0000000000000000;false
Folder=Screens;Screens;&h000000005B965FFF;&h0000000000000000;false
MobileScreen=ActivityScreen;Screens/ActivityScreen.xojo_code;&h000000000C97E7FF;&h000000005B965FFF;false
MobileScreen=AppScreen;Screens/AppScreen.xojo_code;&h00000000757EBFFF;&h000000005B965FFF;false
MobileScreen=ButtonScreen;Screens/ButtonScreen.xojo_code;&h0000000038D6FFFF;&h000000005B965FFF;false
MobileScreen=ControlScreen;Screens/ControlScreen.xojo_code;&h000000001A116FFF;&h000000005B965FFF;false
MobileScreen=FontScreen;Screens/FontScreen.xojo_code;&h000000002481CFFF;&h000000005B965FFF;false
Expand Down Expand Up @@ -69,6 +70,7 @@ MobileContainer=TabPanelContainer;Containers/TabPanelContainer.xojo_code;&h00000
MobileContainer=TextAreaContainer;Containers/TextAreaContainer.xojo_code;&h000000006456FFFF;&h000000003BC167FF;false
Class=TestButton;Controls/TestButton.xojo_code;&h000000003389C7FF;&h000000001E06E7FF;false
MobileContainer=TextFieldContainer;Containers/TextFieldContainer.xojo_code;&h00000000121D0FFF;&h000000003BC167FF;false
Class=WindowInsetsCompatTypes;AndroidDesignExtensions/WindowInsetsCompatTypes.xojo_code;&h0000000003FD7FFF;&h000000004BEA7FFF;false
DefaultMobileView=HomeScreen
MajorVersion=1
MinorVersion=0
Expand Down
306 changes: 295 additions & 11 deletions AndroidDesignExtensions/ApplicationXC.xojo_code

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion AndroidDesignExtensions/ContainerXC.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Protected Module ContainerXC

#If TargetAndroid

Declare Function getCurrentFocusID Lib "Object:myContainer:MobileContainer" Alias "getActivity()!!.getCurrentFocus()!!.getId()" As Integer
Declare Function getCurrentFocusID Lib "Object:myContainer:MobileContainer" Alias "getActivity()!!.getCurrentFocus()!!.getId" As Integer

Try

Expand Down
2 changes: 1 addition & 1 deletion AndroidDesignExtensions/HTMLViewerXC.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ Protected Module HTMLViewerXC

#If TargetAndroid

Declare Function getTextZoom Lib "Object:ctrl:MobileHTMLViewer" Alias "getSettings().getTextZoom()" As Integer
Declare Function getTextZoom Lib "Object:ctrl:MobileHTMLViewer" Alias "getSettings().getTextZoom" As Integer
Return getTextZoom

#EndIf
Expand Down
163 changes: 149 additions & 14 deletions AndroidDesignExtensions/ScreenXC.xojo_code
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
#tag Module
Protected Module ScreenXC
#tag CompatibilityFlags = ( TargetAndroid and ( Target64Bit ) )
#tag Method, Flags = &h0, Description = 52657475726E732074686520626F756E6473206F66207468652061726561206173736F636961746564207769746820746869732077696E646F77206F72205569436F6E746578742E0A0A4E6F74652074686174207468652073697A65206F6620746865207265706F7274656420626F756E64732063616E206861766520646966666572656E742073697A65207468616E20446973706C61792367657453697A6528506F696E74292E2054686973206D6574686F64207265706F727473207468652077696E646F772073697A6520696E636C7564696E6720616C6C2073797374656D206261722061726561732C207768696C6520446973706C61792367657453697A6528506F696E7429207265706F727473207468652061726561206578636C7564696E67206E617669676174696F6E206261727320616E6420646973706C6179206375746F75742061726561732E
Function GetBoundsXC(Extends myScreen As MobileScreen) As Rect
#Pragma Unused myScreen

#If TargetAndroid

Declare Function left Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getWindowManager().getCurrentWindowMetrics().getBounds().left" As Integer
Declare Function top Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getWindowManager().getCurrentWindowMetrics().getBounds().top" As Integer
Declare Function width Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getWindowManager().getCurrentWindowMetrics().getBounds().width()" As Integer
Declare Function height Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getWindowManager().getCurrentWindowMetrics().getBounds().height()" As Integer

Return New Rect(left, top, width, height)

#EndIf
End Function
#tag EndMethod

#tag Method, Flags = &h0
Function GetCurrentFocusedControlXC(Extends myScreen As MobileScreen) As MobileUIControl
#Pragma Unused myScreen
Expand Down Expand Up @@ -37,7 +54,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getCurrentFocusID Lib "Object:myScreen:MobileScreen" Alias "getCurrentFocus()!!.getId()" As Integer
Declare Function getCurrentFocusID Lib "Object:myScreen:MobileScreen" Alias "getCurrentFocus()!!.getId" As Integer

Try

Expand All @@ -53,13 +70,26 @@ Protected Module ScreenXC
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 52657475726E73207468652064656E73697479206F66207468652061726561206173736F636961746564207769746820746869732077696E646F77206F72205569436F6E746578742C2077686963682075736573207468652073616D6520756E69747320617320446973706C61794D6574726963732E64656E736974792E
Function GetDensityXC(Extends myScreen As MobileScreen) As Single
#Pragma Unused myScreen

#If TargetAndroid

Declare Function getDensity Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getWindowManager().getCurrentWindowMetrics().getDensity()" As Single
Return getDensity

#EndIf
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 476574732074686520646973706C61792069642E0A0A45616368206C6F676963616C20646973706C617920686173206120756E697175652069642E205468652064656661756C7420646973706C6179206861732069642044454641554C545F444953504C41592E
Function GetDisplayIDXC(Extends myScreen As MobileScreen) As Integer
#Pragma Unused myScreen

#If TargetAndroid

Declare Function getDisplayId Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getDisplayId()" As Integer
Declare Function getDisplayId Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getDisplayId" As Integer
Return getDisplayId

#EndIf
Expand All @@ -72,7 +102,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getRotation Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getRotation()" As Integer
Declare Function getRotation Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getRotation" As Integer
Return getRotation

#EndIf
Expand All @@ -85,7 +115,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getState Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getState()" As Integer
Declare Function getState Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.getState" As Integer
Return getState

#EndIf
Expand All @@ -98,7 +128,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getHeight Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getHeight()" As Integer
Declare Function getHeight Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getHeight" As Integer
Return getHeight

#EndIf
Expand Down Expand Up @@ -150,8 +180,17 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getSystemBarsAppearance Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getInsetsController()!!.getSystemBarsAppearance()" As Integer
Return getSystemBarsAppearance
' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Function getSystemBarsAppearance Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getInsetsController()!!.getSystemBarsAppearance" As Integer
Return getSystemBarsAppearance

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#EndIf
End Function
Expand All @@ -163,8 +202,17 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getSystemBarsBehavior Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getInsetsController()!!.getSystemBarsBehavior()" As Integer
Return getSystemBarsBehavior
' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Function getSystemBarsBehavior Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getInsetsController()!!.getSystemBarsBehavior" As Integer
Return getSystemBarsBehavior

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#EndIf
End Function
Expand All @@ -189,7 +237,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getTransitionBackgroundFadeDuration Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getTransitionBackgroundFadeDuration()" As Int64
Declare Function getTransitionBackgroundFadeDuration Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getTransitionBackgroundFadeDuration" As Int64
Return getTransitionBackgroundFadeDuration

#EndIf
Expand All @@ -202,7 +250,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function getWidth Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getWidth()" As Integer
Declare Function getWidth Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getWidth" As Integer
Return getWidth

#EndIf
Expand All @@ -215,7 +263,7 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Function isHdr Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.isHdr()" As Boolean
Declare Function isHdr Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getContext().getDisplay()!!.isHdr" As Boolean
Return isHdr

#EndIf
Expand Down Expand Up @@ -527,8 +575,17 @@ Protected Module ScreenXC

#If TargetAndroid

Declare Sub setSystemBarsAppearance Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.setSystemBarsAppearance" (myAppearance As Integer, myMask As Integer)
setSystemBarsAppearance(appearance, mask)
' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Sub setSystemBarsAppearance Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.setSystemBarsAppearance" (myAppearance As Integer, myMask As Integer)
setSystemBarsAppearance(appearance, mask)

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#Else

Expand All @@ -539,6 +596,32 @@ Protected Module ScreenXC
End Sub
#tag EndMethod

#tag Method, Flags = &h0, Description = 436F6E74726F6C7320746865206265686176696F72206F662073797374656D20626172732E
Sub SetSystemBarsBehaviorXC(Extends myScreen As MobileScreen, behavior As Integer)
#Pragma Unused myScreen

#If TargetAndroid

' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Sub setSystemBarsBehavior Lib "Object:myScreen:MobileScreen" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.setSystemBarsBehavior" (myBehavior As Integer)
setSystemBarsBehavior(behavior)

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#Else

#Pragma Unused behavior

#EndIf
End Sub
#tag EndMethod

#tag Method, Flags = &h0, Description = 52657175657374207468617420746865207669736962696C697479206F66207468652073746174757320626172206F72206F746865722073637265656E2F77696E646F77206465636F726174696F6E73206265206368616E6765642E0A0A54686973206D6574686F64206973207573656420746F2070757420746865206F7665722064657669636520554920696E746F2074656D706F72617279206D6F646573207768657265207468652075736572277320617474656E74696F6E20697320666F6375736564206D6F7265206F6E20746865206170706C69636174696F6E20636F6E74656E742C2062792064696D6D696E67206F7220686964696E6720737572726F756E64696E672073797374656D206166666F7264616E6365732E2054686973206973207479706963616C6C79207573656420696E20636F6E6A756E6374696F6E20776974682057696E646F772E464541545552455F414354494F4E5F4241525F4F5645524C41592C20616C6C6F77696E6720746865206170706C69636174696F6E7320636F6E74656E7420746F20626520706C6163656420626568696E642074686520616374696F6E206261722028616E64207769746820746865736520666C616773206F746865722073797374656D206166666F7264616E6365732920736F207468617420736D6F6F7468207472616E736974696F6E73206265747765656E20686964696E6720616E642073686F77696E67207468656D2063616E20626520646F6E652E
Sub SetSystemUiVisibilityXC(Extends myScreen As MobileScreen, visibility As Integer)
#Pragma Unused myScreen
Expand Down Expand Up @@ -608,6 +691,58 @@ Protected Module ScreenXC
End Sub
#tag EndMethod

#tag Method, Flags = &h0, Description = 4D616B6573206120736574206F662077696E646F77732063617573696E6720696E73657473206469736170706561722E0A0A4E6F74652074686174206966207468652077696E646F772063757272656E746C7920646F65736E2774206861766520636F6E74726F6C206F7665722061206365727461696E20747970652C2069742077696C6C206170706C7920746865206368616E676520617320736F6F6E206173207468652077696E646F77206761696E7320636F6E74726F6C2E20546865206170702063616E206C697374656E20746F20746865206576656E74206279206F6273657276696E672056696577236F6E4170706C7957696E646F77496E7365747320616E6420636865636B696E67207669736962696C69747920776974682057696E646F77496E7365747323697356697369626C652E
Sub SetWindowInsetsTypeHideXC(Extends myScreen As MobileScreen, types As Integer)
#Pragma Unused myScreen

#If TargetAndroid

' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Sub hide Lib "Object:myScreen:MobileScreen:Kotlin" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.hide(mytypes.toInt())" (myTypes As Integer)
hide(types)

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#Else

#Pragma Unused types

#EndIf
End Sub
#tag EndMethod

#tag Method, Flags = &h0, Description = 4D616B6573206120736574206F662077696E646F7773207468617420636175736520696E7365747320617070656172206F6E2073637265656E2E0A0A4E6F74652074686174206966207468652077696E646F772063757272656E746C7920646F65736E2774206861766520636F6E74726F6C206F7665722061206365727461696E20747970652C2069742077696C6C206170706C7920746865206368616E676520617320736F6F6E206173207468652077696E646F77206761696E7320636F6E74726F6C2E20546865206170702063616E206C697374656E20746F20746865206576656E74206279206F6273657276696E672056696577236F6E4170706C7957696E646F77496E7365747320616E6420636865636B696E67207669736962696C69747920776974682057696E646F77496E7365747323697356697369626C652E
Sub SetWindowInsetsTypeShowXC(Extends myScreen As MobileScreen, types As Integer)
#Pragma Unused myScreen

#If TargetAndroid

' Working for API 30+ (Android 11+)
If System.Version.MajorVersion >= 11 Then

Declare Sub show Lib "Object:myScreen:MobileScreen:Kotlin" Alias "getWindow()!!.getDecorView().getWindowInsetsController()!!.show(mytypes.toInt())" (myTypes As Integer)
show(types)

Else

Raise New AndroidException(CurrentMethodName + EndOfLine + "This is only working for API 30+ (Android 11+).")

End If

#Else

#Pragma Unused types

#EndIf
End Sub
#tag EndMethod

#tag Method, Flags = &h0, Description = 53686F7773207468652075736572207468652073797374656D20646566696E6564206D65737361676520666F722074656C6C696E6720746865207573657220686F7720746F2065786974206C6F636B207461736B206D6F64652E20546865207461736B20636F6E7461696E696E672074686973206163746976697479206D75737420626520696E206C6F636B207461736B206D6F6465206174207468652074696D65206F6620746869732063616C6C20666F7220746865206D65737361676520746F20626520646973706C617965642E
Sub ShowLockTaskEscapeMessageXC(Extends myScreen As MobileScreen)
#Pragma Unused myScreen
Expand Down
39 changes: 39 additions & 0 deletions AndroidDesignExtensions/TabPanelXC.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,45 @@ Protected Module TabPanelXC
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 476574207468652063757272656E7420696E64696361746F7220616E696D6174696F6E206D6F6465207573656420746F20616E696D617465207468652073656C656374696F6E20696E64696361746F72206265747765656E2064657374696E6174696F6E732E
Function GetTabIndicatorAnimationModeXC(Extends ctrl As MobileTabPanel) As TabIndicatorAnimationModesXC
#Pragma Unused ctrl

#If TargetAndroid

Declare Function getTabIndicatorAnimationMode Lib "Object:ctrl:MobileTabPanel" As Integer
Return TabIndicatorAnimationModesXC(getTabIndicatorAnimationMode)

#EndIf
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 476574207468652063757272656E7420696E64696361746F722067726176697479207573656420746F20616C69676E20746865207461622073656C656374696F6E20696E64696361746F7220696E20746865205461624C61796F75742E
Function GetTabIndicatorGravityXC(Extends ctrl As MobileTabPanel) As TabGravityXC
#Pragma Unused ctrl

#If TargetAndroid

Declare Function getTabIndicatorGravity Lib "Object:ctrl:MobileTabPanel" As Integer
Return TabGravityXC(getTabIndicatorGravity)

#EndIf
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 52657475726E73207468652063757272656E74206D6F646520757365642062792074686973205461624C61796F75742E
Function GetTabModeXC(Extends ctrl As MobileTabPanel) As TabModesXC
#Pragma Unused ctrl

#If TargetAndroid

Declare Function getTabMode Lib "Object:ctrl:MobileTabPanel" As Integer
Return TabModesXC(getTabMode)

#EndIf
End Function
#tag EndMethod

#tag Method, Flags = &h0, Description = 52657475726E73207768657468657220746869732062616467652077696C6C20646973706C61792061206E756D6265722E
Function HasBadgeNumberAtXC(Extends ctrl As MobileTabPanel, index As Integer) As Boolean
#Pragma Unused ctrl
Expand Down
Loading

0 comments on commit 2c33962

Please sign in to comment.