Explicitly express nullness expectations
Bug: 209459024 Test: m SystemUI-core Change-Id: I64dd044579fb8f3fd44e6c406724f04c9d8aa178
This commit is contained in:
@@ -56,6 +56,7 @@ import com.android.systemui.qs.tileimpl.QSTileViewImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -364,11 +365,13 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
}
|
||||
info.state.expandedAccessibilityClassName = "";
|
||||
|
||||
// The holder has a tileView, therefore this call is not null
|
||||
holder.getTileAsCustomizeView().changeState(info.state);
|
||||
holder.getTileAsCustomizeView().setShowAppLabel(position > mEditIndex && !info.isSystem);
|
||||
CustomizeTileView tileView =
|
||||
Objects.requireNonNull(
|
||||
holder.getTileAsCustomizeView(), "The holder must have a tileView");
|
||||
tileView.changeState(info.state);
|
||||
tileView.setShowAppLabel(position > mEditIndex && !info.isSystem);
|
||||
// Don't show the side view for third party tiles, as we don't have the actual state.
|
||||
holder.getTileAsCustomizeView().setShowSideView(position < mEditIndex || info.isSystem);
|
||||
tileView.setShowSideView(position < mEditIndex || info.isSystem);
|
||||
holder.mTileView.setSelected(true);
|
||||
holder.mTileView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
|
||||
holder.mTileView.setClickable(true);
|
||||
@@ -448,7 +451,12 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
mFocusIndex = mEditIndex - 1;
|
||||
mNeedsFocus = true;
|
||||
if (mRecyclerView != null) {
|
||||
mRecyclerView.post(() -> mRecyclerView.smoothScrollToPosition(mFocusIndex));
|
||||
mRecyclerView.post(() -> {
|
||||
final RecyclerView recyclerView = mRecyclerView;
|
||||
if (recyclerView != null) {
|
||||
recyclerView.smoothScrollToPosition(mFocusIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user