Commit 5fb90cc9 authored by Leonardo Aramaki's avatar Leonardo Aramaki Committed by GitHub

Merge branch 'develop' into develop

parents 36c7c066 975bedbd
...@@ -45,8 +45,8 @@ android { ...@@ -45,8 +45,8 @@ android {
applicationId "chat.rocket.android" applicationId "chat.rocket.android"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 41 versionCode 42
versionName "1.0.21" versionName "1.0.22"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
multiDexEnabled true multiDexEnabled true
......
...@@ -133,7 +133,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -133,7 +133,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
private RoomToolbar toolbar; private RoomToolbar toolbar;
private SlidingPaneLayout pane; private Optional<SlidingPaneLayout> optionalPane;
private SidebarMainFragment sidebarFragment; private SidebarMainFragment sidebarFragment;
public RoomFragment() { public RoomFragment() {
...@@ -202,7 +202,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -202,7 +202,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
@Override @Override
protected void onSetupView() { protected void onSetupView() {
pane = getActivity().findViewById(R.id.sliding_pane); optionalPane = Optional.ofNullable(getActivity().findViewById(R.id.sliding_pane));
messageRecyclerView = rootView.findViewById(R.id.messageRecyclerView); messageRecyclerView = rootView.findViewById(R.id.messageRecyclerView);
messageListAdapter = new MessageListAdapter(getContext(), hostname); messageListAdapter = new MessageListAdapter(getContext(), hostname);
...@@ -302,11 +302,11 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -302,11 +302,11 @@ public class RoomFragment extends AbstractChatRoomFragment implements
toolbar.getMenu().clear(); toolbar.getMenu().clear();
toolbar.inflateMenu(R.menu.menu_room); toolbar.inflateMenu(R.menu.menu_room);
toolbar.setNavigationOnClickListener(view -> { optionalPane.ifPresent(pane -> toolbar.setNavigationOnClickListener(view -> {
if (pane.isSlideable() && !pane.isOpen()) { if (pane.isSlideable() && !pane.isOpen()) {
pane.openPane(); pane.openPane();
} }
}); }));
toolbar.setOnMenuItemClickListener(menuItem -> { toolbar.setOnMenuItemClickListener(menuItem -> {
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
...@@ -333,8 +333,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -333,8 +333,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
SlidingPaneLayout subPane = getActivity().findViewById(R.id.sub_sliding_pane); SlidingPaneLayout subPane = getActivity().findViewById(R.id.sub_sliding_pane);
sidebarFragment = (SidebarMainFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.sidebar_fragment_container); sidebarFragment = (SidebarMainFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.sidebar_fragment_container);
if (pane != null) { optionalPane.ifPresent(pane -> pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override @Override
public void onPanelSlide(View view, float v) { public void onPanelSlide(View view, float v) {
messageFormManager.enableComposingText(false); messageFormManager.enableComposingText(false);
...@@ -355,8 +354,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -355,8 +354,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
subPane.closePane(); subPane.closePane();
closeUserActionContainer(); closeUserActionContainer();
} }
}); }));
}
} }
public void closeUserActionContainer() { public void closeUserActionContainer() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment