diff --git a/app/build.gradle b/app/build.gradle
index f5d01443..cbb42cdc 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,36 +1,41 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 'Google Inc.:Google APIs:23'
- buildToolsVersion "23.0.2"
+ compileSdkVersion 'Google Inc.:Google APIs:23'
+ buildToolsVersion "23.0.2"
- defaultConfig {
- applicationId "com.example.arial.downloaddemo"
- minSdkVersion 15
- targetSdkVersion 23
- versionCode 1
- versionName "1.0"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
+ defaultConfig {
+ applicationId "com.arialyy.simple"
+ minSdkVersion 15
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
+ }
- dataBinding {
- enabled = true
- }
+ dataBinding {
+ enabled = true
+ }
+
+ packagingOptions {
+ exclude 'META-INF/services/javax.annotation.processing.Processor'
+ }
}
dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- testCompile 'junit:junit:4.12'
- compile 'com.android.support:appcompat-v7:23.+'
- compile 'com.android.support:design:23.+'
- compile 'com.jakewharton:butterknife:7.0.1'
- compile 'com.google.code.gson:gson:2.7'
- compile 'com.squareup.okhttp3:okhttp:3.2.0'
- compile 'com.arialyy.frame:MVVM2:2.2.0'
- compile project(':downloadutil')
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:23.+'
+ compile 'com.android.support:design:23.+'
+ compile 'com.jakewharton:butterknife:7.0.1'
+ compile 'com.google.code.gson:gson:2.7'
+ compile 'com.squareup.okhttp3:okhttp:3.2.0'
+ compile 'com.arialyy.frame:MVVM2:2.2.0'
+ compile 'com.arialyy.absadapter:AbsAdapter:1.1.2'
+ compile project(':downloadutil')
}
diff --git a/app/src/androidTest/java/com/example/arial/downloaddemo/ApplicationTest.java b/app/src/androidTest/java/com/example/arial/downloaddemo/ApplicationTest.java
index d9b0087c..b0b6aa45 100644
--- a/app/src/androidTest/java/com/example/arial/downloaddemo/ApplicationTest.java
+++ b/app/src/androidTest/java/com/example/arial/downloaddemo/ApplicationTest.java
@@ -7,7 +7,7 @@ import android.test.ApplicationTestCase;
* Testing Fundamentals
*/
public class ApplicationTest extends ApplicationTestCase {
- public ApplicationTest() {
- super(Application.class);
- }
+ public ApplicationTest() {
+ super(Application.class);
+ }
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8dbe4290..bdcd4fb9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,25 +1,28 @@
-
-
-
-
-
-
-
+ package="com.arialyy.simple">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/arialyy/simple/activity/MainActivity.java b/app/src/main/java/com/arialyy/simple/activity/MainActivity.java
new file mode 100644
index 00000000..3dc93dc0
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/activity/MainActivity.java
@@ -0,0 +1,22 @@
+package com.arialyy.simple.activity;
+
+import android.support.v7.widget.RecyclerView;
+import butterknife.Bind;
+import com.arialyy.simple.R;
+import com.arialyy.simple.base.BaseActivity;
+import com.arialyy.simple.databinding.ActivityMainBinding;
+
+/**
+ * Created by Lyy on 2016/9/27.
+ */
+public class MainActivity extends BaseActivity {
+ @Bind(R.id.list)
+ RecyclerView mList;
+
+ @Override protected int setLayoutId() {
+ return R.layout.activity_main;
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/example/arial/downloaddemo/MainActivity.java b/app/src/main/java/com/arialyy/simple/activity/SimpleTestActivity.java
similarity index 82%
rename from app/src/main/java/com/example/arial/downloaddemo/MainActivity.java
rename to app/src/main/java/com/arialyy/simple/activity/SimpleTestActivity.java
index 12f5c03b..3f103496 100644
--- a/app/src/main/java/com/example/arial/downloaddemo/MainActivity.java
+++ b/app/src/main/java/com/arialyy/simple/activity/SimpleTestActivity.java
@@ -1,23 +1,24 @@
-package com.example.arial.downloaddemo;
+package com.arialyy.simple.activity;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
-import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
-
+import butterknife.Bind;
import com.arialyy.downloadutil.util.DownLoadUtil;
import com.arialyy.downloadutil.util.Util;
-
+import com.arialyy.simple.R;
+import com.arialyy.simple.base.BaseActivity;
+import com.arialyy.simple.databinding.ActivitySimpleBinding;
import java.net.HttpURLConnection;
-public class MainActivity extends AppCompatActivity {
+public class SimpleTestActivity extends BaseActivity {
private static final int DOWNLOAD_PRE = 0x01;
private static final int DOWNLOAD_STOP = 0x02;
private static final int DOWNLOAD_FAILE = 0x03;
@@ -30,6 +31,7 @@ public class MainActivity extends AppCompatActivity {
private DownLoadUtil mUtil;
private Button mStart, mStop, mCancel;
private TextView mSize;
+ @Bind(R.id.toolbar) Toolbar toolbar;
private Handler mUpdateHandler = new Handler() {
@Override public void handleMessage(Message msg) {
@@ -40,26 +42,26 @@ public class MainActivity extends AppCompatActivity {
mStart.setEnabled(false);
break;
case DOWNLOAD_FAILE:
- Toast.makeText(MainActivity.this, "下载失败", Toast.LENGTH_SHORT).show();
+ Toast.makeText(SimpleTestActivity.this, "下载失败", Toast.LENGTH_SHORT).show();
break;
case DOWNLOAD_STOP:
- Toast.makeText(MainActivity.this, "暂停下载", Toast.LENGTH_SHORT).show();
+ Toast.makeText(SimpleTestActivity.this, "暂停下载", Toast.LENGTH_SHORT).show();
mStart.setText("恢复");
mStart.setEnabled(true);
break;
case DOWNLOAD_CANCEL:
mPb.setProgress(0);
- Toast.makeText(MainActivity.this, "取消下载", Toast.LENGTH_SHORT).show();
+ Toast.makeText(SimpleTestActivity.this, "取消下载", Toast.LENGTH_SHORT).show();
mStart.setEnabled(true);
mStart.setText("开始");
break;
case DOWNLOAD_RESUME:
- Toast.makeText(MainActivity.this, "恢复下载,恢复位置 ==> " + Util.formatFileSize((Long) msg.obj),
+ Toast.makeText(SimpleTestActivity.this, "恢复下载,恢复位置 ==> " + Util.formatFileSize((Long) msg.obj),
Toast.LENGTH_SHORT).show();
mStart.setEnabled(false);
break;
case DOWNLOAD_COMPLETE:
- Toast.makeText(MainActivity.this, "下载完成", Toast.LENGTH_SHORT).show();
+ Toast.makeText(SimpleTestActivity.this, "下载完成", Toast.LENGTH_SHORT).show();
mStart.setEnabled(true);
mCancel.setEnabled(false);
mStop.setEnabled(false);
@@ -70,8 +72,16 @@ public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+
+ init();
+ }
+
+ @Override protected int setLayoutId() {
+ return R.layout.activity_simple;
+ }
+
+ @Override protected void init(Bundle savedInstanceState) {
+ super.init(savedInstanceState);
setSupportActionBar(toolbar);
init();
}
diff --git a/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java b/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
new file mode 100644
index 00000000..949b3cf6
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
@@ -0,0 +1,72 @@
+package com.arialyy.simple.adapter;
+
+import android.content.Context;
+import android.util.SparseArray;
+import android.view.View;
+import android.widget.Button;
+import butterknife.Bind;
+import com.arialyy.absadapter.common.AbsHolder;
+import com.arialyy.absadapter.recycler_view.AbsRVAdapter;
+import com.arialyy.downloadutil.entity.DownloadEntity;
+import com.arialyy.simple.R;
+import com.arialyy.simple.widget.HorizontalProgressBarWithNumber;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Lyy on 2016/9/27.
+ * 下载列表适配器
+ */
+public class DownloadAdapter extends AbsRVAdapter {
+ private static final String TAG = "DownloadAdapter";
+ private Map mProgress = new HashMap<>();
+ private SparseArray mPositions = new SparseArray<>();
+
+ public DownloadAdapter(Context context, List data) {
+ super(context, data);
+ int i = 0;
+ for (DownloadEntity entity : data) {
+ mProgress.put(entity.getDownloadUrl(), entity.getCurrentProgress());
+ mPositions.append(i, entity.getDownloadUrl());
+ i++;
+ }
+ }
+
+ @Override protected MyHolder getViewHolder(View convertView, int viewType) {
+ return new MyHolder(convertView);
+ }
+
+ @Override protected int setLayoutId(int type) {
+ return R.layout.item_download;
+ }
+
+ public synchronized void setProgress(String url, long currentPosition) {
+ mProgress.put(url, currentPosition);
+ notifyItemChanged(indexItem(url));
+ }
+
+ private int indexItem(String url) {
+ return mPositions.indexOfValue(url);
+ }
+
+ @Override protected void bindData(MyHolder holder, int position, DownloadEntity item) {
+ //holder.progress.setProgress(item.getCurrentProgress());
+ long size = item.getFileSize();
+ int current = 0;
+ if (size == 0){
+ current = 0;
+ }
+ current = (int) (mProgress.get(item.getDownloadUrl()) * 100 / item.getFileSize());
+ holder.progress.setProgress(current);
+ }
+
+ class MyHolder extends AbsHolder {
+ @Bind(R.id.progressBar) HorizontalProgressBarWithNumber progress;
+ @Bind(R.id.bt) Button bt;
+
+ public MyHolder(View itemView) {
+ super(itemView);
+ }
+ }
+}
diff --git a/app/src/main/java/com/arialyy/simple/base/BaseActivity.java b/app/src/main/java/com/arialyy/simple/base/BaseActivity.java
new file mode 100644
index 00000000..6a1013bd
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/base/BaseActivity.java
@@ -0,0 +1,18 @@
+package com.arialyy.simple.base;
+
+import android.databinding.ViewDataBinding;
+import android.os.Bundle;
+import com.arialyy.frame.core.AbsActivity;
+
+/**
+ * Created by Lyy on 2016/9/27.
+ */
+public abstract class BaseActivity extends AbsActivity {
+ @Override protected void dataCallback(int result, Object data) {
+
+ }
+
+ @Override protected void init(Bundle savedInstanceState) {
+ super.init(savedInstanceState);
+ }
+}
diff --git a/app/src/main/java/com/arialyy/simple/base/BaseApplication.java b/app/src/main/java/com/arialyy/simple/base/BaseApplication.java
new file mode 100644
index 00000000..df28de99
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/base/BaseApplication.java
@@ -0,0 +1,14 @@
+package com.arialyy.simple.base;
+
+import android.app.Application;
+import com.arialyy.frame.core.AbsFrame;
+
+/**
+ * Created by Lyy on 2016/9/27.
+ */
+public class BaseApplication extends Application {
+ @Override public void onCreate() {
+ super.onCreate();
+ AbsFrame.init(this);
+ }
+}
diff --git a/app/src/main/java/com/arialyy/simple/base/BaseModule.java b/app/src/main/java/com/arialyy/simple/base/BaseModule.java
new file mode 100644
index 00000000..87994558
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/base/BaseModule.java
@@ -0,0 +1,13 @@
+package com.arialyy.simple.base;
+
+import android.content.Context;
+import com.arialyy.frame.module.AbsModule;
+
+/**
+ * Created by Lyy on 2016/9/27.
+ */
+public class BaseModule extends AbsModule{
+ public BaseModule(Context context) {
+ super(context);
+ }
+}
diff --git a/app/src/main/java/com/arialyy/simple/module/DownloadModule.java b/app/src/main/java/com/arialyy/simple/module/DownloadModule.java
new file mode 100644
index 00000000..d2384e58
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/module/DownloadModule.java
@@ -0,0 +1,21 @@
+//package com.arialyy.simple.module;
+//
+//import android.content.Context;
+//import com.arialyy.downloadutil.entity.DownloadEntity;
+//import com.arialyy.simple.base.BaseModule;
+//import java.util.ArrayList;
+//import java.util.List;
+//
+///**
+// * Created by Lyy on 2016/9/27.
+// */
+//public class DownloadModule extends BaseModule{
+// public DownloadModule(Context context) {
+// super(context);
+// }
+//
+// public List getDownloadData(){
+// List list = new ArrayList<>();
+// DownloadEntity entity
+// }
+//}
diff --git a/app/src/main/java/com/arialyy/simple/widget/HorizontalProgressBarWithNumber.java b/app/src/main/java/com/arialyy/simple/widget/HorizontalProgressBarWithNumber.java
new file mode 100644
index 00000000..daf84fe6
--- /dev/null
+++ b/app/src/main/java/com/arialyy/simple/widget/HorizontalProgressBarWithNumber.java
@@ -0,0 +1,180 @@
+package com.arialyy.simple.widget;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.widget.ProgressBar;
+import com.arialyy.simple.R;
+
+public class HorizontalProgressBarWithNumber extends ProgressBar {
+ private static final int DEFAULT_TEXT_SIZE = 10;
+ private static final int DEFAULT_TEXT_COLOR = 0XFFFC00D1;
+ private static final int DEFAULT_COLOR_UNREACHED_COLOR = 0xFFd3d6da;
+ private static final int DEFAULT_HEIGHT_REACHED_PROGRESS_BAR = 2;
+ private static final int DEFAULT_HEIGHT_UNREACHED_PROGRESS_BAR = 2;
+ private static final int DEFAULT_SIZE_TEXT_OFFSET = 10;
+ /**
+ * painter of all drawing things
+ */
+ protected Paint mPaint = new Paint();
+ /**
+ * color of progress number
+ */
+ protected int mTextColor = DEFAULT_TEXT_COLOR;
+ /**
+ * size of text (sp)
+ */
+ protected int mTextSize = sp2px(DEFAULT_TEXT_SIZE);
+ /**
+ * offset of draw progress
+ */
+ protected int mTextOffset = dp2px(DEFAULT_SIZE_TEXT_OFFSET);
+ /**
+ * height of reached progress bar
+ */
+ protected int mReachedProgressBarHeight = dp2px(DEFAULT_HEIGHT_REACHED_PROGRESS_BAR);
+ /**
+ * color of reached bar
+ */
+ protected int mReachedBarColor = DEFAULT_TEXT_COLOR;
+ /**
+ * color of unreached bar
+ */
+ protected int mUnReachedBarColor = DEFAULT_COLOR_UNREACHED_COLOR;
+ /**
+ * height of unreached progress bar
+ */
+ protected int mUnReachedProgressBarHeight = dp2px(DEFAULT_HEIGHT_UNREACHED_PROGRESS_BAR);
+ /**
+ * view width except padding
+ */
+ protected int mRealWidth;
+ protected boolean mIfDrawText = true;
+ protected static final int VISIBLE = 0;
+
+ public HorizontalProgressBarWithNumber(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public HorizontalProgressBarWithNumber(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ obtainStyledAttributes(attrs);
+ mPaint.setTextSize(mTextSize);
+ mPaint.setColor(mTextColor);
+ }
+
+ @Override protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int width = MeasureSpec.getSize(widthMeasureSpec);
+ int height = measureHeight(heightMeasureSpec);
+ setMeasuredDimension(width, height);
+ mRealWidth = getMeasuredWidth() - getPaddingRight() - getPaddingLeft();
+ }
+
+ private int measureHeight(int measureSpec) {
+ int result = 0;
+ int specMode = MeasureSpec.getMode(measureSpec);
+ int specSize = MeasureSpec.getSize(measureSpec);
+ if (specMode == MeasureSpec.EXACTLY) {
+ result = specSize;
+ } else {
+ float textHeight = (mPaint.descent() - mPaint.ascent());
+ result = (int) (getPaddingTop() + getPaddingBottom() + Math.max(
+ Math.max(mReachedProgressBarHeight, mUnReachedProgressBarHeight), Math.abs(textHeight)));
+ if (specMode == MeasureSpec.AT_MOST) {
+ result = Math.min(result, specSize);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * get the styled attributes
+ */
+ private void obtainStyledAttributes(AttributeSet attrs) {
+ // init values from custom attributes
+ final TypedArray attributes =
+ getContext().obtainStyledAttributes(attrs, R.styleable.HorizontalProgressBarWithNumber);
+ mTextColor =
+ attributes.getColor(R.styleable.HorizontalProgressBarWithNumber_progress_text_color,
+ DEFAULT_TEXT_COLOR);
+ mTextSize = (int) attributes.getDimension(
+ R.styleable.HorizontalProgressBarWithNumber_progress_text_size, mTextSize);
+ mReachedBarColor =
+ attributes.getColor(R.styleable.HorizontalProgressBarWithNumber_progress_reached_color,
+ mTextColor);
+ mUnReachedBarColor =
+ attributes.getColor(R.styleable.HorizontalProgressBarWithNumber_progress_unreached_color,
+ DEFAULT_COLOR_UNREACHED_COLOR);
+ mReachedProgressBarHeight = (int) attributes.getDimension(
+ R.styleable.HorizontalProgressBarWithNumber_progress_reached_bar_height,
+ mReachedProgressBarHeight);
+ mUnReachedProgressBarHeight = (int) attributes.getDimension(
+ R.styleable.HorizontalProgressBarWithNumber_progress_unreached_bar_height,
+ mUnReachedProgressBarHeight);
+ mTextOffset = (int) attributes.getDimension(
+ R.styleable.HorizontalProgressBarWithNumber_progress_text_offset, mTextOffset);
+ int textVisible =
+ attributes.getInt(R.styleable.HorizontalProgressBarWithNumber_progress_text_visibility,
+ VISIBLE);
+ if (textVisible != VISIBLE) {
+ mIfDrawText = false;
+ }
+ attributes.recycle();
+ }
+
+ @Override protected synchronized void onDraw(Canvas canvas) {
+ canvas.save();
+ canvas.translate(getPaddingLeft(), getHeight() / 2);
+ boolean noNeedBg = false;
+ float radio = getProgress() * 1.0f / getMax();
+ float progressPosX = (int) (mRealWidth * radio);
+ String text = getProgress() + "%";
+ // mPaint.getTextBounds(text, 0, text.length(), mTextBound);
+ float textWidth = mPaint.measureText(text);
+ float textHeight = (mPaint.descent() + mPaint.ascent()) / 2;
+ if (progressPosX + textWidth > mRealWidth) {
+ progressPosX = mRealWidth - textWidth;
+ noNeedBg = true;
+ }
+ // draw reached bar
+ float endX = progressPosX - mTextOffset / 2;
+ if (endX > 0) {
+ mPaint.setColor(mReachedBarColor);
+ mPaint.setStrokeWidth(mReachedProgressBarHeight);
+ canvas.drawLine(0, 0, endX, 0, mPaint);
+ }
+ // draw progress bar
+ // measure text bound
+ if (mIfDrawText) {
+ mPaint.setColor(mTextColor);
+ canvas.drawText(text, progressPosX, -textHeight, mPaint);
+ }
+ // draw unreached bar
+ if (!noNeedBg) {
+ float start = progressPosX + mTextOffset / 2 + textWidth;
+ mPaint.setColor(mUnReachedBarColor);
+ mPaint.setStrokeWidth(mUnReachedProgressBarHeight);
+ canvas.drawLine(start, 0, mRealWidth, 0, mPaint);
+ }
+ canvas.restore();
+ }
+
+ /**
+ * dp 2 px
+ */
+ protected int dp2px(int dpVal) {
+ return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpVal,
+ getResources().getDisplayMetrics());
+ }
+
+ /**
+ * sp 2 px
+ */
+ protected int sp2px(int spVal) {
+ return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spVal,
+ getResources().getDisplayMetrics());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 41173feb..9945a899 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,35 +1,17 @@
-
+
-
+
+
+ android:layout_height="match_parent"
+ />
-
-
-
-
-
-
-
-
-
+
+
diff --git a/app/src/main/res/layout/activity_simple.xml b/app/src/main/res/layout/activity_simple.xml
new file mode 100644
index 00000000..87289c58
--- /dev/null
+++ b/app/src/main/res/layout/activity_simple.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
deleted file mode 100644
index 481a2119..00000000
--- a/app/src/main/res/layout/content_main.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/content_simple.xml b/app/src/main/res/layout/content_simple.xml
new file mode 100644
index 00000000..017c1f04
--- /dev/null
+++ b/app/src/main/res/layout/content_simple.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_download.xml b/app/src/main/res/layout/item_download.xml
new file mode 100644
index 00000000..830dde58
--- /dev/null
+++ b/app/src/main/res/layout/item_download.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
index 53f10617..5db63c88 100644
--- a/app/src/main/res/menu/menu_main.xml
+++ b/app/src/main/res/menu/menu_main.xml
@@ -1,9 +1,10 @@
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
index 2ea3a226..69da9f7a 100644
--- a/app/src/main/res/values-v21/styles.xml
+++ b/app/src/main/res/values-v21/styles.xml
@@ -1,8 +1,9 @@
-
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
index 63fc8164..1e656d65 100644
--- a/app/src/main/res/values-w820dp/dimens.xml
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -1,6 +1,6 @@
-
- 64dp
+
+ 64dp
diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml
new file mode 100644
index 00000000..01357195
--- /dev/null
+++ b/app/src/main/res/values/attr.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 3ab3e9cb..5a077b3a 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,6 +1,6 @@
- #3F51B5
- #303F9F
- #FF4081
+ #3F51B5
+ #303F9F
+ #FF4081
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 812cb7be..ac0dbe70 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,6 +1,6 @@
-
- 16dp
- 16dp
- 16dp
+
+ 16dp
+ 16dp
+ 16dp
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2c97a77c..6f8c06c8 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,4 +1,4 @@
- DownloadDemo
- Settings
+ DownloadDemo
+ Settings
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 44f664f2..b1c33cc9 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,17 +1,20 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/example/arial/downloaddemo/ExampleUnitTest.java b/app/src/test/java/com/example/arial/downloaddemo/ExampleUnitTest.java
index 77bb252f..7916c764 100644
--- a/app/src/test/java/com/example/arial/downloaddemo/ExampleUnitTest.java
+++ b/app/src/test/java/com/example/arial/downloaddemo/ExampleUnitTest.java
@@ -2,14 +2,13 @@ package com.example.arial.downloaddemo;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
+ @Test public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
}
\ No newline at end of file