修复数据错乱的bug
This commit is contained in:
19
app/src/main/res/layout/activity_download.xml
Normal file
19
app/src/main/res/layout/activity_download.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.arial.test.MainActivity"
|
||||
>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
@ -8,7 +8,7 @@
|
||||
>
|
||||
<fragment
|
||||
android:id="@+id/fragment1"
|
||||
android:name="com.arialyy.simple.fragment.DownloadFragment"
|
||||
android:name="com.arialyy.simple.fragment_task.DownloadFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
@ -15,8 +15,8 @@
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:layout_above="@+id/num"
|
||||
android:layout_below="@+id/toolbar"
|
||||
/>
|
||||
|
||||
<Button
|
||||
@ -43,14 +43,14 @@
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_task"
|
||||
android:id="@+id/turn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="16dp"
|
||||
android:onClick="onClick"
|
||||
android:text="添加任务"
|
||||
android:text="下载列表"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="com.arialyy.simple.activity.SingleTaskActivity"
|
||||
tools:context="com.arialyy.simple.single_task.SingleTaskActivity"
|
||||
>
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
|
@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="com.arialyy.simple.activity.SingleTaskActivity"
|
||||
tools:context="com.arialyy.simple.single_task.SingleTaskActivity"
|
||||
tools:showIn="@layout/activity_single"
|
||||
>
|
||||
|
||||
|
@ -5,54 +5,86 @@
|
||||
android:padding="16dp"
|
||||
>
|
||||
|
||||
<com.arialyy.simple.widget.HorizontalProgressBarWithNumber
|
||||
android:id="@+id/progressBar"
|
||||
<RelativeLayout
|
||||
android:id="@+id/bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_toLeftOf="@+id/bt"
|
||||
android:max="100"
|
||||
>
|
||||
|
||||
<com.arialyy.simple.widget.HorizontalProgressBarWithNumber
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_toLeftOf="@+id/bt"
|
||||
android:max="100"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fileSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/progressBar"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="0mb/0mb"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="开始"
|
||||
style="?buttonBarButtonStyle"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/fileSize"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="0kb/s"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/del"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignRight="@+id/progressBar"
|
||||
android:layout_alignTop="@+id/fileSize"
|
||||
android:text="删除"
|
||||
android:textColor="@color/bt_selector_cancel"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/bar"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="name"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fileSize"
|
||||
android:id="@+id/download_url"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/progressBar"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="0mb/0mb"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="开始"
|
||||
style="?buttonBarButtonStyle"
|
||||
android:layout_below="@+id/name"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speed"
|
||||
android:id="@+id/download_path"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/fileSize"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="0kb/s"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/del"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignRight="@+id/progressBar"
|
||||
android:layout_alignTop="@+id/fileSize"
|
||||
android:text="删除"
|
||||
android:textColor="@color/bt_selector_cancel"
|
||||
android:layout_below="@+id/download_url"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
40
app/src/main/res/layout/item_file_list.xml
Normal file
40
app/src/main/res/layout/item_file_list.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="name"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/download_url"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/name"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/download_path"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/download_url"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/download_path"
|
||||
android:text="点击下载"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
@ -15,4 +15,21 @@
|
||||
<!--<item>http://static.gaoshouyou.com/d/6e/e5/ff6ecaaf45e532e6d07747af82357472.apk</item>-->
|
||||
<!--<item>http://static.gaoshouyou.com/d/36/69/2d3699acfa69e9632262442c46516ad8.apk</item>-->
|
||||
</string-array>
|
||||
|
||||
<string-array name="file_nams">
|
||||
<item>阴阳师</item>
|
||||
<item>奇迹暖暖</item>
|
||||
<item>幻影纹章</item>
|
||||
<item>史上最坑爹的游戏10</item>
|
||||
<item>鲜果消消乐</item>
|
||||
|
||||
</string-array>
|
||||
<string-array name="download_url">
|
||||
<item>http://g37.gdl.netease.com/onmyoji_netease.apk</item>
|
||||
<item>http://static.gaoshouyou.com/d/eb/f2/dfeba30541f209ab8a50d847fc1661ce.apk</item>
|
||||
<item>http://rs.0.gaoshouyou.com/d/51/46/58514d126c46b8a3f27fc8c7db3b09ec.apk</item>
|
||||
<item>http://rs.0.gaoshouyou.com/d/23/69/07238f952669727878d7a0e180534c8b.apk</item>
|
||||
<item>http://rs.0.gaoshouyou.com/d/e7/3d/73e716d3353de5b479fcf7da8d36a5ef.apk</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user