summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/Support4Demos/Android.mk2
-rw-r--r--samples/Support4Demos/AndroidManifest.xml10
-rw-r--r--samples/Support4Demos/res/drawable-hdpi/android_robot.pngbin0 -> 13408 bytes
-rw-r--r--samples/Support4Demos/res/drawable-mdpi/android_robot.pngbin0 -> 8824 bytes
-rw-r--r--samples/Support4Demos/res/drawable-xhdpi/android_robot.pngbin0 -> 18022 bytes
-rw-r--r--samples/Support4Demos/res/layout/activity_rounded_bitmap.xml36
-rw-r--r--samples/Support4Demos/res/values/strings.xml2
-rw-r--r--samples/Support4Demos/src/com/example/android/supportv4/graphics/RoundedBitmapDrawableActivity.java62
-rw-r--r--testrunner/test_defs.xml7
9 files changed, 117 insertions, 2 deletions
diff --git a/samples/Support4Demos/Android.mk b/samples/Support4Demos/Android.mk
index 05bf8c3f3..1a760ad54 100644
--- a/samples/Support4Demos/Android.mk
+++ b/samples/Support4Demos/Android.mk
@@ -14,5 +14,5 @@ LOCAL_SDK_VERSION := current
include $(BUILD_PACKAGE)
-# Use the folloing include to make our test apk.
+# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/Support4Demos/AndroidManifest.xml b/samples/Support4Demos/AndroidManifest.xml
index f66f58534..e662cf4b9 100644
--- a/samples/Support4Demos/AndroidManifest.xml
+++ b/samples/Support4Demos/AndroidManifest.xml
@@ -25,7 +25,7 @@
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
- <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19" />
+ <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="22" />
<!-- The smallest screen this app works on is a phone. The app will
scale its UI to larger screens but doesn't make good use of them
@@ -359,6 +359,14 @@
</intent-filter>
</activity>
+ <activity android:name=".graphics.RoundedBitmapDrawableActivity"
+ android:label="Graphics/RoundedBitmapDrawable">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="com.example.android.supportv4.SUPPORT4_SAMPLE_CODE" />
+ </intent-filter>
+ </activity>
+
<!-- BEGIN_INCLUDE(file_provider_declaration) -->
<provider
android:name="android.support.v4.content.FileProvider"
diff --git a/samples/Support4Demos/res/drawable-hdpi/android_robot.png b/samples/Support4Demos/res/drawable-hdpi/android_robot.png
new file mode 100644
index 000000000..e2bdf7df7
--- /dev/null
+++ b/samples/Support4Demos/res/drawable-hdpi/android_robot.png
Binary files differ
diff --git a/samples/Support4Demos/res/drawable-mdpi/android_robot.png b/samples/Support4Demos/res/drawable-mdpi/android_robot.png
new file mode 100644
index 000000000..62b8e1063
--- /dev/null
+++ b/samples/Support4Demos/res/drawable-mdpi/android_robot.png
Binary files differ
diff --git a/samples/Support4Demos/res/drawable-xhdpi/android_robot.png b/samples/Support4Demos/res/drawable-xhdpi/android_robot.png
new file mode 100644
index 000000000..88b11134b
--- /dev/null
+++ b/samples/Support4Demos/res/drawable-xhdpi/android_robot.png
Binary files differ
diff --git a/samples/Support4Demos/res/layout/activity_rounded_bitmap.xml b/samples/Support4Demos/res/layout/activity_rounded_bitmap.xml
new file mode 100644
index 000000000..b40d28834
--- /dev/null
+++ b/samples/Support4Demos/res/layout/activity_rounded_bitmap.xml
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright 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:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <ToggleButton
+ android:id="@+id/toggle_round"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textOff="@string/regular"
+ android:textOn="@string/round"
+ android:layout_marginBottom="16dp"/>
+
+ <ImageView
+ android:id="@+id/image"
+ android:layout_width="200dp"
+ android:layout_height="200dp" />
+
+</LinearLayout>
diff --git a/samples/Support4Demos/res/values/strings.xml b/samples/Support4Demos/res/values/strings.xml
index d17c06274..0c388b2b8 100644
--- a/samples/Support4Demos/res/values/strings.xml
+++ b/samples/Support4Demos/res/values/strings.xml
@@ -188,5 +188,7 @@
<string name="nested_scroll">Widget/Nested Scrolling</string>
<string name="nested_scroll_long_text">This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it.</string>
+ <string name="regular">regular</string>
+ <string name="round">round</string>
</resources>
diff --git a/samples/Support4Demos/src/com/example/android/supportv4/graphics/RoundedBitmapDrawableActivity.java b/samples/Support4Demos/src/com/example/android/supportv4/graphics/RoundedBitmapDrawableActivity.java
new file mode 100644
index 000000000..d89d4628b
--- /dev/null
+++ b/samples/Support4Demos/src/com/example/android/supportv4/graphics/RoundedBitmapDrawableActivity.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 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.supportv4.graphics;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Bundle;
+import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
+import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.ToggleButton;
+
+import com.example.android.supportv4.R;
+
+/**
+ * Demonstrates use of a {@link RoundedBitmapDrawable}'s ability to become circular.
+ */
+public class RoundedBitmapDrawableActivity extends Activity {
+
+ private static final int IMAGE_RES = R.drawable.android_robot;
+ private RoundedBitmapDrawable mRoundedBitmapDrawable;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_rounded_bitmap);
+
+ // Create a bitmap and set it circular.
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(), IMAGE_RES);
+ mRoundedBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), bitmap);
+
+ // Get references to the inflated views.
+ ToggleButton toggle = (ToggleButton) findViewById(R.id.toggle_round);
+ ImageView image = (ImageView) findViewById(R.id.image);
+
+ // Set up initial view state and on checked change listener.
+ image.setImageDrawable(mRoundedBitmapDrawable);
+ toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mRoundedBitmapDrawable.setCircular(isChecked);
+ }
+ });
+ }
+
+}
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index 07bb9a461..1f4bfc202 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -271,6 +271,13 @@ See test_defs.xsd for more information.
coverage_target="framework"
suite="cts" />
+<test name="cts-calllog"
+ build_path="cts/tests/tests/calllog"
+ package="com.android.cts.calllog"
+ runner="android.support.test.runner.AndroidJUnitRunner"
+ coverage_target="Phone"
+ suite="cts" />
+
<test name="cts-content"
build_path="cts/tests/tests/content"
package="com.android.cts.content"