@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    url = getIntent().getStringExtra("url");
    title = url;
    type = getIntent().getStringExtra("type");
    isFromVideoActivity = getIntent().getBooleanExtra(VideoActivity.FROM_VIDEO_ACTIVITY, false);
    AppUtils.switchLanguage(getApplicationContext());
    this.setContentView(R.layout.player_on_line_video);
    this.initWebView();
    this.getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
    progressView = (ImageView) findViewById(R.id.progress);
    progressDrawable = AppUtils.getVideoLoadProgress(this);
    progressView.setImageDrawable(progressDrawable);
    progressLayout = findViewById(R.id.progress_layout);
    btnBack = (ImageButton) findViewById(R.id.titlebar_layout);
    btnBack.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
          }
        });
    if (Build.VERSION.SDK_INT < 19) mHandler.post(runnable);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
      getWindow()
          .getDecorView()
          .setSystemUiVisibility(
              View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
  }
Beispiel #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AppUtils.switchLanguage(getApplicationContext());
    exitWithUserOption = false;
    EventBus.getDefault().register(this);
    initSlidingMenu();
    setContentView(R.layout.activity_main);
    Trace.e(tag, getString(R.string.lang));
    fMgr = getSupportFragmentManager();
    imageLoader = BaseApplication.getImageLoader(this);
    options =
        new DisplayImageOptions.Builder()
            .bitmapConfig(Bitmap.Config.RGB_565)
            .showStubImage(R.drawable.tab_center_normal)
            .showImageForEmptyUri(R.drawable.tab_center_normal)
            .showImageOnFail(R.drawable.tab_center_normal)
            .cacheInMemory(true)
            .cacheOnDisc(true)
            .build();
    if (AppUtils.isLogin(this)) majorTeamGsonModel = AppSharePreferences.getMajorTeam(this);
    mTitleView = (TitleView) findViewById(R.id.titlebar_layout);
    mTitleView.initTitleBar(null, 0, 0);
    mTitleView.setRightMenuButton();
    mTitleView.setTitleViewListener(mTitleViewListener);
    dealBottomButtonsClickEvent();
    initFragment(savedInstanceState);
    if (majorTeamGsonModel != null && !TextUtils.isEmpty(majorTeamGsonModel.avatar)) {
      File file = DiskCacheUtils.findInCache(majorTeamGsonModel.avatar, imageLoader.getDiskCache());
      if (file == null || !file.exists()) {
        imageLoader.displayImage(majorTeamGsonModel.avatar, majorImageView, options);
      } else {
        majorImageView.setImageBitmap(BitmapFactory.decodeFile(file.getAbsolutePath()));
      }
    } else {
      if (AppSharePreferences.getFollowFlag(getApplicationContext())) {
        majorImageView.setImageResource(R.drawable.tab_center_notset_normal);
      } else {
        majorImageView.setImageResource(R.drawable.tab_center_normal);
      }
    }

    mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);

    AppService.startCheckVersion(this, false);
    mDownloadReceiver = new DownloadCompleteReceiver();
    registerReceiver(mDownloadReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
    FeedbackAgent agent = new FeedbackAgent(this);
    agent.sync();

    /*
     * if
     * (AppSharePreferences.getDefault().getBoolean("MAIN_TOURNAMENT_GUIDE",
     * true)) { startActivity(new Intent(MainActivity.this,
     * GuideActivity.class)); }
     */

  }