Update to latest support library, improve drawer closing experience
This commit is contained in:
parent
d3ac7187bb
commit
14f08a8fef
@ -69,11 +69,11 @@ dexcount {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// support libraries
|
// support libraries
|
||||||
compile 'com.android.support:palette-v7:23.1.1'
|
compile 'com.android.support:palette-v7:23.2.1'
|
||||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
compile 'com.android.support:appcompat-v7:23.2.1'
|
||||||
compile 'com.android.support:design:23.1.1'
|
compile 'com.android.support:design:23.2.1'
|
||||||
compile 'com.android.support:recyclerview-v7:23.1.1'
|
compile 'com.android.support:recyclerview-v7:23.2.1'
|
||||||
compile 'com.android.support:support-v4:23.1.1'
|
compile 'com.android.support:support-v4:23.2.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'
|
||||||
|
@ -278,28 +278,27 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
|||||||
mDrawerLeft.setLayerType(View.LAYER_TYPE_NONE, null);
|
mDrawerLeft.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
mDrawerRight.setLayerType(View.LAYER_TYPE_NONE, null);
|
mDrawerRight.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
|
|
||||||
//TODO restore when upgrading support library
|
mDrawerLayout.addDrawerListener(new DrawerListener() {
|
||||||
// mDrawerLayout.addDrawerListener(new DrawerListener() {
|
@Override
|
||||||
// @Override
|
public void onDrawerSlide(View drawerView, float slideOffset) {}
|
||||||
// public void onDrawerSlide(View drawerView, float slideOffset) {}
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public void onDrawerOpened(View drawerView) {}
|
||||||
// public void onDrawerOpened(View drawerView) {}
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public void onDrawerClosed(View drawerView) {}
|
||||||
// public void onDrawerClosed(View drawerView) {}
|
|
||||||
//
|
@Override
|
||||||
// @Override
|
public void onDrawerStateChanged(int newState) {
|
||||||
// public void onDrawerStateChanged(int newState) {
|
if (newState == DrawerLayout.STATE_DRAGGING) {
|
||||||
// if (newState == DrawerLayout.STATE_DRAGGING) {
|
mDrawerLeft.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||||
// mDrawerLeft.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
mDrawerRight.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||||
// mDrawerRight.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
} else if (newState == DrawerLayout.STATE_IDLE) {
|
||||||
// } else if (newState == DrawerLayout.STATE_IDLE) {
|
mDrawerLeft.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
// mDrawerLeft.setLayerType(View.LAYER_TYPE_NONE, null);
|
mDrawerRight.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
// mDrawerRight.setLayerType(View.LAYER_TYPE_NONE, null);
|
}
|
||||||
// }
|
}
|
||||||
// }
|
});
|
||||||
// });
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !mShowTabsInDrawer) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !mShowTabsInDrawer) {
|
||||||
getWindow().setStatusBarColor(Color.BLACK);
|
getWindow().setStatusBarColor(Color.BLACK);
|
||||||
@ -1410,29 +1409,24 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
|||||||
}
|
}
|
||||||
mDrawerLayout.closeDrawers();
|
mDrawerLayout.closeDrawers();
|
||||||
|
|
||||||
// TODO restore after updating to latest support lib
|
mDrawerLayout.addDrawerListener(new DrawerListener() {
|
||||||
// delete this code after restoring
|
@Override
|
||||||
if (runnable != null) {
|
public void onDrawerSlide(View drawerView, float slideOffset) {}
|
||||||
runnable.run();
|
|
||||||
}
|
@Override
|
||||||
// mDrawerLayout.addDrawerListener(new DrawerListener() {
|
public void onDrawerOpened(View drawerView) {}
|
||||||
// @Override
|
|
||||||
// public void onDrawerSlide(View drawerView, float slideOffset) {}
|
@Override
|
||||||
//
|
public void onDrawerClosed(View drawerView) {
|
||||||
// @Override
|
if (runnable != null) {
|
||||||
// public void onDrawerOpened(View drawerView) {}
|
runnable.run();
|
||||||
//
|
}
|
||||||
// @Override
|
mDrawerLayout.removeDrawerListener(this);
|
||||||
// public void onDrawerClosed(View drawerView) {
|
}
|
||||||
// if (runnable != null) {
|
|
||||||
// runnable.run();
|
@Override
|
||||||
// }
|
public void onDrawerStateChanged(int newState) {}
|
||||||
// mDrawerLayout.removeDrawerListener(this);
|
});
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onDrawerStateChanged(int newState) {}
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user