This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/services/ChatService.kt:48 | |
fun createGroupChannel(channelName: String) { | |
val channelId = channelName | |
.toLowerCase(Locale.getDefault()) | |
.replace("\\s".toRegex(), "-") | |
val result = client | |
.createChannel( | |
ModelType.channel_livestream, | |
channelId, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/CreateChannelActivity.kt:13 | |
const val CHANNEL_CREATE_SUCCESS = 99 | |
class CreateChannelActivity : AppCompatActivity(), CoroutineScope by MainScope() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_create_channel) | |
val submit: Button = findViewById(R.id.submit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- android/app/src/main/res/layout/activity_create_channel.xml:1 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="io.getstream.thestream.MainActivity"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/ChannelsFragment.kt:19 | |
class ChannelsFragment : Fragment(), CoroutineScope by MainScope() { | |
private lateinit var viewModel: ChannelListViewModel | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
val binding = FragmentChannelsBinding.inflate(layoutInflater) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- android/app/src/main/res/layout/fragment_channels.xml:1 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/ChannelActivity.kt:17 | |
class ChannelActivity : AppCompatActivity(), MessageInputView.PermissionRequestListener { | |
private lateinit var binding: ActivityChannelBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val channelType = intent.getStringExtra(EXTRA_CHANNEL_TYPE)!! | |
val channelId = intent.getStringExtra(EXTRA_CHANNEL_ID)!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- android/app/src/main/res/layout/activity_channel.xml:1 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable | |
name="viewModel" | |
type="com.getstream.sdk.chat.viewmodel.ChannelViewModel" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/services/ChatService.kt:35 | |
fun createPrivateChannel(otherUser: String): Channel { | |
val users = listOf(user.id, otherUser) | |
val result = client | |
.createChannel(ModelType.channel_messaging, users) | |
.execute() | |
if (result.isSuccess) { | |
return result.data() | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/services/BackendService.kt:42 | |
fun getUsers(): List<String> { | |
val request = Request.Builder() | |
.url("$apiRoot/v1/users") | |
.addHeader("Authorization", "Bearer $authToken") | |
.get() | |
http.newCall(request.build()).execute().use { response -> | |
val jsonArray = JSONObject(response.body!!.string()).getJSONArray("users") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- android/app/src/main/res/layout/fragment_people.xml:1 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".PeopleFragment"> | |
<ListView |