How to hide the action-bar in style xml themes while loading



I have a custom theme that I displayed for my application. However, in my main activity class I set a custom font for the action bar font.



// Make sure you find out why it appears after a whole 1 second after the app appears
SpannableString s = new SpannableString("GetDisciplined");
s.setSpan(new TypefaceSpan(this, "roboto-light.ttf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

// Update the action bar title with the TypefaceSpan instance
ActionBar actionBar = getActionBar();
actionBar.setTitle(s);
// set the action bar in this activity as the home
actionBar.setHomeButtonEnabled(true);


Upon launching the app, I want to immediately show the custom font.


I did some research and most solutions didn't work, but I am trying to now use launch a "splash screen" application theme without an action bar and then set the custom_theme with an action in my main activity class.


Kind of like this.


http://ift.tt/1pf1uiH


But I am unsure how to do that modify my current style theme to do that.



<?xml version="1.0" encoding="utf-8"?>


<resources>

<style name="Theme.Light_appalled" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_light_appalled</item>
<item name="popupMenuStyle">@style/PopupMenu.Light_appalled</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Light_appalled</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Light_appalled</item>
<item name="actionDropDownStyle">@style/DropDownNav.Light_appalled</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Light_appalled</item>
<item name="actionModeBackground">@drawable/cab_background_top_light_appalled</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_light_appalled</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Light_appalled</item>



<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">@style/Theme.Light_appalled.Widget</item>

</style>

<style name="ActionBar.Solid.Light_appalled" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@drawable/ab_solid_light_appalled</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_light_appalled</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_light_appalled</item>
<item name="progressBarStyle">@style/ProgressBar.Light_appalled</item>
</style>

<style name="ActionBar.Transparent.Light_appalled" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/ab_transparent_light_appalled</item>
<item name="progressBarStyle">@style/ProgressBar.Light_appalled</item>
</style>

<style name="PopupMenu.Light_appalled" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_light_appalled</item>
</style>

<style name="DropDownListView.Light_appalled" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_light_appalled</item>
</style>

<style name="ActionBarTabStyle.Light_appalled" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_light_appalled</item>
</style>

<style name="DropDownNav.Light_appalled" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_light_appalled</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_light_appalled</item>
<item name="android:dropDownSelector">@drawable/selectable_background_light_appalled</item>
</style>

<style name="ProgressBar.Light_appalled" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_light_appalled</item>
</style>

<style name="ActionButton.CloseMode.Light_appalled" parent="@style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_light_appalled</item>
</style>

<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Light_appalled.Widget" parent="@style/Theme.AppCompat">
<item name="popupMenuStyle">@style/PopupMenu.Light_appalled</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Light_appalled</item>
</style>






</resources>


Unfortunately



<item name="android:windowNoTitle">true</item>


did not work, so I am trying to figure out how to do it.


No comments:

Post a Comment