|
- require "import"" U- S5 L$ N: t* Y0 I0 J% K! G! ^# ?
- import "android.app.*"
; s @3 r. c, s6 |5 F$ j7 @ - import "android.os.*"
3 C% ?% Y* @( m) k1 q - import "android.widget.*"9 T Z1 b7 `* V
- import "android.view.*"
| ^+ S. ?1 n3 I* \ - import "android.graphics.PorterDuff"- w) Y, _7 {+ e) w7 G
- import "android.graphics.PorterDuffColorFilter"
K/ C# N; b5 i9 f% }: r% G' y2 E8 d - import "android.content.res.ColorStateList". d) f [ t+ x- B0 ]* Y
- import "android.content.pm.PackageManager"; ]7 ^/ L4 L* y& d: s
- import "android.content.Intent"
% k3 [8 L f, C* h+ H8 y( g - import "android.net.Uri"
' \. y$ Y( K+ p( X# B/ z - import "android.util.Base64"
# o) ~: \' h' G3 X! W - import "http"
! {1 E. m6 z f/ T* i D1 S - layout={
0 D9 q6 S# Y. F1 b - LinearLayout;$ ]- L0 g2 D; n' r
- layout_height="fill";, B7 m8 I6 l- Z' v1 _* j; b& k6 t; [
- layout_width="fill";
" j: F; Q, a7 p( ` - orientation="horizontal";, l1 ` T! c4 u1 e
- {
, Z9 n2 z0 G5 e2 U - LinearLayout;( r; [6 |& b/ P
- layout_height="-1";* ~0 I8 S( K8 C$ Q5 ~- m
- layout_width="-1";0 t6 V* Q* q g# z' i
- orientation="vertical";
0 e) N I& h! R1 D" k - {$ Z6 _; l- a$ E f0 `% A
- LinearLayout;& t3 Q2 t1 q) w/ Z3 Z f% x$ |4 _" q
- -- layout_height="20%h";1 F# h7 K& O$ b- f1 n/ C* X# H) _
- layout_width="-1";# C, k* B1 A5 u: f/ C( S; [( M B
- {. N7 M Z& i- p5 X) H2 J5 c) C8 r
- TextView;7 W0 ^9 c' { J
- TextSize="7dp",! U* j c% V% H- ] {) @, z
- text="跳转链接:";/ p$ d% ~6 {% _
- };6 y0 ?* H% K! w! p& k
- {
! t* z [$ C ], ]$ | - EditText;& L0 X, v) U4 l8 F
- --Focusable=false;) \" ~" X8 R$ x$ `; O
- hint="就是点击后跳转的链接",+ t0 `* G ?3 _1 I
- text="http://www.baidu.com",6 v, W r% R C+ w. S8 i; S
- id="tz",: r$ q/ g, e! q: x% E
- layout_width="-1";% ~" f, H$ j, A! A
- };
. `5 a$ X5 l" ]! s- j - };
. y3 q8 F2 {( @; o7 G - {
1 c/ b& Y t z, C6 [ - LinearLayout;
2 g2 T ~& C+ J - layout_height="20%h";
7 q% L& m) ~- n7 _3 Z - layout_width="-1";5 p4 L3 t0 u/ h% z
- {* I, i, F, i% `6 d9 {5 e% b
- TextView;
Z3 s) w- e$ N/ M - TextSize="7dp",& s [6 H+ K6 b8 A: n, d X j* Z
- text="图片链接:";9 H- u$ a/ E9 o" m
- };8 t0 D0 h4 |1 Z* b9 S. c
- {& J. ]" m5 ~- w; C* o# f
- EditText,$ P; F; P, Y, B. [$ ^$ B6 [
- id="im",
+ D- ^8 V$ _; f) i/ P [2 N+ h1 T0 N - hint="这里填图片直链",
' @: v& m) L: [; f- {; X - text="http://img01.sogoucdn.com/app/a/100520146/c0b38cbb6a1dc9022072db2804a45cdf";
) W/ R" Q9 u4 @' K) _# J - layout_width="-1"," N" R7 E0 H4 }7 [: X" Q ^
- };9 E! H* [5 E. c$ t* l3 w
- };
8 a; |/ k* s6 m) p% N* Q4 x4 N5 S - {
* Q9 i$ D. \$ h ?# k - LinearLayout;
- m# @& ]) K9 K! a3 a3 M; g1 z% p. { - layout_height="20%h";4 n* X, f+ O) }& N- S( }
- layout_width="-1";
# V, j T; U; t V7 l8 q - {
+ z, l0 n% b9 P - TextView;
1 G! j$ I; c6 V) x7 K, V- D - TextSize="7dp",7 _% c6 i# U" {' Q0 R$ m
- text="标题:";$ z6 A1 f7 V( r$ n
- };0 r. R+ f; h z! R5 Q k' C& [9 M3 z {
- {" `/ k- M4 _6 Y, \! T0 }2 R
- EditText;
+ r' {0 O8 B: P9 v4 Z* t i$ f+ T - id="bt",2 M0 Q+ y8 A9 S" {3 k* Z4 g1 h& y' [
- text="【王者荣耀】甜蜜糖果派送中!",; ?2 I8 E+ M* A9 n
- hint="顾名思义,就是分享的标题";
% F0 m4 t T( b - layout_width="-1";2 @+ ^% X. b; F3 o8 ~& M
- };1 O1 R* p3 P& {5 ]+ Y! i( o" h
- };; O6 a! {% J% f
- {
2 _* L+ o; }5 W1 n - LinearLayout;6 W! ^! m9 L+ o) W) ]
- layout_height="20%h";
; Q) M8 o* o7 ^. U6 t - layout_width="-1";+ C B: L- X) G, Q$ X
- {
9 z8 ?' K4 Y3 ] - TextView;+ E x# S) v$ G5 z4 w& s/ L' ^
- TextSize="7dp",
4 i" z2 G0 u% O( v+ B: [ - text="内容:";7 i& \8 K' R7 ^& r$ I
- };
' C. \% o! |: E3 b$ K+ s - { ?8 ^0 `% g3 P* V9 z' ]2 \: T0 Y
- EditText;
' S/ @8 Z! x9 l - id="nr",
' \* Q0 X; f7 Z4 g - text="内测专属皮肤、电玩小子、苍穹之光等好礼,一起开启甜蜜糖果抽取吧!",9 t$ X& j; s+ f2 B/ |$ i! v
- hint="内容就是内容呗";' U' z' e9 L% _- X; f: [3 D# d
- layout_width="-1";8 T9 h4 g% @: L8 x
- };
/ M& K, E* Z3 P$ N3 g1 Y - };
# M3 \7 b3 V# I% } z# l - {
; x' u6 ]" g/ v5 ?' {/ f: j - LinearLayout;
$ T& O+ G0 _: J: A# `% R - layout_height="20%h";
# l9 M1 W- Z" v1 d& U1 d8 m5 E - layout_width="-1";) f( j( E2 N/ l' k: i- ?( \
- {
- ~: g6 J F; u) \" Y - TextView;
; v/ Q/ o7 w0 J' y! G: b - TextSize="7dp",
% x F8 k7 r2 F- u8 b - text="ID:";/ x$ [1 @2 E" X" q( I
- };
, T% F5 Q/ t; Y$ [0 X/ g+ o - {" |" |: |$ S# w! h: ]4 a$ T7 s8 w
- EditText;
) l( Y# ?' T* D6 m - id="id",
+ Z) S% E4 |6 q; Y' `9 Y - text="1104466820",0 K. g8 j# W$ ~, [1 z0 g# T
- hint="这里填share_id,不知道就填默认或者0";
6 ]; b |( ]& {) ~1 B - layout_width="-1";; D/ k$ l9 C( R
- };
L4 c( b3 S: i& `: M - };
) O$ C8 c: e/ P - {# h" @1 G' p( }: U4 c! A# i. Z
- LinearLayout;* _; f, |9 y1 f0 H+ l) Z
- layout_height="10%h";
( r! Q4 X4 s4 u; @ - layout_width="-1";
; X* U* `. W6 w! U% b. e* w6 @ - gravity="center";
# }* o. b8 j* {# b U - {
! Y9 G% H4 X3 p9 V$ j - Button,
* F; J: S# O ~5 F" P6 z5 E - id="fs",
' k1 j- L4 D1 L/ p* l) j$ ]/ A7 y/ m - TextSize="7dp",
6 E. m- } W% L1 B2 k - gravity="center";
9 a! {7 ~/ u% y. ]; r2 Z( J - text="发送";8 M1 F- F6 R! I! C* |: w' K
- };- U0 z. m) {8 Z0 V/ U/ K5 v/ H
- };
3 Z* d" X* I) P) R8 L( ^ t - };
. t" Q' a% ]2 l0 X4 h - };
" A# K: q4 E4 @1 b! Z - - f: \* `$ f: F# t+ [
- activity.setTitle('AndroLua+')
_: p, }# N1 v$ S p+ _( m - activity.setTheme(android.R.style.Theme_DeviceDefault_Light)--设置md主题+ X2 y: K+ j! Q/ C; A/ G
- activity.setContentView(loadlayout(layout)). H! T5 B) G' t% b; w
- 8 B/ {( g" m" E
- function jm(a)* i8 V* z) k, |# \3 A% O
- h=String(a).getBytes()
~$ o! i. y+ C2 d" f4 [ - h=Base64.encodeToString(h,Base64.DEFAULT)
3 n$ @/ C9 D. j+ p - return h
& `5 I( L& n+ T - end
! ?6 e4 S3 p2 [* Y( K - fs.onClick=function()
+ @/ t6 J' M _" K9 a& q - t="mqqapi://share/to_fri?file_type=news&src_type=web&version=1&share_id="..id.Text.."&url="..jm(tz.Text).."&previewimageUrl=&image_url="..jm(im.Text).."&title="..jm(bt.Text).."&description="..jm(nr.Text).."&callback_type=scheme&thirdAppDsplayName=ufcujgcuggiccikc&app_name=UVE&cflag=0&shareType=0"6 e& P# w# m. ^ T7 a% c, {
- activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(t)))
$ ^& E4 S8 E! T: d! P0 R) y - end' b7 W$ y$ N- m, f" r( _' O0 f
& j# F8 m7 d/ t$ x1 m) o+ c0 i
8 V( \. s5 k7 \" i- V. V- import "android.content.pm.PackageManager"; q# k# u: l& w- M- L$ o
- --pm=getPackageManager();" L8 l; I& H1 s) T( h# w
- --pm.getApplicationInfo("com.poorstudent",PackageManager.GET_ACTIVITIES). c0 D4 f z: F- q5 k! d
- + m& q, v* \6 s3 t' \
- function jmm(jl)
& J9 g( p9 C2 e* N, ~3 |/ f - h=String(jl).getBytes()1 L4 X% Z" s7 b, U i$ {: s3 B* Z
- h=Base64.decode(h,3)6 e/ E/ }7 x5 X1 t+ a6 v
- return h
+ O! t) t9 b7 y4 b ~% ^3 e - end# Q- ?; k" w% v7 j; F8 b" b
- 9 i2 o2 p Y3 M. `1 x9 D4 m
% P" I0 g7 ?0 K0 p- tz.onClick=function()
; {, w: o4 o, o8 z% |3 ^ e6 J
1 z( q; b9 {6 P; ~2 n- end
复制代码 |
|