-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'master/master'
- Loading branch information
Showing
11 changed files
with
87 additions
and
15 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.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 @@ | ||
<resources> | ||
|
||
<style name="AppTheme.NoActionBar"> | ||
<item name="windowActionBar">false</item> | ||
<item name="windowNoTitle">true</item> | ||
<item name="android:windowDrawsSystemBarBackgrounds">true</item> | ||
<item name="android:statusBarColor">@android:color/transparent</item> | ||
</style> | ||
</resources> |
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
38 changes: 38 additions & 0 deletions
38
spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationViewBehavior.java
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,38 @@ | ||
package com.luseen.spacenavigation; | ||
|
||
import android.content.Context; | ||
import android.support.design.widget.CoordinatorLayout; | ||
import android.support.design.widget.Snackbar; | ||
import android.support.v4.view.ViewCompat; | ||
import android.support.v4.view.ViewPropertyAnimatorCompat; | ||
import android.support.v4.view.animation.LinearOutSlowInInterpolator; | ||
import android.util.AttributeSet; | ||
import android.view.View; | ||
import android.view.animation.Interpolator; | ||
|
||
/** | ||
* Created by Chatikyan on 13.10.2016. | ||
*/ | ||
|
||
public class SpaceNavigationViewBehavior<V extends View> extends CoordinatorLayout.Behavior<V> { | ||
|
||
public SpaceNavigationViewBehavior(Context context, AttributeSet attrs) { | ||
super(); | ||
} | ||
|
||
public SpaceNavigationViewBehavior() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) { | ||
return dependency instanceof Snackbar.SnackbarLayout; | ||
} | ||
|
||
@Override | ||
public boolean onDependentViewChanged(CoordinatorLayout parent, final V child, View dependency) { | ||
float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); | ||
child.setTranslationY(translationY); | ||
return true; | ||
} | ||
} |