ManuelPeinado/FadingActionBar

How to use this with fragment

lazypixelIn opened this issue · 4 comments

I have one frame layout in which i load my fragment that fragment should have image at top and listview after that how am i suppose to inflate view and also add your view please help asap thank you

Look at the samples and the documentation. It's pretty well documented.

I don as sample but i still can get Parallax effect on imageview on top while i scroll the list please help here's my code:

@OverRide
public void onAttach(Activity activity) {
// TODO Auto-generated method stub
super.onAttach(activity);
mArguments = getArguments();
int actionBarBg = mArguments != null ? mArguments
.getInt(ARG_ACTION_BG_RES) : R.drawable.ab_background_light;

    mFadingHelper = new FadingActionBarHelper()
            .actionBarBackground(actionBarBg)
            .headerLayout(R.layout.header_light)
            .contentLayout(R.layout.activity_catagories)
            .lightActionBar(actionBarBg == R.drawable.ab_background_light);


    mFadingHelper.initActionBar(activity);
}

@OverRide
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = mFadingHelper.createView(inflater);

    if (mArguments != null) {
        ImageView img = (ImageView) view.findViewById(R.id.image_header);
        img.setImageResource(mArguments.getInt(ARG_IMAGE_RES));
        ListView listView = (ListView) view.findViewById(R.id.listView1);
        ArrayList<String> items = new ArrayList<String>();
        for (int i = 0; i < 20; i++) {
            items.add("parth");
        }
        adapter = new ArrayAdapter<String>((MainActivity) getActivity(),
                android.R.layout.simple_list_item_1, items);
        listView.setAdapter(adapter);
    }

    return view;

}

your listview id must be android.R.id.list

Where is the documenation??