Android 简单记账本的实现(使用LitePal数据库)


1.主要功能展示:

1.登录

 1.注册

 

3.主界面:

 

4.1记一笔(1.收入):

 

4.2记一笔(2.支出):

 

5.1账单(1.收入)

 

5.2账单(2.支出)

 

6.导出(已XLS格式导出到SD卡)

 

 

 2. 详细代码实现(布局,关键代码)

2.1布局:

登录界面:

  

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
tools:context=".LoginActivity">
<LinearLayout
android:id="@+id/linear1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="200dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#99404348"
android:gravity="center"
android:paddingTop="20dp"
android:paddingBottom="30dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Welcome"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#99000000"
android:orientation="vertical"
android:paddingTop="20dp"
android:paddingBottom="20dp">

<EditText
android:id="@+id/edt_Login"
android:text="18730973637"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:background="@null"
android:hint="your username"
android:textColor="#9F9FA0"
android:textColorHint="#9F9FA0" />

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_marginLeft="40dp"
android:layout_marginTop="10dp"
android:layout_marginRight="40dp"
android:layout_marginBottom="5dp"
android:background="#83738F"></View>

<EditText
android:id="@+id/edt_pwd"
android:text="3986479a"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:background="@null"
android:hint="your password"
android:textColor="#9F9FA0"
android:textColorHint="#9F9FA0" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#99404348"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="20dp"
android:paddingBottom="30dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_gravity="center"
android:text="Forget Password?"
android:textColor="#DDDDDD"
android:onClick="btn_Forget"
android:textSize="15sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Register"
android:onClick="btn_Register"
android:layout_marginLeft="20dp"
android:textColor="#FFFFFF"
android:textSize="15sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.dd.CircularProgressButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:id="@+id/btn_Login"
android:background="@drawable/btn_circle"
android:text="Login"
android:onClick="btn_CallLogin"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>


只适合初学者,这里代码太多了,我就放到百度网盘了。
网盘地址:https://pan.baidu.com/s/10T9ZHrOB0gqdZyjLtd-KKw
提取码: 5pef

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM