移动开发技术作业2: App页面间的跳转:今天练了没

目录

APP名称:今天练了没

APP版本:v2.0

一、项目总体介绍

二、关键步骤与核心技术

1.文本框设置:text_border.xml

2.中间内容设计更新:

2.1 热量表:list.xml

2.2 用于实现item跳转页面后的视图:chest.xml

3.中间内容类:Fragment类

3.1 fragment3_test.java

4.适配器:MyAdapter类

4.1 实现列表内item的跳转:MyAdapter2.java

5.MainActivity类

5.1 MainActivity2.java

5.2 moreinfo.java

三、程序结果展示

四、源码线上仓库 


APP名称:今天练了没

APP版本:v2.0

一、项目总体介绍

项目背景:随着生活水平的提高,人们对于提高身体素质的要求越来越强烈,本App旨在为健身爱好者提供相应的参考查询服务,从而提高训练效率。本App包含健身计划、食物热量表、健身动作和简单的低卡食谱四个栏目,每个栏目都有相应的内容。希望用户可以通过这四个栏目的内容,加上实际运动,实现管住嘴、迈开腿,通过自己的努力实现身材管理,达到理想的健身目标。

更新日志:

○ 优化了app页面,添加了文本框使app内容更加美观,提高了可读性。

○ “热量表”栏目添加了更多常见食物的热量,添加了按钮来跳转更多信息页。

○ 删除了没有太多实际意义的“箴言”一栏,更换为实用性更多的“动作”一栏,分为胸、背、腿、肩、二头、三头、腹部七个板块,每个板块内都有效率很高的动作推荐及其细节解析。

实现技术:activity、xml、fragment、recycleview、intent

二、关键步骤与核心技术

(App源码只展更新了的部分,其他未展示的源码均与v1.0版本的源码相同)

1.文本框设置:text_border.xml

○ 在/res/layout目录创建一个text_border.xml

○ xml文件内包含对文本框的设置:颜色、粗细、圆角角度

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/white"/>
    <stroke
        android:width="2dp"
        android:color="#673AB7" />
        <corners android:radius="5dp" />
</shape>

2.中间内容设计更新:
2.1 热量表:list.xml

○ 添加一个button用于进行跳转

○ 新建一个页面用于实现跳转后的页面

list.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/LinearLayout2"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycleView2"
        android:layout_width="match_parent"
        android:layout_height="580dp" />

    <Button
        android:id="@+id/morebutton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="更多信息" />

</LinearLayout>

跳转后的页面:moreinfo.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:orientation="vertical">

    <Button
        android:id="@+id/backbutton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="返回"
        android:textSize="20sp" />

    <androidx.recyclerview.widget.RecyclerView
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值