Thursday, 28 January 2021

Replace home indicator of OSS Licenses Gradle Plugin with a closing icon

I'm using the com.google.android.gms.oss-licenses-plugin with the play-services-oss-licenses library from Google. My default theme doesn't contain an action bar, therefore I defined another theme with action bar Theme.With.ActionBar.

Everything works well. I'm just not able to replace the back icon of the action bar with a close icon , eventhough I tried to set it with [android:]homeAsUpIndicator and [android:]collapseIcon within the theme Theme.With.ActionBar and within the referenced actionBarTheme style attribute.

How can I achieve this instead?

<activity
    android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
    android:exported="false"
    android:label="@string/oss_license_title"
    android:theme="@style/Theme.With.ActionBar">
    <intent-filter>
        <action android:name="ACTION_LICENSES" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
<style name="Theme.With.ActionBar" parent="Theme.WithOut.ActionBar">
    <item name="actionBarWidgetTheme">@null</item>
    <item name="actionBarTheme">@style/ThemeOverlay.MaterialComponents.Dark.ActionBar</item>
    <item name="listChoiceBackgroundIndicator">@drawable/abc_list_selector_holo_dark</item>
    <item name="windowActionBar">true</item>
    <item name="windowActionModeOverlay">false</item>
    <item name="windowNoTitle">false</item>
</style>

This issue might be related to other libraries as well. My device is running Android 10.



from Replace home indicator of OSS Licenses Gradle Plugin with a closing icon

No comments:

Post a Comment