kishu27
kishu27

Reputation: 3120

Is there a theme for Holo, full screen but with Action Bar?

I need to make an activity appear such that the activity remains full screen (no title bar) but with the Action Bar present.

App uses Holo Light for its interfaces.

Is there such a style/theme?

Upvotes: 26

Views: 22230

Answers (6)

Meisam
Meisam

Reputation: 408

just use Theme.Holo it's fullscreen and with action bar :)

Upvotes: 0

Issac Balaji
Issac Balaji

Reputation: 1441

Try this (see http://javatechig.com/android/actionbar-with-custom-view-example-in-android for a full tutorial):

private void actionBar() {
    // remove title
    //    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);

    ActionBar actionBar = getActionBar();
    actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#bdbb35")));
    actionBar.show();

    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    LayoutInflater mInflater = LayoutInflater.from(this);

    View mCustomView = mInflater.inflate(R.layout.custom_actionbar, null);

    //TextView mTitleTextView = (TextView) mCustomView.findViewById(R.id.title_text);
    //  mTitleTextView.setText("My Own Title");

    actionBar.setCustomView(mCustomView);
    actionBar.setDisplayShowCustomEnabled(true);
}

Upvotes: 0

user3755767
user3755767

Reputation: 31

You can create a custom theme that inherits Holo Light and removes the title bar.

Add the following to the res/values/styles.xml

<style name="My.Holo.Light.FullScreen" parent="android:Theme.Holo.Light">
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

Than set this style as the default theme for your application in the manifest xml.

Upvotes: 2

WarrenFaith
WarrenFaith

Reputation: 57672

I had the same "issue" and what I do is basically the good old way:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

This combined with the normal Theme.Holo results in an UI with Actionbar but no Notification area.

Upvotes: 65

AlAsiri
AlAsiri

Reputation: 717

Here are what you have to set to reach that:

    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

Good luck

Upvotes: 5

lrAndroid
lrAndroid

Reputation: 2854

Unfortunately, all built-in Holo Light themes with no title bar also have no action bar. Theme.Holo.Light.NoActionBar has a title bar but no action bar, and Theme.Holo.Light.NoActionBar.Fullscreen has neither the action bar nor the title bar.

Upvotes: 17

Related Questions