Merge "ApiDemos: Add maxAspectRatio demo" into pi-dev

am: 246c5bb514

Change-Id: I56ab2e775c876af36c38cd4de5f6966b5518e5ba
This commit is contained in:
Adrian Roos
2018-03-15 16:54:59 +00:00
committed by android-build-merger
3 changed files with 66 additions and 0 deletions

View File

@@ -298,6 +298,38 @@
</intent-filter>
</activity>
<activity android:name=".app.MaxAspectRatio$Square"
android:label="@string/activity_max_aspect_ratio_square"
android:resizeableActivity="false"
android:theme="@android:style/Theme.DeviceDefault.Settings"
android:maxAspectRatio="1">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".app.MaxAspectRatio$SixteenToNine"
android:label="@string/activity_max_aspect_ratio_16to9"
android:resizeableActivity="false"
android:theme="@android:style/Theme.DeviceDefault.Settings"
android:maxAspectRatio="1.77777778">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".app.MaxAspectRatio$Any"
android:label="@string/activity_max_aspect_ratio_any"
android:resizeableActivity="true"
android:theme="@android:style/Theme.DeviceDefault.Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".app.PresentationActivity"
android:label="@string/activity_presentation">
<intent-filter>

View File

@@ -63,6 +63,9 @@
<string name="screen_orientation">Screen Orientation</string>
<string name="activity_picture_in_picture">App/Activity/Picture in Picture</string>
<string name="activity_max_aspect_ratio_square">App/Activity/Max Aspect Ratio/1:1</string>
<string name="activity_max_aspect_ratio_16to9">App/Activity/Max Aspect Ratio/16:9</string>
<string name="activity_max_aspect_ratio_any">App/Activity/Max Aspect Ratio/Any</string>
<string name="enter_picture_in_picture">Enter picture-in-picture mode</string>
<string name="activity_translucent">App/Activity/Translucent</string>

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2018 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.
*/
package com.example.android.apis.app;
import android.app.Activity;
public abstract class MaxAspectRatio extends Activity {
public static class Square extends MaxAspectRatio {
}
public static class SixteenToNine extends MaxAspectRatio {
}
public static class Any extends MaxAspectRatio {
}
}