summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrizzoli <joey@cyanogenmoditalia.it>2016-01-31 20:32:02 +0100
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-04-16 22:21:27 +0300
commit828959ec14e6670377cfd49cc33f348f5bf3cfdb (patch)
treea97a43c864ecd9b6db61955955b0e779808bd379
parentf5a3cb0fd37e6ac6850b4fc0a10e0fa2e3d18347 (diff)
downloadandroid_packages_apps_Screencast-828959ec14e6670377cfd49cc33f348f5bf3cfdb.tar.gz
android_packages_apps_Screencast-828959ec14e6670377cfd49cc33f348f5bf3cfdb.tar.bz2
android_packages_apps_Screencast-828959ec14e6670377cfd49cc33f348f5bf3cfdb.zip
Screencast: material makeover
Change-Id: I11a3eafd2c2d67b7e263e559637aee8bc8ddb4b3 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
-rw-r--r--AndroidManifest.xml6
-rw-r--r--res/anim/floating_action_button_elevation.xml16
-rw-r--r--res/drawable-hdpi-v11/ic_stat_device_access_video.pngbin378 -> 0 bytes
-rw-r--r--res/drawable-hdpi-v11/ic_stat_rating_important.pngbin775 -> 0 bytes
-rw-r--r--res/drawable-hdpi-v11/ic_stat_rating_not_important.pngbin999 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_stat_device_access_video.pngbin446 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_stat_rating_important.pngbin756 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_stat_rating_not_important.pngbin928 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/stop.pngbin1055 -> 0 bytes
-rw-r--r--res/drawable-mdpi-v11/ic_stat_device_access_video.pngbin261 -> 0 bytes
-rw-r--r--res/drawable-mdpi-v11/ic_stat_rating_important.pngbin507 -> 0 bytes
-rw-r--r--res/drawable-mdpi-v11/ic_stat_rating_not_important.pngbin616 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_stat_device_access_video.pngbin327 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_stat_rating_important.pngbin517 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_stat_rating_not_important.pngbin552 -> 0 bytes
-rwxr-xr-xres/drawable-mdpi/stop.pngbin1047 -> 0 bytes
-rw-r--r--res/drawable-xhdpi-v11/ic_stat_device_access_video.pngbin481 -> 0 bytes
-rw-r--r--res/drawable-xhdpi-v11/ic_stat_rating_important.pngbin1053 -> 0 bytes
-rw-r--r--res/drawable-xhdpi-v11/ic_stat_rating_not_important.pngbin1435 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_stat_device_access_video.pngbin561 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_stat_rating_important.pngbin1006 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_stat_rating_not_important.pngbin1260 -> 0 bytes
-rwxr-xr-xres/drawable-xhdpi/stop.pngbin1114 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi-v11/ic_stat_device_access_video.pngbin708 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi-v11/ic_stat_rating_important.pngbin1667 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi-v11/ic_stat_rating_not_important.pngbin2414 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/ic_stat_device_access_video.pngbin834 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/ic_stat_rating_important.pngbin1612 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/ic_stat_rating_not_important.pngbin2127 -> 0 bytes
-rw-r--r--res/drawable/fab_accent.xml19
-rw-r--r--res/drawable/floating_action_button.xml24
-rw-r--r--res/drawable/ic_share.xml19
-rw-r--r--res/drawable/ic_stat_device_access_video.xml15
-rw-r--r--res/drawable/ic_stop.xml13
-rw-r--r--res/drawable/ic_touch.xml19
-rw-r--r--res/drawable/ic_touch_off.xml23
-rw-r--r--res/drawable/record.xml15
-rw-r--r--res/drawable/stop.xml13
-rw-r--r--res/layout/main.xml74
-rw-r--r--[-rwxr-xr-x]res/mipmap-hdpi/ic_launcher.png (renamed from res/drawable-hdpi/ic_launcher.png)bin2150 -> 2150 bytes
-rw-r--r--[-rwxr-xr-x]res/mipmap-mdpi/ic_launcher.png (renamed from res/drawable-mdpi/ic_launcher.png)bin1350 -> 1350 bytes
-rw-r--r--[-rwxr-xr-x]res/mipmap-xhdpi/ic_launcher.png (renamed from res/drawable-xhdpi/ic_launcher.png)bin2951 -> 2951 bytes
-rw-r--r--[-rwxr-xr-x]res/mipmap-xxhdpi/ic_launcher.png (renamed from res/drawable-xxhdpi/ic_launcher.png)bin4594 -> 4594 bytes
-rw-r--r--[-rwxr-xr-x]res/mipmap-xxxhdpi/ic_launcher.png (renamed from res/drawable-xxxhdpi/ic_launcher.png)bin6091 -> 6091 bytes
-rw-r--r--res/values/colors.xml25
-rw-r--r--res/values/dimens.xml23
-rw-r--r--res/values/strings.xml12
-rw-r--r--res/values/styles.xml39
-rw-r--r--src/org/cyanogenmod/screencast/MainActivity.java165
-rw-r--r--src/org/cyanogenmod/screencast/RecordingDevice.java2
-rw-r--r--src/org/cyanogenmod/screencast/ScreencastService.java10
51 files changed, 388 insertions, 144 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 52cb98b..7c0b8f7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.cyanogenmod.screencast"
- android:versionCode="1003"
- android:versionName="1.0.0.3">
+ android:versionCode="2"
+ android:versionName="2.0">
<uses-sdk
android:minSdkVersion="23"
@@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
<uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />
- <application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
+ <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name">
<service android:name=".ScreencastService"
android:permission="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"
android:label="@string/app_name" android:exported="false">
diff --git a/res/anim/floating_action_button_elevation.xml b/res/anim/floating_action_button_elevation.xml
new file mode 100644
index 0000000..89bddea
--- /dev/null
+++ b/res/anim/floating_action_button_elevation.xml
@@ -0,0 +1,16 @@
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true">
+ <objectAnimator
+ android:propertyName="translationZ"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:valueTo="2dp"
+ android:valueType="floatType"/>
+ </item>
+ <item>
+ <objectAnimator
+ android:propertyName="translationZ"
+ android:duration="@android:integer/config_shortAnimTime"
+ android:valueTo="6dp"
+ android:valueType="floatType"/>
+ </item>
+</selector>
diff --git a/res/drawable-hdpi-v11/ic_stat_device_access_video.png b/res/drawable-hdpi-v11/ic_stat_device_access_video.png
deleted file mode 100644
index 9072a22..0000000
--- a/res/drawable-hdpi-v11/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi-v11/ic_stat_rating_important.png b/res/drawable-hdpi-v11/ic_stat_rating_important.png
deleted file mode 100644
index d46097b..0000000
--- a/res/drawable-hdpi-v11/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi-v11/ic_stat_rating_not_important.png b/res/drawable-hdpi-v11/ic_stat_rating_not_important.png
deleted file mode 100644
index 4f7e777..0000000
--- a/res/drawable-hdpi-v11/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_stat_device_access_video.png b/res/drawable-hdpi/ic_stat_device_access_video.png
deleted file mode 100644
index ad36a69..0000000
--- a/res/drawable-hdpi/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_stat_rating_important.png b/res/drawable-hdpi/ic_stat_rating_important.png
deleted file mode 100644
index d448954..0000000
--- a/res/drawable-hdpi/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_stat_rating_not_important.png b/res/drawable-hdpi/ic_stat_rating_not_important.png
deleted file mode 100644
index 1c85ccf..0000000
--- a/res/drawable-hdpi/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/stop.png b/res/drawable-hdpi/stop.png
deleted file mode 100755
index dd5d6a1..0000000
--- a/res/drawable-hdpi/stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi-v11/ic_stat_device_access_video.png b/res/drawable-mdpi-v11/ic_stat_device_access_video.png
deleted file mode 100644
index 257eb48..0000000
--- a/res/drawable-mdpi-v11/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi-v11/ic_stat_rating_important.png b/res/drawable-mdpi-v11/ic_stat_rating_important.png
deleted file mode 100644
index be0ca8e..0000000
--- a/res/drawable-mdpi-v11/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi-v11/ic_stat_rating_not_important.png b/res/drawable-mdpi-v11/ic_stat_rating_not_important.png
deleted file mode 100644
index 7c93d11..0000000
--- a/res/drawable-mdpi-v11/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_stat_device_access_video.png b/res/drawable-mdpi/ic_stat_device_access_video.png
deleted file mode 100644
index 0fde26d..0000000
--- a/res/drawable-mdpi/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_stat_rating_important.png b/res/drawable-mdpi/ic_stat_rating_important.png
deleted file mode 100644
index eea8483..0000000
--- a/res/drawable-mdpi/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_stat_rating_not_important.png b/res/drawable-mdpi/ic_stat_rating_not_important.png
deleted file mode 100644
index 22623ba..0000000
--- a/res/drawable-mdpi/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/stop.png b/res/drawable-mdpi/stop.png
deleted file mode 100755
index 20df415..0000000
--- a/res/drawable-mdpi/stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi-v11/ic_stat_device_access_video.png b/res/drawable-xhdpi-v11/ic_stat_device_access_video.png
deleted file mode 100644
index 147c486..0000000
--- a/res/drawable-xhdpi-v11/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi-v11/ic_stat_rating_important.png b/res/drawable-xhdpi-v11/ic_stat_rating_important.png
deleted file mode 100644
index 118eca8..0000000
--- a/res/drawable-xhdpi-v11/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi-v11/ic_stat_rating_not_important.png b/res/drawable-xhdpi-v11/ic_stat_rating_not_important.png
deleted file mode 100644
index 9969646..0000000
--- a/res/drawable-xhdpi-v11/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_stat_device_access_video.png b/res/drawable-xhdpi/ic_stat_device_access_video.png
deleted file mode 100644
index fe65cd5..0000000
--- a/res/drawable-xhdpi/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_stat_rating_important.png b/res/drawable-xhdpi/ic_stat_rating_important.png
deleted file mode 100644
index 1ce2e9c..0000000
--- a/res/drawable-xhdpi/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_stat_rating_not_important.png b/res/drawable-xhdpi/ic_stat_rating_not_important.png
deleted file mode 100644
index 76a914c..0000000
--- a/res/drawable-xhdpi/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/stop.png b/res/drawable-xhdpi/stop.png
deleted file mode 100755
index ee5eda2..0000000
--- a/res/drawable-xhdpi/stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi-v11/ic_stat_device_access_video.png b/res/drawable-xxhdpi-v11/ic_stat_device_access_video.png
deleted file mode 100644
index b87a54e..0000000
--- a/res/drawable-xxhdpi-v11/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi-v11/ic_stat_rating_important.png b/res/drawable-xxhdpi-v11/ic_stat_rating_important.png
deleted file mode 100644
index a39b081..0000000
--- a/res/drawable-xxhdpi-v11/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi-v11/ic_stat_rating_not_important.png b/res/drawable-xxhdpi-v11/ic_stat_rating_not_important.png
deleted file mode 100644
index 6b7cd33..0000000
--- a/res/drawable-xxhdpi-v11/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_stat_device_access_video.png b/res/drawable-xxhdpi/ic_stat_device_access_video.png
deleted file mode 100644
index c23919b..0000000
--- a/res/drawable-xxhdpi/ic_stat_device_access_video.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_stat_rating_important.png b/res/drawable-xxhdpi/ic_stat_rating_important.png
deleted file mode 100644
index afdeb26..0000000
--- a/res/drawable-xxhdpi/ic_stat_rating_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_stat_rating_not_important.png b/res/drawable-xxhdpi/ic_stat_rating_not_important.png
deleted file mode 100644
index 3fa1183..0000000
--- a/res/drawable-xxhdpi/ic_stat_rating_not_important.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/fab_accent.xml b/res/drawable/fab_accent.xml
new file mode 100644
index 0000000..22149cb
--- /dev/null
+++ b/res/drawable/fab_accent.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 The CyanogenMod 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
+ <solid android:color="@color/fab" />
+</shape>
diff --git a/res/drawable/floating_action_button.xml b/res/drawable/floating_action_button.xml
new file mode 100644
index 0000000..2bd16f9
--- /dev/null
+++ b/res/drawable/floating_action_button.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 The CyanogenMod 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.
+-->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@color/floating_action_button_touch_tint">
+<item android:id="@android:id/mask">
+ <shape android:shape="oval">
+ <solid android:color="@color/fab" />
+ </shape>
+ </item>
+</ripple>
diff --git a/res/drawable/ic_share.xml b/res/drawable/ic_share.xml
new file mode 100644
index 0000000..8497abc
--- /dev/null
+++ b/res/drawable/ic_share.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
+ <path
+ android:fillColor="@color/white"
+ android:pathData="M18,16.08 C17.24,16.08,16.56,16.38,16.04,16.85 L8.91,12.7
+C8.96,12.47,9,12.24,9,12 S8.96,11.53,8.91,11.3 L15.96,7.19
+C16.5,7.69,17.21,8,18,8 C19.66,8,21,6.66,21,5 S19.66,2,18,2 S15,3.34,15,5
+C15,5.24,15.04,5.47,15.09,5.7 L8.04,9.81 C7.5,9.31,6.79,9,6,9
+C4.34,9,3,10.34,3,12 S4.34,15,6,15 C6.79,15,7.5,14.69,8.04,14.19 L15.16,18.35
+C15.11,18.56,15.08,18.78,15.08,19 C15.08,20.61,16.39,21.92,18,21.92
+C19.61,21.92,20.92,20.61,20.92,19 S19.61,16.08,18,16.08 Z" />
+</vector>
diff --git a/res/drawable/ic_stat_device_access_video.xml b/res/drawable/ic_stat_device_access_video.xml
new file mode 100644
index 0000000..771126c
--- /dev/null
+++ b/res/drawable/ic_stat_device_access_video.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
+ <path
+ android:fillColor="@color/white"
+ android:pathData="M17,10.5 L17,7 C17,6.45,16.55,6,16,6 L4,6 C3.45,6,3,6.45,3,7 L3,17
+C3,17.55,3.45,18,4,18 L16,18 C16.55,18,17,17.55,17,17 L17,13.5 L21,17.5 L21,6.5
+L17,10.5 Z" />
+</vector>
diff --git a/res/drawable/ic_stop.xml b/res/drawable/ic_stop.xml
new file mode 100644
index 0000000..edd566c
--- /dev/null
+++ b/res/drawable/ic_stop.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
+ <path
+ android:fillColor="@color/white"
+ android:pathData="M6,6 L18,6 L18,18 L6,18 Z" />
+</vector>
diff --git a/res/drawable/ic_touch.xml b/res/drawable/ic_touch.xml
new file mode 100644
index 0000000..586a18d
--- /dev/null
+++ b/res/drawable/ic_touch.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:fillColor="@color/white"
+ android:pathData="M9,11.24 L9,7.5 C9,6.12,10.12,5,11.5,5 S14,6.12,14,7.5 L14,11.24
+C15.21,10.43,16,9.06,16,7.5 C16,5.01,13.99,3,11.5,3 S7,5.01,7,7.5
+C7,9.06,7.79,10.43,9,11.24 Z M18.84,15.87 L14.3,13.61
+C14.13,13.54,13.95,13.5,13.76,13.5 L13,13.5 L13,7.5 C13,6.67,12.33,6,11.5,6
+S10,6.67,10,7.5 L10,18.24 L6.57,17.52 C6.49,17.51,6.42,17.49,6.33,17.49
+C6.02,17.49,5.74,17.62,5.54,17.82 L4.75,18.62 L9.69,23.56
+C9.96,23.83,10.34,24,10.75,24 L17.54,24 C18.29,24,18.87,23.45,18.98,22.72
+L19.73,17.45 C19.74,17.38,19.75,17.31,19.75,17.25
+C19.75,16.63,19.37,16.09,18.84,15.87 Z" />
+</vector>
diff --git a/res/drawable/ic_touch_off.xml b/res/drawable/ic_touch_off.xml
new file mode 100644
index 0000000..5d61815
--- /dev/null
+++ b/res/drawable/ic_touch_off.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:fillColor="@color/white"
+ android:pathData="M9,11.24 L9,7.5 C9,6.12,10.12,5,11.5,5 S14,6.12,14,7.5 L14,11.24
+C15.21,10.43,16,9.06,16,7.5 C16,5.01,13.99,3,11.5,3 S7,5.01,7,7.5
+C7,9.06,7.79,10.43,9,11.24 Z M18.84,15.87 L14.3,13.61
+C14.13,13.54,13.95,13.5,13.76,13.5 L13,13.5 L13,7.5 C13,6.67,12.33,6,11.5,6
+S10,6.67,10,7.5 L10,18.24 L6.57,17.52 C6.49,17.51,6.42,17.49,6.33,17.49
+C6.02,17.49,5.74,17.62,5.54,17.82 L4.75,18.62 L9.69,23.56
+C9.96,23.83,10.34,24,10.75,24 L17.54,24 C18.29,24,18.87,23.45,18.98,22.72
+L19.73,17.45 C19.74,17.38,19.75,17.31,19.75,17.25
+C19.75,16.63,19.37,16.09,18.84,15.87 Z" />
+ <path
+ android:strokeColor="@color/white"
+ android:strokeWidth="1"
+ android:pathData="M2.13559,4.88136 L21.0508,23.0847" />
+</vector>
diff --git a/res/drawable/record.xml b/res/drawable/record.xml
new file mode 100644
index 0000000..b898697
--- /dev/null
+++ b/res/drawable/record.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
+ <path
+ android:fillColor="@color/fab_icon"
+ android:pathData="M17,10.5 L17,7 C17,6.45,16.55,6,16,6 L4,6 C3.45,6,3,6.45,3,7 L3,17
+C3,17.55,3.45,18,4,18 L16,18 C16.55,18,17,17.55,17,17 L17,13.5 L21,17.5 L21,6.5
+L17,10.5 Z" />
+</vector>
diff --git a/res/drawable/stop.xml b/res/drawable/stop.xml
new file mode 100644
index 0000000..bb304ef
--- /dev/null
+++ b/res/drawable/stop.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
+ <path
+ android:fillColor="@color/fab_icon"
+ android:pathData="M6,6 L18,6 L18,18 L6,18 Z" />
+</vector>
diff --git a/res/layout/main.xml b/res/layout/main.xml
index 7a73579..d04651a 100644
--- a/res/layout/main.xml
+++ b/res/layout/main.xml
@@ -1,57 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:gravity="center"
- android:layout_margin="10dp"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:padding="16dp">
<TextView
- style="@android:style/TextAppearance.Medium"
- android:id="@+id/start_description"
- android:gravity="center"
- android:text="@string/start_description"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:id="@+id/hint"
+ style="@style/textStyle"
+ android:text="@string/start_description"
+ android:paddingBottom="8dp"/>
+
+ <FrameLayout android:id="@+id/floating_action_button_container"
+ style="@style/floating_action_button"
+ android:background="@drawable/fab_accent">
+ <ImageButton
+ android:id="@+id/screencast"
+ style="@style/floating_action_button_image"
+ android:background="@drawable/floating_action_button"
+ android:src="@drawable/record" />
+ </FrameLayout>
<TextView
- style="@android:style/TextAppearance.Medium"
- android:id="@+id/no_audio_warning"
- android:gravity="center"
- android:text="@string/no_audio_warning"
- android:layout_marginTop="10dp"
- android:visibility="gone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:layout_marginTop="20dp"
- android:orientation="vertical"
- >
- <Button
- android:id="@+id/settings"
- android:text="@string/settings"
- android:visibility="gone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <Button
- android:id="@+id/start_screencast"
- android:text="@string/start_screencast"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <Button
- android:id="@+id/stop_screencast"
- android:text="@string/stop"
- android:enabled="false"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- </LinearLayout>
-
+ android:id="@+id/audio_warning"
+ style="@style/textStyle"
+ android:text="@string/no_audio_warning"
+ android:background="?android:attr/selectableItemBackground"
+ android:clickable="true"
+ android:paddingTop="8dp"/>
</LinearLayout>
diff --git a/res/drawable-hdpi/ic_launcher.png b/res/mipmap-hdpi/ic_launcher.png
index 020f640..020f640 100755..100644
--- a/res/drawable-hdpi/ic_launcher.png
+++ b/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher.png b/res/mipmap-mdpi/ic_launcher.png
index 9dffd66..9dffd66 100755..100644
--- a/res/drawable-mdpi/ic_launcher.png
+++ b/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/mipmap-xhdpi/ic_launcher.png
index 0ceeb68..0ceeb68 100755..100644
--- a/res/drawable-xhdpi/ic_launcher.png
+++ b/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/mipmap-xxhdpi/ic_launcher.png
index 97db3d2..97db3d2 100755..100644
--- a/res/drawable-xxhdpi/ic_launcher.png
+++ b/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_launcher.png b/res/mipmap-xxxhdpi/ic_launcher.png
index 567f114..567f114 100755..100644
--- a/res/drawable-xxxhdpi/ic_launcher.png
+++ b/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/res/values/colors.xml b/res/values/colors.xml
new file mode 100644
index 0000000..34dbbb1
--- /dev/null
+++ b/res/values/colors.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2016 The CyanogenMod 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="white">#fafafa</color>
+ <color name="accent">#D69A46</color>
+ <color name="accent_dark">#9C7A34</color>
+
+ <color name="fab">@color/accent</color>
+ <color name="fab_icon">@color/accent_dark</color>
+ <color name="floating_action_button_touch_tint">#CC9345</color>
+</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
new file mode 100644
index 0000000..82e5c7d
--- /dev/null
+++ b/res/values/dimens.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2016 The CyanogenMod 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="fab_size">56dp</dimen>
+ <dimen name="fab_margin">16dp</dimen>
+ <dimen name="fab_icon_size">24dp</dimen>
+ <dimen name="fab_elevation_normal">4dp</dimen>
+ <dimen name="fab_elevation_pressed">2dp</dimen>
+</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 62b09f6..b881b05 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -15,18 +15,18 @@
limitations under the License.
-->
<resources>
- <string name="app_name">Screencast</string>
+ <string name="app_name">Screen Recorder</string>
<string name="share">Share</string>
<string name="stop">Stop</string>
<string name="insufficient_storage">Insufficient storage</string>
<string name="show_touches">Show touches</string>
+ <string name="hide_touches">Hide touches</string>
<string name="recording">Recording\u2026</string>
<string name="recording_ready_to_share">Recording ready to share</string>
<string name="video_length">Video length: %s</string>
<string name="not_enough_storage">Not enough storage available</string>
- <string name="start_screencast">Start Screencast</string>
- <string name="start_description">Press \"Start Screencast\" to begin recording a video of your Android screen and microphone.</string>
- <string name="start_description_no_audio">Press \"Start Screencast\" to begin recording a video of your Android screen.</string>
- <string name="no_audio_warning">To include audio, go to Settings and enable the microphone permission for this app.</string>
- <string name="settings">Settings</string>
+ <string name="start_description">Tap to start recording the screen and the microphone of your device</string>
+ <string name="start_description_no_audio">Tap to start recording the screen of your device</string>
+ <string name="stop_description">Tap to stop recording</string>
+ <string name="no_audio_warning">To include audio, <b>tap here</b></string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644
index 0000000..497adcd
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2016 The CyanogenMod 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 xmlns:android="http://schemas.android.com/apk/res/android">
+ <style name="floating_action_button">
+ <item name="android:layout_width">@dimen/fab_size</item>
+ <item name="android:layout_height">@dimen/fab_size</item>
+ <item name="android:layout_margin">@dimen/fab_margin</item>
+ <item name="android:background">@drawable/floating_action_button</item>
+ <item name="android:stateListAnimator">@anim/floating_action_button_elevation</item>
+ <item name="android:elevation">@dimen/fab_elevation_normal</item>
+ </style>
+
+ <style name="floating_action_button_image">
+ <item name="android:layout_width">@dimen/fab_size</item>
+ <item name="android:layout_height">@dimen/fab_size</item>
+ </style>
+
+ <style name="textStyle" parent="@android:style/TextAppearance.Medium">
+ <item name="android:gravity">center</item>
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:paddingStart">4dp</item>
+ <item name="android:paddingEnd">4dp</item>
+ </style>
+</resources>
diff --git a/src/org/cyanogenmod/screencast/MainActivity.java b/src/org/cyanogenmod/screencast/MainActivity.java
index 63f1c68..a61ee11 100644
--- a/src/org/cyanogenmod/screencast/MainActivity.java
+++ b/src/org/cyanogenmod/screencast/MainActivity.java
@@ -17,6 +17,7 @@
package org.cyanogenmod.screencast;
import android.Manifest;
+import android.animation.Animator;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -24,88 +25,65 @@ import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
-import android.widget.Button;
+import android.view.ViewAnimationUtils;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.CheckBox;
+import android.widget.ImageButton;
import android.widget.TextView;
public class MainActivity extends Activity {
- Button mStartScreencastButton;
- Button mStopScreencastButton;
- Button mSettingsButton;
- TextView mStartDescription;
- View mNoAudioWarning;
-
- boolean mHasAudioPermission = false;
-
+ private ImageButton mScreencastButton;
+ private TextView mText;
+ private TextView mAudioText;
+ private boolean mHasAudioPermission;
private static final int REQUEST_AUDIO_PERMS = 654;
- private boolean hasPermissions() {
- int res = checkCallingOrSelfPermission(Manifest.permission.RECORD_AUDIO);
- return (res == PackageManager.PERMISSION_GRANTED);
- }
-
- private void requestNecessaryPermissions() {
- String[] permissions = new String[] {
- Manifest.permission.RECORD_AUDIO,
- };
- requestPermissions(permissions, REQUEST_AUDIO_PERMS);
- }
-
- @Override
- public void onRequestPermissionsResult(int requestCode, String[] permissions,
- int[] grantResults) {
- if (requestCode == REQUEST_AUDIO_PERMS) {
- mHasAudioPermission = true;
- for (int res : grantResults) {
- mHasAudioPermission &= (res == PackageManager.PERMISSION_GRANTED);
- }
- refreshState();
- }
- }
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
- if (!hasPermissions()) {
- requestNecessaryPermissions();
- } else {
- mHasAudioPermission = true;
- }
+ mScreencastButton = (ImageButton) findViewById(R.id.screencast);
+ mText = (TextView) findViewById(R.id.hint);
+ mAudioText = (TextView) findViewById(R.id.audio_warning);
- mStartDescription = (TextView) findViewById(R.id.start_description);
- mNoAudioWarning = findViewById(R.id.no_audio_warning);
-
- mStartScreencastButton = (Button) findViewById(R.id.start_screencast);
- mStartScreencastButton.setOnClickListener(new View.OnClickListener() {
+ mScreencastButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- getSharedPreferences(ScreencastService.PREFS, 0).edit().putBoolean(ScreencastService.KEY_RECORDING, true).apply();
- startService(new Intent("org.cyanogenmod.ACTION_START_SCREENCAST")
- .setClass(MainActivity.this, ScreencastService.class));
- finish();
+ animateFAB(v);
+ if (getSharedPreferences(ScreencastService.PREFS, 0)
+ .getBoolean(ScreencastService.KEY_RECORDING, false)) {
+ // stop
+ getSharedPreferences(ScreencastService.PREFS, 0)
+ .edit()
+ .putBoolean(ScreencastService.KEY_RECORDING, false)
+ .apply();
+ startService(new Intent("org.cyanogenmod.ACTION_STOP_SCREENCAST")
+ .setClass(MainActivity.this, ScreencastService.class));
+ refreshState();
+ } else {
+ // record
+ getSharedPreferences(ScreencastService.PREFS, 0)
+ .edit()
+ .putBoolean(ScreencastService.KEY_RECORDING, true)
+ .apply();
+ startService(new Intent("org.cyanogenmod.ACTION_START_SCREENCAST")
+ .setClass(MainActivity.this, ScreencastService.class));
+ finish();
+ }
}
});
- mStopScreencastButton = (Button) findViewById(R.id.stop_screencast);
- mStopScreencastButton.setOnClickListener(new View.OnClickListener() {
+ mAudioText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- getSharedPreferences(ScreencastService.PREFS, 0).edit().putBoolean(ScreencastService.KEY_RECORDING, false).apply();
- startService(new Intent("org.cyanogenmod.ACTION_STOP_SCREENCAST")
- .setClass(MainActivity.this, ScreencastService.class));
- refreshState();
+ requestNecessaryPermissions();
}
});
- mSettingsButton = (Button) findViewById(R.id.settings);
- mSettingsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- goToSettings();
- }
- });
+ refreshState();
}
@Override
@@ -121,29 +99,41 @@ public class MainActivity extends Activity {
refreshState();
}
- private void refreshState() {
- final boolean recording = getSharedPreferences(ScreencastService.PREFS, 0).getBoolean(ScreencastService.KEY_RECORDING, false);
- if (mStartScreencastButton != null) {
- mStartScreencastButton.setEnabled(!recording);
- }
- if (mStopScreencastButton != null) {
- mStopScreencastButton.setEnabled(recording);
- }
+ private boolean hasPermissions() {
+ int res = checkSelfPermission(Manifest.permission.RECORD_AUDIO);
+ return (res == PackageManager.PERMISSION_GRANTED);
+ }
- int visibility = mHasAudioPermission ? View.GONE : View.VISIBLE;
- if (mSettingsButton != null) {
- mSettingsButton.setVisibility(visibility);
- }
- if (mNoAudioWarning != null) {
- mNoAudioWarning.setVisibility(visibility);
+ private void requestNecessaryPermissions() {
+ String[] permissions = new String[] {
+ Manifest.permission.RECORD_AUDIO,
+ };
+ requestPermissions(permissions, REQUEST_AUDIO_PERMS);
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions,
+ int[] grantResults) {
+ if (requestCode == REQUEST_AUDIO_PERMS) {
+ for (int res : grantResults) {
+ mHasAudioPermission &= (res == PackageManager.PERMISSION_GRANTED);
+ }
+ refreshState();
}
+ }
- if (mStartDescription != null) {
- mStartDescription.setText(
- mHasAudioPermission
- ? R.string.start_description
- : R.string.start_description_no_audio
- );
+ private void refreshState() {
+ final boolean recording = getSharedPreferences(ScreencastService.PREFS, 0)
+ .getBoolean(ScreencastService.KEY_RECORDING, false);
+ if (recording) {
+ mScreencastButton.setImageResource(R.drawable.stop);
+ mText.setText(R.string.stop_description);
+ mAudioText.setVisibility(View.GONE);
+ } else {
+ mScreencastButton.setImageResource(R.drawable.record);
+ mText.setText(mHasAudioPermission ?
+ R.string.start_description : R.string.start_description_no_audio);
+ mAudioText.setVisibility(mHasAudioPermission ? View.GONE: View.VISIBLE);
}
}
@@ -156,4 +146,17 @@ public class MainActivity extends Activity {
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent);
}
-} \ No newline at end of file
+
+ private void animateFAB(View view) {
+ int centerX = (view.getLeft() + view.getRight()) / 2;
+ int centerY = (view.getTop() + view.getBottom()) / 2;
+ int startRadius = 0;
+ int endRadius = (int) Math.hypot(view.getWidth(), view.getHeight());
+
+ Animator anim = ViewAnimationUtils.createCircularReveal(
+ view, centerX, centerY, startRadius, endRadius);
+
+ anim.setDuration(800);
+ anim.start();
+ }
+}
diff --git a/src/org/cyanogenmod/screencast/RecordingDevice.java b/src/org/cyanogenmod/screencast/RecordingDevice.java
index 4806890..c6fe471 100644
--- a/src/org/cyanogenmod/screencast/RecordingDevice.java
+++ b/src/org/cyanogenmod/screencast/RecordingDevice.java
@@ -17,6 +17,7 @@
package org.cyanogenmod.screencast;
import android.content.Context;
+import android.content.SharedPreferences;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaCodec;
@@ -40,6 +41,7 @@ class RecordingDevice extends EncoderDevice {
private static final String LOGTAG = "RecordingDevice";
private static final File RECORDINGS_DIR = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES), "Screencasts");
File path;
+ public boolean shouldRecordAudio;
public RecordingDevice(Context context, int width, int height) {
super(context, width, height);
diff --git a/src/org/cyanogenmod/screencast/ScreencastService.java b/src/org/cyanogenmod/screencast/ScreencastService.java
index 2fc8d7b..1f37ac3 100644
--- a/src/org/cyanogenmod/screencast/ScreencastService.java
+++ b/src/org/cyanogenmod/screencast/ScreencastService.java
@@ -233,14 +233,14 @@ public class ScreencastService extends Service {
if (showingTouches) {
Settings.System.putInt(getContentResolver(), SHOW_TOUCHES, 1);
showTouchesIntent.putExtra(SHOW_TOUCHES, "off");
- mBuilder.addAction(R.drawable.ic_stat_rating_important,
- getString(R.string.show_touches),
+ mBuilder.addAction(R.drawable.ic_touch_off,
+ getString(R.string.hide_touches),
PendingIntent.getService(this, 0,
showTouchesIntent, PendingIntent.FLAG_UPDATE_CURRENT));
} else {
Settings.System.putInt(getContentResolver(), SHOW_TOUCHES, 0);
showTouchesIntent.putExtra(SHOW_TOUCHES, "on");
- mBuilder.addAction(R.drawable.ic_stat_rating_not_important,
+ mBuilder.addAction(R.drawable.ic_touch,
getString(R.string.show_touches),
PendingIntent.getService(this, 0,
showTouchesIntent, PendingIntent.FLAG_UPDATE_CURRENT));
@@ -254,7 +254,7 @@ public class ScreencastService extends Service {
.setContentTitle(getString(R.string.recording));
Intent stopRecording = new Intent(ACTION_STOP_SCREENCAST);
stopRecording.setClass(this, ScreencastService.class);
- builder.addAction(R.drawable.stop, getString(R.string.stop),
+ builder.addAction(R.drawable.ic_stop, getString(R.string.stop),
PendingIntent.getService(this, 0, stopRecording, 0));
return builder;
}
@@ -291,7 +291,7 @@ public class ScreencastService extends Service {
.setContentTitle(getString(R.string.recording_ready_to_share))
.setContentText(getString(R.string.video_length,
DateUtils.formatElapsedTime(timeElapsed / 1000)))
- .addAction(android.R.drawable.ic_menu_share, getString(R.string.share),
+ .addAction(R.drawable.ic_share, getString(R.string.share),
PendingIntent.getActivity(this, 0, chooserIntent, PendingIntent.FLAG_CANCEL_CURRENT))
.setContentIntent(contentIntent);
return builder;