Merge pull request #67 from GeorgeNewby/master

Swapped video mute icon
This commit is contained in:
Docile-Alligator 2020-03-03 17:38:28 +08:00 committed by GitHub
commit b101e4c87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,17 +318,17 @@ public class ViewVideoActivity extends AppCompatActivity {
isMute = savedInstanceState.getBoolean(IS_MUTE_STATE); isMute = savedInstanceState.getBoolean(IS_MUTE_STATE);
if (isMute) { if (isMute) {
player.setVolume(0f); player.setVolume(0f);
muteButton.setImageResource(R.drawable.ic_unmute_24dp); muteButton.setImageResource(R.drawable.ic_mute_24dp);
} else { } else {
player.setVolume(1f); player.setVolume(1f);
muteButton.setImageResource(R.drawable.ic_mute_24dp); muteButton.setImageResource(R.drawable.ic_unmute_24dp);
} }
} else if (muteVideo) { } else if (muteVideo) {
isMute = true; isMute = true;
player.setVolume(0f); player.setVolume(0f);
muteButton.setImageResource(R.drawable.ic_unmute_24dp);
} else {
muteButton.setImageResource(R.drawable.ic_mute_24dp); muteButton.setImageResource(R.drawable.ic_mute_24dp);
} else {
muteButton.setImageResource(R.drawable.ic_unmute_24dp);
} }
player.addListener(new Player.EventListener() { player.addListener(new Player.EventListener() {
@ -343,11 +343,11 @@ public class ViewVideoActivity extends AppCompatActivity {
if (isMute) { if (isMute) {
isMute = false; isMute = false;
player.setVolume(1f); player.setVolume(1f);
muteButton.setImageResource(R.drawable.ic_mute_24dp); muteButton.setImageResource(R.drawable.ic_unmute_24dp);
} else { } else {
isMute = true; isMute = true;
player.setVolume(0f); player.setVolume(0f);
muteButton.setImageResource(R.drawable.ic_unmute_24dp); muteButton.setImageResource(R.drawable.ic_mute_24dp);
} }
}); });
break; break;