如何实不写代码实现android应用

是一套基于一整套开发框架实现的基于databinding实现不需要写java代码来实现简单的应用。
可以实现大部分页面功能,历时两周实现此功能。等待在项目只实践,如有补充欢迎提出。转载请标明出处。

测试apk其中 ”自动frame测试“ 按钮点击后的所有内容即为本文中的代码实现
点击下载 https://pan.baidu.com/s/1nvonPrz

  • 实现登陆页面,实现登陆并进入下一个页面。登陆需要输入3个参数 门店名称,账号,密码,其中账号必须是数字,密码需要转换为md5。
<?xml version="1.0" encoding="UTF-8"?><layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"><data><variable
            name="F"type="com.mdx.framework.autofit.AutoFit" /><variable
            name="P"type="java.util.HashMap" /><import type="com.udows.canyin.proto.ApisFactory"></import><import type="com.mdx.framework.commons.verify.Md5"></import></data><com.mdx.framework.autofit.layout.FitLinearLayout
        android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><EditText
            android:id="@+id/store"android:layout_width="match_parent"android:layout_height="48dip"android:background="@color/colorPrimary"android:gravity="center"android:text="002@458996"android:textSize="20sp" /><EditText
            android:id="@+id/name"android:layout_width="match_parent"android:layout_height="48dip"android:background="@color/colorPrimary"android:gravity="center"android:text="001"android:textSize="20sp" /><EditText
            android:id="@+id/psw"android:layout_width="match_parent"android:layout_height="48dip"android:background="@color/colorPrimary"android:gravity="center"android:text="123456"android:textSize="20sp" /><Button
            android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="登陆"android:onClick='@{(v)->F.save(ApisFactory.getApiEmpLogin().set((String)F.V(@id/store),(String)F.V(@id/name,F.NUM,"门店"),Md5.mD5((String)F.V(@id/psw)),"android","111111111"),"@user").CKERR().close().startActivity(@layout/frg_autofittest,F.CV("state","1"))}'/></com.mdx.framework.autofit.layout.FitLinearLayout>
</layout>

-** 布局中主要绑定登陆按钮的事件解释如下。

    (String)F.V(@id/name,F.NUM,"门店")  //获取name的值,验证器使用NUM即数字验证器,提示字段为门店F.save(...,"@user")       //获取接口数据并保存,第一个参数为接口类,@user为保存数据名@是全局保存,全局保存后可以在任意位置获取此参数。CKERR() //验证接口错误,如果有错误则中断执行,否则向下执行close() //关闭当前页面.startActivity()  //打开新的页面,新的页面加载@layout/frg_autofittest这个布局,并且传递F.CV("state","1")  state 和1 的参数

-** 显示效果如下

-** 点击后进入列表页。页面是一个列表页是显示一个根据服务器数据显示的一个列表。有筛选功能。

