Merge "Add AVDC demo to Support7Demos" into mnc-ub-dev

This commit is contained in:
Chris Banes
2016-01-29 09:17:08 +00:00
committed by Android (Google) Code Review
8 changed files with 220 additions and 3 deletions

View File

@@ -357,6 +357,15 @@
</intent-filter>
</activity>
<activity android:name=".app.AppCompatAnimatedVector"
android:label="@string/appcompat_vector_title"
android:theme="@style/Theme.AppCompat.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.example.android.supportv7.SAMPLE_CODE" />
</intent-filter>
</activity>
<provider android:name=".app.RecentSuggestionsProvider"
android:authorities="com.example.android.supportv7.RecentSuggestionsProvider" />

View File

@@ -0,0 +1,27 @@
<?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:duration="2000"
android:propertyName="rotation"
android:valueFrom="0"
android:valueTo="360"
android:repeatCount="infinite"
android:interpolator="@android:anim/linear_interpolator"/>
</set>

View File

@@ -0,0 +1,26 @@
<!--
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.
-->
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_drawable_grouping_1">
<target
android:name="sun"
android:animation="@anim/animation_grouping_1_01"/>
<target
android:name="earth"
android:animation="@anim/animation_grouping_1_01"/>
</animated-vector>

View File

@@ -0,0 +1,52 @@
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
android:width="64dp"
android:viewportHeight="256"
android:viewportWidth="256">
<group
android:name="shape_layer_1"
android:translateX="128"
android:translateY="128">
<group android:name="sun">
<path
android:name="ellipse_path_1"
android:fillColor="#ffff8000"
android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0"/>
<group
android:name="earth"
android:translateX="75">
<path
android:name="ellipse_path_1_1"
android:fillColor="#ff5656ea"
android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0"/>
<group
android:name="moon"
android:translateX="25">
<path
android:name="ellipse_path_1_2"
android:fillColor="#ffadadad"
android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0"/>
</group>
</group>
</group>
</group>
</vector>

View File

@@ -0,0 +1,29 @@
<?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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView android:id="@+id/vector_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/animation_vector_drawable_grouping_1"/>
</FrameLayout>

View File

@@ -0,0 +1,28 @@
<?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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/appcompat_vector_disabled"
android:layout_margin="16dp"/>
</FrameLayout>

View File

@@ -166,7 +166,7 @@
<string name="palette">Palette</string>
<string name="palette_all_colors">Full color palette</string>
<string name="search_hint">Search...</string>
<string name="sorted_list_activity">Sorted List</string>
<string name="sorted_list_activity">RecyclerView/Sorted List</string>
<string name="add_new_item">Add New Item</string>
<string name="start_action_mode">Start Action Mode</string>
@@ -197,12 +197,12 @@
<string name="mode_night_dialog_title">AppCompat/DayNight/Dialog Usage</string>
<string name="mode_night_alertdialog_title">AppCompat/DayNight/AlertDialog Usage</string>
<string name="list_popup_window_activity">List popup window</string>
<string name="list_popup_window_activity">AppCompat/List popup window</string>
<string name="list_popup_window_summary">This activity illustrates the use of list popup windows. The popup window is shown by clicking the button above. The checkbox controls the modality. The text area below logs various events - it should log a tap on itself when a non-modal popup window is dismissed by tapping on the log area.</string>
<string name="list_popup_window_button">Show popup!</string>
<string name="list_popup_window_is_modal">is modal</string>
<string name="popup_menu_activity">Popup menu</string>
<string name="popup_menu_activity">AppCompat/Popup menu</string>
<string name="popup_menu_summary">This activity illustrates the use of popup menus. The popup menu is shown by clicking the button above. The text area below logs various events.</string>
<string name="popup_menu_button">Show popup!</string>
<string name="popup_menu_highlight">Highlight</string>
@@ -213,5 +213,8 @@
<string name="popup_menu_share_email">Via email</string>
<string name="popup_menu_share_circles">To my circles</string>
<string name="popup_menu_print">Print</string>
<string name="appcompat_vector_disabled">AnimatedVectorDrawableCompat does not work on devices running API v10 or below</string>
<string name="appcompat_vector_title">AppCompat/Integrations/AnimatedVectorDrawable</string>
</resources>

View File

@@ -0,0 +1,43 @@
/*
* 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.
*/
package com.example.android.supportv7.app;
import com.example.android.supportv7.R;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
public class AppCompatAnimatedVector extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.appcompat_animated_vector);
final ImageView imageView = (ImageView) findViewById(R.id.vector_image);
if (imageView != null) {
final Drawable src = imageView.getDrawable();
if (src instanceof Animatable) {
((Animatable) src).start();
}
}
}
}