Skip to content
Merged

Topbar #2382

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.LinearLayout;

import com.reactnativenavigation.views.TopBar;

Expand Down Expand Up @@ -118,7 +119,7 @@ public void animateShowTopBar(final TopBar topBar, final View container) {
containerHeightAnim.setDuration(DURATION_TOPBAR);
containerHeightAnim.addUpdateListener(valueAnimator -> {
int val = (Integer) valueAnimator.getAnimatedValue();
ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
layoutParams.height = val;
container.setLayoutParams(layoutParams);
});
Expand Down Expand Up @@ -164,7 +165,7 @@ public void animateHideTopBar(final TopBar topBar, final View container) {
containerHeightAnim.setDuration(DURATION_TOPBAR);
containerHeightAnim.addUpdateListener(valueAnimator -> {
int val = (Integer) valueAnimator.getAnimatedValue();
ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
layoutParams.height = val;
container.setLayoutParams(layoutParams);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ public ReactView(final Context context, ReactInstanceManager reactInstanceManage
}

private void start() {
setEventListener(new ReactRootView.ReactRootViewEventListener() {

@Override
public void onAttachedToReactInstance(final ReactRootView reactRootView) {
reactRootView.setEventListener(null);
isAttachedToReactInstance = true;
}
});
setEventListener(reactRootView -> {
reactRootView.setEventListener(null);
isAttachedToReactInstance = true;
});
final Bundle opts = new Bundle();
opts.putString("containerId", containerId);
startReactApplication(reactInstanceManager, containerName, opts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected View createView() {
@Override
public void mergeNavigationOptions(NavigationOptions options) {
navigationOptions.mergeWith(options);
container.applyOptions(options);
container.applyOptions(navigationOptions);
}

NavigationOptions getNavigationOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ContainerLayout(Context context, IReactView reactView) {
super(context);
this.topBar = new TopBar(context);
this.reactView = reactView;
optionsPresenter = new OptionsPresenter(topBar, this);
optionsPresenter = new OptionsPresenter(topBar, reactView.asView());
initViews();
}

Expand Down Expand Up @@ -61,7 +61,7 @@ public void applyOptions(NavigationOptions options) {
optionsPresenter.applyOptions(options);
}

@Override
@Override
@RestrictTo(RestrictTo.Scope.TESTS)
public TopBar getTopBar() {
return topBar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public TopTabsLayout(Context context, List<TopTabController> tabs) {
topBar = new TopBar(context);
this.tabs = tabs;
viewPager = new TopTabsViewPager(context, tabs);
optionsPresenter = new OptionsPresenter(topBar, this);
optionsPresenter = new OptionsPresenter(topBar, viewPager);
initViews();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TestContainerLayout extends View implements ReactContainer {
public TestContainerLayout(final Context context) {
super(context);
topBar = new TopBar(context);
optionsPresenter = new OptionsPresenter(topBar, this);
optionsPresenter = new OptionsPresenter(topBar, new View(context));
}

public TopBar getTopBar() {
Expand Down