Search in sources :

Example 31 with ViewGroup

use of android.view.ViewGroup in project Rutgers-Course-Tracker by tevjef.

the class CourseInfoFragment method createCourseMetaDataView.

private View createCourseMetaDataView() {
    ViewGroup root = (ViewGroup) getParentActivity().getLayoutInflater().inflate(R.layout.course_info_metadata, null);
    setPreReqNotes(root, mSelectedCourse);
    setCourseNotes(root, mSelectedCourse);
    setSubjectNotes(root, mSelectedCourse);
    return root;
}
Also used : ViewGroup(android.view.ViewGroup)

Example 32 with ViewGroup

use of android.view.ViewGroup in project Rutgers-Course-Tracker by tevjef.

the class RatingLayoutInflater method getProfessorLayout.

@MainThread
public ViewGroup getProfessorLayout() {
    ViewGroup root = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.section_info_rmp_rating, null);
    setOpenInBrowser(root);
    setName(root);
    setSubtitle(root);
    setOverall(root);
    setEasiness(root);
    setClarity(root);
    setHelpfulness(root);
    setAverageGrade(root);
    setRatingCount(root);
    tagView(root);
    return root;
}
Also used : ViewGroup(android.view.ViewGroup) MainThread(android.support.annotation.MainThread)

Example 33 with ViewGroup

use of android.view.ViewGroup in project Rutgers-Course-Tracker by tevjef.

the class TrackedSectionsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    LayoutInflater themedInflator = inflater.cloneInContext(Utils.wrapContextTheme(getActivity(), R.style.RutgersCT));
    ViewGroup rootView = (ViewGroup) themedInflator.inflate(R.layout.fragment_tracked_sections, container, false);
    ButterKnife.bind(this, rootView);
    return rootView;
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(android.view.LayoutInflater)

Example 34 with ViewGroup

use of android.view.ViewGroup in project Shuttle by timusus.

the class ThemeUtils method updateThemableViews.

/**
     * Traverses the hierarchy of this view (if it's a ViewGroup). If the view itself or any of its children
     * implement {@link Themable}, calls {@link Themable#updateTheme()}
     */
public static void updateThemableViews(View view) {
    if (view instanceof ViewGroup) {
        for (int i = 0, count = ((ViewGroup) view).getChildCount(); i < count; i++) {
            View child = ((ViewGroup) view).getChildAt(i);
            updateThemableViews(child);
        }
    } else {
        if (view instanceof Themable) {
            ((Themable) view).updateTheme();
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) Themable(com.simplecity.amp_library.ui.views.Themable) SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) HmsView(com.doomonafireball.betterpickers.hmspicker.HmsView) AbsListView(android.widget.AbsListView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) SuppressLint(android.annotation.SuppressLint)

Example 35 with ViewGroup

use of android.view.ViewGroup in project Shuttle by timusus.

the class SlidingUpPanelLayout method canScroll.

/**
     * Tests scrollability within child views of v given a delta of dx.
     *
     * @param v      View to test for horizontal scrollability
     * @param checkV Whether the view v passed should itself be checked for scrollability (true),
     *               or just its children (false).
     * @param dx     Delta scrolled in pixels
     * @param x      X coordinate of the active touch point
     * @param y      Y coordinate of the active touch point
     * @return true if child views of v can be scrolled by delta of dx.
     */
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
    if (v instanceof ViewGroup) {
        final ViewGroup group = (ViewGroup) v;
        final int scrollX = v.getScrollX();
        final int scrollY = v.getScrollY();
        final int count = group.getChildCount();
        // Count backwards - let topmost views consume scroll distance first.
        for (int i = count - 1; i >= 0; i--) {
            final View child = group.getChildAt(i);
            if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() && y + scrollY >= child.getTop() && y + scrollY < child.getBottom() && canScroll(child, true, dx, x + scrollX - child.getLeft(), y + scrollY - child.getTop())) {
                return true;
            }
        }
    }
    return checkV && ViewCompat.canScrollHorizontally(v, -dx);
}
Also used : ViewGroup(android.view.ViewGroup) View(android.view.View) SuppressLint(android.annotation.SuppressLint) Paint(android.graphics.Paint)

Aggregations

ViewGroup (android.view.ViewGroup)2327 View (android.view.View)1300 TextView (android.widget.TextView)452 ImageView (android.widget.ImageView)282 ArrayList (java.util.ArrayList)204 ViewParent (android.view.ViewParent)185 ListView (android.widget.ListView)159 LayoutInflater (android.view.LayoutInflater)127 FrameLayout (android.widget.FrameLayout)127 Paint (android.graphics.Paint)126 AdapterView (android.widget.AdapterView)118 LinearLayout (android.widget.LinearLayout)113 AbsListView (android.widget.AbsListView)106 RecyclerView (android.support.v7.widget.RecyclerView)100 Drawable (android.graphics.drawable.Drawable)95 Animator (android.animation.Animator)94 AnimatedView (carbon.animation.AnimatedView)88 ComponentView (carbon.component.ComponentView)88 RippleView (carbon.drawable.ripple.RippleView)88 ShadowView (carbon.shadow.ShadowView)88