|
- require "import"
/ r; {+ G) E2 c' c/ l+ b - import "android.app.*"
+ h! D) L7 f$ j - import "android.os.*". w a9 V: }" h2 k
- import "android.widget.*"
% B! }3 H, a( o& `! D3 z8 U - import "android.view.*"
7 Y# R. M1 [9 d+ C1 k
" Z4 {: |) _- R. h- import "android.os.Build"" Q/ `/ J" F; T, p4 u2 N) l3 e
- import "android.view.WindowManager"
. k* Z! a* y) a0 y: X& w - import "android.view.View"
9 L4 I: h, ]6 d. P! B" \ - 1 `. ]$ v- S! }; X8 n. X( {7 D
- activity.setContentView(loadlayout("layout"))
$ S! H6 @' x' r! {
8 J1 `0 U3 m' X$ b1 A+ e+ b( ]- function 隐藏虚拟按键()' x" h1 f) o b
- if Build.VERSION.SDK_INT > 11 and Build.VERSION.SDK_INT < 19* r( q! S1 C7 \ c( z3 j2 m, b. Y
- v = this.getWindow().getDecorView();
, J% z. T8 O+ X1 T2 ~" F - v.setSystemUiVisibility(View.GONE);/ U& @* v% N6 v5 q" O' e- S
- elseif (Build.VERSION.SDK_INT >= 19)8 e- q+ g3 t- \! R( r& a* l4 V5 f
- decorView = activity.getWindow().getDecorView();
3 b% X4 K4 o% U; h$ J" R - uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_IMMERSIVE;
2 I" U- V, u/ n4 T9 p - decorView.setSystemUiVisibility(uiOptions);
, A& K0 ]. Y1 c" j3 M - activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);: U% ?5 W+ k' O" G4 B H: y5 G( f
- end: K( t+ X) B* |
- end) X) Q1 j! j4 Z. u
3 U0 g1 w7 B4 i! h: t. q
# K7 i# Y( e, }: C' g, G- J3 L- --定时器 两秒 隐藏一次
2 P; b2 h! i) t8 p' R - ti=Ticker(), M1 d# J/ f2 w& i8 ^, c9 c
- ti.Period=2000
6 |& {/ H! h, y0 V, n& G0 z% h M" F - ti.onTick=function()
( ]/ J2 T2 h ~% M: y2 Y% P0 t - 隐藏虚拟按键()" M0 B& l# e2 |! X4 [
- end# C+ a) r0 P( V; m1 Q* C
- --启动Ticker定时器" y/ V+ f0 Q7 L* e& I+ _
- ti.start() { K/ h% g4 ` q4 ?* O7 b* O
- 8 N0 S3 A1 `) `
- % B7 [% j4 b) g( |* A7 O
复制代码 |
|