created proper drawable icons for speaker

This commit is contained in:
Juha Heinanen
2018-05-13 11:31:44 +03:00
parent 1a880ec971
commit f9ec64fb2a
7 changed files with 14 additions and 1 deletions

View File

@ -308,9 +308,10 @@ class MainActivity : AppCompatActivity() {
am.isSpeakerphoneOn = !am.isSpeakerphoneOn am.isSpeakerphoneOn = !am.isSpeakerphoneOn
val speakerIcon = findViewById(R.id.speakerIcon) as ActionMenuItemView val speakerIcon = findViewById(R.id.speakerIcon) as ActionMenuItemView
if (am.isSpeakerphoneOn) if (am.isSpeakerphoneOn)
speakerIcon.setBackgroundColor(Color.RED)
// speakerIcon.setIcon(ContextCompat.getDrawable(this, R.drawable.speaker_on)) // speakerIcon.setIcon(ContextCompat.getDrawable(this, R.drawable.speaker_on))
speakerIcon.setBackgroundColor(Color.rgb(0x04,0xb4, 0x04))
else else
// speakerIcon.setBackgroundColor(resources.getColor(R.color.colorPrimary, applicationContext.theme))
speakerIcon.setBackgroundColor(resources.getColor(R.color.colorPrimary)) speakerIcon.setBackgroundColor(resources.getColor(R.color.colorPrimary))
return true return true
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -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>