Merge tm-qpr-dev-plus-aosp-without-vendor@9467136
Bug: 264720040 Merged-In: Ia275a2ab69ee31b7d81a2ca8c83bef08cbf107df Change-Id: I7d4f8d91bb43f0094687c9bc74bda2d7aef3d124
This commit is contained in:
@@ -161,7 +161,10 @@ genrule {
|
|||||||
java_device_for_host {
|
java_device_for_host {
|
||||||
name: "build-tools_core-lambda-stubs-device",
|
name: "build-tools_core-lambda-stubs-device",
|
||||||
visibility: ["//visibility:private"],
|
visibility: ["//visibility:private"],
|
||||||
libs: ["core-lambda-stubs"],
|
// Use the prebuilt of the stubs irrespective of whether prebuilts are enabled
|
||||||
|
// in this build configuration. This ensures that this non-host specific library
|
||||||
|
// is treated consistently on all hosts.
|
||||||
|
libs: ["prebuilt_core-lambda-stubs"],
|
||||||
target: {
|
target: {
|
||||||
windows: {
|
windows: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|||||||
@@ -102,6 +102,24 @@
|
|||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/label_aspect_ratio" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/aspect_ratio"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/enter_pip_button"
|
android:id="@+id/enter_pip_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
~ See the License for the specific language governing permissions and
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
<!-- Note that app:aspectRatio can be changed dynamically. -->
|
||||||
<com.example.android.apis.view.FixedAspectRatioImageView
|
<com.example.android.apis.view.FixedAspectRatioImageView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
|||||||
@@ -74,6 +74,15 @@
|
|||||||
<string name="label_exit_position">Exit position</string>
|
<string name="label_exit_position">Exit position</string>
|
||||||
<string name="label_position_start">Start</string>
|
<string name="label_position_start">Start</string>
|
||||||
<string name="label_position_end">End</string>
|
<string name="label_position_end">End</string>
|
||||||
|
<string name="label_aspect_ratio">Aspect Ratio</string>
|
||||||
|
<!-- List of aspect ratio to demo, we use Rational.parseRational to parse what's inside () -->
|
||||||
|
<string-array name="aspect_ratio_list">
|
||||||
|
<item>Extreme wide (21/9)</item>
|
||||||
|
<item>Video (16/9)</item>
|
||||||
|
<item>Square (1/1)</item>
|
||||||
|
<item>Video call (9/16)</item>
|
||||||
|
<item>Extreme tall (9/21)</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string name="activity_keep_clear">App/Activity/Keep Clear Rects</string>
|
<string name="activity_keep_clear">App/Activity/Keep Clear Rects</string>
|
||||||
<string name="keep_clear_property_set">
|
<string name="keep_clear_property_set">
|
||||||
|
|||||||
@@ -39,14 +39,18 @@ import android.util.Rational;
|
|||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.window.OnBackInvokedDispatcher;
|
import android.window.OnBackInvokedDispatcher;
|
||||||
|
|
||||||
import com.example.android.apis.R;
|
import com.example.android.apis.R;
|
||||||
|
import com.example.android.apis.view.FixedAspectRatioImageView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -57,6 +61,7 @@ public class PictureInPicture extends Activity {
|
|||||||
private static final String EXTRA_ENABLE_SEAMLESS_RESIZE = "seamless_resize";
|
private static final String EXTRA_ENABLE_SEAMLESS_RESIZE = "seamless_resize";
|
||||||
private static final String EXTRA_ENTER_PIP_ON_BACK = "enter_pip_on_back";
|
private static final String EXTRA_ENTER_PIP_ON_BACK = "enter_pip_on_back";
|
||||||
private static final String EXTRA_CURRENT_POSITION = "current_position";
|
private static final String EXTRA_CURRENT_POSITION = "current_position";
|
||||||
|
private static final String EXTRA_ASPECT_RATIO = "aspect_ratio";
|
||||||
|
|
||||||
private static final int TABLET_BREAK_POINT_DP = 700;
|
private static final int TABLET_BREAK_POINT_DP = 700;
|
||||||
|
|
||||||
@@ -95,13 +100,14 @@ public class PictureInPicture extends Activity {
|
|||||||
(v, id) -> updateContentPosition(id);
|
(v, id) -> updateContentPosition(id);
|
||||||
|
|
||||||
private LinearLayout mContainer;
|
private LinearLayout mContainer;
|
||||||
private ImageView mImageView;
|
private FixedAspectRatioImageView mImageView;
|
||||||
private View mControlGroup;
|
private View mControlGroup;
|
||||||
private Switch mAutoPipToggle;
|
private Switch mAutoPipToggle;
|
||||||
private Switch mSourceRectHintToggle;
|
private Switch mSourceRectHintToggle;
|
||||||
private Switch mSeamlessResizeToggle;
|
private Switch mSeamlessResizeToggle;
|
||||||
private Switch mEnterPipOnBackToggle;
|
private Switch mEnterPipOnBackToggle;
|
||||||
private RadioGroup mCurrentPositionGroup;
|
private RadioGroup mCurrentPositionGroup;
|
||||||
|
private Spinner mAspectRatioSpinner;
|
||||||
private List<RemoteAction> mPipActions;
|
private List<RemoteAction> mPipActions;
|
||||||
private RemoteAction mCloseAction;
|
private RemoteAction mCloseAction;
|
||||||
|
|
||||||
@@ -119,6 +125,13 @@ public class PictureInPicture extends Activity {
|
|||||||
mSeamlessResizeToggle = findViewById(R.id.seamless_resize_toggle);
|
mSeamlessResizeToggle = findViewById(R.id.seamless_resize_toggle);
|
||||||
mEnterPipOnBackToggle = findViewById(R.id.enter_pip_on_back);
|
mEnterPipOnBackToggle = findViewById(R.id.enter_pip_on_back);
|
||||||
mCurrentPositionGroup = findViewById(R.id.current_position);
|
mCurrentPositionGroup = findViewById(R.id.current_position);
|
||||||
|
mAspectRatioSpinner = findViewById(R.id.aspect_ratio);
|
||||||
|
|
||||||
|
// Initiate views if applicable
|
||||||
|
final ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
||||||
|
R.array.aspect_ratio_list, android.R.layout.simple_spinner_item);
|
||||||
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
mAspectRatioSpinner.setAdapter(adapter);
|
||||||
|
|
||||||
// Attach listeners
|
// Attach listeners
|
||||||
mImageView.addOnLayoutChangeListener(mOnLayoutChangeListener);
|
mImageView.addOnLayoutChangeListener(mOnLayoutChangeListener);
|
||||||
@@ -135,6 +148,22 @@ public class PictureInPicture extends Activity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
mCurrentPositionGroup.setOnCheckedChangeListener(mOnPositionChangedListener);
|
mCurrentPositionGroup.setOnCheckedChangeListener(mOnPositionChangedListener);
|
||||||
|
mAspectRatioSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
final String rawText = parent.getItemAtPosition(position).toString();
|
||||||
|
final String textToParse = rawText.substring(
|
||||||
|
rawText.indexOf('(') + 1,
|
||||||
|
rawText.indexOf(')'));
|
||||||
|
mImageView.addOnLayoutChangeListener(mOnLayoutChangeListener);
|
||||||
|
mImageView.setAspectRatio(Rational.parseRational(textToParse));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
});
|
||||||
findViewById(R.id.enter_pip_button).setOnClickListener(v -> enterPictureInPictureMode());
|
findViewById(R.id.enter_pip_button).setOnClickListener(v -> enterPictureInPictureMode());
|
||||||
findViewById(R.id.enter_content_pip_button).setOnClickListener(v -> enterContentPip());
|
findViewById(R.id.enter_content_pip_button).setOnClickListener(v -> enterContentPip());
|
||||||
|
|
||||||
@@ -152,6 +181,7 @@ public class PictureInPicture extends Activity {
|
|||||||
? R.id.radio_current_end
|
? R.id.radio_current_end
|
||||||
: R.id.radio_current_start;
|
: R.id.radio_current_start;
|
||||||
mCurrentPositionGroup.check(positionId);
|
mCurrentPositionGroup.check(positionId);
|
||||||
|
mAspectRatioSpinner.setSelection(1);
|
||||||
|
|
||||||
updateLayout(getResources().getConfiguration());
|
updateLayout(getResources().getConfiguration());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import com.example.android.apis.R;
|
|||||||
* one of the dimension is in exact while the other one in wrap_content size mode.
|
* one of the dimension is in exact while the other one in wrap_content size mode.
|
||||||
*/
|
*/
|
||||||
public class FixedAspectRatioImageView extends ImageView {
|
public class FixedAspectRatioImageView extends ImageView {
|
||||||
private final Rational mAspectRatio;
|
private Rational mAspectRatio;
|
||||||
|
|
||||||
public FixedAspectRatioImageView(Context context, AttributeSet attrs) {
|
public FixedAspectRatioImageView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -43,6 +43,13 @@ public class FixedAspectRatioImageView extends ImageView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAspectRatio(Rational aspectRatio) {
|
||||||
|
if (!mAspectRatio.equals(aspectRatio)) {
|
||||||
|
mAspectRatio = aspectRatio;
|
||||||
|
requestLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
Pkg.UserSrc=false
|
Pkg.UserSrc=false
|
||||||
Pkg.Revision=${PLATFORM_SDK_VERSION}.0.1
|
Pkg.Revision=${PLATFORM_SDK_VERSION}.0.2
|
||||||
#Pkg.Revision=33.0.0 rc4
|
#Pkg.Revision=33.0.0 rc4
|
||||||
|
|||||||
3
tools/motion/OWNERS
Normal file
3
tools/motion/OWNERS
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
cinek@google.com
|
||||||
|
gallmann@google.com
|
||||||
|
michschn@google.com
|
||||||
Reference in New Issue
Block a user