Skip to content
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

Merged
merged 5 commits into from
Jan 13, 2017
Merged

Sliding overlay #651

merged 5 commits into from
Jan 13, 2017

Conversation

d4vidi
Copy link
Collaborator

@d4vidi d4vidi commented Jan 8, 2017

No description provided.

@@ -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);
Copy link
Collaborator

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);
Copy link
Collaborator

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 {
Copy link
Collaborator

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);
Copy link
Collaborator

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));

Copy link
Contributor

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);

Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

@DanielZlotin DanielZlotin left a 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

@guyca guyca merged commit e283d44 into master Jan 13, 2017
@DanielZlotin DanielZlotin deleted the slidingOverlay branch February 19, 2017 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants