Updating widget tray theme

Using standard theme attributes rather than custom color codes, so
that it plays nice with system theme changes.

Bug: 34819119
Bug: 34897402
Bug: 21446746
Change-Id: I265fba3ceae8873650fd09e4704838d313155e83
This commit is contained in:
Sunny Goyal
2017-02-07 13:11:17 -08:00
parent db7b82960a
commit d5d5e22715
17 changed files with 68 additions and 93 deletions

View File

@@ -45,6 +45,7 @@ import android.os.UserHandle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextThemeWrapper;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.UserManagerCompat;
@@ -132,9 +133,9 @@ public class IconCache {
mWorkerHandler = new Handler(LauncherModel.getWorkerLooper());
mActivityBgColor = context.getResources().getColor(R.color.quantum_panel_bg_color);
TypedArray ta = context.obtainStyledAttributes(new int[]{R.attr.colorSecondary});
mPackageBgColor = ta.getColor(0, 0);
ta.recycle();
mPackageBgColor = Utilities.getAttrColor(
new ContextThemeWrapper(context, R.style.WidgetContainerTheme),
android.R.attr.colorPrimary);
mLowResOptions = new BitmapFactory.Options();
// Always prefer RGB_565 config for low res. If the bitmap has transparency, it will
// automatically be loaded as ALPHA_8888.