<?xml version="1.0" encoding="UTF-8"?><layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"><data><variable
            name="item"type="com.mdx.framework.server.api.base.Msg_Update" /><variable
            name="F"type="com.mdx.framework.autofit.AutoFit" /><variable
            name="P"type="java.util.HashMap" /><import type="com.udows.canyin.proto.ApisFactory"></import><import type="com.mdx.framework.commons.verify.Md5"></import></data><com.mdx.framework.autofit.layout.FitLinearLayout
        android:layout_width="match_parent"android:layout_height="match_parent"android:background="#fff"android:orientation="vertical"app:saveApi='@{F.listSet(ApisFactory.getApiEmpKcOrders().set((String)P["state"]),@layout/item_kc)}'><TextView
            android:id="@+id/title"android:layout_width="match_parent"android:layout_height="48dip"android:background="@color/colorPrimary"android:gravity="center"android:text="@{item.url}"android:textSize="20sp" /><LinearLayout
            android:layout_width="match_parent"android:layout_height="wrap_content"><TextView
            android:layout_width="match_parent"android:layout_weight="1"android:layout_height="40dip"android:gravity="center"android:onClick="@{(v)->F.dialog(@layout/pop_select)}"android:text='@{P["flname"]??"all"}'/><TextView
            android:layout_width="match_parent"android:layout_weight="1"android:layout_height="40dip"android:gravity="center"android:onClick="@{(v)->F.pop(v,@layout/frg_autofittest)}"android:text='@{P["flname"]??"all"}'/></LinearLayout><com.mdx.framework.widget.pagerecycleview.MFRecyclerView
            android:id="@+id/mrecycleview"android:layout_width="match_parent"android:layout_height="300dip"android:minHeight="200dip"android:layout_weight="1"app:column="1" /><LinearLayout
            android:layout_width="match_parent"android:layout_height="50dip"><LinearLayout
                android:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:orientation="vertical"><com.mdx.framework.widget.MImageView
                    android:id="@+id/icon1"android:layout_width="25dip"android:layout_height="22dip"android:src="@mipmap/tylt_bt_shouye_n" /><TextView
                    android:id="@+id/txt"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="3dip"android:text="首页"android:textSize="12sp" /></LinearLayout><LinearLayout
                android:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:orientation="vertical"><com.mdx.framework.widget.MImageView
                    android:id="@+id/icon2"android:layout_width="25dip"android:layout_height="22dip"android:src="@mipmap/tylt_bt_feilei_n" /><TextView
                    android:id="@+id/txt2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="5dip"android:text="分类"android:textSize="12sp" /></LinearLayout><LinearLayout
                android:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:orientation="vertical"><com.mdx.framework.widget.MImageView
                    android:id="@+id/icon4"android:layout_width="25dip"android:layout_height="22dip"android:src="@mipmap/tylt_bt_luntan_n" /><TextView
                    android:id="@+id/txt3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="3dip"android:text="论坛"android:textSize="12sp" /></LinearLayout><LinearLayout
                android:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:orientation="vertical"><com.mdx.framework.widget.MImageView
                    android:id="@+id/icon3"android:layout_width="25dip"android:layout_height="22dip"android:src="@mipmap/tylt_bt_wo_n" /><TextView
                    android:id="@+id/txt4"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="3dip"android:text="我的"android:textSize="12sp" /></LinearLayout></LinearLayout></com.mdx.framework.autofit.layout.FitLinearLayout>
</layout>
  • ** 核心实现代码功能为
