Merge "PIP: Changed the wording and background of the PIP onboarding screen" into nyc-dev
am: b27a5fd
* commit 'b27a5fd45b2ae461cfa61dfff52e897d236d0d26':
PIP: Changed the wording and background of the PIP onboarding screen
Change-Id: I9eeaf9e51346ad900945a927c1c05816d9172de4
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
<?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>
|
||||||
@@ -21,8 +21,13 @@
|
|||||||
android:id="@+id/pip_onboarding"
|
android:id="@+id/pip_onboarding"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#B3000000"
|
|
||||||
android:orientation="vertical">
|
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
|
<ImageView
|
||||||
android:id="@+id/remote"
|
android:id="@+id/remote"
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
<!-- Delay between the start of slide in animation for each card. -->
|
<!-- Delay between the start of slide in animation for each card. -->
|
||||||
<integer name="recents_home_delay">40</integer>
|
<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 -->
|
<!-- Duration of the onboarding animation duration -->
|
||||||
<integer name="tv_pip_onboarding_anim_duration">1000</integer>
|
<integer name="tv_pip_onboarding_anim_duration">1000</integer>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -32,9 +32,9 @@
|
|||||||
<!-- Picture-in-Picture (PIP) onboarding screen -->
|
<!-- Picture-in-Picture (PIP) onboarding screen -->
|
||||||
<eat-comment />
|
<eat-comment />
|
||||||
<!-- Title for picture-in-picture (PIP) onboarding screen to indicate that an user is in PIP mode. [CHAR LIMIT=NONE] -->
|
<!-- 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] -->
|
<!-- 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. -->
|
<!-- Button to close picture-in-picture (PIP) onboarding screen. -->
|
||||||
<string name="pip_onboarding_button">Got it</string>
|
<string name="pip_onboarding_button">Got it</string>
|
||||||
<!-- Dismiss icon description -->
|
<!-- Dismiss icon description -->
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.app.Activity;
|
|||||||
import android.graphics.drawable.AnimationDrawable;
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
@@ -33,6 +34,7 @@ import com.android.systemui.R;
|
|||||||
*/
|
*/
|
||||||
public class PipOnboardingActivity extends Activity implements PipManager.Listener {
|
public class PipOnboardingActivity extends Activity implements PipManager.Listener {
|
||||||
private final PipManager mPipManager = PipManager.getInstance();
|
private final PipManager mPipManager = PipManager.getInstance();
|
||||||
|
private AnimatorSet mEnterAnimator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle bundle) {
|
protected void onCreate(Bundle bundle) {
|
||||||
@@ -51,22 +53,25 @@ public class PipOnboardingActivity extends Activity implements PipManager.Listen
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
AnimatorSet enterAnimator = new AnimatorSet();
|
mEnterAnimator = new AnimatorSet();
|
||||||
enterAnimator.playTogether(
|
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, R.anim.tv_pip_onboarding_image_enter_animation),
|
||||||
loadAnimator(R.id.remote_button, 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.title, R.anim.tv_pip_onboarding_title_enter_animation),
|
||||||
loadAnimator(R.id.description,
|
loadAnimator(R.id.description,
|
||||||
R.anim.tv_pip_onboarding_description_enter_animation),
|
R.anim.tv_pip_onboarding_description_enter_animation),
|
||||||
loadAnimator(R.id.button, R.anim.tv_pip_onboarding_button_enter_animation));
|
loadAnimator(R.id.button, R.anim.tv_pip_onboarding_button_enter_animation));
|
||||||
enterAnimator.addListener(new AnimatorListenerAdapter() {
|
mEnterAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animator animation) {
|
public void onAnimationStart(Animator animation) {
|
||||||
ImageView button = (ImageView) findViewById(R.id.remote_button);
|
ImageView button = (ImageView) findViewById(R.id.remote_button);
|
||||||
((AnimationDrawable) button.getDrawable()).start();
|
((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) {
|
private Animator loadAnimator(int viewResId, int animResId) {
|
||||||
@@ -75,6 +80,22 @@ public class PipOnboardingActivity extends Activity implements PipManager.Listen
|
|||||||
return animator;
|
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
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|||||||
Reference in New Issue
Block a user