1.源码位置
packages\apps\PackageInstaller
2.解决方案
1.继承Theme.Leanback.GuidedStep
<style name="Theme.Settings.GuidedStep" parent="@style/Theme.Leanback.GuidedStep"><item name="guidedStepBackground">@color/settings_background</item><item name="guidedActionsBackground">@color/settings_background</item>//右侧item的样式<item name="guidedActionItemContainerStyle">@style/Settings.GuidedActionItemContainerStyle</item></style><style name="Settings.GuidedActionItemContainerStyle" parent="@style/Widget.Leanback.GuidedActionItemContainerStyle">//右侧item的背景<item name="android:background">@drawable/setup_list_item_background</item></style>
2.重写布局
@Overridepublic GuidedActionsStylist onCreateActionsStylist() {return new GuidedActionsStylist() {@Overridepublic int onProvideLayoutId() {//return your custom layout herereturn super.onProvideLayoutId();}@Overridepublic int onProvideItemLayoutId(int viewType) {return super.onProvideItemLayoutId(viewType);}@Overridepublic int getItemViewType(GuidedAction action) {return super.getItemViewType(action);}};}
修改前 :
修改后 :