Browse Source

Temporarily revert v4 support until its fixed, add some documentation

master
Anthony Restaino 8 years ago
parent
commit
9c3607aa3d
  1. 15
      app/build.gradle
  2. 20
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java

15
app/build.gradle

@ -70,9 +70,17 @@ dexcount {
dependencies { dependencies {
// support libraries // support libraries
compile 'com.android.support:palette-v7:23.2.0' compile 'com.android.support:palette-v7:23.2.0'
compile 'com.android.support:appcompat-v7:23.1.1' compile('com.android.support:appcompat-v7:23.2.0') {
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' }
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 // html parsing fo reading mode
compile 'org.jsoup:jsoup:1.8.3' compile 'org.jsoup:jsoup:1.8.3'
@ -100,6 +108,7 @@ dependencies {
// memory leak analysis // memory leak analysis
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op: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' provided 'javax.annotation:jsr250-api:1.0'

20
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() { private void initializeTabHeight() {
doOnLayout(mRootLayout, new Runnable() { doOnLayout(mRootLayout, new Runnable() {
@Override @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) { private static void doOnLayout(@NonNull final View view, @NonNull final Runnable runnable) {
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @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() { private void setTabHeight() {
if (mRootLayout.getHeight() == 0) { if (mRootLayout.getHeight() == 0) {
mRootLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); mRootLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);

Loading…
Cancel
Save