Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
2 bottom-bar/bottom-bar.iml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module external.linked.project.id=":bottom-bar" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.roughike" external.system.module.version="1.1.5" type="JAVA_MODULE" version="4">
+<module external.linked.project.id=":bottom-bar" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.roughike" external.system.module.version="1.1.6" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
View
2 bottom-bar/build.gradle
@@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/roughike/BottomBar'
gitUrl = 'https://github.com/roughike/BottomBar.git'
- libraryVersion = '1.1.5'
+ libraryVersion = '1.1.6'
developerId = 'roughike'
developerName = 'Iiro Krankka'
View
29 bottom-bar/src/main/java/com/roughike/bottombar/BottomBar.java
@@ -175,6 +175,15 @@ public static BottomBar attach(View view, Bundle savedInstanceState) {
}
/**
+ * Deprecated. Breaks support for tablets.
+ * Use {@link #attachShy(CoordinatorLayout, View, Bundle)} instead.
+ */
+ @Deprecated
+ public static BottomBar attachShy(CoordinatorLayout coordinatorLayout, Bundle savedInstanceState) {
+ return attachShy(coordinatorLayout, null, savedInstanceState);
+ }
+
+ /**
* Adds the BottomBar inside of your CoordinatorLayout and shows / hides
* it according to scroll state changes.
* <p/>
@@ -182,14 +191,21 @@ public static BottomBar attach(View view, Bundle savedInstanceState) {
* of your {@link Activity#onSaveInstanceState(Bundle)} to restore the state.
*
* @param coordinatorLayout a CoordinatorLayout for the BottomBar to add itself into
+ * @param userContentView the view (usually a NestedScrollView) that has your scrolling content.
+ * Needed for tablet support.
* @param savedInstanceState a Bundle for restoring the state on configuration change.
* @return a BottomBar at the bottom of the screen.
*/
- public static BottomBar attachShy(CoordinatorLayout coordinatorLayout, Bundle savedInstanceState) {
+ public static BottomBar attachShy(CoordinatorLayout coordinatorLayout, View userContentView, Bundle savedInstanceState) {
final BottomBar bottomBar = new BottomBar(coordinatorLayout.getContext());
bottomBar.toughChildHood(ViewCompat.getFitsSystemWindows(coordinatorLayout));
bottomBar.onRestoreInstanceState(savedInstanceState);
+ if (userContentView != null && coordinatorLayout.getContext()
+ .getResources().getBoolean(R.bool.bb_bottom_bar_is_tablet_mode)) {
+ bottomBar.setPendingUserContentView(userContentView);
+ }
+
coordinatorLayout.addView(bottomBar);
return bottomBar;
}
@@ -588,6 +604,10 @@ private void initializeViews() {
mBackgroundView = rootView.findViewById(R.id.bb_bottom_bar_background_view);
mBackgroundOverlay = rootView.findViewById(R.id.bb_bottom_bar_background_overlay);
+ if (mIsShy && mIgnoreTabletLayout) {
+ mPendingUserContentView = null;
+ }
+
if (mPendingUserContentView != null) {
ViewGroup.LayoutParams params = mPendingUserContentView.getLayoutParams();
@@ -596,7 +616,12 @@ private void initializeViews() {
ViewGroup.LayoutParams.MATCH_PARENT);
}
+ if (mIsTabletMode && mIsShy) {
+ ((ViewGroup) mPendingUserContentView.getParent()).removeView(mPendingUserContentView);
+ }
+
mUserContentContainer.addView(mPendingUserContentView, 0, params);
+ mPendingUserContentView = null;
}
if (mIsShy && !mIsTabletMode) {
@@ -697,7 +722,7 @@ public boolean onLongClick(View v) {
return true;
}
- private void updateItems(BottomBarItemBase[] bottomBarItems) {
+ private void updateItems(final BottomBarItemBase[] bottomBarItems) {
if (mItemContainer == null) {
initializeViews();
}

No commit comments for this range

Something went wrong with that request. Please try again.