-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sliding overlay #651
Sliding overlay #651
Conversation
@@ -81,7 +79,7 @@ private void addScreenStacks() { | |||
|
|||
private void createAndAddScreens(int position) { | |||
ScreenParams screenParams = params.tabParams.get(position); | |||
ScreenStack newStack = new ScreenStack(activity, getScreenStackParent(), screenParams.getNavigatorId(), this); | |||
ScreenStack newStack = new ScreenStack(getActivity(), getScreenStackParent(), screenParams.getNavigatorId(), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
@@ -277,7 +275,7 @@ public void newStack(ScreenParams params) { | |||
removeView(currentScreenStack.peek()); | |||
currentScreenStack.destroy(); | |||
|
|||
ScreenStack newStack = new ScreenStack(activity, getScreenStackParent(), params.getNavigatorId(), this); | |||
ScreenStack newStack = new ScreenStack(getActivity(), getScreenStackParent(), params.getNavigatorId(), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much performance 😝
|
||
import android.animation.Animator; | ||
|
||
public class StubAnimatorListener implements Animator.AnimatorListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is redundant, we can use AnimatorListenerAdapter
} | ||
|
||
protected ContentView createSlidingOverlayView(SlidingOverlayParams params) { | ||
final float heightPixels = ViewUtils.convertDpToPixel(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer we let Js dictate the notification height by using WRAP_CONTENT
and setting a specific height in Jsx. wdyt?
ObjectAnimator slideIn = ObjectAnimator.ofFloat(view, TRANSLATION_Y, 0); | ||
slideIn.setDuration(600); | ||
slideIn.setInterpolator(new OvershootInterpolator(0.2f)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this screams for slideIn()
method
|
||
ObjectAnimator slideOut = ObjectAnimator.ofFloat(view, TRANSLATION_Y, -heightPixels); | ||
slideIn.setDuration(300); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too slideOut()
import com.reactnativenavigation.views.slidingOverlay.SlidingOverlay; | ||
import com.reactnativenavigation.views.slidingOverlay.SlidingOverlaysQueue; | ||
|
||
public abstract class BaseLayout extends RelativeLayout implements Layout { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should prefer encapsulation over inheritance. If anything, this should be called SlidingOverlayLayout
but this is yucky :)
@@ -33,9 +33,8 @@ | |||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; | |||
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; | |||
|
|||
public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottomNavigation.OnTabSelectedListener { | |||
public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.OnTabSelectedListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means this layout can hold a slidingOverlayQueue
or something
f6b464d
to
db042ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for current api
No description provided.