Loading src/com/android/contacts/compat/EdgeEffectCompat.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 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.contacts.compat; import android.widget.EdgeEffect; import com.android.contacts.common.compat.CompatUtils; /** * Compatibility class for {@link android.widget.EdgeEffect} * The android.support.v4.widget.EdgeEffectCompat doesn't support customized color, so we write * our own and keep using EdgeEffect to customize color. */ public class EdgeEffectCompat { /** * Compatibility method for {@link EdgeEffect#onPull(float, float)}, which is only available * on Lollipop+. */ public static void onPull(EdgeEffect edgeEffect, float deltaDistance, float displacement) { if (CompatUtils.isLollipopCompatible()) { edgeEffect.onPull(deltaDistance, displacement); } else { edgeEffect.onPull(deltaDistance); } } } src/com/android/contacts/quickcontact/QuickContactActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.activity.RequestPermissionsActivity; import com.android.contacts.common.compat.CompatUtils; import com.android.contacts.common.compat.EventCompat; import com.android.contacts.common.dialog.CallSubjectDialog; import com.android.contacts.common.editor.SelectAccountDialogFragment; import com.android.contacts.common.interactions.TouchPointManager; Loading Loading @@ -1803,7 +1804,7 @@ public class QuickContactActivity extends ContactsActivity } header = res.getString(R.string.header_event_entry); if (event.hasKindTypeColumn(kind)) { subHeader = Event.getTypeLabel(res, event.getKindTypeColumn(kind), subHeader = EventCompat.getTypeLabel(res, event.getKindTypeColumn(kind), event.getLabel()).toString(); } text = DateUtils.formatDate(context, dataString); Loading src/com/android/contacts/widget/MultiShrinkScroller.java +3 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.contacts.widget; import com.android.contacts.R; import com.android.contacts.common.compat.CompatUtils; import com.android.contacts.compat.EdgeEffectCompat; import com.android.contacts.quickcontact.ExpandingEntryCardView; import com.android.contacts.test.NeededForReflection; import com.android.contacts.util.SchedulingUtils; Loading Loading @@ -501,7 +502,8 @@ public class MultiShrinkScroller extends FrameLayout { if (delta > distanceFromMaxScrolling) { // The ScrollView is being pulled upwards while there is no more // content offscreen, and the view port is already fully expanded. mEdgeGlowBottom.onPull(delta / getHeight(), 1 - event.getX() / getWidth()); EdgeEffectCompat.onPull(mEdgeGlowBottom, delta / getHeight(), 1 - event.getX() / getWidth()); } if (!mEdgeGlowBottom.isFinished()) { Loading Loading
src/com/android/contacts/compat/EdgeEffectCompat.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 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.contacts.compat; import android.widget.EdgeEffect; import com.android.contacts.common.compat.CompatUtils; /** * Compatibility class for {@link android.widget.EdgeEffect} * The android.support.v4.widget.EdgeEffectCompat doesn't support customized color, so we write * our own and keep using EdgeEffect to customize color. */ public class EdgeEffectCompat { /** * Compatibility method for {@link EdgeEffect#onPull(float, float)}, which is only available * on Lollipop+. */ public static void onPull(EdgeEffect edgeEffect, float deltaDistance, float displacement) { if (CompatUtils.isLollipopCompatible()) { edgeEffect.onPull(deltaDistance, displacement); } else { edgeEffect.onPull(deltaDistance); } } }
src/com/android/contacts/quickcontact/QuickContactActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.activity.RequestPermissionsActivity; import com.android.contacts.common.compat.CompatUtils; import com.android.contacts.common.compat.EventCompat; import com.android.contacts.common.dialog.CallSubjectDialog; import com.android.contacts.common.editor.SelectAccountDialogFragment; import com.android.contacts.common.interactions.TouchPointManager; Loading Loading @@ -1803,7 +1804,7 @@ public class QuickContactActivity extends ContactsActivity } header = res.getString(R.string.header_event_entry); if (event.hasKindTypeColumn(kind)) { subHeader = Event.getTypeLabel(res, event.getKindTypeColumn(kind), subHeader = EventCompat.getTypeLabel(res, event.getKindTypeColumn(kind), event.getLabel()).toString(); } text = DateUtils.formatDate(context, dataString); Loading
src/com/android/contacts/widget/MultiShrinkScroller.java +3 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.contacts.widget; import com.android.contacts.R; import com.android.contacts.common.compat.CompatUtils; import com.android.contacts.compat.EdgeEffectCompat; import com.android.contacts.quickcontact.ExpandingEntryCardView; import com.android.contacts.test.NeededForReflection; import com.android.contacts.util.SchedulingUtils; Loading Loading @@ -501,7 +502,8 @@ public class MultiShrinkScroller extends FrameLayout { if (delta > distanceFromMaxScrolling) { // The ScrollView is being pulled upwards while there is no more // content offscreen, and the view port is already fully expanded. mEdgeGlowBottom.onPull(delta / getHeight(), 1 - event.getX() / getWidth()); EdgeEffectCompat.onPull(mEdgeGlowBottom, delta / getHeight(), 1 - event.getX() / getWidth()); } if (!mEdgeGlowBottom.isFinished()) { Loading