summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/PageIndicatorMarker.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-07-16 11:11:32 -0700
committerWinson Chung <winsonc@google.com>2013-07-17 11:15:22 -0700
commitd2be381d36485059d0108ae89cfe57a30a7a8499 (patch)
tree105185b3b15aed3a1ea825a8f6f73e54a1c5fec2 /src/com/android/launcher3/PageIndicatorMarker.java
parentb5da44583957ffe9b0311074eeb77d33e753a9e5 (diff)
downloadandroid_packages_apps_Trebuchet-d2be381d36485059d0108ae89cfe57a30a7a8499.tar.gz
android_packages_apps_Trebuchet-d2be381d36485059d0108ae89cfe57a30a7a8499.tar.bz2
android_packages_apps_Trebuchet-d2be381d36485059d0108ae89cfe57a30a7a8499.zip
Removing old scroll indicator and adding page indicator dots.
Change-Id: I44c5b4b532e8464010d45dd0a3dfeccb2d475216
Diffstat (limited to 'src/com/android/launcher3/PageIndicatorMarker.java')
-rw-r--r--src/com/android/launcher3/PageIndicatorMarker.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/com/android/launcher3/PageIndicatorMarker.java b/src/com/android/launcher3/PageIndicatorMarker.java
new file mode 100644
index 000000000..852ee518f
--- /dev/null
+++ b/src/com/android/launcher3/PageIndicatorMarker.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2011 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.launcher3;
+
+import android.animation.LayoutTransition;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import com.android.launcher3.R;
+
+public class PageIndicatorMarker extends FrameLayout {
+ @SuppressWarnings("unused")
+ private static final String TAG = "PageIndicator";
+
+ private static final int MARKER_FADE_DURATION = 150;
+
+ private View mActiveMarker;
+ private View mInactiveMarker;
+
+ public PageIndicatorMarker(Context context) {
+ this(context, null);
+ }
+
+ public PageIndicatorMarker(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public PageIndicatorMarker(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ protected void onFinishInflate() {
+ mActiveMarker = findViewById(R.id.active);
+ mInactiveMarker = findViewById(R.id.inactive);
+ }
+
+ public void activate() {
+ mActiveMarker.animate().alpha(1f)
+ .setDuration(MARKER_FADE_DURATION).start();
+ mInactiveMarker.animate().alpha(0f)
+ .setDuration(MARKER_FADE_DURATION).start();
+ }
+ public void inactivate() {
+ mInactiveMarker.animate().alpha(1f)
+ .setDuration(MARKER_FADE_DURATION).start();
+ mActiveMarker.animate().alpha(0f)
+ .setDuration(MARKER_FADE_DURATION).start();
+ }
+}