Search in sources :

Example 1 with NotifyingScrollView

use of com.cyrilmottier.android.translucentactionbar.NotifyingScrollView in project GlassActionBar by ManuelPeinado.

the class GlassActionBarHelper method createView.

public View createView(Context context) {
    int[] attrs = { android.R.attr.windowBackground };
    // Need to get resource id of style pointed to from actionBarStyle
    TypedValue outValue = new TypedValue();
    context.getTheme().resolveAttribute(android.R.attr.windowBackground, outValue, true);
    TypedArray style = context.getTheme().obtainStyledAttributes(outValue.resourceId, attrs);
    windowBackground = style.getDrawable(0);
    style.recycle();
    LayoutInflater inflater = LayoutInflater.from(context);
    frame = (FrameLayout) inflater.inflate(R.layout.gab__frame, null);
    content = inflater.inflate(contentLayout, (ViewGroup) frame, false);
    frame.addView(content, 0);
    frame.getViewTreeObserver().addOnGlobalLayoutListener(this);
    blurredOverlay = (ImageView) frame.findViewById(R.id.blurredOverlay);
    if (content instanceof NotifyingScrollView) {
        if (verbose)
            Log.v(TAG, "ScrollView content!");
        scrollView = (NotifyingScrollView) content;
        scrollView.setOnScrollChangedListener(this);
    } else if (content instanceof ListView) {
        if (verbose)
            Log.v(TAG, "ListView content!");
        listView = (ListView) content;
        listView.setAdapter(adapter);
        ListViewScrollObserver observer = new ListViewScrollObserver(listView);
        observer.setOnScrollUpAndDownListener(this);
    }
    actionBarHeight = getActionBarHeight(context);
    return frame;
}
Also used : ListView(android.widget.ListView) ViewGroup(android.view.ViewGroup) TypedArray(android.content.res.TypedArray) LayoutInflater(android.view.LayoutInflater) TypedValue(android.util.TypedValue) NotifyingScrollView(com.cyrilmottier.android.translucentactionbar.NotifyingScrollView)

Example 2 with NotifyingScrollView

use of com.cyrilmottier.android.translucentactionbar.NotifyingScrollView in project FadingActionBar-Native by ManuelPeinado.

the class FadingActionBarHelper method createScrollView.

private View createScrollView() {
    mScrollView = (ViewGroup) mInflater.inflate(R.layout.fab__scrollview_container, null);
    NotifyingScrollView scrollView = (NotifyingScrollView) mScrollView.findViewById(R.id.fab__scroll_view);
    scrollView.setOnScrollChangedListener(mOnScrollChangedListener);
    mContentContainer = (ViewGroup) mScrollView.findViewById(R.id.fab__container);
    mContentContainer.addView(mContentView);
    mHeaderContainer = (FrameLayout) mScrollView.findViewById(R.id.fab__header_container);
    initializeGradient(mHeaderContainer);
    mHeaderContainer.addView(mHeaderView, 0);
    mMarginView = mContentContainer.findViewById(R.id.fab__content_top_margin);
    return mScrollView;
}
Also used : NotifyingScrollView(com.cyrilmottier.android.translucentactionbar.NotifyingScrollView)

Aggregations

NotifyingScrollView (com.cyrilmottier.android.translucentactionbar.NotifyingScrollView)2 TypedArray (android.content.res.TypedArray)1 TypedValue (android.util.TypedValue)1 LayoutInflater (android.view.LayoutInflater)1 ViewGroup (android.view.ViewGroup)1 ListView (android.widget.ListView)1