created proper drawable icons for speaker
This commit is contained in:
@ -308,9 +308,10 @@ class MainActivity : AppCompatActivity() {
|
||||
am.isSpeakerphoneOn = !am.isSpeakerphoneOn
|
||||
val speakerIcon = findViewById(R.id.speakerIcon) as ActionMenuItemView
|
||||
if (am.isSpeakerphoneOn)
|
||||
speakerIcon.setBackgroundColor(Color.RED)
|
||||
// speakerIcon.setIcon(ContextCompat.getDrawable(this, R.drawable.speaker_on))
|
||||
speakerIcon.setBackgroundColor(Color.rgb(0x04,0xb4, 0x04))
|
||||
else
|
||||
// speakerIcon.setBackgroundColor(resources.getColor(R.color.colorPrimary, applicationContext.theme))
|
||||
speakerIcon.setBackgroundColor(resources.getColor(R.color.colorPrimary))
|
||||
return true
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/ic_action_speaker.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_action_speaker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_speaker.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_action_speaker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 794 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_speaker.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_action_speaker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_speaker.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_action_speaker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/speakerIcon"
|
||||
android:title=""
|
||||
app:showAsAction="always"
|
||||
android:icon="@drawable/ic_action_speaker"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
|
||||
Reference in New Issue
Block a user