From 9c3607aa3d15f4c71b5c84b3ce4c4188815917a7 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Thu, 3 Mar 2016 23:16:30 -0500 Subject: [PATCH] Temporarily revert v4 support until its fixed, add some documentation --- app/build.gradle | 15 +++++++++++--- .../lightning/activity/BrowserActivity.java | 20 +++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fade51e..82aa509 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -70,9 +70,17 @@ dexcount { dependencies { // support libraries compile 'com.android.support:palette-v7:23.2.0' - compile 'com.android.support:appcompat-v7:23.1.1' - compile 'com.android.support:design:23.2.0' - compile 'com.android.support:recyclerview-v7:23.2.0' + compile('com.android.support:appcompat-v7:23.2.0') { + exclude group: 'com.android.support', module: 'support-v4' + } + compile('com.android.support:design:23.2.0') { + exclude group: 'com.android.support', module: 'support-v4' + } + compile('com.android.support:recyclerview-v7:23.2.0') { + exclude group: 'com.android.support', module: 'support-v4' + } + // Temp downgrade until google fixes the support lib + compile 'com.android.support:support-v4:23.1.1' // html parsing fo reading mode compile 'org.jsoup:jsoup:1.8.3' @@ -100,6 +108,7 @@ dependencies { // memory leak analysis debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' +// compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' provided 'javax.annotation:jsr250-api:1.0' diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java index 75c548b..74813c3 100644 --- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java @@ -1841,6 +1841,13 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements } } + /** + * This method initializes the height of the + * view that holds the current WebView. It waits + * for the root layout to be laid out before setting + * the height as it needs the root layout to be measured + * first. + */ private void initializeTabHeight() { doOnLayout(mRootLayout, new Runnable() { @Override @@ -1850,6 +1857,13 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements }); } + /** + * Performs an action when the provided view is laid out. + * + * @param view the view to listen to for layouts. + * @param runnable the runnable to run when the view is + * laid out. + */ private static void doOnLayout(@NonNull final View view, @NonNull final Runnable runnable) { view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override @@ -1864,6 +1878,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements }); } + /** + * This method sets the height of the browser + * frame view that holds the current WebView. + * It requires the root layout to be properly + * laid out in order to set the correct height. + */ private void setTabHeight() { if (mRootLayout.getHeight() == 0) { mRootLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);