Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
android_packages_apps_DeskClock
Commits
9026139e
Commit
9026139e
authored
Jun 08, 2020
by
Jesse Chan
Committed by
Michael W
Jun 10, 2020
Browse files
DeskClock: also apply disabled color to annotations
Change-Id: Ia2c7e28e161f1a0f01de13deff4d02a78c34f8d5
parent
6fcbe7e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/com/android/deskclock/alarms/dataadapter/AlarmItemViewHolder.java
View file @
9026139e
...
...
@@ -36,8 +36,8 @@ import com.android.deskclock.widget.TextTime;
public
abstract
class
AlarmItemViewHolder
extends
ItemAdapter
.
ItemViewHolder
<
AlarmItemHolder
>
implements
ItemAnimator
.
OnAnimateChangeListener
{
p
rivate
static
final
float
CLOCK_ENABLED_ALPHA
=
1
f
;
p
rivate
static
final
float
CLOCK_DISABLED_ALPHA
=
0.69f
;
p
ublic
static
final
float
CLOCK_ENABLED_ALPHA
=
1
f
;
p
ublic
static
final
float
CLOCK_DISABLED_ALPHA
=
0.69f
;
public
static
final
float
ANIM_STANDARD_DELAY_MULTIPLIER
=
1
f
/
6
f
;
public
static
final
float
ANIM_LONG_DURATION_MULTIPLIER
=
2
f
/
3
f
;
...
...
src/com/android/deskclock/alarms/dataadapter/CollapsedAlarmViewHolder.java
View file @
9026139e
...
...
@@ -52,6 +52,8 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
private
final
TextView
upcomingInstanceLabel
;
private
final
View
hairLine
;
private
float
annotationsAlpha
=
CLOCK_ENABLED_ALPHA
;
private
CollapsedAlarmViewHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -105,6 +107,7 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
bindReadOnlyLabel
(
context
,
alarm
);
bindUpcomingInstance
(
context
,
alarm
);
bindPreemptiveDismissButton
(
context
,
alarm
,
alarmInstance
);
bindAnnotations
(
context
,
alarm
);
}
private
void
bindReadOnlyLabel
(
Context
context
,
Alarm
alarm
)
{
...
...
@@ -145,6 +148,11 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
}
}
private
void
bindAnnotations
(
Context
context
,
Alarm
alarm
)
{
annotationsAlpha
=
alarm
.
enabled
?
CLOCK_ENABLED_ALPHA
:
CLOCK_DISABLED_ALPHA
;
setChangingViewsAlpha
(
annotationsAlpha
);
}
@Override
public
Animator
onAnimateChange
(
List
<
Object
>
payloads
,
int
fromLeft
,
int
fromTop
,
int
fromRight
,
int
fromBottom
,
long
duration
)
{
...
...
@@ -161,7 +169,7 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
}
final
boolean
isCollapsing
=
this
==
newHolder
;
setChangingViewsAlpha
(
isCollapsing
?
0
f
:
1
f
);
setChangingViewsAlpha
(
isCollapsing
?
0
f
:
annotationsAlpha
);
final
Animator
changeAnimatorSet
=
isCollapsing
?
createCollapsingAnimator
((
AlarmItemViewHolder
)
oldHolder
,
duration
)
...
...
@@ -173,7 +181,7 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
onOff
.
setVisibility
(
View
.
VISIBLE
);
arrow
.
setVisibility
(
View
.
VISIBLE
);
arrow
.
setTranslationY
(
0
f
);
setChangingViewsAlpha
(
1
f
);
setChangingViewsAlpha
(
annotationsAlpha
);
arrow
.
jumpDrawablesToCurrentState
();
}
});
...
...
@@ -208,11 +216,11 @@ public final class CollapsedAlarmViewHolder extends AlarmItemViewHolder {
private
Animator
createCollapsingAnimator
(
AlarmItemViewHolder
oldHolder
,
long
duration
)
{
final
AnimatorSet
alphaAnimatorSet
=
new
AnimatorSet
();
alphaAnimatorSet
.
playTogether
(
ObjectAnimator
.
ofFloat
(
alarmLabel
,
View
.
ALPHA
,
1
f
),
ObjectAnimator
.
ofFloat
(
daysOfWeek
,
View
.
ALPHA
,
1
f
),
ObjectAnimator
.
ofFloat
(
upcomingInstanceLabel
,
View
.
ALPHA
,
1
f
),
ObjectAnimator
.
ofFloat
(
preemptiveDismissButton
,
View
.
ALPHA
,
1
f
),
ObjectAnimator
.
ofFloat
(
hairLine
,
View
.
ALPHA
,
1
f
));
ObjectAnimator
.
ofFloat
(
alarmLabel
,
View
.
ALPHA
,
annotationsAlpha
),
ObjectAnimator
.
ofFloat
(
daysOfWeek
,
View
.
ALPHA
,
annotationsAlpha
),
ObjectAnimator
.
ofFloat
(
upcomingInstanceLabel
,
View
.
ALPHA
,
annotationsAlpha
),
ObjectAnimator
.
ofFloat
(
preemptiveDismissButton
,
View
.
ALPHA
,
annotationsAlpha
),
ObjectAnimator
.
ofFloat
(
hairLine
,
View
.
ALPHA
,
annotationsAlpha
));
final
long
standardDelay
=
(
long
)
(
duration
*
ANIM_STANDARD_DELAY_MULTIPLIER
);
alphaAnimatorSet
.
setDuration
(
standardDelay
);
alphaAnimatorSet
.
setStartDelay
(
duration
-
standardDelay
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment