private void clearDrawableCache(android.util.LongSparseArray<[email protected] <android.graphics.drawable.Drawable.ConstantState>> cache, int configChanges) { int N = cache.size(); { for (int i = 0; i < N; i++) { [email protected]<android.graphics.drawable.Drawable.ConstantState> @ref = cache.valueAt(i); if (@ref != null) { android.graphics.drawable.Drawable.ConstantState cs = @ref.get(); if (cs != null) { if (android.content.res.Configuration.needNewResources(configChanges, cs.getChangingConfigurations ())) { cache.setValueAt(i, null); } } } } } }
private void mutateColumnsWidth(android.util.SparseBooleanArray columns, bool allColumns , int size, int totalWidth) { int skipped = 0; int[] maxWidths = mMaxWidths; int length = maxWidths.Length; int count = allColumns ? length : columns.size(); int totalExtraSpace = size - totalWidth; int extraSpace = totalExtraSpace / count; // Column's widths are changed: force child table rows to re-measure. // (done by super.measureVertical after shrinkAndStretchColumns.) int nbChildren = getChildCount(); { for (int i = 0; i < nbChildren; i++) { android.view.View child = getChildAt(i); if (child is android.widget.TableRow) { child.forceLayout(); } } } if (!allColumns) { { for (int i_1 = 0; i_1 < count; i_1++) { int column = columns.keyAt(i_1); if (columns.valueAt(i_1)) { if (column < length) { maxWidths[column] += extraSpace; } else { skipped++; } } } } } else { { for (int i_1 = 0; i_1 < count; i_1++) { maxWidths[i_1] += extraSpace; } } // we don't skip any column so we can return right away return; } if (skipped > 0 && skipped < count) { // reclaim any extra space we left to columns that don't exist extraSpace = skipped * extraSpace / (count - skipped); { for (int i_1 = 0; i_1 < count; i_1++) { int column = columns.keyAt(i_1); if (columns.valueAt(i_1) && column < length) { if (extraSpace > maxWidths[column]) { maxWidths[column] = 0; } else { maxWidths[column] += extraSpace; } } } } } }