Loading core/res/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ <dimen name="thumbnail_height">192dp</dimen> <!-- The amount to scale a fullscreen screenshot thumbnail. --> <item name="thumbnail_fullscreen_scale" type="fraction">60%</item> <!-- The width used to calculate scale for full screen thumbnail on TV --> <integer name="thumbnail_width_tv">240</integer> <!-- The standard size (both width and height) of an application icon that will be displayed in the app launcher and elsewhere. --> <dimen name="app_icon_size">48dip</dimen> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1496,6 +1496,7 @@ <java-symbol type="integer" name="config_dockedStackDividerSnapMode" /> <java-symbol type="fraction" name="docked_stack_divider_fixed_ratio" /> <java-symbol type="fraction" name="thumbnail_fullscreen_scale" /> <java-symbol type="integer" name="thumbnail_width_tv" /> <java-symbol type="dimen" name="resize_shadow_size" /> <java-symbol type="color" name="resize_shadow_start_color" /> <java-symbol type="color" name="resize_shadow_end_color" /> Loading packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java +5 −3 Original line number Diff line number Diff line Loading @@ -54,9 +54,9 @@ import com.android.systemui.recents.model.Task; import com.android.systemui.recents.model.TaskStack; import com.android.systemui.recents.tv.animations.HomeRecentsEnterExitAnimationHolder; import com.android.systemui.recents.tv.views.RecentsTvView; import com.android.systemui.recents.tv.views.TaskCardView; import com.android.systemui.recents.tv.views.TaskStackHorizontalGridView; import com.android.systemui.recents.tv.views.TaskStackHorizontalViewAdapter; import com.android.systemui.recents.views.AnimationProps; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.tv.pip.PipManager; import com.android.systemui.tv.pip.PipRecentsOverlayManager; Loading Loading @@ -184,12 +184,14 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener { if (!plan.hasTasks()) { loader.preloadTasks(plan, -1, !launchState.launchedFromHome); } int numVisibleTasks = TaskCardView.getNumberOfVisibleTasks(getApplicationContext()); mLaunchedFromHome = launchState.launchedFromHome; TaskStack stack = plan.getTaskStack(); RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); loadOpts.runningTaskId = launchState.launchedToTaskId; loadOpts.numVisibleTasks = stack.getStackTaskCount(); loadOpts.numVisibleTaskThumbnails = stack.getStackTaskCount(); loadOpts.numVisibleTasks = numVisibleTasks; loadOpts.numVisibleTaskThumbnails = numVisibleTasks; loader.loadTasks(this, plan, loadOpts); Loading packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskCardView.java +13 −2 Original line number Diff line number Diff line Loading @@ -288,7 +288,6 @@ public class TaskCardView extends LinearLayout { lp.height = LayoutParams.MATCH_PARENT; screenshotView.setLayoutParams(lp); screenshotView.setImageBitmap(screenshot); screenshotView.setClipToOutline(true); screenshotView.setOutlineProvider(new ViewOutlineProvider() { @Override Loading @@ -296,6 +295,7 @@ public class TaskCardView extends LinearLayout { outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), mCornerRadius); } }); screenshotView.setImageBitmap(screenshot); } private void setAsBannerView(Drawable banner, ImageView bannerView) { Loading @@ -304,7 +304,6 @@ public class TaskCardView extends LinearLayout { .getDimensionPixelSize(R.dimen.recents_tv_banner_width); lp.height = getResources() .getDimensionPixelSize(R.dimen.recents_tv_banner_height); bannerView.setLayoutParams(lp); bannerView.setImageDrawable(banner); } Loading @@ -327,4 +326,16 @@ public class TaskCardView extends LinearLayout { public View getDismissIconView() { return mDismissIconView; } public static int getNumberOfVisibleTasks(Context context) { Resources res = context.getResources(); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size); int screenWidth = size.x; int cardWidth = res.getDimensionPixelSize(R.dimen.recents_tv_card_width); int spacing = res.getDimensionPixelSize(R.dimen.recents_tv_gird_card_spacing); return (int) (1.0 + Math.ceil(screenWidth / (cardWidth + spacing * 2.0))); } } packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.view.View; import android.view.ViewGroup; import com.android.systemui.R; import com.android.systemui.recents.Recents; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.LaunchTvTaskEvent; import com.android.systemui.recents.events.ui.DeleteTaskDataEvent; import com.android.systemui.recents.model.RecentsTaskLoader; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.views.AnimationProps; Loading Loading @@ -122,7 +124,10 @@ public class TaskStackHorizontalViewAdapter extends @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.init(mTaskList.get(position)); Task task = mTaskList.get(position); // Retrives from caches, loading only if necessary Recents.getTaskLoader().loadTaskData(task); holder.init(task); } @Override Loading Loading
core/res/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ <dimen name="thumbnail_height">192dp</dimen> <!-- The amount to scale a fullscreen screenshot thumbnail. --> <item name="thumbnail_fullscreen_scale" type="fraction">60%</item> <!-- The width used to calculate scale for full screen thumbnail on TV --> <integer name="thumbnail_width_tv">240</integer> <!-- The standard size (both width and height) of an application icon that will be displayed in the app launcher and elsewhere. --> <dimen name="app_icon_size">48dip</dimen> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1496,6 +1496,7 @@ <java-symbol type="integer" name="config_dockedStackDividerSnapMode" /> <java-symbol type="fraction" name="docked_stack_divider_fixed_ratio" /> <java-symbol type="fraction" name="thumbnail_fullscreen_scale" /> <java-symbol type="integer" name="thumbnail_width_tv" /> <java-symbol type="dimen" name="resize_shadow_size" /> <java-symbol type="color" name="resize_shadow_start_color" /> <java-symbol type="color" name="resize_shadow_end_color" /> Loading
packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java +5 −3 Original line number Diff line number Diff line Loading @@ -54,9 +54,9 @@ import com.android.systemui.recents.model.Task; import com.android.systemui.recents.model.TaskStack; import com.android.systemui.recents.tv.animations.HomeRecentsEnterExitAnimationHolder; import com.android.systemui.recents.tv.views.RecentsTvView; import com.android.systemui.recents.tv.views.TaskCardView; import com.android.systemui.recents.tv.views.TaskStackHorizontalGridView; import com.android.systemui.recents.tv.views.TaskStackHorizontalViewAdapter; import com.android.systemui.recents.views.AnimationProps; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.tv.pip.PipManager; import com.android.systemui.tv.pip.PipRecentsOverlayManager; Loading Loading @@ -184,12 +184,14 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener { if (!plan.hasTasks()) { loader.preloadTasks(plan, -1, !launchState.launchedFromHome); } int numVisibleTasks = TaskCardView.getNumberOfVisibleTasks(getApplicationContext()); mLaunchedFromHome = launchState.launchedFromHome; TaskStack stack = plan.getTaskStack(); RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); loadOpts.runningTaskId = launchState.launchedToTaskId; loadOpts.numVisibleTasks = stack.getStackTaskCount(); loadOpts.numVisibleTaskThumbnails = stack.getStackTaskCount(); loadOpts.numVisibleTasks = numVisibleTasks; loadOpts.numVisibleTaskThumbnails = numVisibleTasks; loader.loadTasks(this, plan, loadOpts); Loading
packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskCardView.java +13 −2 Original line number Diff line number Diff line Loading @@ -288,7 +288,6 @@ public class TaskCardView extends LinearLayout { lp.height = LayoutParams.MATCH_PARENT; screenshotView.setLayoutParams(lp); screenshotView.setImageBitmap(screenshot); screenshotView.setClipToOutline(true); screenshotView.setOutlineProvider(new ViewOutlineProvider() { @Override Loading @@ -296,6 +295,7 @@ public class TaskCardView extends LinearLayout { outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), mCornerRadius); } }); screenshotView.setImageBitmap(screenshot); } private void setAsBannerView(Drawable banner, ImageView bannerView) { Loading @@ -304,7 +304,6 @@ public class TaskCardView extends LinearLayout { .getDimensionPixelSize(R.dimen.recents_tv_banner_width); lp.height = getResources() .getDimensionPixelSize(R.dimen.recents_tv_banner_height); bannerView.setLayoutParams(lp); bannerView.setImageDrawable(banner); } Loading @@ -327,4 +326,16 @@ public class TaskCardView extends LinearLayout { public View getDismissIconView() { return mDismissIconView; } public static int getNumberOfVisibleTasks(Context context) { Resources res = context.getResources(); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size); int screenWidth = size.x; int cardWidth = res.getDimensionPixelSize(R.dimen.recents_tv_card_width); int spacing = res.getDimensionPixelSize(R.dimen.recents_tv_gird_card_spacing); return (int) (1.0 + Math.ceil(screenWidth / (cardWidth + spacing * 2.0))); } }
packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.view.View; import android.view.ViewGroup; import com.android.systemui.R; import com.android.systemui.recents.Recents; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.LaunchTvTaskEvent; import com.android.systemui.recents.events.ui.DeleteTaskDataEvent; import com.android.systemui.recents.model.RecentsTaskLoader; import com.android.systemui.recents.model.Task; import com.android.systemui.recents.views.AnimationProps; Loading Loading @@ -122,7 +124,10 @@ public class TaskStackHorizontalViewAdapter extends @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.init(mTaskList.get(position)); Task task = mTaskList.get(position); // Retrives from caches, loading only if necessary Recents.getTaskLoader().loadTaskData(task); holder.init(task); } @Override Loading