-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing icon and fixing AppBar bug (#22)
## Context - Removing icon from Recipe details and fixing AppBar "bug": lock expansion if no screen header image was loaded ## Code - Removing `recipe_detail_item_image` view - Create extension `AppBarLayout.setCollapsedAndDisableScroll` ## Additional notes | Before | After | | -- | -- | | |  | |||
- Loading branch information
Showing
10 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Sun May 17 14:26:48 BRT 2020 | ||
#Thu Dec 24 11:13:58 BRT 2020 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...rc/main/java/br/com/recipebook/utilityandroid/view/appbarlayout/AppBarLayoutExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package br.com.recipebook.utilityandroid.view.appbarlayout | ||
|
||
import androidx.coordinatorlayout.widget.CoordinatorLayout | ||
import androidx.core.view.ViewCompat | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.google.android.material.appbar.AppBarLayout | ||
|
||
fun AppBarLayout.setCollapsedAndDisableScroll(recyclerView: RecyclerView) { | ||
// Collapse AppBar | ||
setExpanded(false) | ||
// Disable AppBar scroll from the recycler view | ||
ViewCompat.setNestedScrollingEnabled(recyclerView, false) | ||
// Disable AppBar scroll from the AppBar | ||
((layoutParams as CoordinatorLayout.LayoutParams).behavior as AppBarLayout.Behavior) | ||
.setDragCallback(object : AppBarLayout.Behavior.DragCallback() { | ||
override fun canDrag(appBarLayout: AppBarLayout): Boolean { | ||
return false | ||
} | ||
}) | ||
} |