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;
}
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;
}
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;
}
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();
}
}
}
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);
}
Aggregations