| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.ScreenUtils; |
| | | import com.lcjian.library.util.common.BitmapUtils; |
| | | import com.lcjian.library.util.common.DrawableUtils; |
| | |
| | | setContentView(R.layout.activity_splash); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | |
| | | if(ConfigUtil.isAiDaoMode(this)){ |
| | | if (ConfigUtil.isAiDaoMode(this)) { |
| | | AiDaoUtil.setAiDaoMode(this); |
| | | } |
| | | |
| | |
| | | iv_bg.setImageBitmap(bitmap1); |
| | | } |
| | | |
| | | private void init(){ |
| | | private void init() { |
| | | SharedPreferences preferences = getSharedPreferences("link_page", |
| | | Context.MODE_PRIVATE); |
| | | isInput = preferences.getBoolean("isInput", false); |
| | |
| | | vg_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | init(); |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mGMAdSplashManager != null) { |
| | | // mGMAdSplashManager.destroy(); |
| | | // mGMAdSplashManager.destroy(); |
| | | } |
| | | } |
| | | |
| | |
| | | if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PERMISSION_GRANTED) { |
| | | SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE); |
| | | //是否需要再次请求权限 |
| | | if (sharedPreferences.getBoolean("show", true)) |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | else { |
| | | if (sharedPreferences.getBoolean("show", true)) { |
| | | String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"); |
| | | if ("huawei".equalsIgnoreCase(channel)) { |
| | | next(); |
| | | } else { |
| | | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE); |
| | | iv_bg.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | findViewById(R.id.ll_authority_notify).setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | next(); |
| | | } |
| | | } else { |
| | |
| | | private void next() { |
| | | //百度内容联盟 |
| | | // MobadsPermissionSettings.setPermissionReadDeviceID(true); |
| | | iv_bg.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | findViewById(R.id.ll_authority_notify).setVisibility(View.GONE); |
| | | } |
| | | }); |
| | | |
| | | if (!BeibeiVideoApplication.IsInited()) { |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application, new BeibeiVideoApplication.InitListener() { |
| | | @Override |
| | |
| | | |
| | | // 设置哀悼模式 |
| | | ConfigUtil.saveAiDaoMode(getApplicationContext(), data.optBoolean("aiDaoMode")); |
| | | |
| | | |
| | | |
| | | |
| | | //保存免广告权益持续时间 |
| | |
| | | if (requestCode == REQUEST_CODE) { |
| | | for (int i = 0; i < permissions.length; i++) { |
| | | if (grantResults[i] == PERMISSION_GRANTED) {//选择了“始终允许” |
| | | |
| | | init(); |
| | | } else { |
| | | //拒绝了授权 |