Commit 8a4d8f94 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit

Merge branch 'chore/bump_version_2' of...

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