第七週(2) 打卡功能

引言

在這半周的工作中,我們小組仍然主要進行後臺客戶端的代碼編寫工作以及界面的優化,在這裏,我對自己主要從事的工作,即客戶端的打卡功能的規劃,做一個重點的介紹。

一、界面編寫

計劃界面爲一個列表,顯示出每個人的打卡狀態,以及上傳的照片。具體代碼如下所示:

<?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: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="CommentBack"
            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>

    <ListView
        android:id="@+id/comment_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>

二、內部邏輯實現

邏輯代碼目前還沒有編寫,因爲後半周時還沒有後臺接口,所以只進行了一下類的創建與界面獲取,這裏不再貼代碼。

同時下半周我幫頁面做了一些xml方面的工作,代碼大致如下:

<merge
    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" >

    <com.lorentzos.flingswipe.SwipeFlingAdapterView
        android:id="@+id/frame"
        android:background="#ffeee9e2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:rotation_degrees="15.5"
        tools:context=".MyActivity" />

    <include layout="@layout/buttons" />

</merge>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章