update dynamic layout inflater to latest version; add some ui samples

This commit is contained in:
hyb1996
2017-11-30 00:49:06 +08:00
parent 92f296cc19
commit 7bf9b3f0d9
14 changed files with 368 additions and 37 deletions

View File

@@ -0,0 +1,16 @@
"ui";
ui.layout(
<vertical padding="16">
<text textSize="40sp">大字</text>
<text textSize="12sp">小字</text>
<text textStyle="bold" textColor="black">加粗</text>
<text textStyle="italic">斜体</text>
<text textColor="#00ff00">原谅色</text>
<text margin="8">Android是一种基于Linux的自由及开放源代码的操作系统主要使用于移动设备如智能手机和平板电脑由Google公司和开放手机联盟领导及开发尚未有统一中文名称中国大陆地区较多人使用安卓安致Android操作系统最初由Andy Rubin开发主要支持手机2005年8月由Google收购注资2007年11月Google与84家硬件制造商软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统</text>
<text maxLines="1" ellipsize="end" marginTop="8">Android是一种基于Linux的自由及开放源代码的操作系统主要使用于移动设备如智能手机和平板电脑由Google公司和开放手机联盟领导及开发尚未有统一中文名称中国大陆地区较多人使用安卓安致Android操作系统最初由Andy Rubin开发主要支持手机2005年8月由Google收购注资2007年11月Google与84家硬件制造商软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统</text>
<text maxLines="2" ellipsize="end" margin="8">Android是一种基于Linux的自由及开放源代码的操作系统主要使用于移动设备如智能手机和平板电脑由Google公司和开放手机联盟领导及开发尚未有统一中文名称中国大陆地区较多人使用安卓安致Android操作系统最初由Andy Rubin开发主要支持手机2005年8月由Google收购注资2007年11月Google与84家硬件制造商软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统</text>
<text w="*" gravity="center">居中</text>
<text autoLink="all">自动超链接网址www.baidu.com, 邮箱 123@qq.com等</text>
</vertical>
);

View File

@@ -10,38 +10,38 @@ ui.layout(
<text textSize="16sp" margin="8">1. 您的年龄是?</text>
<input text="18" inputType="number" margin="0 16"/>
<text textSize="16sp" margin="8">2. 您用过其他类似软件(脚本精灵按键精灵等)?</text>
<RadioGroup margin="0 16">
<RadioButton text="没有用过"/>
<RadioButton text="用过"/>
<RadioButton text="用过,感觉不好用"/>
<RadioButton text="没有Root权限无法使用"/>
</RadioGroup>
<radiogroup margin="0 16">
<radio text="没有用过"/>
<radio text="用过"/>
<radio text="用过,感觉不好用"/>
<radio text="没有Root权限无法使用"/>
</radiogroup>
<text textSize="16sp" margin="8">3. 您使用Auto.js通常用于做什么?(多选)</text>
<CheckBox text="游戏辅助" marginLeft="16"/>
<CheckBox text="点赞" marginLeft="16"/>
<CheckBox text="日常生活工作辅助" marginLeft="16"/>
<CheckBox text="练习编程" marginLeft="16"/>
<CheckBox text="自动化测试" marginLeft="16"/>
<checkbox text="游戏辅助" marginLeft="16"/>
<checkbox text="点赞" marginLeft="16"/>
<checkbox text="日常生活工作辅助" marginLeft="16"/>
<checkbox text="练习编程" marginLeft="16"/>
<checkbox text="自动化测试" marginLeft="16"/>
<linear>
<CheckBox text="其他" marginLeft="16"/>
<checkbox text="其他" marginLeft="16"/>
<input w="*" margin="0 16"/>
</linear>
<text textSize="16sp" margin="8">4. 您更喜欢以下哪个图标?</text>
<RadioGroup margin="0 16">
<RadioButton/>
<radiogroup margin="0 16">
<radio/>
<img w="100" h="100" margin="0 16" src="http://www.autojs.org/assets/uploads/profile/3-profileavatar.png"/>
<RadioButton/>
<radio/>
<img w="100" h="100" margin="0 16" src="http://www.autojs.org/assets/uploads/files/1511945512596-autojs_logo.png"/>
</RadioGroup>
</radiogroup>
<text textSize="16sp" margin="8">5. 您是什么时候开始使用Auto.js的呢?</text>
<DatePicker margin="4 16"/>
<datepicker margin="4 16" datePickerMode="spinner"/>
<text textSize="16sp" margin="8">6. 您用过下面这个Auto.js的论坛吗?</text>
<com.stardust.scriptdroid.ui.widget.EWebView id="webview" h="300" margin="0 16"/>
<RadioGroup marginLeft="16" marginTop="16">
<RadioButton text="没有用过"/>
<RadioButton text="用过"/>
<RadioButton text="用过,感觉不好用"/>
</RadioGroup>
<webview id="webview" h="300" margin="0 16"/>
<radiogroup marginLeft="16" marginTop="16">
<radio text="没有用过"/>
<radio text="用过"/>
<radio text="用过,感觉不好用"/>
</radiogroup>
<linear gravity="center">
<button margin="16">提交</button>
<button margin="16">放弃</button>

View File

@@ -10,8 +10,6 @@ import android.widget.ImageView;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.flurry.android.FlurryAgent;
import com.nickandjerry.dynamiclayoutinflator.lib.ImageLoader;
import com.nickandjerry.dynamiclayoutinflator.lib.util.Drawables;
import com.raizlabs.android.dbflow.config.DatabaseConfig;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;
@@ -29,6 +27,9 @@ import com.stardust.theme.ThemeColor;
import com.stardust.theme.ThemeColorManager;
import com.stardust.util.UiHandler;
import org.autojs.dynamiclayoutinflater.ImageLoader;
import org.autojs.dynamiclayoutinflater.util.Drawables;
import java.lang.ref.WeakReference;
/**