高仿课程格子实现课程表的功能
又是一年中秋节,中秋佳节更思亲,一直很纠结到底是回家呢还是回家呢,呵呵,随着时间的推移,现在又没有时间回家了,最近也挺迷茫的,android和iphone 开发到底该学哪一个,有点小郁闷,眼看就要9月底了,来学校这么长时间,什么也没有学到,再开学就大三了,以后的工作咋弄嘞,好多事要想,诶,头痛中... 最近在弄一个课程表,说弄吧,也不算弄,算是仿制吧,毕竟中国的山寨很流行,下面看看那自己山寨的课程格子,声明一下:功能没有实现完全,没有正版的好。。
首先看看实现的图片
2接着看看布局吧
welcom.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<ImageView
android:id="@+id/welcome"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/splashscreen" />
</LinearLayout>
addcourse.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background_holo"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="@drawable/topbar"
android:orientation="horizontal" >
<Button
android:id="@+id/addcoursereturnbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/btn_arrow_bg"
android:text="@string/returnbtn"
android:textColor="#FFFFFF" />
<TextView
android:id="@+id/addcousetext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:ellipsize="end"
android:maxLength="7"
android:text="@string/addcourse"
android:textColor="#FFFFFF"
android:textSize="20dp" />
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/btn_bg"
android:text="@string/add"
android:textColor="#FFFFFF" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:layout_gravity="center_horizontal"
android:background="@drawable/weekview_course_block"
android:orientation="vertical" >
<EditText
android:id="@+id/addcourseedit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:drawableLeft="@drawable/weekview_study"
android:hint="请输入课程的名字" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/renren_sdk_line" />
<EditText
android:id="@+id/addcourseteacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:drawableLeft="@drawable/dayview_icon_teacher"
android:hint="请输入老师名字(可选)" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/renren_sdk_line" />
<EditText
android:id="@+id/addcourseclass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:drawableLeft="@drawable/dayview_icon_classroom"
android:hint="请输入上课地点(可选)" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/renren_sdk_line" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:gravity="center_vertical"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/beginweek"
android:textColor="#292421"
android:textSize="20dp" />
<EditText
android:id="@+id/addcoursebeginweek"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1" />
</LinearLayout>
<ImageView
android:id="@+id/addcourseimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/renren_sdk_vertical_line" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/addcourseimage"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/endweek"
android:textColor="#292421"
android:textSize="20dp" />
<EditText
android:id="@+id/addcoursebeginweek"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="17" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="40dp"
android:paddingTop="50dp" >
<ImageView
android:id="@+id/coursetimedelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_delete_course_time" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/coursetimedelete"
android:layout_toRightOf="@id/coursetimedelete"
android:background="@drawable/invitation_bg"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/clock" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#292421"
android:text="@string/addclasstime"
android:textSize="18dp" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/btn_delete_course_time_normal"
android:text="@string/delete"
android:textSize="11dp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
course.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutcourse"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_height="40dp"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:background="@drawable/topbar"
>
<ImageView
android:id="@+id/coursesettting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout_alignParentLeft="true"
android:src="@drawable/umeng_analyse_see_list_normal"/>
<TextView
android:id="@+id/coursetime"
android:layout_centerHorizontal="true"
android:paddingTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/coursetime"
android:textSize="20dp"
android:textColor="#FFFFFF"
android:paddingBottom="4dp"
/>
<Button
android:id="@+id/courseweek"
android:background="@drawable/btn_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/courseeveryday"
android:textColor="#FFFFFF"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingTop="14dp"
android:background="@drawable/weekview_bg"
>
<GridView
android:id="@+id/gridviewcourse"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_5"
android:numColumns="7"
android:gravity="center"
></GridView>
</LinearLayout>
</LinearLayout>
coursemanager.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="280dp"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linear1"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/mycoursetable"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear2"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/addclasstable"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear3"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/myfriends"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear4"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/background"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear5"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/setting"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear6"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/feedback"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
<LinearLayout
android:id="@+id/linear7"
android:layout_width="280dp"
android:layout_height="50dp"
android:background="@drawable/topbar"
android:clickable="true" >
<TextView
android:layout_width="250dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="@string/exit"
android:textSize="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="@drawable/list_tappable" />
</LinearLayout>
</LinearLayout>
<SlidingDrawer
android:id="@+id/sliding"
android:layout_width="40dp"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:content="@+id/concent"
android:handle="@+id/handle" >
<ImageView
android:id="@+id/handle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/a" />
<LinearLayout
android:id="@+id/concent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_5"
android:orientation="vertical" >
</LinearLayout>
</SlidingDrawer>
</RelativeLayout>
courseinfo.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="@drawable/topbar"
android:orientation="horizontal" >
<Button
android:id="@+id/coursereturn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/btn_arrow_bg"
android:text="@string/returnbtn"
android:textColor="#FFFFFF" />
<TextView
android:id="@+id/coursetime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLength="7"
android:layout_centerInParent="true"
android:text="@string/classname"
android:textColor="#FFFFFF"
android:textSize="20dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:background="@drawable/topbar"
android:orientation="horizontal" >
<Button
android:id="@+id/coursenotes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/course_detail_toolbar_addnote" />
<Button
android:id="@+id/courseedit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/course_detail_toolbar_edit" />
<Button
android:id="@+id/coursedelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/course_detail_toolbar_delete" />
</RelativeLayout>
</RelativeLayout>
gridview.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/itemText"
android:background="@drawable/button_large_blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="7dp"
android:text="课程名称:" >
</TextView>
</LinearLayout>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!