X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdefinitions%2FWrapVerticalContentViewPager.java;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdefinitions%2FWrapVerticalContentViewPager.java;h=0000000000000000000000000000000000000000;hp=8b1d9782e4930759fcebcbb88594b432371bcb13;hb=ba40295dffd761ccdc95d3b46ca7acbad1f00d5e;hpb=33bd447a83bd3d763ee26bbb3a3f4adb074776ed diff --git a/app/src/main/java/com/stoutner/privacybrowser/definitions/WrapVerticalContentViewPager.java b/app/src/main/java/com/stoutner/privacybrowser/definitions/WrapVerticalContentViewPager.java deleted file mode 100644 index 8b1d9782..00000000 --- a/app/src/main/java/com/stoutner/privacybrowser/definitions/WrapVerticalContentViewPager.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.stoutner.privacybrowser.definitions; - -/* - * Copyright © 2017 Soren Stoutner . - * - * This file is part of Privacy Browser . - * - * Privacy Browser is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Privacy Browser is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser. If not, see . - */ - -import android.content.Context; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.View; - -public class WrapVerticalContentViewPager extends ViewPager { - // Setup the default constructors. - public WrapVerticalContentViewPager(Context context) { - super(context); - } - - public WrapVerticalContentViewPager(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - // Perform an initial `super.onMeasure`, which populates `getChildCount`. - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - // Initialize `maximumHeight`. - int maximumHeight = 0; - - // Find the maximum height of each of the child views. - for (int i = 0; i < getChildCount(); i++) { - View childView = getChildAt(i); - - // Measure the child view height with no constraints. - childView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); - - // Store the child's height if it is larger than `maximumHeight`. - if (childView.getMeasuredHeight() > maximumHeight) { - maximumHeight = childView.getMeasuredHeight(); - } - } - - // Perform a final `super.onMeasure` to set the `maximumHeight`. - super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(maximumHeight, MeasureSpec.EXACTLY)); - } -} \ No newline at end of file