use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class RecentsTvActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFinishedOnStartup = false;
// In the case that the activity starts up before the Recents component has initialized
// (usually when debugging/pushing the SysUI apk), just finish this activity.
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp == null) {
mFinishedOnStartup = true;
finish();
return;
}
mPipRecentsOverlayManager = PipManager.getInstance().getPipRecentsOverlayManager();
// Register this activity with the event bus
EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
mPackageMonitor = new RecentsPackageMonitor();
mPackageMonitor.register(this);
// Set the Recents layout
setContentView(R.layout.recents_on_tv);
mRecentsView = (RecentsTvView) findViewById(R.id.recents_view);
mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
mPipView = findViewById(R.id.pip);
mPipView.setOnFocusChangeListener(mPipViewFocusChangeListener);
// Place mPipView at the PIP bounds for fine tuned focus handling.
Rect pipBounds = mPipManager.getRecentsFocusedPipBounds();
LayoutParams lp = (LayoutParams) mPipView.getLayoutParams();
lp.width = pipBounds.width();
lp.height = pipBounds.height();
lp.leftMargin = pipBounds.left;
lp.topMargin = pipBounds.top;
mPipView.setLayoutParams(lp);
mPipRecentsOverlayManager.setCallback(mPipRecentsOverlayManagerCallback);
getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;
// Create the home intent runnable
Intent homeIntent = new Intent(Intent.ACTION_MAIN, null);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
homeIntent.putExtra(RECENTS_HOME_INTENT_EXTRA, true);
mFinishLaunchHomeRunnable = new FinishRecentsRunnable(homeIntent);
mPipManager.addListener(mPipListener);
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class RecentsActivity method onBusEvent.
public final void onBusEvent(DeleteTaskDataEvent event) {
// Remove any stored data from the loader
RecentsTaskLoader loader = Recents.getTaskLoader();
loader.deleteTaskData(event.task, false);
// Remove the task from activity manager
SystemServicesProxy ssp = Recents.getSystemServices();
ssp.removeTask(event.task.key.id);
// Update memory details
mRecentsView.updateMemoryStatus();
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class RecentsActivity method onBusEvent.
public final void onBusEvent(CancelEnterRecentsWindowAnimationEvent event) {
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
int launchToTaskId = launchState.launchedToTaskId;
if (launchToTaskId != -1 && (event.launchTask == null || launchToTaskId != event.launchTask.key.id)) {
SystemServicesProxy ssp = Recents.getSystemServices();
ssp.cancelWindowTransition(launchState.launchedToTaskId);
ssp.cancelThumbnailTransition(getTaskId());
}
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskViewHeader method showAppOverlay.
/**
* Shows the application overlay.
*/
private void showAppOverlay() {
// Skip early if the task is invalid
SystemServicesProxy ssp = Recents.getSystemServices();
ComponentName cn = mTask.key.getComponent();
int userId = mTask.key.userId;
ActivityInfo activityInfo = ssp.getActivityInfo(cn, userId);
if (activityInfo == null) {
return;
}
// Inflate the overlay if necessary
if (mAppOverlayView == null) {
mAppOverlayView = (FrameLayout) Utilities.findViewStubById(this, R.id.app_overlay_stub).inflate();
mAppOverlayView.setBackground(mOverlayBackground);
mAppIconView = (ImageView) mAppOverlayView.findViewById(R.id.app_icon);
mAppIconView.setOnClickListener(this);
mAppIconView.setOnLongClickListener(this);
mAppInfoView = (ImageView) mAppOverlayView.findViewById(R.id.app_info);
mAppInfoView.setOnClickListener(this);
mAppTitleView = (TextView) mAppOverlayView.findViewById(R.id.app_title);
updateLayoutParams(mAppIconView, mAppTitleView, null, mAppInfoView);
}
// Update the overlay contents for the current app
mAppTitleView.setText(ssp.getBadgedApplicationLabel(activityInfo.applicationInfo, userId));
mAppTitleView.setTextColor(mTask.useLightOnPrimaryColor ? mTaskBarViewLightTextColor : mTaskBarViewDarkTextColor);
mAppIconView.setImageDrawable(ssp.getBadgedApplicationIcon(activityInfo.applicationInfo, userId));
mAppInfoView.setImageDrawable(mTask.useLightOnPrimaryColor ? mLightInfoIcon : mDarkInfoIcon);
mAppOverlayView.setVisibility(View.VISIBLE);
int x = mIconView.getLeft() + mIconView.getWidth() / 2;
int y = mIconView.getTop() + mIconView.getHeight() / 2;
Animator revealAnim = ViewAnimationUtils.createCircularReveal(mAppOverlayView, x, y, 0, getWidth());
revealAnim.setDuration(OVERLAY_REVEAL_DURATION);
revealAnim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
revealAnim.start();
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskStackView method updateLayoutAlgorithm.
/**
* Updates the layout algorithm min and max virtual scroll bounds.
*/
public void updateLayoutAlgorithm(boolean boundScrollToNewMinMax) {
// Compute the min and max scroll values
mLayoutAlgorithm.update(mStack, mIgnoreTasks);
// Update the freeform workspace background
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
mTmpRect.set(mLayoutAlgorithm.mFreeformRect);
mFreeformWorkspaceBackground.setBounds(mTmpRect);
}
if (boundScrollToNewMinMax) {
mStackScroller.boundScroll();
}
}
Aggregations