The require "import"
Import "android app. *"
Import "android OS. *"
Import "android. Widget. * '
* "import" android. View.
The import "layout"
* "import" android. Content.
Import android. The provider. "Settings", "
Import "android. The content. The Context"
The import "AndLua
"The import "page_1
"The import "page_2
"The import "page_3
"The import "su"
The window title (' floating window)
Set the theme (state Richard armitage ndLua5)
Load the page (" layout ")
Hide the title bar ()
Immerse the status bar ()
Import "Win_Lay" -- import layout
The import "Min_Lay
"Import "android. The content. The Context"
Do
WmManager=activity. GetSystemService (Context. WINDOW_SERVICE) - get window manager
HasFocus=false - if there is a focus of
WmParams=WindowManager. LayoutParams object () -
WmParams. Type=WindowManager. LayoutParams. TYPE_SYSTEM_ALERT - for floating window way
Import "android. Graphics. PixelFormat" - import
WmParams. Format=PixelFormat. RGBA_8888 - set the background
WmParams. Flags=WindowManager. LayoutParams () FLAG_NOT_FOCUSABLE - focus Settings
WmParams. Gravity=gravity. LEFT | gravity. The TOP - gravity setting
WmParams. X=activity. GetWidth ()/6
WmParams. Y=activity. GetHeight ()/5
WmParams. Width=WindowManager. LayoutParams. WRAP_CONTENT
WmParams. Hei
CodePudding user response:
The require "import"
Import "android app. *"
Import "android OS. *"
Import "android. Widget. * '
* "import" android. View.
The import "layout"
* "import" android. Content.
Import android. The provider. "Settings", "
Import "android. The content. The Context"
The import "AndLua
"The import "page_1
"The import "page_2
"The import "page_3
"The import "su"
The window title (' floating window)
Set the theme (state Richard armitage ndLua5)
Load the page (" layout ")
Hide the title bar ()
Immerse the status bar ()
Import "Win_Lay" -- import layout
The import "Min_Lay
"Import "android. The content. The Context"
Do
WmManager=activity. GetSystemService (Context. WINDOW_SERVICE) - get window manager
HasFocus=false - if there is a focus of
WmParams=WindowManager. LayoutParams object () -
WmParams. Type=WindowManager. LayoutParams. TYPE_SYSTEM_ALERT - for floating window way
Import "android. Graphics. PixelFormat" - import
WmParams. Format=PixelFormat. RGBA_8888 - set the background
WmParams. Flags=WindowManager. LayoutParams () FLAG_NOT_FOCUSABLE - focus Settings
WmParams. Gravity=gravity. LEFT | gravity. The TOP - gravity setting
WmParams. X=activity. GetWidth ()/6
WmParams. Y=activity. GetHeight ()/5
WmParams. Width=WindowManager. LayoutParams. WRAP_CONTENT
WmParams. Height=WindowManager. LayoutParams. WRAP_CONTENT
MainWindow=loadlayout (winlay)
MinWindow=loadlayout (minlay)
End
Suspension window function open () - according to
If HasLaunch==true then
Print (" are you retarded? Keep a little point ")
Return
The else
HasLaunch=true
WmManager. AddView (minWindow wmParams)
End
End
The function close (v) - shut down
HasLaunch=false
WmManager. RemoveView (mainWindow)
- wmParams=nil
- the mainWindow=nil
- wmManager=nil
End
IsMa=false - state
The function changeWindow ()
If isMax==false then
IsMax=true
WmManager. RemoveView (minWindow)
WmManager. AddView (mainWindow, wmParams)
The else
IsMax=false
WmManager. RemoveView (mainWindow)
WmManager. AddView (minWindow wmParams)
End
End
The function Win_minWindow. OnClick (v)
ChangeWindow ()
End
Function Win_minWindow. OnTouchListener (v, event) - mobile
If the event. GetAction ()==MotionEvent. ACTION_DOWN then
FirstX=event. GetRawX ()
FirstY=event. GetRawY ()
WmX=wmParams. X
WmY=wmParams. Y
Elseif event. GetAction ()==MotionEvent. ACTION_MOVE then
WmParams. X=wmX + (event. GetRawX () - firstX)
WmParams. Y=wmY + (event. GetRawY () - firstY)
WmManager. UpdateViewLayout (minWindow wmParams)
Elseif event. GetAction ()==MotionEvent. ACTION_UP then
- changeWindow ()
End
Return false
End
- move
Function win_move. OnTouchListener (v, event) - mobile
If the event. GetAction ()==MotionEvent. ACTION_DOWN then
FirstX=event. GetRawX ()
FirstY=event. GetRawY ()
WmX=wmParams. X
WmY=wmParams. Y
Elseif event. GetAction ()==MotionEvent. ACTION_MOVE then
WmParams. X=wmX + (event. GetRawX () - firstX)
WmParams. Y=wmY + (event. GetRawY () - firstY)
WmManager. UpdateViewLayout (mainWindow, wmParams)
Elseif event. GetAction ()==MotionEvent. ACTION_UP then
End
Return true
End
- [[
Function windown_move. OnTouchListener (v, event) - mobile
If the event. GetAction ()==MotionEvent. ACTION_DOWN then
FirstX=event. GetRawX ()
FirstY=event. GetRawY ()
WmX=wmParams. X
WmY=wmParams. Y
Elseif event. GetAction ()==MotionEvent. ACTION_MOVE then
WmParams. X=wmX + (event. GetRawX () - firstX)
WmParams. Y=wmY + (event. GetRawY () - firstY)
WmManager. UpdateViewLayout (mainWindow, wmParams)
Elseif event. GetAction ()==MotionEvent. ACTION_UP then
End
Return true
End
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull