Skip to content

Commit

Permalink
[Main] Fix disabled apps not being highlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
MuntashirAkon committed Jul 3, 2020
1 parent f08263d commit 873abb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -754,18 +754,16 @@ public View getView(int i, View view, ViewGroup viewGroup) {
holder.iconLoader.cancel(true);
}

ApplicationItem item = mAdapterList.get(i);
ApplicationInfo info = item.applicationInfo;
final ApplicationItem item = mAdapterList.get(i);
final ApplicationInfo info = item.applicationInfo;

// Alternate background colors
if (mPackageNames.contains(info.packageName)) {
if (mPackageNames.contains(info.packageName))
view.setBackgroundColor(mColorHighlight);
} else view.setBackgroundColor(i % 2 == 0 ? mColorSemiTransparent : mColorTransparent);

// If the app is disabled, add an ocean blue background
if (!info.enabled) {
else if (!info.enabled)
view.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.disabled_app));
}
else view.setBackgroundColor(i % 2 == 0 ? mColorSemiTransparent : mColorTransparent);

// Add yellow star if the app is in debug mode
holder.favorite_icon.setVisibility(item.star ? View.VISIBLE : View.INVISIBLE);
try {
Expand Down Expand Up @@ -875,7 +873,10 @@ public View getView(int i, View view, ViewGroup viewGroup) {
holder.icon.setOnClickListener(v -> {
if (MainActivity.mPackageNames.contains(info.packageName)) {
MainActivity.mPackageNames.remove(info.packageName);
finalView.setBackgroundColor(i % 2 == 0 ? mColorSemiTransparent : mColorTransparent);
if (!info.enabled)
finalView.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.disabled_app));
else
finalView.setBackgroundColor(i % 2 == 0 ? mColorSemiTransparent : mColorTransparent);
} else {
MainActivity.mPackageNames.add(info.packageName);
finalView.setBackgroundColor(mColorHighlight);
Expand Down
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Fri Jul 03 10:44:01 BDT 2020
#Fri Jul 03 17:29:47 BDT 2020
VERSION_NAME=2.5.6
VERSION_CODE=229
VERSION_CODE=231

0 comments on commit 873abb7

Please sign in to comment.