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

Commit ad12b76a authored by Fan Zhang's avatar Fan Zhang
Browse files

Add a timeout waiting for contextual card loader.

- Intially setting it to 1 second.
- Also changed card appear animation from drop in to fade in. It looks
  less janky if we don't animate any size change.
- And some random code cleanup

Change-Id: I6e73bcf98fd9aa1d76ae002b94ab5b068dfecf1e
Fixes: 120916829
Test: robotests
parent 07933cb9
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -18,25 +18,10 @@
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:duration="500">

    <!-- Move up the view by 20% of it’s own height, and let it fall down to its final position -->
    <translate
        android:fromYDelta="-20%"
        android:toYDelta="0"
        android:interpolator="@android:anim/decelerate_interpolator"/>

    <!-- Fade in: alpha from 0 to 100% -->
    <alpha
        android:fromAlpha="0"
        android:toAlpha="1"
        android:interpolator="@android:anim/decelerate_interpolator"/>

    <!-- Shrink from 105% to 100% -->
    <scale
        android:fromXScale="105%"
        android:fromYScale="105%"
        android:toXScale="100%"
        android:toYScale="100%"
        android:pivotX="50%"
        android:pivotY="50%"
        android:interpolator="@android:anim/decelerate_interpolator"/>
</set>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -17,6 +17,6 @@

<layoutAnimation
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:animation="@anim/item_animation_fall_down"
    android:animation="@anim/item_animation_fade_in"
    android:delay="15%"
    android:animationOrder="normal"/>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -25,6 +25,6 @@
        android:id="@+id/card_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layoutAnimation="@anim/layout_animation_fall_down"/>
        android:layoutAnimation="@anim/layout_animation_fade_in"/>

</LinearLayout>
+4 −4
Original line number Diff line number Diff line
@@ -24,16 +24,16 @@ import java.util.List;
public interface ContextualCardFeatureProvider {

    /** Homepage displays. */
    public void logHomepageDisplay(Context context, Long latency);
    void logHomepageDisplay(Context context, long latency);

    /** When user clicks dismiss in contextual card */
    public void logContextualCardDismiss(Context context, ContextualCard card);
    void logContextualCardDismiss(Context context, ContextualCard card);

    /** After ContextualCardManager decides which cards will be displayed/hidden */
    public void logContextualCardDisplay(Context context, List<ContextualCard> showedCards,
    void logContextualCardDisplay(Context context, List<ContextualCard> showedCards,
            List<ContextualCard> hiddenCards);

    /** When user clicks toggle/title area of a contextual card. */
    public void logContextualCardClick(Context context, ContextualCard card, int row,
    void logContextualCardClick(Context context, ContextualCard card, int row,
            int tapTarget);
}
+4 −5
Original line number Diff line number Diff line
@@ -85,11 +85,10 @@ public class ContextualCardFeatureProviderImpl implements ContextualCardFeatureP
    private static final int TARGET_SLIDER = 3;

    @Override
    public void logHomepageDisplay(Context context, Long latency) {
        final Intent intent = new Intent();
        intent.putExtra(EXTRA_CONTEXTUALCARD_ACTION_TYPE, CONTEXTUAL_HOME_SHOW);
        intent.putExtra(EXTRA_LATENCY, latency);
        sendBroadcast(context, intent);
    public void logHomepageDisplay(Context context, long latency) {
        sendBroadcast(context, new Intent()
                .putExtra(EXTRA_CONTEXTUALCARD_ACTION_TYPE, CONTEXTUAL_HOME_SHOW)
                .putExtra(EXTRA_LATENCY, latency));
    }

    @Override
Loading