自定义 HomeScreen的UI
在overlay里先定义好需要调整好的UI.
然后在 .../packages/apps/Launcher3/src/com/android/launcher3/InvariantDeviceProfile.java
对应的位置加上相应的判断即可:
...
public static final class GridOption {
public static final String TAG_NAME = "grid-option";
.....
public static final String THUNDERBOLT_WALN_LAYOUT = "default_workspace_4x4_thunderbolt_wlan";
....
public GridOption(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.GridDisplayOption);
name = a.getString(R.styleable.GridDisplayOption_name);
numRows = a.getInt(R.styleable.GridDisplayOption_numRows, 0);
numColumns = a.getInt(R.styleable.GridDisplayOption_numColum
.....
} else if (XXXX.isDeviceThunderbolt().orElse(false) && !XXXXX.isDeviceWWAN().orElse(false)){
defaultLayoutId = context.getResources().getIdentifier(THUNDERBOLT_WALN_LAYOUT, "xml", "com.android.launcher3");
}
....
}