示例#1
2
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   Log.d(TAG, "onWindowFocusChanged() hasFocus=" + hasFocus);
   super.onWindowFocusChanged(hasFocus);
   this.hasFocus = hasFocus;
   resumeIfHasFocus();
 }
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus) {
      // At this moment, status bar exists.
      // So, height of status bar can be get.
      // See comments in fitVideoSurfaceToScreen() for details.
      if (0 == mStatusBarHeight) // if valid height is not gotten yet..
      mStatusBarHeight = Utils.getStatusBarHeight(this);

      if (mDelayedSetIfVisibility) {
        mDelayedSetIfVisibility = false;
        // At first, full screen mode is used.
        updateUserInterfaceVisibility(false);
      }
    }
  }
 public void onWindowFocusChanged(boolean bool) {
   super.onWindowFocusChanged(bool);
   Log.d("DEBUG", "onWindowFocusChanged");
   if (CreateItemActivity.create_item_result != null) {
     synchronized (CreateItemActivity.create_item_result) {
       final AlertDialog dialog = new AlertDialog.Builder(this).create();
       final boolean success = CreateItemActivity.create_item_result.success();
       final String item_id = CreateItemActivity.create_item_result.http_response;
       dialog.setTitle(CreateItemActivity.create_item_result.getTitle());
       dialog.setMessage(CreateItemActivity.create_item_result.getMessage());
       CreateItemActivity.create_item_result = null;
       dialog.setButton(
           "OK",
           new DialogInterface.OnClickListener() {
             public void onClick(DialogInterface dialog, int which) {
               // TODO avoid moving to item view if previous thread was
               // interrupted? create_item.isInterrupted() but need
               // user to be aware if we
               // have created example already - progress dialog is set
               // cancelable, so back button will work? maybe should
               // avoid encouraging cancel
               // on POST operations ... not sure what to do if no
               // response from server - guess we will time out
               // eventually ...
               if (success) {
                 // want to go to individual item screen now ...
                 ItemListActivity.loadItem(CreateItemActivity.this, item_id);
               }
             }
           });
       dialog.show();
     }
   }
 }
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    if (hasFocus) {
      if (!UtilityClass.registered) register();
    }
  }
 @Override
 public void onWindowFocusChanged(final boolean hasWindowFocus) {
   super.onWindowFocusChanged(hasWindowFocus);
   Log.d(TAG, "ACTIVITY ON WINDOW FOCUS CHANGED " + (hasWindowFocus ? "true" : "false"));
   if (hasWindowFocus && !mIsOnPause) {
     resumeGame();
   }
 }
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (null == IOuyaActivity.GetUnityPlayer()) {
     Log.i("Unity", "IOuyaActivity.GetUnityPlayer() is null");
     return;
   }
   IOuyaActivity.GetUnityPlayer().windowFocusChanged(hasFocus);
 }
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (hasFocus && !isContentStarted) {
     adActivityContentWrapper.startContent();
     isContentStarted = true;
   }
 }
示例#8
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   if (hasFocus && !adIsLive) {
     MMSDK.initialize(this);
     bannerAdView();
   }
   super.onWindowFocusChanged(hasFocus);
 }
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   Log.e("TAG", "ActionBar height=" + getActionBar().getHeight());
   Rect rect = new Rect();
   getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
   Log.e("TAG", "StatusBar height=" + rect.top);
 }
示例#10
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (hasFocus) {
     if (drawable != null) {
       drawable.start();
     }
   }
 }
示例#11
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   /// M: IME launch again while tap suggestion which comes from File Manager @{
   if (hasFocus && isResumed()) {
     /// @}
     // Launch the IME after a bit
     mHandler.postDelayed(mShowInputMethodTask, 0);
   }
 }
示例#12
0
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus) {

      // Get the size of the display so this View knows where borders are
      mDisplayWidth = mFrame.getWidth();
      mDisplayHeight = mFrame.getHeight();
    }
  }
示例#13
0
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);

    SDLActivity.mHasFocus = hasFocus;
    if (hasFocus) {
      SDLActivity.handleResume();
    }
  }
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    mHasFocus = hasFocus;

    if (mHasFocus == true && mPlaying == false) {
      mGLView.onResume();
      GiderosApplication.getInstance().onResume();
      mPlaying = true;
    }
  }
