Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Hiding the ActionBar with an App Theme

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Action Bar and other rendering problems

Hi!

Now, I know there are 16 other questions on this video to go through and that much of the problems I'm about to talk about are probably to do with compatibility issues in Android...

But....

I'm currently running Android Studio 11.5. AI-141.2422023 Nexus 5 API 23 on Android Virtual Device Manager.

The 2 style xml files are different from the video

values-21/styles.xml
<resources>

    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>
values/styles.xml
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

</resources>```

My App theme is currently set to Material.Light.NoActionBar.  With a bit of poking around, I can eventually get the bar to go but it messes up the Button and EditText with no way to get them back where they should be.

Can anyone advise as to what code I may need to put in here?  If not, can I just carry on and try to make do regardless?  

Am I better off just upgrading to the very latest version of Android since I've probably failed to get the exact version used in this course.
Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

AS I mentioned in another thread, I've tried everything I know to get rid of the action bar. I thought I'd downloaded the same version as the video but I'm on AP23. The app functionally works as the video but for me, there's too many visual differences and quirks to the video so I'm just going to move on I think.

So long as we all understand there are going to be little differences and get to know the software we should be fine. :-)