第五周(1) Flag相关的功能设计
来源:互联网 发布:2016农村金融数据报告 编辑:程序博客网 时间:2024/05/16 05:31
引言
不知不觉,我们的创新项目实训已经过去了大半,按照我们事先商定好的计划,这周的任务主要是安卓客户端与后天有关具体的Flag的功能的相关实现,计划能顺利实施,得益于我们前期花费大量时间的讨论以及对工作量的正确的评估。本周的主要任务有:
- 客户端 :我的好友消息和Flag详情
- 后台:DAO层的详细逻辑梳理架构
- 客户端:客户端设计工作的细节调整以及界面优化
客户端
本次我的工作是编写我的好友消息功能,其中xml界面代码如下:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/activity_bg_gray" android:orientation="vertical"> <RelativeLayout android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/white" android:padding="0dp"> <ImageButton android:layout_width="?attr/actionBarSize" android:layout_height="?attr/actionBarSize" android:layout_alignParentLeft="true" android:background="@drawable/toolbar_back_bg" android:onClick="myMessageFriendBack" android:src="?attr/homeAsUpIndicator" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="我的好友消息" android:textColor="@color/black" android:textSize="19sp" /> </RelativeLayout> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/friend_msg_swipe_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="20dp"> <ListView android:id="@+id/myMessageListView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="20dp" android:background="@color/white" /> </android.support.v4.widget.SwipeRefreshLayout></LinearLayout>
相对应的Activity相关的核心实现部分MyMessageFriendActivity核心代码块为;
public void onSuccess(Response response) { if (response.isSuccessful()) { try { String res = response.body().string(); JSONObject request = new JSONObject(res); JSONArray jsonArray = request.getJSONArray("request"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); String nickname = jsonObject.optString("nickname"); String phone = jsonObject.optString("phone"); String message = jsonObject.optString("message"); String requestUid = jsonObject.optString("requestUid"); String agree = jsonObject.optString("agree"); int iconId = jsonObject.optInt("photo"); list.add(new TempFriendBean(nickname, phone, message, requestUid, agree, iconId)); } MyMessageFriendActivity.this.runOnUiThread(new Runnable() { @Override public void run() { friendMessageAdapter = new FriendMessageAdapter(MyMessageFriendActivity.this, list); listView.setAdapter(friendMessageAdapter); } }); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } } }
其主要功能是从服务器获取数据后的回调函数,根据请求的成功或者失败做出具体的响应。
总结
这一阶段的过程还算顺利,小组成员深刻体会到了前期需求讨论的充分以及花费了大量的时间进行计划的评估和修改,好让我们的开发过程思路清晰明了,遇到的问题也会快速解决。阅读全文
0 0
- 第五周(1) Flag相关的功能设计
- MyFlag Step 9:Flag相关的功能设计
- 第五周(2) 后台代码解耦与客户端具体功能设计
- 如何做一个简单的开放接口(1)-功能设计
- 谈谈MVC项目中的缓存功能设计的相关问题
- android Intent的相关Flag说明
- MyFlag Step9 :Flag功能相关的设计
- 自用数据库软件(3-1功能设计)
- 【TOF-3D】学习笔记(1)-上层界面的功能设计
- 字符串的一个功能设计
- Flag相关常量
- 两个跟锁屏解锁相关的window的flag
- 基于redis的点赞功能设计(张高伟)
- 软件功能设计实战-订单管理系统(1)
- 软件的需求与功能设计
- 门户网站功能设计的准则
- 一个子功能设计的思维过程
- 关于退出按钮的功能设计
- 810C. Do you want a date?
- Android Studio编译问题:ProcessException: org.gradle.process.internal.ExecException
- OpenGL CubeMapping及天空盒
- PHP中无限极分类函数的实现
- 今天搜并发看到的一些文章
- 第五周(1) Flag相关的功能设计
- python 确保windows下网络正常
- ios 判断字符串是否全部空格
- final关键字
- ECMAScript创建对象
- 百度地图集成的那些坑
- 17.6.1]Codeforces Round #417 (Div. 2)(T1-T3)
- nginx启动、重启、关闭
- yii2 activeform相关问题记录