Skip to content
This repository was archived by the owner on Sep 10, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions telecine/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<resources>
<string name="launcher_name" translatable="false">Telecine Debug</string>

<string name="shortcut_name">Launch Debug</string>
<string name="tile_name">Launch Telecine Debug</string>
<string name="launch">Launch Debug</string>
<string name="launch_telecine">Launch Telecine Debug</string>
</resources>
51 changes: 51 additions & 0 deletions telecine/src/debug/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:targetApi="n_mr1"
>
<shortcut
android:enabled="true"
android:icon="@drawable/ic_shortcut_overlay_48dp"
android:shortcutDisabledMessage="@string/launch"
android:shortcutId="overlay"
android:shortcutLongLabel="@string/launch_telecine"
android:shortcutShortLabel="@string/launch"
>
<intent
android:action="com.jakewharton.telecine.STATIC_SHORTCUT_OVERLAY"
android:targetClass="com.jakewharton.telecine.TelecineShortcutLaunchActivity"
android:targetPackage="com.jakewharton.telecine.debug"
>
<extra
android:name="launch-action"
android:value="Static Shortcut Overlay"
/>
</intent>
<categories android:name="android.shortcut.conversation"/>
</shortcut>
<shortcut
android:enabled="true"
android:icon="@drawable/ic_shortcut_record_48dp"
android:shortcutDisabledMessage="@string/record"
android:shortcutId="record"
android:shortcutLongLabel="@string/start_recording"
android:shortcutShortLabel="@string/record"
>
<intent
android:action="com.jakewharton.telecine.STATIC_SHORTCUT_RECORD"
android:targetClass="com.jakewharton.telecine.TelecineShortcutLaunchActivity"
android:targetPackage="com.jakewharton.telecine.debug"
>
<extra
android:name="launch-action"
android:value="Static Shortcut Record"
/>
<extra
android:name="auto-recording"
android:value="true"
/>
</intent>
<categories android:name="android.shortcut.conversation"/>
</shortcut>
</shortcuts>
7 changes: 6 additions & 1 deletion telecine/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts"
/>
</activity>

<service android:name=".TelecineService"/>
Expand All @@ -41,6 +45,7 @@
android:theme="@style/Theme.Telecine.Transparent"
android:excludeFromRecents="true"
android:taskAffinity=""
android:enabled="@bool/widget_shortcut_enabled"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

>
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
Expand All @@ -56,7 +61,7 @@

<service
android:icon="@drawable/ic_videocam_white_24dp"
android:label="@string/tile_name"
android:label="@string/launch_telecine"
android:name=".TelecineTileService"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface Analytics {
String ACTION_QUICK_TILE_ADDED = "Quick Tile Added";
String ACTION_QUICK_TILE_LAUNCHED = "Quick Tile Launched";
String ACTION_QUICK_TILE_REMOVED = "Quick Tile Removed";
String ACTION_STATIC_SHORTCUT_RECORD = "Static Shortcut Record";
String ACTION_STATIC_SHORTCUT_OVERLAY = "Static Shortcut Overlay";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are unused...


String VARIABLE_RECORDING_LENGTH = "Recording Length";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ private RecordingInfo getRecordingInfo() {
cameraWidth, cameraHeight, cameraFrameRate, sizePercentage);
}

/** Perform a click on the start button to simulate the auto-recording. */
void triggerAutoRecording() {
if (overlayView == null) {
throw new AssertionError();
}
// Most of the time, overlayView is not yet attached to the Window
if (overlayView.isAttachedToWindow()) {
overlayView.onStartClicked();
} else {
overlayView.post(new Runnable() {
@Override
public void run() {
triggerAutoRecording();
}
});
}
}

private void startRecording() {
Timber.d("Starting screen recording...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ static Intent newIntent(Context context, int resultCode, Intent data) {
videoSizePercentageProvider);
recordingSession.showOverlay();

if (data.getBooleanExtra(TelecineShortcutLaunchActivity.EXTRA_AUTO_RECORDING, false)) {
Timber.d("Auto-recording requested!");
recordingSession.triggerAutoRecording();
}
return START_NOT_STICKY;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class TelecineShortcutConfigureActivity extends Activity {
ShortcutIconResource icon = ShortcutIconResource.fromContext(this, R.drawable.ic_launcher);

Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_name));
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.launch));
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, launchIntent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

