Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb701aaa authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Updated launcher assets part 2.

 - fixed centering on new pagination indicators
 - also tuned the pagination animation a bit to make the
   size change feel more natural

Bug: 10807054
Change-Id: I0953cff80bfeecf085172f710a4bc947133115ed
parent 94e01d60
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -16,20 +16,24 @@
<com.android.launcher3.PageIndicatorMarker
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_width="16dp"
    android:layout_height="16dp"
    android:layout_gravity="center_vertical">
    <ImageView
        android:id="@+id/inactive"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerInside"
        android:src="@drawable/custom_content_page"
        />
    <ImageView
        android:id="@+id/active"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerInside"
        android:src="@drawable/custom_content_page"
        android:alpha="0"
        android:scaleX="0.5"
        android:scaleY="0.5"
        />
</com.android.launcher3.PageIndicatorMarker>
+8 −4
Original line number Diff line number Diff line
@@ -21,15 +21,19 @@
    android:layout_gravity="center_vertical">
    <ImageView
        android:id="@+id/inactive"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerInside"
        android:src="@drawable/ic_pageindicator_default"
        />
    <ImageView
        android:id="@+id/active"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerInside"
        android:src="@drawable/ic_pageindicator_current"
        android:alpha="0"
        android:scaleX="0.5"
        android:scaleY="0.5"
        />
</com.android.launcher3.PageIndicatorMarker>
+15 −3
Original line number Diff line number Diff line
@@ -57,26 +57,38 @@ public class PageIndicatorMarker extends FrameLayout {
        if (immediate) {
            mActiveMarker.animate().cancel();
            mActiveMarker.setAlpha(1f);
            mActiveMarker.setScaleX(1f);
            mActiveMarker.setScaleY(1f);
            mInactiveMarker.animate().cancel();
            mInactiveMarker.setAlpha(0f);
        } else {
            mActiveMarker.animate().alpha(1f)
            mActiveMarker.animate()
                    .alpha(1f)
                    .scaleX(1f)
                    .scaleY(1f)
                    .setDuration(MARKER_FADE_DURATION).start();
            mInactiveMarker.animate().alpha(0f)
            mInactiveMarker.animate()
                    .alpha(0f)
                    .setDuration(MARKER_FADE_DURATION).start();
        }
        mIsActive = true;
    }

    void inactivate(boolean immediate) {
        if (immediate) {
            mInactiveMarker.animate().cancel();
            mInactiveMarker.setAlpha(1f);
            mActiveMarker.animate().cancel();
            mActiveMarker.setAlpha(0f);
            mActiveMarker.setScaleX(0.5f);
            mActiveMarker.setScaleY(0.5f);
        } else {
            mInactiveMarker.animate().alpha(1f)
                    .setDuration(MARKER_FADE_DURATION).start();
            mActiveMarker.animate().alpha(0f)
            mActiveMarker.animate()
                    .alpha(0f)
                    .scaleX(0.5f)
                    .scaleY(0.5f)
                    .setDuration(MARKER_FADE_DURATION).start();
        }
        mIsActive = false;