'@{F.listSet(ApisFactory.getApiEmpKcOrders().set((String)P["state"]),@layout/item_kc)}F.listSet(ApiUpdate,res) //为页面中的list设置接口类,和显示的cell的形式
P["state"]   //取页面传递以及接口设置的参数,如需要区全局的可以使用@前缀@{(v)->F.dialog(@layout/pop_select)  //弹出 @layout/pop_select 布局的dialog
@{(v)->F.pop(v,@layout/pop_select)  //弹出 @layout/pop_select 布局的popwindow

  • **筛选布局窗口 主要功能弹出多种状态,点击后关闭弹出框并且传递参数给列表并刷新。
<?xml version="1.0" encoding="UTF-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"><data><variable
            name="F"type="com.mdx.framework.autofit.AutoFit" /><variable
            name="P"type="java.util.HashMap" /></data><LinearLayout
        android:layout_width="match_parent"android:layout_height="wrap_content"android:background="#fff"android:orientation="vertical"><TextView
            android:id="@+id/state_all"android:layout_width="match_parent"android:layout_height="40dip"style="@style/kcxdselectpop"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","0","flname","all").close()}'android:text="全部"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_dfk"android:layout_width="match_parent"android:layout_height="40dip"style="@style/kcxdselectpop"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","1","flname","dfk").close()}'android:text="待付款"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_djd"android:layout_width="match_parent"android:layout_height="40dip"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","2","flname","djd").close()}'style="@style/kcxdselectpop"android:text="待接单"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_yjd"android:layout_width="match_parent"android:layout_height="40dip"style="@style/kcxdselectpop"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","3","flname","yjd").close()}'android:text="已接单"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_yjud"android:layout_width="match_parent"android:layout_height="40dip"style="@style/kcxdselectpop"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","4","flname","ysd").close()}'android:text="已拒单"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_yqx"android:layout_width="match_parent"android:layout_height="40dip"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","5","flname","yqx").close()}'style="@style/kcxdselectpop"android:text="已取消"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><TextView
            android:id="@+id/state_ywc"android:layout_width="match_parent"android:layout_height="40dip"android:onClick='@{()->F.setParams(@layout/frg_autofittest,"state","0","flname","ywc").close()}'style="@style/kcxdselectpop"android:text="已完成"  /><View
            android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View></LinearLayout>
</layout>
  • *核心代码解释如下
'@{()->F.setParams(@layout/frg_autofittest,"state","0","flname","ywc").close()}'
F.setParams(resid,...) //给一个布局传递参数 resid,参数以键值对方式传递。传递后会根据设置刷新页面。
.close() //关闭窗口

  • *Cell数据显示如下,显示服务器的数据,并且实现一个点击功能,点击后显示一个loading按钮并且数据加载完成后关闭
<?xml version="1.0" encoding="UTF-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"><data><import type="android.view.View" /><import type="android.text.TextUtils" /><variable
            name="F"type="com.mdx.framework.autofit.AutoFit" /><variable
            name="P"type="java.util.HashMap" /><variable
            name="item"type="com.udows.canyin.proto.MOrderInfo" /><variable
            name="clickListener"type="android.view.View.OnClickListener" /><import type="com.udows.canyin.proto.ApisFactory"></import></data><LinearLayout
        android:layout_width="match_parent"android:layout_height="wrap_content"><LinearLayout
            android:layout_width="match_parent"android:layout_height="120dip"android:layout_marginTop="10dip"android:layout_marginLeft="5dip"android:onClick='@{(v)->F.visable(@id/process_jd,View.VISIBLE).save(ApisFactory.getApiEmpLogin().set("111","111","111","android","111111111"),"@user").visable(@id/process_jd,View.GONE).toast("wancheng")}'android:layout_marginRight="5dip"android:orientation="vertical"><RelativeLayout
                android:layout_width="match_parent"android:layout_height="55dip"android:layout_marginLeft="10dip"android:layout_marginRight="10dip"android:gravity="top"android:orientation="vertical"><TextView
                    android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="10dip"android:text="@{item.code}"android:textColor="#262626"android:textSize="13dip" /><TextView
                    android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="30dip"android:text="@{item.time}"android:textColor="#262626"android:textSize="13dip" /><TextView
                    android:id="@+id/state"style="@style/text_style_11_white"android:layout_width="52dip"android:layout_height="25dip"android:layout_alignParentRight="true"android:layout_marginRight="5dip"android:gravity="center_horizontal"android:paddingTop="3dip"android:textSize="12dip" /></RelativeLayout><View
                android:layout_width="match_parent"android:layout_height="1px"android:layout_marginLeft="10dip"android:layout_marginRight="10dip"android:background="#eee"></View><View
                android:layout_width="match_parent"android:layout_height="1px"android:background="#eee"></View><RelativeLayout
                android:layout_width="match_parent"android:layout_height="0dp"android:layout_marginLeft="10dip"android:layout_marginRight="10dip"android:layout_weight="1"><TextView
                    android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dip"android:text='@{item.desk}'android:layout_marginRight="100dip"android:textColor="#262626"android:textSize="13dip" /><TextView
                    android:id="@+id/paystate"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginRight="5dp"android:layout_marginTop="34dp"android:gravity="center"android:paddingBottom="2dip"android:paddingLeft="8dip"android:paddingRight="8dip"android:paddingTop="2dip"android:textSize="10dip" /><LinearLayout
                    android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentRight="true"android:gravity="bottom"android:paddingTop="10dip"><TextView
                        android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentRight="true"android:gravity="center_horizontal"android:text="¥"android:textColor="#e73b3b"android:textSize="12dip" /><TextView
                        android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentRight="true"android:gravity="center_horizontal"android:text="@{item.amount}"android:textColor="#e73b3b"android:textSize="17dip" /></LinearLayout><LinearLayout
                    android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_alignParentRight="true"android:layout_marginBottom="3dip"android:gravity="bottom"android:paddingTop="10dip"><RelativeLayout
                        android:id="@+id/btn_td"android:layout_width="50dip"android:layout_height="25dip"android:gravity="center_horizontal|bottom"android:orientation="vertical"android:visibility="@{(item.state==2)?View.VISIBLE:View.GONE}"><TextView
                            android:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:singleLine="true"android:text="拒单"android:textSize="14dip" /><ImageView
                            android:layout_width="50dip"android:layout_height="2dip"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"android:layout_marginTop="3dip" /><ProgressBar
                            android:id="@+id/process_td"android:layout_width="match_parent"android:layout_height="match_parent"android:background="#ffffff"android:visibility="gone" /></RelativeLayout><RelativeLayout
                        android:id="@+id/btn_jd"android:layout_width="50dip"android:layout_height="25dip"android:layout_marginLeft="15dip"android:gravity="center_horizontal|bottom"android:orientation="vertical"><TextView
                            android:layout_width="match_parent"android:layout_height="match_parent"android:layout_alignParentTop="true"android:gravity="center"android:singleLine="true"android:text="接单"android:textSize="14dip" /><ImageView
                            android:layout_width="50dip"android:layout_height="2dip"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"android:layout_marginTop="3dip" /><ProgressBar
                            android:id="@+id/process_jd"android:layout_width="match_parent"android:layout_height="match_parent"android:background="#ffffff"android:visibility="gone"/></RelativeLayout></LinearLayout></RelativeLayout></LinearLayout></LinearLayout>
</layout>

-* 其中apiuodate是封装好的接口调用类
-** MFRecyclerView是封装好的recyclerview实现页面的布局显示。 github上可以看到源码。https://github.com/ryanliu19843/pagerecycleview
-** MImageview是封装的imageview 实现图片变色动画显示等。
github上可以看到源码。https://github.com/ryanliu19843/XImageView
测试apk如下其中
”自动frame测试“ 按钮点击后的所有内容即为本文中的代码实现
https://pan.baidu.com/s/1nvonPrz

不写代码也能实现android应用相关推荐

  1. android写代码截屏微信,android 模仿微信头像裁剪

    android 在android开发中经常会碰到修改头像的功能需求, 而在修改头像>中最难的部分就是在头像的裁剪功能.虽说网上一大堆裁剪的例子,但最重要的是要理解里面的实现原理,这样以后自己改起 ...

  2. qtdesigner怎么实现菜单栏跳转_人人都可写代码-Android零基础编程-app 入口菜单栏实操08...

    欢迎来到人人都可写代码,大家好,我是杨晓华,今天我们的课程内容是项目实操,以智者精选项目为例,编写一个Android app的入口关联菜单栏逻辑. 这是要实现的菜单栏组件展示效果,下面就是教大家如何制 ...

  3. android 按钮顶级效果_人人都可写代码-Android零基础编程-相对布局11

    欢迎来到人人都可写代码,大家好,我是杨晓华,今天我们的课程内容是:Android界面布局中的相对布局. 1.RelativeLayout的概述 (1) RelativeLayout是一个允许子视图相对 ...

  4. android 不通过数据线打印日志_人人都可写代码-Android零基础编程-开发调试、APK编译04...

    欢迎来到人人都可写代码,大家好,我是杨晓华,今天我们的课程内容是,讲解Android开发中如何调试代码程序,开发完后如何打包成可发布的apk文件. 开发调试 在开发中,难免我们会遇到BUG,快速定位问 ...

  5. 用c语言写代码_教你如何用android mvp分层架构优雅写代码

    背景 看了好多android技术博客,写android分层架构的博客越来越多,有mvc.mvp.mvvm.clean等各式各样的,而mvp异常火热,然而每个人对mvp的定义又是不同,写法自然也是千紫万 ...

  6. 从零开始--系统深入学习android(实践-让我们开始写代码-新手指南-6.使用Fragments构建动态UI)...

    第6章 使用Fragments构建动态UI 为了在Android创建一个动态的多面的用户界面,你需要封装UI组件和activity的行为到一种可以相互交换的act的模块中.我们能使用 Fragment ...

  7. java开发平板_用Android平板来写代码 - Termux 环境搭建

    之前入了一个洋垃圾 华硕P00I,我对这款平板的第一印象是:屏幕好,电池耐用.如果忽略后压屏的缺点,还是很有性价比的. 除了平时看小说.PDF.PPT.视频,作为一个程序员(还没毕业),想着是否可以更 ...

  8. 像大牛一样写代码: 31个Android 开发者工具

    原文:Code like a pro: 31 tools for Android app developers.文中部分工具是收费的,但是绝大多数都是免费的. FlowUp 这是一个帮助你跟踪app整 ...

  9. 如何写出低碳环保的Android代码

    声明:本文CSDN作者原创投稿文章,未经许可禁止任何形式的转载.  作者:徐鸿福,多年后端及移动端开发经验,现任MaxLeap UX团队成员,主要从事于Android相关开发,目前对Kotlin和Ru ...

最新文章

  1. 面试再被问到 ConcurrentHashMap,把这篇文章甩给他!
  2. 如何通过AppDomain用特定的安全上下文加载外部程序集
  3. 微信小程序button授权页面,用户拒绝后仍可再次授权
  4. 这两天发现一个老外用JavaScript编写的好东西:dp.SyntaxHighlighter。
  5. SpringContextUtil
  6. 基于mui框架读取nfc数据_基于NFC的数据采集软件系统的设计与实现
  7. C之printf()函数
  8. http协议与php关系,PHP中的HTTP协议
  9. linux文本处理常用指令总结
  10. 用scikit-learn学习主成分分析(PCA)
  11. 算法提高 数的划分 动态规划 无序
  12. 你扔掉的旧衣服撑起了一个千亿市场?
  13. linux启动日志服务命令,linux命令:syslog日志服务-系统缩减之增加日志服务功能...
  14. 【★原创★】夜晚,不要让电白白流失!
  15. Milano Store OpenCart 2.0 主题模板 ABC-0473
  16. PAIP.DB4O与SQL配合使用在海量数据下.txt
  17. 【POJ 3320】【尺取法】Jessica's Reading Problem【暑期 No.2】
  18. 13.solr学习速成之IK分词器
  19. 深度学习:摩尔纹识别(翻拍检测)
  20. excel两列数据对比找不同_莫斯科地标百年前后对比图,快来“找不同”

热门文章

  1. 关于麻球网关闭的感想
  2. 国内一些期刊的搞笑审稿
  3. VSTO C# 操作excel
  4. 【Unity3d】3d网页游戏场景打包与加载
  5. esxi6.0虚拟机克隆及跨版本克隆
  6. CCF-集合竞价(开盘价定为买价,1e8*5000--long long)
  7. 联想A800新蜂ROM V1.1 基于官方4.0.4精简省电稳定
  8. 计算机教育中缺失的一课,劝学弟学妹们一句,一定要趁早补上,工作后会如有神助!
  9. 694. Number of Distinct Islands
  10. sap BusinessObject Enterprise XI 4.0 安装载图