Comments (8)
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.
<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.
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.
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.
can i make another PR?
from advancedmaterialdrawer.
What dou you mean with PR?
from advancedmaterialdrawer.
pull request
from advancedmaterialdrawer.
Yeah, you can make a pull request ;).
from advancedmaterialdrawer.
Related Issues (20)
- RTL slide shod HOT 1
- Header title text font HOT 1
- Account photo is changed to color HOT 9
- retain selected fragment on rotation HOT 1
- Master Child Navigation - Update? HOT 1
- support navigation bar in different api levels
- Toolbar cut off HOT 6
- Crashes on API 10 HOT 1
- app:theme is now deprecated. Please move to using android:theme instead. HOT 1
- Color of divider for section bottom HOT 1
- how to change drawer icon? HOT 1
- how to change height of actionbar? HOT 1
- PreferenceFragment support HOT 2
- failed to resolve HOT 2
- Keep fragment on orientation change HOT 2
- ActionBarActivity is deprecated HOT 3
- change background color of ActionBar to primaryColor HOT 2
- ActionBar Style (Colors and background)
- Closed
- Customize Item Background Colour HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advancedmaterialdrawer.