|
|
@@ -97,10 +97,6 @@ public class MainActivity extends BaseActivity<MainPresenter> implements MainCon |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 初始化ViewPager数据 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void initViewPager() { |
|
|
private void initViewPager() { |
|
|
List<Fragment> fragments = new ArrayList<>(); |
|
|
List<Fragment> fragments = new ArrayList<>(); |
|
|
fragments.add(FragmentFactory.getInstance().getExperienceFragment()); |
|
|
fragments.add(FragmentFactory.getInstance().getExperienceFragment()); |
|
|
@@ -159,10 +155,10 @@ public class MainActivity extends BaseActivity<MainPresenter> implements MainCon |
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
|
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
|
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
|
|
Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.mindspore.himindspore.fileprovider", |
|
|
Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.mindspore.himindspore.fileprovider", |
|
|
new File(getApkPath(), "HiMindSpore.apk")); |
|
|
|
|
|
|
|
|
new File(getApkPath(), "MindSpore_inhand.apk")); |
|
|
intent.setDataAndType(contentUri, "application/vnd.android.package-archive"); |
|
|
intent.setDataAndType(contentUri, "application/vnd.android.package-archive"); |
|
|
} else { |
|
|
} else { |
|
|
intent.setDataAndType(Uri.fromFile(new File(getApkPath(), "HiMindSpore.apk")), "application/vnd.android.package-archive"); |
|
|
|
|
|
|
|
|
intent.setDataAndType(Uri.fromFile(new File(getApkPath(), "MindSpore_inhand.apk")), "application/vnd.android.package-archive"); |
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|
|
} |
|
|
} |
|
|
startActivity(intent); |
|
|
startActivity(intent); |
|
|
@@ -192,7 +188,7 @@ public class MainActivity extends BaseActivity<MainPresenter> implements MainCon |
|
|
progressDialog.setProgressNumberFormat("%1d Mb/%2d Mb"); |
|
|
progressDialog.setProgressNumberFormat("%1d Mb/%2d Mb"); |
|
|
progressDialog.setProgress(0); |
|
|
progressDialog.setProgress(0); |
|
|
progressDialog.show(); |
|
|
progressDialog.show(); |
|
|
presenter.downloadApk(getApkPath(), "HiMindSpore.apk", new FileDownLoadObserver<File>() { |
|
|
|
|
|
|
|
|
presenter.downloadApk(getApkPath(), "MindSpore_inhand.apk", new FileDownLoadObserver<File>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onDownLoadSuccess(File file) { |
|
|
public void onDownLoadSuccess(File file) { |
|
|
downSuccess(); |
|
|
downSuccess(); |