-
-
Save bgorkowy/10199826 to your computer and use it in GitHub Desktop.
Android example of how to add a custom logo to the ActionBar and ensure the best possible matching starting Window.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.cyrilmottier.android.anapp"> | |
<!-- ... --> | |
<application | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/config_app_name" | |
android:theme="@style/Theme.AnApp" > | |
<activity | |
android:name="com.cyrilmottier.android.anapp.LauncherActivity" | |
android:theme="@style/Theme.AnApp.Logo"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
<!-- ... --> | |
</application> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<resources> | |
<style name="Widget.ActionBar" parent="..."> | |
<!-- ... --> | |
</style> | |
<style name="Widget.ActionBar.Logo"> | |
<item name="android:logo">@drawable/app_text_logo</item> | |
<item name="android:displayOptions">useLogo|showHome</item> | |
</style> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<resources> | |
<style name="Theme.AnApp" parent="..."> | |
<item name="android:actionBarStyle">@style/Widget.ActionBar</item> | |
<!-- ... --> | |
</style> | |
<style name="Theme.AnApp.Logo"> | |
<item name="android:actionBarStyle">@style/Widget.ActionBar.Logo</item> | |
<!-- ... --> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment