parent
bc48fd5b4d
commit
375eb25499
@ -1,135 +1,155 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
<layout 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" |
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
||||
tools:context="com.arialyy.simple.download.SingleTaskActivity" |
||||
tools:showIn="@layout/activity_single" |
||||
> |
||||
|
||||
<com.arialyy.simple.widget.HorizontalProgressBarWithNumber |
||||
android:id="@+id/progressBar" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="20dp" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_alignParentStart="true" |
||||
android:layout_alignParentTop="true" |
||||
android:layout_margin="16dp" |
||||
android:layout_toLeftOf="@+id/size" |
||||
android:max="100" |
||||
style="?android:attr/progressBarStyleHorizontal" |
||||
/> |
||||
|
||||
<TextView |
||||
android:id="@+id/size" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_alignTop="@+id/progressBar" |
||||
android:layout_marginRight="16dp" |
||||
android:text="0mb" |
||||
android:textSize="16sp" |
||||
/> |
||||
|
||||
|
||||
<LinearLayout |
||||
android:id="@+id/handle_bar" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/progressBar" |
||||
android:orientation="horizontal" |
||||
> |
||||
<TextView |
||||
android:id="@+id/speed" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="16dp" |
||||
android:text="0kb/s" |
||||
android:textColor="@color/black" |
||||
<data> |
||||
<variable |
||||
name="fileSize" |
||||
type="String" |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/start" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="开始" |
||||
style="?buttonBarButtonStyle" |
||||
<variable |
||||
name="speed" |
||||
type="String" |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/stop" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="暂停" |
||||
style="?buttonBarButtonStyle" |
||||
<variable |
||||
name="progress" |
||||
type="int" |
||||
/> |
||||
</data> |
||||
|
||||
<Button |
||||
android:id="@+id/cancel" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="删除任务" |
||||
style="?buttonBarButtonStyle" |
||||
/> |
||||
</LinearLayout> |
||||
|
||||
<TextView |
||||
android:id="@+id/speed_hint" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/handle_bar" |
||||
/> |
||||
|
||||
<RadioGroup |
||||
android:visibility="gone" |
||||
android:id="@+id/speeds" |
||||
<RelativeLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/speed_hint" |
||||
android:orientation="horizontal" |
||||
android:layout_height="match_parent" |
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
||||
tools:context="com.arialyy.simple.download.SingleTaskActivity" |
||||
tools:showIn="@layout/activity_single" |
||||
> |
||||
|
||||
<RadioButton |
||||
<com.arialyy.simple.widget.HorizontalProgressBarWithNumber |
||||
android:id="@+id/progressBar" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="256kb" |
||||
android:layout_height="20dp" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_alignParentStart="true" |
||||
android:layout_alignParentTop="true" |
||||
android:layout_margin="16dp" |
||||
android:layout_toLeftOf="@+id/size" |
||||
android:max="100" |
||||
android:progress="@{progress}" |
||||
style="?android:attr/progressBarStyleHorizontal" |
||||
/> |
||||
|
||||
<RadioButton |
||||
<TextView |
||||
android:id="@+id/size" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="512kb" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_alignTop="@+id/progressBar" |
||||
android:layout_marginRight="16dp" |
||||
android:text="@{fileSize}" |
||||
android:textSize="16sp" |
||||
/> |
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
|
||||
|
||||
<LinearLayout |
||||
android:id="@+id/handle_bar" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="1mb" |
||||
/> |
||||
<RadioButton |
||||
android:layout_below="@+id/progressBar" |
||||
android:orientation="horizontal" |
||||
> |
||||
<TextView |
||||
android:id="@+id/speed" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="16dp" |
||||
android:text="@{speed}" |
||||
android:textColor="@color/black" |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/start" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="开始" |
||||
style="?buttonBarButtonStyle" |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/stop" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="暂停" |
||||
style="?buttonBarButtonStyle" |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/cancel" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:onClick="onClick" |
||||
android:text="删除任务" |
||||
style="?buttonBarButtonStyle" |
||||
/> |
||||
</LinearLayout> |
||||
|
||||
<TextView |
||||
android:id="@+id/speed_hint" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="2mb" |
||||
android:layout_below="@+id/handle_bar" |
||||
/> |
||||
|
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
<RadioGroup |
||||
android:id="@+id/speeds" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="max" |
||||
/> |
||||
android:layout_below="@+id/speed_hint" |
||||
android:orientation="horizontal" |
||||
android:visibility="gone" |
||||
> |
||||
|
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="256kb" |
||||
/> |
||||
|
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="512kb" |
||||
/> |
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="1mb" |
||||
/> |
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="2mb" |
||||
/> |
||||
|
||||
<RadioButton |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:text="max" |
||||
/> |
||||
|
||||
</RadioGroup> |
||||
</RadioGroup> |
||||
|
||||
</RelativeLayout> |
||||
</RelativeLayout> |
||||
</layout> |
||||
|
@ -1,12 +1,35 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:bind="http://schemas.android.com/apk/res-auto" |
||||
> |
||||
|
||||
<data> |
||||
<variable |
||||
name="fileSize" |
||||
type="String" |
||||
/> |
||||
<variable |
||||
name="speed" |
||||
type="String" |
||||
/> |
||||
<variable |
||||
name="progress" |
||||
type="int" |
||||
/> |
||||
</data> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical" |
||||
> |
||||
|
||||
<include layout="@layout/dialog_download"/> |
||||
<include |
||||
layout="@layout/dialog_download" |
||||
bind:fileSize="@{fileSize}" |
||||
bind:progress="@{progress}" |
||||
bind:speed="@{speed}" |
||||
/> |
||||
|
||||
</LinearLayout> |
||||
</layout> |
||||
|
Loading…
Reference in new issue