Commit 5d6523ae authored by LuK1337's avatar LuK1337 Committed by Bruno Martins
Browse files

DeskClock: Update drawables

* Copied from:
  frameworks/base/packages/overlays/IconPackCircularSettingsOverlay/res/drawable/ic_delete.xml
  frameworks/base/packages/SystemUI/res-keyguard/drawable/ic_backspace_black_24dp.xml
  https://materialdesignicons.com
  https://material.io

Change-Id: I84de4bfb9e38a88de182586e849c4e47d8d59b69
parent 4fdeff36
......@@ -24,7 +24,7 @@
android:pivotX="12"
android:scaleX="-1">
<path
android:fillColor="#FFFFFF"
android:pathData="M17.63,5.84C17.27,5.33 16.67,5 16,5L5,5.01C3.9,5.01 3,5.9 3,7v10c0,1.1 0.9,1.99 2,1.99L16,19c0.67,0 1.27,-0.33 1.63,-0.84L22,12l-4.37,-6.16z" />
android:fillColor="@android:color/white"
android:pathData="M16,17H5V7H16L19.55,12M17.63,5.84C17.27,5.33 16.67,5 16,5H5A2,2 0 0,0 3,7V17A2,2 0 0,0 5,19H16C16.67,19 17.27,18.66 17.63,18.15L22,12L17.63,5.84Z" />
</group>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_pause_white_24dp"
android:tint="@color/black_54p" />
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_start_white_24dp"
android:tint="@color/black_54p" />
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_stop_white_24dp"
android:tint="@color/black_54p" />
......@@ -24,9 +24,6 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFF"
android:pathData="M22,3L7,3c-0.69,0 -1.23,0.35 -1.59,0.88L0,12l5.41,8.11c0.36,0.53
0.9,0.89 1.59,0.89h15c1.1,0 2,-0.9 2,-2L24,5c0,-1.1 -0.9,-2 -2,-2zM19,15.59L17.59,17
14,13.41 10.41,17 9,15.59 12.59,12 9,8.41 10.41,7 14,10.59 17.59,7 19,8.41 15.41,12
19,15.59z" />
android:fillColor="@android:color/white"
android:pathData="M9,15.59L12.59,12L9,8.41L10.41,7L14,10.59L17.59,7L19,8.41L15.41,12L19,15.59L17.59,17L14,13.41L10.41,17L9,15.59zM21,6H8l-4.5,6L8,18h13V6M21,4c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H8c-0.63,0 -1.22,-0.3 -1.6,-0.8L1,12l5.4,-7.2C6.78,4.3 7.37,4 8,4H21L21,4z" />
</vector>
......@@ -20,6 +20,12 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
android:fillColor="@android:color/white"
android:pathData="M9,20h6c1.66,0,3-1.34,3-3V6h0.5c0.41,0,0.75-0.34,0.75-0.75S18.91,4.5,18.5,4.5H18h-3l-1-1h-4l-1,1H6H5.5 c-0.41,0-0.75,0.34-0.75,0.75S5.09,6,5.5,6H6v11C6,18.66,7.34,20,9,20z M16.5,6v11c0,0.83-0.67,1.5-1.5,1.5H9 c-0.83,0-1.5-0.67-1.5-1.5V6H16.5z" />
<path
android:fillColor="@android:color/white"
android:pathData="M13.97,16c0.41,0,0.75-0.34,0.75-0.75v-6.5c0-0.41-0.34-0.75-0.75-0.75s-0.75,0.34-0.75,0.75v6.5 C13.22,15.66,13.55,16,13.97,16z" />
<path
android:fillColor="@android:color/white"
android:pathData="M10,16c0.41,0,0.75-0.34,0.75-0.75v-6.5C10.75,8.34,10.41,8,10,8S9.25,8.34,9.25,8.75v6.5C9.25,15.66,9.59,16,10,16z" />
</vector>
\ No newline at end of file
......@@ -21,6 +21,6 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFF"
android:pathData="M17.63,5.84C17.27,5.33 16.67,5 16,5L5,5.01C3.9,5.01 3,5.9 3,7v10c0,1.1 0.9,1.99 2,1.99L16,19c0.67,0 1.27,-0.33 1.63,-0.84L22,12l-4.37,-6.16z"/>
android:fillColor="@android:color/white"
android:pathData="M16,17H5V7H16L19.55,12M17.63,5.84C17.27,5.33 16.67,5 16,5H5A2,2 0 0,0 3,7V17A2,2 0 0,0 5,19H16C16.67,19 17.27,18.66 17.63,18.15L22,12L17.63,5.84Z" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_pause_white_24dp" />
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M19,19h-6L13,5h6v14zM15,17h2L17,7h-2v10zM11,19L5,19L5,5h6v14zM7,17h2L9,7L7,7v10z" />
</vector>
......@@ -20,6 +20,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM11,19.93c-3.95,-0.49 -7,-3.85 -7,-7.93 0,-0.62 0.08,-1.21 0.21,-1.79L9,15v1c0,1.1 0.9,2 2,2v1.93zM17.9,17.39c-0.26,-0.81 -1,-1.39 -1.9,-1.39h-1v-3c0,-0.55 -0.45,-1 -1,-1L8,12v-2h2c0.55,0 1,-0.45 1,-1L11,7h2c1.1,0 2,-0.9 2,-2v-0.41c2.93,1.19 5,4.06 5,7.41 0,2.08 -0.8,3.97 -2.1,5.39z"/>
android:fillColor="@android:color/white"
android:pathData="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z" />
</vector>
\ No newline at end of file
......@@ -20,6 +20,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
android:fillColor="@android:color/white"
android:pathData="M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61C20.04,6.3 21,8.6 21,11H23C23,8.07 21.84,5.25 19.75,3.19M1,11H3C3,8.6 3.96,6.3 5.67,4.61L4.25,3.19C2.16,5.25 1,8.07 1,11Z" />
</vector>
\ No newline at end of file
......@@ -20,6 +20,6 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
android:fillColor="@android:color/white"
android:pathData="M12 3l0.01 10.55c-0.59-0.34-1.27-0.55-2-0.55C7.79 13 6 14.79 6 17s1.79 4 4.01 4S14 19.21 14 17V7h4V3h-6zm-10.99 16c-1.1 0-2-0.9-2-2s0.9-2 2-2 2 0.9 2 2-0.9 2-2 2z" />
</vector>
......@@ -20,6 +20,6 @@
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M20,18.69L7.84,6.14 5.27,3.49 4,4.76l2.8,2.8v0.01c-0.52,0.99 -0.8,2.16 -0.8,3.42v5l-2,2v1h13.73l2,2L21,19.72l-1,-1.03zM12,22c1.11,0 2,-0.89 2,-2h-4c0,1.11 0.89,2 2,2zM18,14.68L18,11c0,-3.08 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68c-0.15,0.03 -0.29,0.08 -0.42,0.12 -0.1,0.03 -0.2,0.07 -0.3,0.11h-0.01c-0.01,0 -0.01,0 -0.02,0.01 -0.23,0.09 -0.46,0.2 -0.68,0.31 0,0 -0.01,0 -0.01,0.01L18,14.68z" />
</vector>
\ No newline at end of file
android:fillColor="@android:color/white"
android:pathData="M22.11,21.46L2.39,1.73L1.11,3L5.83,7.72C5.29,8.73 5,9.86 5,11V17L3,19V20H18.11L20.84,22.73L22.11,21.46M7,18V11C7,10.39 7.11,9.79 7.34,9.23L16.11,18H7M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M8.29,5.09C8.82,4.75 9.4,4.5 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V15.8L17,13.8V11A5,5 0 0,0 12,6C11.22,6 10.45,6.2 9.76,6.56L8.29,5.09Z" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_start_white_24dp" />
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M8.5,8.64L13.77,12L8.5,15.36V8.64M6.5,5V19L17.5,12" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_stop_white_24dp" />
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M16,8v8H8V8h8m2-2H6v12h12V6z" />
</vector>
......@@ -79,8 +79,6 @@ final class RingtoneViewHolder extends ItemAdapter.ItemViewHolder<RingtoneHolder
}
} else if (itemHolder.item == Utils.RINGTONE_SILENT) {
mImageView.setImageResource(R.drawable.ic_ringtone_silent);
} else if (itemHolder.isPlaying()) {
mImageView.setImageResource(R.drawable.ic_ringtone_active);
} else {
mImageView.setImageResource(R.drawable.ic_ringtone);
}
......
......@@ -239,33 +239,26 @@ public final class StopwatchFragment extends DeskClockFragment {
}
}
private void updateFab(@NonNull ImageView fab, boolean animate) {
private void updateFab(@NonNull ImageView fab) {
if (getStopwatch().isRunning()) {
if (animate) {
fab.setImageResource(R.drawable.ic_play_pause_animation);
} else {
fab.setImageResource(R.drawable.ic_play_pause);
}
fab.setImageResource(R.drawable.ic_pause_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.sw_pause_button));
} else {
if (animate) {
fab.setImageResource(R.drawable.ic_pause_play_animation);
} else {
fab.setImageResource(R.drawable.ic_pause_play);
}
fab.setImageResource(R.drawable.ic_start_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.sw_start_button));
}
fab.setVisibility(VISIBLE);
}
@Override
public void onUpdateFab(@NonNull ImageView fab) {
updateFab(fab, false);
updateFab(fab);
}
@Override
public void onMorphFab(@NonNull ImageView fab) {
// Update the fab's drawable to match the current timer state.
updateFab(fab, Utils.isNOrLater());
updateFab(fab);
// Animate the drawable.
AnimatorUtils.startDrawableAnimation(fab);
}
......
......@@ -236,7 +236,7 @@ public final class TimerFragment extends DeskClockFragment {
}
}
private void updateFab(@NonNull ImageView fab, boolean animate) {
private void updateFab(@NonNull ImageView fab) {
if (mCurrentView == mTimersView) {
final Timer timer = getTimer();
if (timer == null) {
......@@ -247,38 +247,26 @@ public final class TimerFragment extends DeskClockFragment {
fab.setVisibility(VISIBLE);
switch (timer.getState()) {
case RUNNING:
if (animate) {
fab.setImageResource(R.drawable.ic_play_pause_animation);
} else {
fab.setImageResource(R.drawable.ic_play_pause);
}
fab.setImageResource(R.drawable.ic_pause_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.timer_stop));
break;
case RESET:
if (animate) {
fab.setImageResource(R.drawable.ic_stop_play_animation);
} else {
fab.setImageResource(R.drawable.ic_pause_play);
}
fab.setImageResource(R.drawable.ic_start_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.timer_start));
break;
case PAUSED:
if (animate) {
fab.setImageResource(R.drawable.ic_pause_play_animation);
} else {
fab.setImageResource(R.drawable.ic_pause_play);
}
fab.setImageResource(R.drawable.ic_start_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.timer_start));
break;
case MISSED:
case EXPIRED:
fab.setImageResource(R.drawable.ic_stop_white_24dp);
fab.setImageResource(R.drawable.ic_stop_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.timer_stop));
break;
}
} else if (mCurrentView == mCreateTimerView) {
if (mCreateTimerView.hasValidInput()) {
fab.setImageResource(R.drawable.ic_start_white_24dp);
fab.setImageResource(R.drawable.ic_start_24dp);
fab.setContentDescription(fab.getResources().getString(R.string.timer_start));
fab.setVisibility(VISIBLE);
} else {
......@@ -290,13 +278,13 @@ public final class TimerFragment extends DeskClockFragment {
@Override
public void onUpdateFab(@NonNull ImageView fab) {
updateFab(fab, false);
updateFab(fab);
}
@Override
public void onMorphFab(@NonNull ImageView fab) {
// Update the fab's drawable to match the current timer state.
updateFab(fab, Utils.isNOrLater());
updateFab(fab);
// Animate the drawable.
AnimatorUtils.startDrawableAnimation(fab);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment