Use adaptive icon shapes for settings homeepage

- Add AdaptiveIconShapeDrawable for the homepage icon backgrounds
- Rename RoundedHomepageIcon -> AdaptiveHomepageIcon to reflect that the
adaptive icon shape is used

Bug: 123829919
Test: mp settings; manually viewing homepage icons
Change-Id: I9fddfbf57461b300200f30f716d861878bbbcc38
This commit is contained in:
Amin Shaikh
2019-02-05 13:52:30 -05:00
parent 12cec79889
commit 3304bec980
20 changed files with 122 additions and 148 deletions

View File

@@ -32,18 +32,19 @@ import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.homepage.AdaptiveIconShapeDrawable;
import com.android.settingslib.drawer.Tile;
public class RoundedHomepageIcon extends LayerDrawable {
public class AdaptiveHomepageIcon extends LayerDrawable {
private static final String TAG = "RoundedHomepageIcon";
private static final String TAG = "AdaptiveHomepageIcon";
@VisibleForTesting(otherwise = NONE)
int mBackgroundColor = -1;
public RoundedHomepageIcon(Context context, Drawable foreground) {
public AdaptiveHomepageIcon(Context context, Drawable foreground) {
super(new Drawable[]{
context.getDrawable(R.drawable.ic_homepage_generic_background),
new AdaptiveIconShapeDrawable(context.getResources()),
foreground
});
final int insetPx = context.getResources()