upload android base code part7
This commit is contained in:
parent
4e516ec6ed
commit
841ae54672
25229 changed files with 1709508 additions and 0 deletions
|
@ -0,0 +1,51 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- This layout contains a TextView and a LogFragment that logs some text to the screen. -->
|
||||
<LinearLayout android:id="@+id/layout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="top"
|
||||
android:layout_weight="0.75">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:textColor="@color/white" />
|
||||
</ScrollView>
|
||||
|
||||
|
||||
<include
|
||||
layout="@layout/logging"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_weight="0.25" />
|
||||
</LinearLayout>
|
|
@ -0,0 +1,124 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/lightgray">
|
||||
|
||||
<ScrollView xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.75"
|
||||
android:background="@color/white"
|
||||
android:layout_gravity="top"
|
||||
android:id="@+id/scrollview"
|
||||
tools:context="com.android.multiwindowplayground.MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/introduction_title"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/warning_multiwindow_disabled"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
style="@style/TextWarning"
|
||||
android:paddingTop="@dimen/content_vertical_dividing_padding"
|
||||
android:paddingBottom="@dimen/content_vertical_dividing_padding"
|
||||
android:text="Enable multi-window mode to see this sample in action!" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/description"
|
||||
android:text="@string/sample_introduction" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/button_start_basic"
|
||||
android:onClick="onStartBasicActivity"
|
||||
android:text="@string/start_default" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/start_unresizable"
|
||||
android:onClick="onStartUnresizableClick"
|
||||
android:text="@string/start_unresizable" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/start_adjacent"
|
||||
android:onClick="onStartAdjacentActivity"
|
||||
android:text="@string/start_adjacent" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/start_customconfiguration"
|
||||
android:onClick="onStartCustomConfigurationActivity"
|
||||
android:text="@string/start_custom_activity" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/content_vertical_dividing_padding"
|
||||
android:text="@string/sample_freeform_introduction" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/start_minimumsize"
|
||||
android:onClick="onStartMinimumSizeActivity"
|
||||
android:text="@string/start_minimum" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/start_launchbounds"
|
||||
android:onClick="onStartLaunchBoundsActivity"
|
||||
android:text="@string/start_bounds" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<include
|
||||
layout="@layout/logging"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_weight="0.25" />
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,24 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/log_fragment"
|
||||
android:name="com.example.android.common.logger.LogFragment" />
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
|
@ -0,0 +1,19 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
</resources>
|
|
@ -0,0 +1,31 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
|
||||
<color name="purple">#512DA8</color>
|
||||
<color name="pink">#C2185B</color>
|
||||
<color name="teal">#00695C</color>
|
||||
<color name="lime">#9E9D24</color>
|
||||
<color name="gray">#424242</color>
|
||||
<color name="lightgray">#F5F5F5</color>
|
||||
<color name="cyan">#00838F</color>
|
||||
|
||||
<color name="white">#FFFFFF</color>
|
||||
</resources>
|
|
@ -0,0 +1,22 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="content_vertical_dividing_padding">16dp</dimen>
|
||||
</resources>
|
|
@ -0,0 +1,66 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">MultiWindow Playground</string>
|
||||
<string name="introduction_title">Multiwindow Playground</string>
|
||||
<string name="sample_introduction">This sample demonstrates the use of the multi-window API
|
||||
available in Android N.\nFirst, switch this app into
|
||||
<b>split-screen mode</b>
|
||||
(for example by long-pressing the recents button). Each button below starts a new activity
|
||||
with special flags.\n<b>See the files MainActivity.java and AndroidManifest.xml for
|
||||
implementation details.</b>
|
||||
</string>
|
||||
<string name="sample_freeform_introduction">The buttons below demonstrate features only
|
||||
available in <b>free-form multi-window mode</b>.</string>
|
||||
<string name="start_default">Start basic, default Activity</string>
|
||||
<string name="start_unresizable">Start unresizable Activity</string>
|
||||
<string name="start_adjacent">Start Activity adjacent</string>
|
||||
<string name="start_minimum">Start Activity with minimum size</string>
|
||||
<string name="start_bounds">Start Activity with launch bounds</string>
|
||||
<string name="start_custom_activity">Start activity that handles configuration changes.</string>
|
||||
|
||||
<string name="activity_description_basic">This Activity was launched in a new task without any
|
||||
additional flags or options.
|
||||
</string>
|
||||
<string name="activity_description_unresizable">This activity is set as unresizable in the
|
||||
AndroidManifest. This is done by setting the <i>resizeableActivity</i> property to
|
||||
<i>false</i> for this activity.
|
||||
</string>
|
||||
<string name="activity_adjacent_description">This activity was launched with the flag
|
||||
<b>Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT</b>.\n\nIf possible, it has been launched into the
|
||||
adjacent area from the activity that started it.\nThis is only a hint to the system. For
|
||||
example - if the application is not in split-screen mode, it will be launched full-screen.
|
||||
If it is launched in the same task as the initial Activity, it will retain its activity
|
||||
properties and its location.
|
||||
</string>
|
||||
<string name="activity_custom_description">This activity handles configuration changes
|
||||
itself.\n\nIn the AndroidManifest, this activity has been configured to receive callbacks
|
||||
for <b>screenSize|smallestScreenSize|screenLayout|orientation</b>
|
||||
changes.\nTry resizing this activity to different sizes to see which configuration
|
||||
properties change.
|
||||
</string>
|
||||
<string name="activity_bounds_description">This activity has been launched with a launch bounds
|
||||
set in its intent. The bounds define the area into which the activity should be launched.
|
||||
\n\nNote that this flag only applies in free-form mode.
|
||||
</string>
|
||||
<string name="activity_minimum_description">This activity has a minimum size.\nIt was launched
|
||||
into the top/end corner with a a default size of 750dp by 500dp, with a minimum size of 750dp
|
||||
as defined in its <b>layout attribute in the AndroidManifest definition</b>.
|
||||
\n\nNote that this Activity was launched in a different task, otherwise the properties from
|
||||
the Activity that launched this one would have been applied.
|
||||
</string>
|
||||
</resources>
|
|
@ -0,0 +1,36 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="MultiWindowSampleTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<!-- Drawable to use in the background while the window is resizing on Android N. -->
|
||||
<item name="android:windowBackgroundFallback">@color/colorAccent</item>
|
||||
<item name="android:windowBackground">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="TextWarning" parent="TextAppearance.AppCompat.Medium">
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
Loading…
Add table
Add a link
Reference in a new issue