manuelpeinado / fadingactionbar-native Goto Github PK
View Code? Open in Web Editor NEWAndroid - A version of FadingActionBar that works with the native action bar.
Android - A version of FadingActionBar that works with the native action bar.
Does it work with ActionBarCompat?
add EditText,the offset of header image is wrong..the layout is white head or the image is white...
Excellent stuff.
A feature request.
Regardless if using dark or light actionbar the text can be hard to see depending on the image.
Handling header images with difficult to see text like the Google Play Music app could be very useful. Looking closely at that app they add a grey transparent shape coming in from the top under the text when at the top.
On Android 4.2.2 this action bar shows as white, rather than transparent. It does fade in when the user scrolls the content down, but it fades in from White rather than from Transparent.
FadingActionBarHelper helper = new FadingActionBarHelper()
.actionBarBackground(R.drawable.ab_solid_tinsel)
.headerLayout(R.layout.fragment_profile_header)
.contentLayout(R.layout.fragment_profile)
.lightActionBar(false);
setContentView(helper.createView(this));
helper.initActionBar(this);
Here is the profile_header:
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:id="@+id/profile_avatar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:contentDescription="@string/content_desc_avatar"/>
And here is the main contentLayout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
android:orientation="vertical">
<!-- TextViews here -->
</LinearLayout>
The action bar style is:
<style name="ActionBar.Solid.Tinsel" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/ab_solid_tinsel</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_tinsel</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_tinsel</item>
<item name="android:progressBarStyle">@style/ProgressBar.Tinsel</item>
</style>
When scrolling a little bit and then let the software keyboard show up, the header offset suddenly changes. This problem also occurs when scrolling with the keyboard showing and then hide the keyboard.
Hope this description is enough to solve it, otherwise you can always contact me.
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.