中小学试卷生成系统评测-分析顾同学代码

 

  • 需求实现

    • 整体代码通过安卓app实现需求,通过下载app来完成登录和生成试卷等功能,所以功能需求实现的很好,登录界面设计的很干净,操作方便,这点值得我去借鉴学习。

  • 问题缺陷

    • 第一感觉就是,这个App做的太丑了,这UI界面做的跟没有一样,我要是老师绝对不会用这个系统的,所以我向队友提出的第一个要求就是给我把所有界面全部重新做一遍,不然这么丑的App是没人会用的,当然,鉴于我们不是设计师,所以也只能尽力改进,我会在下文给出一些建议

    • 第二个问题是,Activity太多了,虽然这是个小项目,不需要用MVP之类的架构把View和Model完全分离,但是问题在于他在每一个Activity中都调用了initData()和setListener(),既然有通用的模式,为什么不让Activity都继承一个BaseActivity基类呢?此外,Utils类中同时包含了保存文件和生成题库的功能,虽然说这个项目需要模块化的功能并不多,但是把完全不相关的功能全写一块也太过分了吧,而且结队项目还要求加入短信验证功能,向短信运行商发送HTTP请求的功能类总该另写一个类吧,希望进行第二版本开发的时候能注意

    • 另外吧,把生成的文件存到手机的文件夹里其实挺蠢的,虽然需求里是这样要求的,但实际上Android的文件夹基本都是有访问权限的,把文件存到App的内部存储文件夹里普通用户是不能查看的,更不用说导出了,其实最好的改进方法应该是把文件存到手机的外部存储的SD卡上,虽然需要在生成时添加运行时权限的代码,不过这样用户应该就能访问生成的文件了

    • 还有,好像没有加上记住密码功能呢,虽然是最简单的登录注册页面,但还是要考虑考虑用户体验的吖

  • 建议方案

    • 关于UI优化方面,我提出的第一个建议是加上一个圆形图标,还有给EditText和Button添加自定义样式,像圆角啊,颜色啊

    • 首先,引入显示圆形图标的开源库CircleImageView,在build.gradle中添加依赖即可

    • 第二,算了,直接附上代码

      <RelativeLayout 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"
         android:id="@+id/activity_login"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@color/logoScreenBackground">

         <de.hdodenhof.circleimageview.CircleImageView
             android:id="@+id/iv_icon"
             android:layout_width="90dp"
             android:layout_height="90dp"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="60dp"
             android:scaleType="centerCrop"
             android:src="@mipmap/ic_logo" />

         <TextView
             android:id="@+id/tv_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="160dp"
             android:text="AlphaGo"
             android:textColor="#000"
             android:textSize="23sp"
             android:typeface="monospace" />

         <RelativeLayout
             android:id="@+id/rl_userName"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/tv_title"
             android:layout_marginTop="40dp"
             android:background="@drawable/rectangle_edittext">

             <ImageView
                 android:id="@+id/iv_userIconName"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
                 android:paddingBottom="15dp"
                 android:paddingLeft="30dp"
                 android:paddingTop="15dp"
                 android:src="@mipmap/ic_edittextuname" />

             <View
                 android:id="@+id/viewName"
                 android:layout_width="1dip"
                 android:layout_height="20dp"
                 android:layout_centerVertical="true"
                 android:layout_marginLeft="10dp"
                 android:layout_toRightOf="@id/iv_userIconName"
                 android:background="@color/colorCursor" />

             <EditText
                 android:id="@+id/et_userName"
                 android:layout_width="match_parent"
                 android:layout_height="30dp"
                 android:layout_centerVertical="true"
                 android:layout_marginLeft="10dp"
                 android:layout_toRightOf="@id/viewName"
                 android:background="@null"
                 android:ems="19"
                 android:hint=" 用户名"
                 android:textColorHint="@color/colorCursor"
                 android:textCursorDrawable="@drawable/color_cursor"
                 android:textSize="15sp" />

             <ImageView
                 android:id="@+id/iv_unameClear"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_centerVertical="true"
                 android:layout_marginRight="20dp"
                 android:src="@mipmap/ic_backspace_grey600_24dp"
                 android:visibility="invisible" />

         </RelativeLayout>

         <RelativeLayout
             android:id="@+id/rl_userPassword"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/rl_userName"
             android:layout_marginTop="1dp"
             android:background="@drawable/rectangle_edittext">

             <ImageView
                 android:id="@+id/iv_userIconPwd"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
                 android:paddingBottom="15dp"
                 android:paddingLeft="30dp"
                 android:paddingTop="15dp"
                 android:src="@mipmap/ic_edittextupwd" />

             <View
                 android:id="@+id/viewPwd"
                 android:layout_width="1dip"
                 android:layout_height="20dp"
                 android:layout_centerVertical="true"
                 android:layout_marginLeft="10dp"
                 android:layout_toRightOf="@id/iv_userIconPwd"
                 android:background="@color/colorCursor" />

             <EditText
                 android:id="@+id/et_password"
                 android:layout_width="match_parent"
                 android:layout_height="30dp"
                 android:layout_centerVertical="true"
                 android:layout_marginLeft="10dp"
                 android:layout_toRightOf="@id/viewPwd"
                 android:background="@null"
                 android:drawablePadding="5dp"
                 android:ems="19"
                 android:hint=" 密码"
                 android:inputType="textPassword"
                 android:textColorHint="@color/colorCursor"
                 android:textCursorDrawable="@drawable/color_cursor"
                 android:textSize="15sp" />

             <ImageView
                 android:id="@+id/iv_pwdClear"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_centerVertical="true"
                 android:layout_marginRight="20dp"
                 android:src="@mipmap/ic_backspace_grey600_24dp"
                 android:visibility="invisible" />

         </RelativeLayout>

         <CheckBox
             android:id="@+id/cb_checkbox"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/rl_userPassword"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="20dp"
             android:background="@null"
             android:checked="false"
             android:duplicateParentState="false"
             android:text="记住密码"
             android:textColor="#666666"
             android:textSize="15sp"
             app:buttonTint="@color/colorLoginButton" />

         <Button
             android:id="@+id/btn_login"
             android:layout_width="340dp"
             android:layout_height="wrap_content"
             android:layout_below="@id/cb_checkbox"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="20dp"
             android:background="@drawable/round_corner_bg"
             android:gravity="center"
             android:padding="10dp"
             android:text="登录"
             android:textColor="#fff"
             android:textSize="18sp" />

      </RelativeLayout>
posted @ 2019-09-19 22:22  Hnu_hu  阅读(483)  评论(0编辑  收藏  举报