public final class TelecineShortcutLaunchActivity extends Activity {
private static final String KEY_ACTION = "launch-action";
static final String EXTRA_AUTO_RECORDING = "auto-recording";

static Intent createQuickTileIntent(Context context) {
Intent intent = new Intent(context, TelecineShortcutLaunchActivity.class);
Expand Down Expand Up @@ -36,6 +37,10 @@ static Intent createQuickTileIntent(Context context) {
}

@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (getIntent().getBooleanExtra(EXTRA_AUTO_RECORDING, false) && data != null) {
// Add the auto-recording extra from the original intent to the result data.
data.putExtra(EXTRA_AUTO_RECORDING, true);
}
if (!CaptureHelper.handleActivityResult(this, requestCode, resultCode, data, analytics)) {
super.onActivityResult(requestCode, resultCode, data);
}
Expand Down
14 changes: 14 additions & 0 deletions telecine/src/main/res/drawable/ic_shortcut_overlay_48dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="49.333336"
android:viewportWidth="49.333336">
<path
android:fillAlpha="1"
android:fillColor="#f5f5f5"
android:pathData="M24.67,24.67m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<path
android:fillAlpha="1"
android:fillColor="#e73c35"
android:pathData="m31.42,17.92 l-13.5,0c-0.82,0 -1.5,0.68 -1.5,1.5l0,10.5c0,0.82 0.68,1.5 1.5,1.5l13.5,0c0.82,0 1.5,-0.68 1.5,-1.5l0,-10.5c0,-0.82 -0.68,-1.5 -1.5,-1.5zM31.42,29.92 L17.92,29.92 17.92,19.42 25.42,19.42 25.42,22.42 31.42,22.42 31.42,29.92z" />
</vector>
14 changes: 14 additions & 0 deletions telecine/src/main/res/drawable/ic_shortcut_record_48dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="49.333336"
android:viewportWidth="49.333336">
<path
android:fillAlpha="1"
android:fillColor="#f5f5f5"
android:pathData="M24.67,24.67m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<path
android:fillAlpha="1"
android:fillColor="#e73c35"
android:pathData="m29.67,23.17 l0,-3.5c0,-0.55 -0.45,-1 -1,-1l-12,0c-0.55,0 -1,0.45 -1,1l0,10c0,0.55 0.45,1 1,1l12,0c0.55,0 1,-0.45 1,-1l0,-3.5 4,4 0,-11 -4,4z" />
</vector>
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">Aufnahme starten</string>
<string name="launch">Aufnahme starten</string>
<string name="clear">Leeren</string>
<string name="record">Aufnehmen</string>
<string name="countdown_one">1…</string>
Expand Down
4 changes: 2 additions & 2 deletions telecine/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="shortcut_name">Inicia</string>
<string name="launch">Inicia</string>
<string name="clear">Despejar</string>
<string name="record">Grabar</string>
<string name="launch_overlay">Inicia superposición</string>
Expand All @@ -16,4 +16,4 @@
<string name="notification_recording_subtitle">Toque el reloj para detener la grabación.</string>
<string name="recording_notification">Notificación de grabación</string>
<string name="show_touches">Mostrar Toques</string>
</resources>
</resources>
6 changes: 3 additions & 3 deletions telecine/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">Lancer</string>
<string name="launch">Lancer</string>
<string name="clear">Effacer</string>
<string name="record">Enregistrer</string>
<string name="countdown_one">1…</string>
Expand All @@ -13,10 +13,10 @@
<string name="recents_hide">Masquer dans les applications récentes</string>
<string name="video_size_percentage">Taille de la vidéo</string>
<string name="notification_captured_title">Capture d\'écran vidéo réussie.</string>
<string name="notification_captured_subtitle">Appuyez pour afficher votre capture d\'écran vidéo.</string>
<string name="notification_captured_subtitle">Appuyez pour afficher votre capture d\'écran vidéo.</string>
<string name="notification_captured_share">Partager</string>
<string name="notification_captured_delete">Supprimer</string>
<string name="notification_recording_title">Capture d\'écran vidéo en cours.</string>
<string name="notification_recording_title">Capture d\'écran vidéo en cours.</string>
<string name="notification_recording_subtitle">Appuyez sur la zone de l\'horloge pour arrêter.</string>
<string name="recording_notification">Notification d\'enregistrement</string>
<string name="show_touches">Afficher les appuis</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


<resources>
<string name="shortcut_name">Avvia</string>
<string name="launch">Avvia</string>
<string name="clear">Clear</string>
<string name="record">Registra</string>
<string name="countdown_one">1…</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">起動</string>
<string name="launch">起動</string>
<string name="clear">クリア</string>
<string name="record">録画</string>
<string name="countdown_one">1…</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-ka/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="shortcut_name">ჩაწერის დაწყება</string>
<string name="launch">ჩაწერის დაწყება</string>
<string name="clear">წაშლა</string>
<string name="record">ჩაწერა</string>
<string name="launch_overlay">ჩაწერის დაწყება ფონურ რეჟიმში</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-no/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">Start</string>
<string name="launch">Start</string>
<string name="clear">Slett</string>
<string name="record">Ta opp</string>
<string name="launch_overlay">Start overlay</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">Uruchom</string>
<string name="launch">Uruchom</string>
<string name="clear">Wyczyść</string>
<string name="record">Nagraj</string>
<string name="countdown_one">1…</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="shortcut_name">Iniciar</string>
<string name="launch">Iniciar</string>
<string name="tile_name">Iniciar Telecine</string>
<string name="clear">Limpar</string>
<string name="record">Gravar</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-pt-rPT/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="shortcut_name">Iniciar</string>
<string name="launch">Iniciar</string>
<string name="clear">Limpar</string>
<string name="record">Gravar</string>
<string name="countdown_one">1…</string>
Expand Down
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="recents_hide">Не показывать в недавних приложениях</string>
<string name="record">Запись</string>
<string name="recording_notification">Уведомление о записи экрана</string>
<string name="shortcut_name">Начать запись</string>
<string name="launch">Начать запись</string>
<string name="show_touches">Показывать нажатия на экран</string>
<string name="video_size_percentage">Размер видео</string>
</resources>
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">Çalıştır</string>
<string name="launch">Çalıştır</string>
<string name="clear">Temizle</string>
<string name="record">Kayıt</string>
<string name="countdown_one">1…</string>
Expand Down
5 changes: 5 additions & 0 deletions telecine/src/main/res/values-v25/bools.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Static shortcuts are used on API 25 instead. -->
<bool name="widget_shortcut_enabled">false</bool>
</resources>
2 changes: 1 addition & 1 deletion telecine/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">启动</string>
<string name="launch">启动</string>
<string name="clear">清除</string>
<string name="record">记录</string>
<string name="countdown_one">1…</string>
Expand Down
4 changes: 2 additions & 2 deletions telecine/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">啟動</string>
<string name="launch">啟動</string>
<string name="clear">清除</string>
<string name="record">記錄</string>
<string name="countdown_one">1…</string>
Expand All @@ -18,4 +18,4 @@
<string name="notification_recording_title">錄製屏幕中.</string>
<string name="notification_recording_subtitle">觸摸時鍾區域停止錄像.</string>
<string name="recording_notification">錄像通知</string>
</resources>
</resources>
4 changes: 2 additions & 2 deletions telecine/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="shortcut_name">啟動</string>
<string name="launch">啟動</string>
<string name="clear">清除</string>
<string name="record">記錄</string>
<string name="countdown_one">1…</string>
Expand All @@ -18,4 +18,4 @@
<string name="notification_recording_title">錄製屏幕中.</string>
<string name="notification_recording_subtitle">觸摸時鍾區域停止錄像.</string>
<string name="recording_notification">錄像通知</string>
</resources>
</resources>
4 changes: 4 additions & 0 deletions telecine/src/main/res/values/bools.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="widget_shortcut_enabled">true</bool>
</resources>
5 changes: 3 additions & 2 deletions telecine/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<string name="app_name" translatable="false">Telecine</string>
<string name="launcher_name" translatable="false">@string/app_name</string>

<string name="shortcut_name">Launch</string>
<string name="tile_name">Launch Telecine</string>
<string name="clear">Clear</string>
<string name="record">Record</string>
<string name="start_recording">Start Recording</string>
<string name="countdown_one">1…</string>
<string name="countdown_two">2…</string>
<string name="countdown_three">3…</string>
Expand All @@ -24,6 +23,8 @@
<string name="notification_recording_subtitle">Touch the clock area to stop recording.</string>
<string name="recording_notification">Recording Notification</string>
<string name="show_touches">Show Touches</string>
<string name="launch">Launch</string>
<string name="launch_telecine">Launch Telecine</string>

<array name="countdown">
<item>@string/countdown_three</item>
Expand Down
Loading