Loading policy/com/android/internal/policy/impl/RecentApplicationsDialog.java +33 −28 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; Loading Loading @@ -54,8 +55,14 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener View mNoAppsText; IntentFilter mBroadcastIntentFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); private int mIconSize; public RecentApplicationsDialog(Context context) { super(context); final Resources resources = context.getResources(); mIconSize = (int) resources.getDimension(android.R.dimen.app_icon_size); } /** Loading @@ -81,6 +88,7 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener WindowManager.LayoutParams.FLAG_BLUR_BEHIND); theWindow.setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); theWindow.setTitle("Recents"); setContentView(com.android.internal.R.layout.recent_apps_dialog); Loading Loading @@ -224,21 +232,18 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener * Adjust appearance of each icon-button */ private void setButtonAppearance(View theButton, final String theTitle, final Drawable icon) { TextView tv = (TextView) theButton.findViewById(com.android.internal.R.id.label); TextView tv = (TextView) theButton; tv.setText(theTitle); ImageView iv = (ImageView) theButton.findViewById(com.android.internal.R.id.icon); iv.setImageDrawable(icon); if (icon != null) { icon.setBounds(0, 0, mIconSize, mIconSize); } tv.setCompoundDrawables(null, icon, null, null); } /** * This is the listener for the ACTION_CLOSE_SYSTEM_DIALOGS intent. It's an indication that * we should close ourselves immediately, in order to allow a higher-priority UI to take over * (e.g. phone call received). * * TODO: This is a really heavyweight solution for something that should be so simple. * For example, we already have a handler, in our superclass, why aren't we sharing that? * I think we need to investigate simplifying this entire methodology, or perhaps boosting * it up into the Dialog class. */ private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override Loading Loading
policy/com/android/internal/policy/impl/RecentApplicationsDialog.java +33 −28 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; Loading Loading @@ -54,8 +55,14 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener View mNoAppsText; IntentFilter mBroadcastIntentFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); private int mIconSize; public RecentApplicationsDialog(Context context) { super(context); final Resources resources = context.getResources(); mIconSize = (int) resources.getDimension(android.R.dimen.app_icon_size); } /** Loading @@ -81,6 +88,7 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener WindowManager.LayoutParams.FLAG_BLUR_BEHIND); theWindow.setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); theWindow.setTitle("Recents"); setContentView(com.android.internal.R.layout.recent_apps_dialog); Loading Loading @@ -224,21 +232,18 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener * Adjust appearance of each icon-button */ private void setButtonAppearance(View theButton, final String theTitle, final Drawable icon) { TextView tv = (TextView) theButton.findViewById(com.android.internal.R.id.label); TextView tv = (TextView) theButton; tv.setText(theTitle); ImageView iv = (ImageView) theButton.findViewById(com.android.internal.R.id.icon); iv.setImageDrawable(icon); if (icon != null) { icon.setBounds(0, 0, mIconSize, mIconSize); } tv.setCompoundDrawables(null, icon, null, null); } /** * This is the listener for the ACTION_CLOSE_SYSTEM_DIALOGS intent. It's an indication that * we should close ourselves immediately, in order to allow a higher-priority UI to take over * (e.g. phone call received). * * TODO: This is a really heavyweight solution for something that should be so simple. * For example, we already have a handler, in our superclass, why aren't we sharing that? * I think we need to investigate simplifying this entire methodology, or perhaps boosting * it up into the Dialog class. */ private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override Loading