Skip to content

Commit

Permalink
Merge pull request #120 from GetStream/feature/channellist
Browse files Browse the repository at this point in the history
Feature/channellist
  • Loading branch information
tschellenbach authored Oct 9, 2019
2 parents 554204b + 20c3349 commit aa7422e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="OPEN_ACTIVITY_1" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".ChannelActivity" android:parentActivityName=".MainActivity">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.getstream.sdk.chat.viewmodel.ChannelListViewModel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

Expand Down Expand Up @@ -173,7 +174,7 @@ void createNewChannel(String channelName){

String channelId = channelName.replaceAll(" ", "-").toLowerCase();
Channel channel = new Channel(client, ModelType.channel_messaging, channelId, extraData);
ChannelQueryRequest request = new ChannelQueryRequest().withMessages(10);
ChannelQueryRequest request = new ChannelQueryRequest().withMessages(10).withWatch();

viewModel.setLoading();
channel.query(request, new QueryChannelCallback() {
Expand All @@ -183,6 +184,7 @@ public void onSuccess(ChannelState response) {
intent.putExtra(EXTRA_CHANNEL_TYPE, channel.getType());
intent.putExtra(EXTRA_CHANNEL_ID, channel.getId());
startActivity(intent);
viewModel.addChannels(Arrays.asList(channel.getChannelState()));
viewModel.setLoadingDone();
}

Expand Down

0 comments on commit aa7422e

Please sign in to comment.