のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

PhoneStatusBar onConfigurationChange

   3125     // SystemUIService notifies SystemBars of configuration changes, which then calls down here
   3126     @Override
   3127     protected void onConfigurationChanged(Configuration newConfig) {
   3128         super.onConfigurationChanged(newConfig); // calls refreshLayout
   3129 
   3130         if (DEBUG) {
   3131             Log.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
   3132         }
   3133         updateDisplaySize(); // populates mDisplayMetrics
   3134 
   3135         updateResources();  <=====
   3136         updateClockSize();
   3137         repositionNavigationBar();
   3138         updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
   3139         updateShowSearchHoldoff();
   3140         updateRowStates();
   3141     }
   3187     void updateResources() {
   3188         // Update the quick setting tiles
   3189         if (mQSPanel != null) {
   3190             mQSPanel.updateResources(); <=====
   3191         }
   3192 
   3193         loadDimens();
   3194         mLinearOutSlowIn = AnimationUtils.loadInterpolator(
   3195                 mContext, android.R.interpolator.linear_out_slow_in);
   3196 
   3197         if (mNotificationPanel != null) {
   3198             mNotificationPanel.updateResources();
   3199         }
   3200         if (mHeadsUpNotificationView != null) {
   3201             mHeadsUpNotificationView.updateResources();
   3202         }
   3203         if (mBrightnessMirrorController != null) {
   3204             mBrightnessMirrorController.updateResources();
   3205         }
   3206     }
    143     public void updateResources() {
    144         final Resources res = mContext.getResources();
    145         final int columns = Math.max(1, res.getInteger(R.integer.quick_settings_num_columns));
    146         mCellHeight = res.getDimensionPixelSize(R.dimen.qs_tile_height);
    147         mCellWidth = (int)(mCellHeight * TILE_ASPECT);
    148         mLargeCellHeight = res.getDimensionPixelSize(R.dimen.qs_dual_tile_height);
    149         mLargeCellWidth = (int)(mLargeCellHeight * TILE_ASPECT);
    150         mPanelPaddingBottom = res.getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
    151         mDualTileUnderlap = res.getDimensionPixelSize(R.dimen.qs_dual_tile_padding_vertical);
    152         mBrightnessPaddingTop = res.getDimensionPixelSize(R.dimen.qs_brightness_padding_top);
    153         if (mColumns != columns) {
    154             mColumns = columns;
    155             postInvalidate();
    156         }
    157         if (mListening) {
    158             refreshAllTiles(); <====
    159         }
    160         updateDetailText();
    161     }
    206     private void refreshAllTiles() {
    207         for (TileRecord r : mRecords) {
    208             r.tile.refreshState();
    209         }
    210         mFooter.refreshState();
    211     }
    521     private static final class TileRecord extends Record {
    522         QSTile<?> tile;
    523         QSTileView tileView;
    524         int row;
    525         int col;
    526         boolean scanState;
    527     }