学生党一枚,前段时间因为做东西需要,自学了一点Android,然后前段时间情人节突发奇想,自己做一个情人节表白的app,毕竟是初学者,做的很简单,这里只提供一个模板,文字、图片、视频大家可以根据需要自己更换,如果有喜欢的或者想用的话可以借鉴参考一下,祝大家好运,找到自己喜欢的那个人~
P.S. 新手上路,做的很简单,除了网上找材料什么的时间,很快就做出来了,仅制作了三个界面MainActivity、SecondActivity、VideoActivity,可能有一些地方代码写的不是很规范或者不太符合现在开发的一些写法,如有什么问题请大家批评指正,谢谢。
代码压缩包已放入百度网盘,如有需要自行下载:https://pan.baidu.com/s/1QQALADzeX0_riFIX0GHZ2w 提取码:9cwz
自定义标题栏布局
title_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@drawable/newbar">
<ImageView
android:id="@+id/ib_title_back"
android:layout_marginTop="14dp"
android:layout_width="24dp"
android:layout_height="28dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="12dp"
android:src="@drawable/white_back_button" />
<TextView
android:id="@+id/tv_title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="115dp"
android:text="标题"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#AA049E"
android:textSize="25sp"
android:textStyle="bold"/>
</RelativeLayout>
noback_title_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@drawable/bar">
<ImageView
android:id="@+id/exitbutton"
android:layout_marginTop="14dp"
android:layout_width="22dp"
android:layout_height="28dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="330dp"
android:src="@drawable/exitbutton" />
<TextView
android:id="@+id/tv_title0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="115dp"
android:text="标题"
andro