// Path: app/src/main/java/com/zsorg/neteasecloudmusic/presenters/ScanMusicPresenter.java
// public class ScanMusicPresenter {
// 
//     private final IScanMusicView iScanMusicView;
//     private final DiskMusicDao mScanMusicDao;
// 
//     public ScanMusicPresenter(IScanMusicView scanMusicView) {
//         iScanMusicView = scanMusicView;
//         mScanMusicDao = new DiskMusicDao(scanMusicView.getContext());
//     }
// 
//     public void scanMusic() {
// //        final PlaylistModel playlistModel = new PlaylistModel(iScanMusicView.getContext());
//         ScanMusicModel scanMusicModel = new ScanMusicModel();
//         scanMusicModel.setIsFilter60s(ConfigModel.getInstance(iScanMusicView.getContext()).isFilter60s());
//         scanMusicModel.scanMusicFile().observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber<MusicBean>() {
//             @Override
//             public void onSubscribe(Subscription s) {
//                 iScanMusicView.startScan();
//                 mScanMusicDao.clearAll();
//                 s.request(Integer.MAX_VALUE);
//             }
// 
//             @Override
//             public void onNext(MusicBean musicBean) {
//                 mScanMusicDao.addMusic(musicBean);
// //                playlistModel.addToPlaylist(CONST.TEMP_PLAYLIST_ID,musicBean.getPath());
//             }
// 
//             @Override
//             public void onError(Throwable t) {
//                 iScanMusicView.onError(t);
//             }
// 
//             @Override
//             public void onComplete() {
//                 iScanMusicView.finishScan();
//             }
//         });
// 
//     }
// 
// }
// 
// Path: app/src/main/java/com/zsorg/neteasecloudmusic/views/IScanMusicView.java
// public interface IScanMusicView {
//     void startScan();
// 
//     void finishScan();
// 
//     void onError(Throwable throwable);
// 
//     Context getContext();
// }


import android.Manifest;
import android.content.Context;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;
import com.zsorg.neteasecloudmusic.R;
import com.zsorg.neteasecloudmusic.presenters.ScanMusicPresenter;
import com.zsorg.neteasecloudmusic.views.IScanMusicView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
package com.zsorg.neteasecloudmusic.activities;




public class ScanMusicActivity extends AppCompatActivity implements IScanMusicView{

    private final int radius = 40;

    @BindView(R.id.iv_search)
    ImageView ivSearch;
    @BindView(R.id.iv_scan_effect)
    ImageView ivScanEffect;
    @BindView(R.id.tv_back)
    TextView tvBack;
    @BindView(R.id.tv_scan_or_cancel)
    TextView tvScanOrCancel;
    @BindView(R.id.tv_scan)
    TextView tvScan;
    private ValueAnimator searchAnimation;
    private TranslateAnimation scanAnimation;
// Path: app/src/main/java/com/zsorg/neteasecloudmusic/presenters/ScanMusicPresenter.java
// public class ScanMusicPresenter {
// 
//     private final IScanMusicView iScanMusicView;
//     private final DiskMusicDao mScanMusicDao;
// 
//     public ScanMusicPresenter(IScanMusicView scanMusicView) {
//         iScanMusicView = scanMusicView;
//         mScanMusicDao = new DiskMusicDao(scanMusicView.getContext());
//     }
// 
//     public void scanMusic() {
// //        final PlaylistModel playlistModel = new PlaylistModel(iScanMusicView.getContext());
//         ScanMusicModel scanMusicModel = new ScanMusicModel();
//         scanMusicModel.setIsFilter60s(ConfigModel.getInstance(iScanMusicView.getContext()).isFilter60s());
//         scanMusicModel.scanMusicFile().observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber<MusicBean>() {
//             @Override
//             public void onSubscribe(Subscription s) {
//                 iScanMusicView.startScan();
//                 mScanMusicDao.clearAll();
//                 s.request(Integer.MAX_VALUE);
//             }
// 
//             @Override
//             public void onNext(MusicBean musicBean) {
//                 mScanMusicDao.addMusic(musicBean);
// //                playlistModel.addToPlaylist(CONST.TEMP_PLAYLIST_ID,musicBean.getPath());
//             }
// 
//             @Override
//             public void onError(Throwable t) {
//                 iScanMusicView.onError(t);
//             }
// 
//             @Override
//             public void onComplete() {
//                 iScanMusicView.finishScan();
//             }
//         });
// 
//     }
// 
// }
// 
// Path: app/src/main/java/com/zsorg/neteasecloudmusic/views/IScanMusicView.java
// public interface IScanMusicView {
//     void startScan();
// 
//     void finishScan();
// 
//     void onError(Throwable throwable);
// 
//     Context getContext();
// }


// Path: app/src/main/java/com/zsorg/neteasecloudmusic/activities/ScanMusicActivity.java
import android.Manifest;
import android.content.Context;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;
import com.zsorg.neteasecloudmusic.R;
import com.zsorg.neteasecloudmusic.presenters.ScanMusicPresenter;
import com.zsorg.neteasecloudmusic.views.IScanMusicView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

package com.zsorg.neteasecloudmusic.activities;




public class ScanMusicActivity extends AppCompatActivity implements IScanMusicView{

    private final int radius = 40;

    @BindView(R.id.iv_search)
    ImageView ivSearch;
    @BindView(R.id.iv_scan_effect)
    ImageView ivScanEffect;
    @BindView(R.id.tv_back)
    TextView tvBack;
    @BindView(R.id.tv_scan_or_cancel)
    TextView tvScanOrCancel;
    @BindView(R.id.tv_scan)
    TextView tvScan;
    private ValueAnimator searchAnimation;
    private TranslateAnimation scanAnimation;
    private ScanMusicPresenter mPresenter;