コード例 #1
0
 public void onConfigurationChanged(Configuration configuration) {
   super.onConfigurationChanged(configuration);
   this.f3573e.m7110a();
   if (this.f3571c != null) {
     this.f3571c.m5698a();
   }
 }
コード例 #2
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   BaseApplication.getBus().post(new FragmentOnConfigurationChangedEvent());
   Timber.tag(TAG);
   Timber.d("onConfigurationChanged");
   initOnConfigurationChangedBody();
 }
コード例 #3
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (this.webView == null) {
     return;
   }
   PluginManager pm = this.webView.getPluginManager();
   if (pm != null) {
     pm.onConfigurationChanged(newConfig);
   }
 }
コード例 #4
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    LayoutInflater inflater =
        (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.equalizer, null);
    ViewGroup rootView = (ViewGroup) getView();
    rootView.removeAllViews();
    rootView.addView(v);
    saveViewChildren(v);

    fillViews();
  }
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    Log.d(TAG, "on change");

    if (mFolderPopupWindow != null) {
      if (mFolderPopupWindow.isShowing()) {
        mFolderPopupWindow.dismiss();
      }
    }

    mGridView
        .getViewTreeObserver()
        .addOnGlobalLayoutListener(
            new ViewTreeObserver.OnGlobalLayoutListener() {
              @Override
              @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
              public void onGlobalLayout() {

                final int height = mGridView.getHeight();

                final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
                Log.d(TAG, "Desire Size = " + desireSize);
                final int numCount = mGridView.getWidth() / desireSize;
                Log.d(TAG, "Grid Size = " + mGridView.getWidth());
                Log.d(TAG, "num count = " + numCount);
                final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
                int columnWidth = (mGridView.getWidth() - columnSpace * (numCount - 1)) / numCount;
                mImageAdapter.setItemSize(columnWidth);

                if (mFolderPopupWindow != null) {
                  mFolderPopupWindow.setHeight(height * 5 / 8);
                }

                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                  mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                } else {
                  mGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                }
              }
            });

    super.onConfigurationChanged(newConfig);
  }
コード例 #6
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    // Getting the width on orientation changed
    Display display = getActivity().getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    int width = size.x;

    /**
     * Getting the orientation of the device. Set margin for pages as a negative number, so a part
     * of next and previous pages will be showed
     */
    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
      pager.setPageMargin(-width / 2);
    } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
      pager.setPageMargin(-width / 3);
    }
    pager.refreshDrawableState();
  }
コード例 #7
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
 }
コード例 #8
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   // Forward the new configuration the drawer toggle component.
   mDrawerToggle.onConfigurationChanged(newConfig);
 }
コード例 #9
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   checkOrientation();
 }
コード例 #10
0
ファイル: YmtImgFragment.java プロジェクト: cavin2012/JJ
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   linearLayoutManager.setSpanCount(getSpanCount());
 }
コード例 #11
0
ファイル: SubmissionsView.java プロジェクト: KonradIT/Slide
  @Override
  public void onConfigurationChanged(Configuration newConfig) {

    super.onConfigurationChanged(newConfig);
    int currentOrientation = newConfig.orientation;

    int i = 0;
    if (rv.getLayoutManager() instanceof LinearLayoutManager
        && currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
      if (rv.getAdapter() != null) {
        i = ((LinearLayoutManager) rv.getLayoutManager()).findFirstVisibleItemPosition();
      }
      final RecyclerView.LayoutManager mLayoutManager;
      if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE && SettingValues.tabletUI) {
        mLayoutManager =
            new CatchStaggeredGridLayoutManager(
                Reddit.dpWidth, CatchStaggeredGridLayoutManager.VERTICAL);
      } else if (currentOrientation == Configuration.ORIENTATION_PORTRAIT
          && SettingValues.dualPortrait) {
        mLayoutManager =
            new CatchStaggeredGridLayoutManager(2, CatchStaggeredGridLayoutManager.VERTICAL);
      } else {
        mLayoutManager = new PreCachingLayoutManager(getContext());
      }

      rv.setLayoutManager(mLayoutManager);

    } else {
      final RecyclerView.LayoutManager mLayoutManager;

      if (rv.getAdapter() != null) {
        if (rv.getLayoutManager() instanceof CatchStaggeredGridLayoutManager) {
          int[] firstVisibleItems = null;
          try {
            firstVisibleItems =
                ((CatchStaggeredGridLayoutManager) rv.getLayoutManager())
                    .findFirstVisibleItemPositions(firstVisibleItems);
          } catch (Exception e) {
            firstVisibleItems = new int[] {0, 1};
          }
          if (firstVisibleItems != null && firstVisibleItems.length > 0) {
            i = firstVisibleItems[0];
          }
        } else {
          i =
              ((PreCachingLayoutManager) rv.getLayoutManager())
                  .findFirstCompletelyVisibleItemPosition();
        }
      }
      if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE && SettingValues.tabletUI) {
        mLayoutManager =
            new CatchStaggeredGridLayoutManager(
                Reddit.dpWidth, CatchStaggeredGridLayoutManager.VERTICAL);
      } else if (currentOrientation == Configuration.ORIENTATION_PORTRAIT
          && SettingValues.dualPortrait) {
        mLayoutManager =
            new CatchStaggeredGridLayoutManager(2, CatchStaggeredGridLayoutManager.VERTICAL);
      } else {
        mLayoutManager = new PreCachingLayoutManager(getContext());
      }
      rv.setLayoutManager(mLayoutManager);
    }
    rv.getLayoutManager().scrollToPosition(i);
  }
コード例 #12
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   // 当系统配置改变时调用DrawerToggle的改变配置方法(例如横竖屏切换会回调此方法)
   mDrawerToggle.onConfigurationChanged(newConfig);
 }
コード例 #13
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   recLifeCycle(getClass(), CALL_TO_SUPER);
   super.onConfigurationChanged(newConfig);
   recLifeCycle(getClass(), RETURN_FROM_SUPER);
 }
コード例 #14
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   mCalculatorKeyboard =
       new CalculatorKeyboard(getActivity(), mKeyboardView, R.xml.calculator_keyboard);
 }
コード例 #15
0
ファイル: Fragment.java プロジェクト: sheytoon/Soroush
 void m962a(Configuration configuration) {
     onConfigurationChanged(configuration);
     if (this.f773v != null) {
         this.f773v.m1410a(configuration);
     }
 }
コード例 #16
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   Log.d("FragmentCycle===>", "onConfigurationChanged");
   super.onConfigurationChanged(newConfig);
 }