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

Commit b96a7859 authored by Jaewan Kim's avatar Jaewan Kim Committed by android-build-merger
Browse files

Merge "PIP: Changed the wording and background of the PIP onboarding screen" into nyc-dev

am: b27a5fd4

* commit 'b27a5fd4':
  PIP: Changed the wording and background of the PIP onboarding screen

Change-Id: I121a159de9c5599ea3769ecc3c6cd50eebadd07f
parents 352a7180 b27a5fd4
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android">

    <objectAnimator
        android:propertyName="alpha"
        android:valueFrom="0"
        android:valueTo="0.9"
        android:interpolator="@android:interpolator/linear"
        android:duration="@integer/tv_pip_onboarding_anim_duration" />
</set>
+6 −1
Original line number Diff line number Diff line
@@ -21,8 +21,13 @@
    android:id="@+id/pip_onboarding"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#B3000000"
    android:orientation="vertical">
    <View
        android:id="@+id/background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#000000"
        android:alpha="0" />

    <ImageView
        android:id="@+id/remote"
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
    <!-- Delay between the start of slide in animation for each card. -->
    <integer name="recents_home_delay">40</integer>

    <!-- Delay of the onboarding animation start after it launches -->
    <integer name="tv_pip_onboarding_anim_start_delay">1000</integer>
    <!-- Duration of the onboarding animation duration -->
    <integer name="tv_pip_onboarding_anim_duration">1000</integer>
</resources>
+2 −2
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@
    <!-- Picture-in-Picture (PIP) onboarding screen -->
    <eat-comment />
    <!-- Title for picture-in-picture (PIP) onboarding screen to indicate that an user is in PIP mode. [CHAR LIMIT=NONE] -->
    <string name="pip_onboarding_title">PIP mode</string>
    <string name="pip_onboarding_title">Picture-in-picture</string>
    <!-- Description for picture-in-picture (PIP) onboarding screen to indicate that longpress HOME key to control PIP. [CHAR LIMIT=NONE] -->
    <string name="pip_onboarding_description">To control PIP press and hold the <b>HOME</b> button on the remote</string>
    <string name="pip_onboarding_description">This keeps your video in view until you play another one. Press and hold <b>HOME</b> to control it.</string>
    <!-- Button to close picture-in-picture (PIP) onboarding screen. -->
    <string name="pip_onboarding_button">Got it</string>
    <!-- Dismiss icon description -->
+25 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.widget.ImageView;

import com.android.systemui.R;
@@ -33,6 +34,7 @@ import com.android.systemui.R;
 */
public class PipOnboardingActivity extends Activity implements PipManager.Listener {
    private final PipManager mPipManager = PipManager.getInstance();
    private AnimatorSet mEnterAnimator;

    @Override
    protected void onCreate(Bundle bundle) {
@@ -51,22 +53,25 @@ public class PipOnboardingActivity extends Activity implements PipManager.Listen
    @Override
    public void onResume() {
        super.onResume();
        AnimatorSet enterAnimator = new AnimatorSet();
        enterAnimator.playTogether(
        mEnterAnimator = new AnimatorSet();
        mEnterAnimator.playTogether(
                loadAnimator(R.id.background, R.anim.tv_pip_onboarding_background_enter_animation),
                loadAnimator(R.id.remote, R.anim.tv_pip_onboarding_image_enter_animation),
                loadAnimator(R.id.remote_button, R.anim.tv_pip_onboarding_image_enter_animation),
                loadAnimator(R.id.title, R.anim.tv_pip_onboarding_title_enter_animation),
                loadAnimator(R.id.description,
                        R.anim.tv_pip_onboarding_description_enter_animation),
                loadAnimator(R.id.button, R.anim.tv_pip_onboarding_button_enter_animation));
        enterAnimator.addListener(new AnimatorListenerAdapter() {
        mEnterAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
                ImageView button = (ImageView) findViewById(R.id.remote_button);
                ((AnimationDrawable) button.getDrawable()).start();
            }
        });
        enterAnimator.start();
        int delay = getResources().getInteger(R.integer.tv_pip_onboarding_anim_start_delay);
        mEnterAnimator.setStartDelay(delay);
        mEnterAnimator.start();
    }

    private Animator loadAnimator(int viewResId, int animResId) {
@@ -75,6 +80,22 @@ public class PipOnboardingActivity extends Activity implements PipManager.Listen
        return animator;
    }

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (mEnterAnimator.isStarted()) {
            return true;
        }
        return super.onKeyUp(keyCode, event);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (mEnterAnimator.isStarted()) {
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onPause() {
        super.onPause();