示例#15
0
  /** Convenience function to change UI state based on being logged in */
  private void setLoggedIn(final boolean loggedIn) {
    mLoggedIn = loggedIn;
    if (loggedIn) {

      //     setContentView(R.layout.logedin);

      mSubmit.setVisibility(View.VISIBLE);
      mDisplay.setVisibility(View.VISIBLE);
      asd.setVisibility(View.VISIBLE);
      //       Start1.setVisibility(View.GONE);

      Kill.setVisibility(View.VISIBLE);

      dropbox.setVisibility(View.VISIBLE);
      gallbutton.setVisibility(View.VISIBLE);

      vmix.setVisibility(View.GONE);
      vtext.setVisibility(View.GONE);

      //            Start2.setVisibility(View.GONE);
      //            Start4.setVisibility(View.GONE);
      Start5.setVisibility(View.GONE);
      //            Dropbox.setVisibility(View.VISIBLE);
      mPhoto.setVisibility(View.VISIBLE);
      loginbutton.setVisibility(View.GONE);

    } else {

      Kill.setVisibility(View.GONE);

      loginbutton.setVisibility(View.VISIBLE);
      mSubmit.setVisibility(View.GONE);
      mDisplay.setVisibility(View.GONE);
      //            mImage.setImageDrawable(null);
      asd.setVisibility(View.GONE);

      vmix.setVisibility(View.VISIBLE);
      vtext.setVisibility(View.VISIBLE);

      //            Start1.setVisibility(View.VISIBLE);
      //           Start2.setVisibility(View.VISIBLE);
      dropbox.setVisibility(View.GONE);

      gallbutton.setVisibility(View.GONE);

      //           Start4.setVisibility(View.VISIBLE);
      Start5.setVisibility(View.VISIBLE);
      //         Dropbox.setVisibility(View.GONE);
      mPhoto.setVisibility(View.GONE);
    }
    super.onWindowFocusChanged(loggedIn);
  }
示例#16
0
  public void onWindowFocusChanged(boolean hasFocus) {

    // TODO Auto-generated method stub

    super.onWindowFocusChanged(hasFocus);
    TableLayout map1 = (TableLayout) findViewById(R.id.map);

    int left = map1.getLeft();
    int top = map1.getTop();
    arrayMap.setPara(left, top);

    //			BallStart();
  }
示例#17
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   if (hasFocus == true) {
     frameAnimation.start();
     frameAnimation_title.start();
   } else {
     frameAnimation.stop();
     frameAnimation_title.stop();
     frameAnimation = null;
     frameAnimation_title = null;
   }
   super.onWindowFocusChanged(hasFocus);
 }
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   // Log.v("SMSPopupActivity: onWindowFocusChanged(" + hasFocus + ")");
   if (hasFocus) {
     // This is really hacky, basically a flag that is set if the message
     // was at some point visible. I tried using onResume() or other methods
     // to prevent doing some things 2 times but this seemed to be the only
     // reliable way (?)
     wasVisible = true;
     refreshPrivacy();
   }
 }
示例#19
0
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);

    if (SDLActivity.mBrokenLibraries) {
      return;
    }

    SDLActivity.mHasFocus = hasFocus;
    if (hasFocus) {
      SDLActivity.handleResume();
    }
  }
示例#20
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (hasFocus) {
     View decorView = getWindow().getDecorView();
     decorView.setSystemUiVisibility(
         View.SYSTEM_UI_FLAG_LAYOUT_STABLE
             | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
             | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
             | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
             | View.SYSTEM_UI_FLAG_FULLSCREEN
             | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
   }
 }
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    // TODO: Implement this method
    super.onWindowFocusChanged(hasFocus);

    if (waitForNext) {
      this.nextLevel();
      waitForNext = false;
    }

    ((GameBoard) findViewById(R.id.gameBoard)).setGame(this.game);
    findViewById(R.id.gameBoard).invalidate();
    ((GameBoard) findViewById(R.id.gameBoard)).getHowdyShadeView().invalidate();
  }
示例#22
0
  // Reset the flags to hide the navigation bar
  @SuppressLint("NewApi")
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    menu.hideNavBar(this.getWindow());

    if (onFocusChangedCounterMemoryGame
        == 0) // On return from HelpDialogActivity Screen this method is triggered
    // it is also triggered any other time the app changes focus so we restart the game only once
    {
      // Log.w("Warn", "Returned!");
      onFocusChangedCounterMemoryGame++;
      memoryGameScreen.StartGame();
    }
  }
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   // When the window loses focus (e.g., the action overflow is shown),
   // cancel any pending hide action. When the window gains focus,
   // hide the system UI.
   if (hasFocus) {
     if (ImmersiveMode.apiOver19()) {
       // Immersive flag only works on API 19 and above.
       immersion.hideSystemUI();
     }
   } else {
     immersion.cancelSystemUIHide();
   }
 }
示例#24
0
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    // update nfc state for api < 18
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
      if (!hasFocus) {
        Log.d(TAG, "onWindowFocusChanged: false");
        cancelTimer();
      }
      if (hasFocus) {
        Log.d(TAG, "onWindowFocusChanged: true");
        scheduleNfcStateTimer();
      }
    }
  }
示例#25
0
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);

    if (hasFocus) {
      // FIXME: When activity is resumed, title isn't sometimes hidden properly (there is black
      // empty space at the top of the screen). This is desperate workaround.
      if (mFullScreen) {
        mGuiHandler.postDelayed(
            new Runnable() {
              @Override
              public void run() {
                getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
                mRootLayout.requestLayout();
              }
            },
            1000);
      }
    }
  }
  /**
   * create any associated state and call init methods on an activity
   *
   * <p>call any life cycle events for the activity
   *
   * @param activity
   */
  @DSVerified
  @DSBan(DSCat.DROIDSAFE_INTERNAL)
  public static void modelActivity(android.app.Activity activity) {
    if (mApplication != null) activity.setApplication(mApplication);

    Bundle b = new Bundle();
    activity.performCreate(b, context);

    activity.onAttachedToWindow();
    activity.onWindowFocusChanged(true);

    // Call all public methods with no params
    activity.onBackPressed();
    activity.onContentChanged();
    activity.onCreateDescription();
    activity.onLowMemory();
    activity.onRetainNonConfigurationInstance();
    // do not call this automatically because it leads to a crazy long path of crap
    // activity.onSearchRequested();
    activity.onUserInteraction();

    // TODO: DOES THIS MAKE SENSE?
    // We should not change method's visiblity
    /*
    activity.onCreateDialog(0);
    activity.onCreateDialog(0, new Bundle());
    activity.onPrepareDialog(0, new Dialog(context));
    */

    /*
    //TODO: WHAT ABOUT A REAL MENU?  We moved to Activity's droidsafeOnOtherHook
    activity.onCreateOptionsMenu(null);
    activity.onPrepareOptionsMenu(null);
    activity.onCreateContextMenu(null, null, null);
    activity.onOptionsItemSelected(null);
    activity.onContextItemSelected(null);
    activity.dispatchTouchEvent(new MotionEvent());

    //activity.droidsafeOnKeyEvents();
    */
    activity.onConfigurationChanged(new Configuration());
    activity.droidsafeOnSavedInstanceState(b);

    activity.droidsafeOnResume();
    activity.droidsafeOnPause();

    ////////////////
    // Callback hooks specific for SubActivity classes
    // All subclass of Activity should implment this in the model
    // so that their callback will be called
    // Map, listview, expandblelist, etc...
    activity.droidsafeSubActivityCallbackHook();

    activity.droidsafeOnStop();

    activity.droidsafeOnRestart();

    activity.droidsafeOnDestroy();

    activity.droidsafePerformRestoreInstanceState(b);

    activity.onDetachedFromWindow();
    // Calls for MapActivity from mapping library
  }
示例#27
0
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   // Log.v("main","onWindowFoucsChanged");
   enterAnim.start();
 }
示例#28
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   // TODO Auto-generated method stub
   super.onWindowFocusChanged(hasFocus);
 }
示例#29
0
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (processBA.subExists("activity_windowfocuschanged"))
     processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
 }
 // Notify Unity of the focus change.
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   mUnityPlayer.windowFocusChanged(hasFocus);
 }