Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a478d70a authored by Andrew Flynn's avatar Andrew Flynn
Browse files

SysUI: Carrier Network Change icon

- Listen for new PhoneStateListener.CARRIER_NETWORK_CHANGE events.
- Show/hide a new unique animated icon in status bar and quick settings during
  Carrier Network Change events if we are instructed by PhoneStateListener
  and it's during a period without connectivity.
- ObjectAnimator doesn't let you animate colors between themed colors, so
  there's quite a bit of boilerplate duplication in the animation xml.
- Add a new demo mode command to toggle it on/off.

Change-Id: Ic5bb2aa7444303c6b7f2456526a9c25325c6e1f4
parent 5925a910
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
<!--
    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.
-->
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="@integer/carrier_network_change_anim_time"
    android:repeatCount="-1">

    <propertyValuesHolder
        android:propertyName="fillColor"
        android:valueType="colorType">
        <keyframe
            android:fraction="0.0"
            android:value="#FFFFFFFF"/>
        <keyframe
            android:fraction="0.32"
            android:value="#FFFFFFFF"/>
        <keyframe
            android:fraction="0.33"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="1.0"
            android:value="#4DFFFFFF"/>
    </propertyValuesHolder>

</objectAnimator>
+44 −0
Original line number Diff line number Diff line
<!--
    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.
-->
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="@integer/carrier_network_change_anim_time"
    android:repeatCount="-1">

    <propertyValuesHolder
        android:propertyName="fillColor"
        android:valueType="colorType">
        <keyframe
            android:fraction="0.0"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="0.32"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="0.33"
            android:value="#FFFFFFFF"/>
        <keyframe
            android:fraction="0.66"
            android:value="#FFFFFFFF"/>
        <keyframe
            android:fraction="0.67"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="1.0"
            android:value="#4DFFFFFF"/>
    </propertyValuesHolder>

</objectAnimator>
+38 −0
Original line number Diff line number Diff line
<!--
    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.
-->
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="@integer/carrier_network_change_anim_time"
    android:repeatCount="-1">

    <propertyValuesHolder
        android:propertyName="fillColor"
        android:valueType="colorType">
        <keyframe
            android:fraction="0.0"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="0.66"
            android:value="#4DFFFFFF"/>
        <keyframe
            android:fraction="0.67"
            android:value="#FFFFFFFF"/>
        <keyframe
            android:fraction="1.0"
            android:value="#FFFFFFFF"/>
    </propertyValuesHolder>

</objectAnimator>
+38 −0
Original line number Diff line number Diff line
<!--
    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.
-->
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="@integer/carrier_network_change_anim_time"
    android:repeatCount="-1">

    <propertyValuesHolder
        android:propertyName="fillColor"
        android:valueType="colorType">
        <keyframe
            android:fraction="0.0"
            android:value="@color/light_mode_icon_color_dual_tone_fill"/>
        <keyframe
            android:fraction="0.32"
            android:value="@color/light_mode_icon_color_dual_tone_fill"/>
        <keyframe
            android:fraction="0.33"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
        <keyframe
            android:fraction="1.0"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
    </propertyValuesHolder>

</objectAnimator>
+44 −0
Original line number Diff line number Diff line
<!--
    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.
-->
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="@integer/carrier_network_change_anim_time"
    android:repeatCount="-1">

    <propertyValuesHolder
        android:propertyName="fillColor"
        android:valueType="colorType">
        <keyframe
            android:fraction="0.0"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
        <keyframe
            android:fraction="0.32"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
        <keyframe
            android:fraction="0.33"
            android:value="@color/light_mode_icon_color_dual_tone_fill"/>
        <keyframe
            android:fraction="0.66"
            android:value="@color/light_mode_icon_color_dual_tone_fill"/>
        <keyframe
            android:fraction="0.67"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
        <keyframe
            android:fraction="1.0"
            android:value="@color/light_mode_icon_color_dual_tone_background"/>
    </propertyValuesHolder>

</objectAnimator>
Loading