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

Commit 8c02884c authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix Volume icons for RTL languages

- add mirrored version of the icons
- make VolumePanel respond to layout direction changes
- make AudioService propagate layout direction changes to the VolumePanel

Change-Id: Ibb884ab81641c319a9b7bea1381066f3f19581f0
parent 82fca5d2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -336,6 +336,11 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
        listenToRingerMode();
    }

    public void setLayoutDirection(int layoutDirection) {
        mPanel.setLayoutDirection(layoutDirection);
        updateStates();
    }

    private void listenToRingerMode() {
        final IntentFilter filter = new IntentFilter();
        filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
@@ -459,6 +464,8 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
    private void updateSlider(StreamControl sc) {
        sc.seekbarView.setProgress(getStreamVolume(sc.streamType));
        final boolean muted = isMuted(sc.streamType);
        // Force reloading the image resource
        sc.icon.setImageDrawable(null);
        sc.icon.setImageResource(muted ? sc.iconMuteRes : sc.iconRes);
        if (sc.streamType == AudioManager.STREAM_RING &&
                mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE) {
+3.93 KiB
Loading image diff...
+4.16 KiB
Loading image diff...
+3.88 KiB
Loading image diff...
+4.18 KiB
Loading image diff...
Loading