Commit 7a6f5d19 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge branch 'develop' into chore/bump_version_2

parents 8b8fbb13 8fbdc0a2
{
"project_info": {
"project_number": "361979207101",
"firebase_url": "https://rocketchatandroid-92e1e.firebaseio.com",
"project_id": "rocketchatandroid-92e1e",
"storage_bucket": "rocketchatandroid-92e1e.appspot.com"
"project_number": "1020987621558",
"firebase_url": "https://rocketchatnative.firebaseio.com",
"project_id": "rocketchatnative",
"storage_bucket": "rocketchatnative.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:361979207101:android:16da2e50aff9f0c9",
"mobilesdk_app_id": "1:1020987621558:android:16da2e50aff9f0c9",
"android_client_info": {
"package_name": "chat.rocket.android"
}
},
"oauth_client": [
{
"client_id": "361979207101-68jt4s85vqfidsgtb0jircio1s4l0la6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "chat.rocket.android",
"certificate_hash": "5540F34145397BBDE62DEE1433BE7FF9D991D5A2"
}
},
{
"client_id": "361979207101-tvvl8a3s98vd933svlepieo81mul17da.apps.googleusercontent.com",
"client_id": "1020987621558-trk61fjrahho0ujtjap095p1jmi48pfq.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCjInoCWiVXbC02aKgBPeH3EqiHGt6vGyE"
"current_key": "AIzaSyDc7VYUdU6kRkoRTToiCn1rh-W0wJvhLWk"
}
],
"services": {
......@@ -37,13 +29,8 @@
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "361979207101-tvvl8a3s98vd933svlepieo81mul17da.apps.googleusercontent.com",
"client_type": 3
}
]
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
......
......@@ -4,6 +4,7 @@ import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.View;
import chat.rocket.android.LaunchUtil;
import chat.rocket.android.R;
......@@ -29,6 +30,7 @@ import hugo.weaving.DebugLog;
public class MainActivity extends AbstractAuthedActivity implements MainContract.View {
private RoomToolbar toolbar;
private StatusTicker statusTicker;
private SlidingPaneLayout pane;
private MainContract.Presenter presenter;
@Override
......@@ -42,6 +44,8 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
setContentView(R.layout.activity_main);
toolbar = (RoomToolbar) findViewById(R.id.activity_main_toolbar);
statusTicker = new StatusTicker();
pane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
setupToolbar();
}
@Override
......@@ -61,10 +65,34 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
super.onPause();
}
private void setupToolbar() {
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View view, float v) {
//Ref: ActionBarDrawerToggle#setProgress
toolbar.setNavigationIconProgress(v);
}
@Override
public void onPanelOpened(View view) {
toolbar.setNavigationIconVerticalMirror(true);
}
@Override
public void onPanelClosed(View view) {
toolbar.setNavigationIconVerticalMirror(false);
}
});
toolbar.setNavigationOnClickListener(view -> {
if (pane.isSlideable() && !pane.isOpen()) {
pane.openPane();
}
});
}
private boolean closeSidebarIfNeeded() {
// REMARK: Tablet UI doesn't have SlidingPane!
SlidingPaneLayout pane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
if (pane != null && pane.isSlideable() && pane.isOpen()) {
pane.closePane();
return true;
......
......@@ -43,16 +43,18 @@ import com.jakewharton.rxbinding2.support.v7.widget.RxSearchView;
import com.jakewharton.rxbinding2.widget.RxCompoundButton;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import java.util.ArrayList;
import java.util.List;
public class SidebarMainFragment extends AbstractFragment implements SidebarMainContract.View {
private SidebarMainContract.Presenter presenter;
private RoomListAdapter adapter;
private RecyclerView recyclerView;
private SearchView searchView;
private TextView loadMoreResultsText;
private List<RoomSidebar> roomSidebarList;
private Disposable spotlightDisposable;
private String hostname;
private static final String HOSTNAME = "hostname";
......@@ -139,7 +141,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
}
});
recyclerView = rootView.findViewById(R.id.room_list_container);
RecyclerView recyclerView = rootView.findViewById(R.id.room_list_container);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
recyclerView.setAdapter(adapter);
......@@ -148,15 +150,17 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
RxSearchView.queryTextChanges(searchView)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(charSequence -> {
adapter.setMode(RoomListAdapter.MODE_ROOM);
if (spotlightDisposable != null && !spotlightDisposable.isDisposed()) {
spotlightDisposable.dispose();
}
presenter.disposeSubscriptions();
if (charSequence.length() == 0) {
loadMoreResultsText.setVisibility(View.GONE);
adapter.setMode(RoomListAdapter.MODE_ROOM);
presenter.bindView(this);
recyclerView.setVisibility(View.VISIBLE);
} else {
presenter.disposeSubscriptions();
filterRoomSidebarList(charSequence);
}
} else {
filterRoomSidebarList(charSequence);
}
});
loadMoreResultsText.setOnClickListener(view -> loadMoreResults());
......@@ -179,16 +183,16 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
}
if (filteredRoomSidebarList.isEmpty()) {
recyclerView.setVisibility(View.GONE);
loadMoreResults();
} else {
recyclerView.setVisibility(View.VISIBLE);
loadMoreResultsText.setVisibility(View.VISIBLE);
adapter.setMode(RoomListAdapter.MODE_ROOM);
adapter.setRoomSidebarList(filteredRoomSidebarList);
}
loadMoreResultsText.setVisibility(View.VISIBLE);
}
private void loadMoreResults() {
presenter.searchSpotlight(searchView.getQuery().toString())
spotlightDisposable = presenter.searchSpotlight(searchView.getQuery().toString())
.toObservable()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::showSearchSuggestions);
......@@ -198,7 +202,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
loadMoreResultsText.setVisibility(View.GONE);
adapter.setMode(RoomListAdapter.MODE_SPOTLIGHT);
adapter.setSpotlightList(spotlightList);
recyclerView.setVisibility(View.VISIBLE);
}
@SuppressLint("RxLeakedSubscription")
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="gcm_sender_id">YOUR-SENDER-ID</string>
<string name="gcm_sender_id">673693445664</string>
</resources>
\ No newline at end of file
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