Giter VIP home page Giter VIP logo

Comments (8)

jjhesk avatar jjhesk commented on August 17, 2024

Referenced by the stackoverflow, so far I have looked into the xml

  <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:minHeight="?attr/actionBarSize"
            android:background="?attr/statusBarBackground"
            android:layout_below="@+id/statusBar" />

where the custom toolbar is inserted into the field.

from advancedmaterialdrawer.

jjhesk avatar jjhesk commented on August 17, 2024
  <style name="Base.V21.Theme.AppCompat" parent="Base.V7.Theme.AppCompat">

        <!-- Action Bar styling attributes -->
        <item name="actionBarSize">?android:attr/actionBarSize</item>
        <item name="actionBarDivider">?android:attr/actionBarDivider</item>
        <item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
        <item name="actionButtonStyle">?android:attr/actionButtonStyle</item>
        <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
        <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
        <item name="actionModeBackground">?android:attr/actionModeBackground</item>
        <item name="actionModeCloseDrawable">?android:attr/actionModeCloseDrawable</item>
        <item name="actionModeShareDrawable">?android:attr/actionModeShareDrawable</item>
        <item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
        <item name="homeAsUpIndicator">?android:attr/homeAsUpIndicator</item>

        <!-- For PopupMenu -->
        <item name="listPreferredItemHeightSmall">?android:attr/listPreferredItemHeightSmall</item>
        <item name="textAppearanceLargePopupMenu">?android:attr/textAppearanceLargePopupMenu</item>
        <item name="textAppearanceSmallPopupMenu">?android:attr/textAppearanceSmallPopupMenu</item>

        <!-- General view attributes -->
        <item name="selectableItemBackground">?android:attr/selectableItemBackground</item>
        <item name="selectableItemBackgroundBorderless">?android:attr/selectableItemBackgroundBorderless</item>
        <item name="dividerHorizontal">?android:attr/dividerHorizontal</item>
        <item name="dividerVertical">?android:attr/dividerVertical</item>
        <item name="editTextBackground">?android:attr/editTextBackground</item>
        <item name="editTextColor">?android:attr/editTextColor</item>
        <item name="listChoiceBackgroundIndicator">?android:attr/listChoiceBackgroundIndicator</item>

        <!-- Copy our color theme attributes to the framework -->
        <item name="android:colorPrimary">?attr/colorPrimary</item>
        <item name="android:colorPrimaryDark">?attr/colorPrimaryDark</item>
        <item name="android:colorAccent">?attr/colorAccent</item>
        <item name="android:colorControlNormal">?attr/colorControlNormal</item>
        <item name="android:colorControlActivated">?attr/colorControlActivated</item>
        <item name="android:colorControlHighlight">?attr/colorControlHighlight</item>
    </style>

Final I traced back to V21 setup for the actionbar theme and it doesnt seems to have a background drawable attribute for customisation..

from advancedmaterialdrawer.

jjhesk avatar jjhesk commented on August 17, 2024

according to another module there are some setup required for customization
v2.9.0 now uses the latest com.android.support:appcompat version 22.1.1. Please update if you use an older version. It is now also required to set the theme within your layout for toolbars. (Especially for the DarkToolbar theme)

<android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        android:elevation="4dp"/>

To understand more there is some learning curve

from advancedmaterialdrawer.

madcyph3r avatar madcyph3r commented on August 17, 2024

Have you looked into the example apk. There i use the parallax library. It sets a background and you can see it in the actionbar. You can look into this and set an own image over the actionbar.

Or do this:

Hide the overlayView (is the id) with gone and add a new ImageView to your layout. This new ImageView must be under the statusBar, like this: android:layout_below="@+id/statusBar" .

And set the alpha from the toolbar to 0, like this:
((MainActivity) getActivity()).setActionBarAlpha(0) in the afterInit() method.

Now you have a toolbar with a custom background

from advancedmaterialdrawer.

jjhesk avatar jjhesk commented on August 17, 2024

can i make another PR?

from advancedmaterialdrawer.

madcyph3r avatar madcyph3r commented on August 17, 2024

What dou you mean with PR?

from advancedmaterialdrawer.

jjhesk avatar jjhesk commented on August 17, 2024

pull request

from advancedmaterialdrawer.

madcyph3r avatar madcyph3r commented on August 17, 2024

Yeah, you can make a pull request ;).

from advancedmaterialdrawer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.