Merge remote-tracking branch 'origin/temp' into dev
This commit is contained in:
@ -67,7 +67,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
private boolean isNewFirstLaunch;
|
||||
|
||||
private final static int REQUEST_PERMISSION_TAG = 30001;
|
||||
private String[] permissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
private String[] mPermissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_PHONE_STATE};
|
||||
|
||||
public static Intent[] getRedirectIntents(Context context, Uri uri) {
|
||||
@ -155,7 +155,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
|
||||
if (isNewFirstLaunch && EasyPermissions.hasPermissions(this, permissions)) {
|
||||
if (isNewFirstLaunch && EasyPermissions.hasPermissions(this, mPermissions)) {
|
||||
launch();
|
||||
} else {
|
||||
return true;
|
||||
@ -222,7 +222,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
DownloadManager.getInstance(this).checkAll();
|
||||
|
||||
// 检查权限
|
||||
if (EasyPermissions.hasPermissions(this, permissions)) {
|
||||
if (EasyPermissions.hasPermissions(this, mPermissions)) {
|
||||
if (!isNewFirstLaunch) {
|
||||
long end = System.currentTimeMillis() - start;
|
||||
if (end < 2000) {
|
||||
@ -244,10 +244,10 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
@AfterPermissionGranted(REQUEST_PERMISSION_TAG)
|
||||
private void checkAndRequestPermission() {
|
||||
if (EasyPermissions.hasPermissions(this, permissions)) {
|
||||
if (EasyPermissions.hasPermissions(this, mPermissions)) {
|
||||
launch();
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, permissions, REQUEST_PERMISSION_TAG);
|
||||
ActivityCompat.requestPermissions(this, mPermissions, REQUEST_PERMISSION_TAG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,24 +364,24 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
private class GuidePagerAdapter extends PagerAdapter {
|
||||
|
||||
private int[] pics = {R.drawable.splash_01};
|
||||
private int[] mPics = {R.drawable.splash_01};
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return pics.length;
|
||||
return mPics.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
View view = View.inflate(container.getContext(), R.layout.splash_guide_item, null);
|
||||
ImageView ivImage = (ImageView) view.findViewById(R.id.splsh_guide_iv_image);
|
||||
ivImage.setImageResource(pics[position]);
|
||||
if (position == pics.length - 1) {
|
||||
ivImage.setImageResource(mPics[position]);
|
||||
if (position == mPics.length - 1) {
|
||||
TextView tvSkip = (TextView) view.findViewById(R.id.splsh_guide_tv_skip);
|
||||
tvSkip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (EasyPermissions.hasPermissions(SplashScreenActivity.this, permissions)) {
|
||||
if (EasyPermissions.hasPermissions(SplashScreenActivity.this, mPermissions)) {
|
||||
launch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user