团队冲刺第六天

1.今天完善了一下。地图定位界面功能。理想的是实现倒计时之后进行跑步。之后出现了一些问题今天可虽然不多但另外有考试。总体的编写时间不是很长。新增的布局代码如下以及相关的效果图:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/layout_bg"
android:id="@+id/sport_content"
tools:context=".DynamicDemo">
<RelativeLayout
    android:id="@+id/rlMap"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.baidu.mapapi.map.MapView
        android:id="@+id/bmapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</RelativeLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/sport_change_bg">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/title_height"
        android:layout_marginTop="@dimen/spacing_normal"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_mode"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="@dimen/margin_edge"
            android:drawableStart="@mipmap/map_mode"
            android:drawablePadding="5dp"
            android:gravity="center_vertical"

            android:text="开始运动"
            android:textColor="@color/red"
            android:textColorLink="@color/red"
            android:textSize="@dimen/textsize_8"
            android:layout_marginLeft="@dimen/margin_edge"
            android:drawableLeft="@mipmap/map_mode" />

    </LinearLayout>
</RelativeLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="@dimen/margin_edge_20"
    android:layout_marginTop="110dp"
    android:orientation="vertical"
    android:layout_marginLeft="@dimen/margin_edge_20">

    <Chronometer
        android:id="@+id/cm_passtime"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:format="00:00:00"
        android:gravity="center"
        android:textColor="@color/text_color_white"
        android:textSize="65sp"
        android:textStyle="bold" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/margin_edge_20"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tvMileage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:maxLength="8"
            android:text="0.00"
            android:textColor="@color/text_color_white"
            android:textSize="26sp"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_marginStart="6dp"
            android:layout_marginBottom="2.5dp"
            android:text="公里"
            android:textColor="@color/text_color_white"
            android:textSize="@dimen/textsize_2"
            android:layout_marginLeft="6dp" />

        <TextView
            android:id="@+id/tvSpeed"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/margin_edge_20"
            android:ellipsize="end"
            android:maxLength="8"
            android:text="0.00"
            android:textColor="@color/text_color_white"
            android:textSize="26sp"
            android:textStyle="bold"
            android:layout_marginLeft="@dimen/margin_edge_20" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_marginStart="6dp"
            android:layout_marginBottom="2.5dp"
            android:text="配速(分/公里)"
            android:textColor="@color/text_color_white"
            android:textSize="@dimen/textsize_2"
            android:layout_marginLeft="6dp" />
    </LinearLayout>

</LinearLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:orientation="horizontal"
    android:paddingBottom="30dp">

    <TextView
        android:id="@+id/tv1"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:background="@drawable/sport_white_round"
        android:gravity="center"
        android:text="完成"
        android:textColor="@color/text_color_green"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/tv2"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:background="@drawable/sport_white_round"
        android:gravity="center"
        android:text="暂停"
        android:textColor="@color/text_color_green"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/tv3"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:background="@drawable/sport_white_round"
        android:gravity="center"
        android:text="继续"
        android:textColor="@color/text_color_green"
        android:textSize="18sp" />

</LinearLayout>

<FrameLayout
    android:id="@+id/fl_count_timer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#77000000"
    android:clickable="true"
    android:focusable="true"
    android:focusableInTouchMode="true">

    <!--倒数时动画-->
    <TextView
        android:id="@+id/tv_number_anim"
        android:layout_width="140dp"
        android:layout_height="140dp"
        android:layout_gravity="center"
        android:gravity="center"
        android:textColor="@color/text_color_white"
        android:textSize="100sp"
        android:textStyle="bold" />
</FrameLayout>
<!--
<Button
    android:id="@+id/buttonStart"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="150dip"
    android:layout_marginTop="10dip"
    android:text="开始" />

<Button
    android:id="@+id/buttonFinish"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_marginRight="25dp"
    android:layout_marginTop="10dip"
    android:text="停止" />
-->
<RelativeLayout
    android:id="@+id/progressBarRl"
    android:layout_width="match_parent"
    android:layout_height="80dp"
    android:layout_alignParentBottom="true"
    android:visibility="gone"
    android:background="@android:color/white">

    <TextView
        android:id="@+id/info"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textColor="@android:color/black"
        android:text="GPS信号连接中,请稍后..." />

    <ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:paddingLeft="20dp"
        android:layout_centerVertical="true"
        android:paddingRight="10dp"
        android:layout_toLeftOf="@id/info"
        android:layout_height="wrap_content" />
</RelativeLayout>

</RelativeLayout>

原文地址:https://www.cnblogs.com/dazhi151/p/12741126.html