DO NOT MERGE Hide decor caption APIs
am: 43d246dfa2
* commit '43d246dfa202e01051f942995ed81c1d6128569e':
DO NOT MERGE Hide decor caption APIs
Change-Id: Ie5552afd5c7f9f8357e4a7e9c5de3c7feda539b7
This commit is contained in:
@@ -17,16 +17,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.android.multiwindow">
|
||||
<application android:label="Multi Window">
|
||||
<activity android:name=".CaptionOverlayActivity"
|
||||
android:label="Caption Overlay"
|
||||
android:resizeableActivity="true"
|
||||
android:theme="@android:style/Theme.Holo.Light">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".LaunchingToSideActivity"
|
||||
android:label="Launch To Side"
|
||||
android:resizeableActivity="true">
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2015 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.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/caption_overlay_activity_hello_text"
|
||||
/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/caption_overlay_activity_fish_text"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/caption_overlay_activity_hello_text"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<string name="caption_overlay_activity_hello_text">Hello, World!</string>
|
||||
<string name="caption_overlay_activity_fish_text">Thanks for All the Fish!</string>
|
||||
<string name="launch_settings_to_side">Launch settings to other side</string>
|
||||
<string name="launch_new_task">Launch new task</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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.multiwindow;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
/**
|
||||
* A minimal application that overlays caption on the content.
|
||||
*/
|
||||
public class CaptionOverlayActivity extends Activity
|
||||
implements Window.OnRestrictedCaptionAreaChangedListener {
|
||||
private static final String TAG = "CaptionOverlayActivity";
|
||||
|
||||
/**
|
||||
* Called with the activity is first created.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Overlay the caption on the content.
|
||||
setOverlayWithDecorCaptionEnabled(true);
|
||||
setContentView(R.layout.caption_overlay_layout);
|
||||
getWindow().setRestrictedCaptionAreaListener(this);
|
||||
getWindow().setResizingCaptionDrawable(new ColorDrawable(Color.BLACK));
|
||||
getWindow().setDecorCaptionShade(Window.DECOR_CAPTION_SHADE_AUTO);
|
||||
|
||||
View decorView = getWindow().getDecorView();
|
||||
//Hide the status bar, because it likes to consume touch events.
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
//Remember that you should never show the action bar if the
|
||||
// status bar is hidden, so hide that too if necessary.
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.hide();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestrictedCaptionAreaChanged(Rect rect) {
|
||||
Log.d(TAG, "rect: " + rect);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user