任务组bug fix

This commit is contained in:
AriaLyy
2017-07-11 17:26:33 +08:00
parent bc48fd5b4d
commit 375eb25499
27 changed files with 523 additions and 240 deletions

View File

@@ -1,5 +1,21 @@
<?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"
@@ -9,10 +25,16 @@
<include layout="@layout/layout_bar"/>
<include layout="@layout/content_single"/>
<include
layout="@layout/content_single"
bind:fileSize="@{fileSize}"
bind:progress="@{progress}"
bind:speed="@{speed}"
/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
/>
</LinearLayout>
</layout>

View File

@@ -1,5 +1,22 @@
<?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>
<android.support.design.widget.CoordinatorLayout
xmlns:tools="http://schemas.android.com/tools"
@@ -18,7 +35,12 @@
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_single"/>
<include
layout="@layout/content_single"
bind:fileSize="@{fileSize}"
bind:progress="@{progress}"
bind:speed="@{speed}"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"

View File

@@ -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"
/>
<data>
<variable
name="fileSize"
type="String"
/>
<variable
name="speed"
type="String"
/>
<variable
name="progress"
type="int"
/>
</data>
<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"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/progressBar"
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"
>
<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"
android:progress="@{progress}"
style="?android:attr/progressBarStyleHorizontal"
/>
<TextView
android:id="@+id/speed"
android:id="@+id/size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:text="0kb/s"
android:textColor="@color/black"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/progressBar"
android:layout_marginRight="16dp"
android:text="@{fileSize}"
android:textSize="16sp"
/>
<Button
android:id="@+id/start"
android:layout_width="0dp"
<LinearLayout
android:id="@+id/handle_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="onClick"
android:text="开始"
style="?buttonBarButtonStyle"
/>
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/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/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/cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="onClick"
android:text="删除任务"
style="?buttonBarButtonStyle"
/>
</LinearLayout>
<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"
/>
<TextView
android:id="@+id/speed_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/handle_bar"
/>
<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>
<RadioGroup
android:visibility="gone"
android:id="@+id/speeds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/speed_hint"
android:orientation="horizontal"
>
<RadioButton
<TextView
android:id="@+id/speed_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="256kb"
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="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"
/>
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="max"
/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="256kb"
/>
</RadioGroup>
<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"
/>
</RelativeLayout>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="max"
/>
</RadioGroup>
</RelativeLayout>
</layout>

View File

@@ -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>

View File

@@ -46,7 +46,7 @@
<string-array name="group_urls">
<item>http://img.sc115.com/uploads/allimg/110420/20110420225600154.jpg</item>
<item>https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQv8s5M31tFNvbjtGgxqmx14eh2h2651gkbrx-kN0cNYPD0qvRi</item>
<item>http://img05.tooopen.com/images/20160121/tooopen_sy_155168162826.jpg</item>
<item>http://img03.tooopen.com/images/20130811/tooopen_15265353.jpg</item>
<!--<item></item>-->
<!--<item></item>-->