Loading core/res/res/layout/keyguard_add_widget.xml +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ android:layout_height="match_parent" android:gravity="center_horizontal"> <ImageView android:id="@+id/keyguard_add_widget_view" android:clickable="true" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/add_widget" /> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1311,6 +1311,7 @@ <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="keyguard_add_widget" /> <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="keyguard_add_widget_view" /> <java-symbol type="integer" name="config_carDockRotation" /> <java-symbol type="integer" name="config_defaultUiModeType" /> Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +26 −0 Original line number Diff line number Diff line Loading @@ -35,7 +35,9 @@ import android.graphics.Rect; import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.util.Slog; Loading Loading @@ -518,6 +520,8 @@ public class KeyguardHostView extends KeyguardViewBase { if (mViewMediatorCallback != null) { mViewMediatorCallback.keyguardDone(true); } } else { mViewStateManager.showBouncer(true); } } Loading Loading @@ -836,6 +840,28 @@ public class KeyguardHostView extends KeyguardViewBase { View cameraWidget = inflater.inflate(R.layout.keyguard_camera_widget, null, true); mAppWidgetContainer.addWidget(cameraWidget); View addWidgetButton = addWidget.findViewById(R.id.keyguard_add_widget_view); addWidgetButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mCallback.setOnDismissRunnable(new Runnable() { @Override public void run() { Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS); intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); } }); mCallback.dismiss(false); } }); inflateAndAddUserSelectorWidgetIfNecessary(); initializeTransportControl(); } Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.policy.impl.keyguard; import android.view.View; Loading Loading @@ -31,6 +46,10 @@ public class KeyguardViewStateManager implements SlidingChallengeLayout.OnChalle public void onPageEndMoving() { } public void showBouncer(boolean show) { mSlidingChallengeLayout.showChallenge(show); } public void onPageSwitch(View newPage, int newPageIndex) { // Reset the previous page size and ensure the current page is sized appropriately if (mPagedView != null) { Loading policy/src/com/android/internal/policy/impl/keyguard/PagedView.java +27 −28 Original line number Diff line number Diff line Loading @@ -1371,7 +1371,6 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL int oldX = getOffsetX() + getChildOffset(i); int newX = getOffsetX() + getChildOffset(i + shiftDelta); // Animate the view translation from its old position to its new // position AnimatorSet anim = (AnimatorSet) v.getTag(); Loading Loading @@ -2123,8 +2122,8 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL final View dragView = mDragView; from.left = (int) dragView.getTranslationX(); from.top = (int) dragView.getTranslationY(); AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel, from, startTime, FLING_TO_DELETE_FRICTION); AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel, from, startTime, FLING_TO_DELETE_FRICTION); final Runnable onAnimationEndRunnable = new Runnable() { @Override Loading Loading
core/res/res/layout/keyguard_add_widget.xml +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ android:layout_height="match_parent" android:gravity="center_horizontal"> <ImageView android:id="@+id/keyguard_add_widget_view" android:clickable="true" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/add_widget" /> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1311,6 +1311,7 @@ <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="keyguard_add_widget" /> <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="keyguard_add_widget_view" /> <java-symbol type="integer" name="config_carDockRotation" /> <java-symbol type="integer" name="config_defaultUiModeType" /> Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +26 −0 Original line number Diff line number Diff line Loading @@ -35,7 +35,9 @@ import android.graphics.Rect; import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.util.Slog; Loading Loading @@ -518,6 +520,8 @@ public class KeyguardHostView extends KeyguardViewBase { if (mViewMediatorCallback != null) { mViewMediatorCallback.keyguardDone(true); } } else { mViewStateManager.showBouncer(true); } } Loading Loading @@ -836,6 +840,28 @@ public class KeyguardHostView extends KeyguardViewBase { View cameraWidget = inflater.inflate(R.layout.keyguard_camera_widget, null, true); mAppWidgetContainer.addWidget(cameraWidget); View addWidgetButton = addWidget.findViewById(R.id.keyguard_add_widget_view); addWidgetButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mCallback.setOnDismissRunnable(new Runnable() { @Override public void run() { Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS); intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); } }); mCallback.dismiss(false); } }); inflateAndAddUserSelectorWidgetIfNecessary(); initializeTransportControl(); } Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.policy.impl.keyguard; import android.view.View; Loading Loading @@ -31,6 +46,10 @@ public class KeyguardViewStateManager implements SlidingChallengeLayout.OnChalle public void onPageEndMoving() { } public void showBouncer(boolean show) { mSlidingChallengeLayout.showChallenge(show); } public void onPageSwitch(View newPage, int newPageIndex) { // Reset the previous page size and ensure the current page is sized appropriately if (mPagedView != null) { Loading
policy/src/com/android/internal/policy/impl/keyguard/PagedView.java +27 −28 Original line number Diff line number Diff line Loading @@ -1371,7 +1371,6 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL int oldX = getOffsetX() + getChildOffset(i); int newX = getOffsetX() + getChildOffset(i + shiftDelta); // Animate the view translation from its old position to its new // position AnimatorSet anim = (AnimatorSet) v.getTag(); Loading Loading @@ -2123,8 +2122,8 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL final View dragView = mDragView; from.left = (int) dragView.getTranslationX(); from.top = (int) dragView.getTranslationY(); AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel, from, startTime, FLING_TO_DELETE_FRICTION); AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel, from, startTime, FLING_TO_DELETE_FRICTION); final Runnable onAnimationEndRunnable = new Runnable() { @Override Loading