Commit 8dc117d8 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Shows create new channel view

parent a99b2e79
......@@ -9,6 +9,7 @@ import chat.rocket.android.db.model.ChatRoomEntity
import chat.rocket.android.helper.UserHelper
import chat.rocket.android.infrastructure.LocalRepository
import chat.rocket.android.main.presentation.MainNavigator
import chat.rocket.android.server.domain.GetAccountsInteractor
import chat.rocket.android.server.domain.SettingsRepository
import chat.rocket.android.server.domain.useRealName
import chat.rocket.android.server.domain.useSpecialCharsOnRoom
......@@ -16,10 +17,12 @@ import chat.rocket.android.server.infraestructure.ConnectionManager
import chat.rocket.android.util.extension.launchUI
import chat.rocket.android.util.retryDB
import chat.rocket.android.util.retryIO
import chat.rocket.common.RocketChatAuthException
import chat.rocket.common.RocketChatException
import chat.rocket.common.model.RoomType
import chat.rocket.common.model.User
import chat.rocket.common.model.roomTypeOf
import chat.rocket.common.util.ifNull
import chat.rocket.core.internal.realtime.createDirectMessage
import chat.rocket.core.internal.rest.me
import chat.rocket.core.internal.rest.show
......@@ -35,6 +38,7 @@ class ChatRoomsPresenter @Inject constructor(
private val strategy: CancelStrategy,
private val navigator: MainNavigator,
@Named("currentServer") private val currentServer: String,
private val getAccountsInteractor: GetAccountsInteractor,
private val dbManager: DatabaseManager,
manager: ConnectionManager,
private val localRepository: LocalRepository,
......@@ -44,6 +48,33 @@ class ChatRoomsPresenter @Inject constructor(
private val client = manager.client
private val settings = settingsRepository.get(currentServer)
fun toCreateChannel() = navigator.toCreateChannel()
fun getCurrentServerName() {
view.setupToolbar(currentServer)
}
fun getAllServers() {
launchUI(strategy) {
try {
view.setupServerListView(getAccountsInteractor.get())
} catch (exception: Exception) {
Timber.e(exception, "Error while getting all servers")
when (exception) {
// is RocketChatAuthException -> logout()
else -> {
exception.message?.let {
view.showMessage(it)
}.ifNull {
view.showGenericErrorMessage()
}
}
}
}
}
}
fun loadChatRoom(roomId: String) {
launchUI(strategy) {
view.showLoadingRoom("")
......@@ -97,11 +128,12 @@ class ChatRoomsPresenter @Inject constructor(
suspend fun loadChatRoom(chatRoom: ChatRoomEntity, local: Boolean = false) {
with(chatRoom) {
val isDirectMessage = roomTypeOf(type) is RoomType.DirectMessage
val roomName = if (settings.useSpecialCharsOnRoom() || (isDirectMessage && settings.useRealName())) {
fullname ?: name
} else {
name
}
val roomName =
if (settings.useSpecialCharsOnRoom() || (isDirectMessage && settings.useRealName())) {
fullname ?: name
} else {
name
}
val myself = getCurrentUser()
if (myself?.username == null) {
......@@ -131,14 +163,14 @@ class ChatRoomsPresenter @Inject constructor(
}
navigator.toChatRoom(
chatRoomId = id,
chatRoomName = roomName,
chatRoomType = type,
isReadOnly = readonly ?: false,
chatRoomLastSeen = lastSeen ?: -1,
isSubscribed = open,
isCreator = ownerId == myself.id || isDirectMessage,
isFavorite = favorite ?: false
chatRoomId = id,
chatRoomName = roomName,
chatRoomType = type,
isReadOnly = readonly ?: false,
chatRoomLastSeen = lastSeen ?: -1,
isSubscribed = open,
isCreator = ownerId == myself.id || isDirectMessage,
isFavorite = favorite ?: false
)
}
}
......
......@@ -2,8 +2,24 @@ package chat.rocket.android.chatrooms.presentation
import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView
import chat.rocket.android.server.domain.model.Account
interface ChatRoomsView : LoadingView, MessageView {
/**
* Setups the toolbar with the current logged in server name.
*
* @param serverName The current logged in server name to show on Toolbar.
*/
fun setupToolbar(serverName: String)
/**
* Setups the server list view with all server list.
*
* @param serverList The server list to show on server list.
*/
fun setupServerListView(serverList: List<Account>)
fun showLoadingRoom(name: CharSequence)
fun hideLoadingRoom()
......
......@@ -30,6 +30,7 @@ import chat.rocket.android.chatrooms.viewmodel.Query
import chat.rocket.android.helper.ChatRoomsSortOrder
import chat.rocket.android.helper.Constants
import chat.rocket.android.helper.SharedPreferenceHelper
import chat.rocket.android.server.domain.model.Account
import chat.rocket.android.util.extension.onQueryTextListener
import chat.rocket.android.util.extensions.ifNotNullNotEmpty
import chat.rocket.android.util.extensions.inflate
......@@ -38,6 +39,7 @@ import chat.rocket.android.util.extensions.ui
import chat.rocket.android.widget.DividerItemDecoration
import chat.rocket.core.internal.realtime.socket.model.State
import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.app_bar_chat_rooms.*
import kotlinx.android.synthetic.main.fragment_chat_rooms.*
import timber.log.Timber
import javax.inject.Inject
......@@ -93,15 +95,20 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
presenter.getCurrentServerName()
setupListeners()
viewModel = ViewModelProviders.of(this, factory).get(ChatRoomsViewModel::class.java)
subscribeUi()
setupToolbar()
setupListeners()
analyticsManager.logScreenView(ScreenViewEvent.ChatRooms)
}
override fun setupServerListView(serverList: List<Account>) {
// TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
private fun subscribeUi() {
ui {
val adapter = RoomsAdapter { room ->
......@@ -184,6 +191,13 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
})
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_new_channel -> presenter.toCreateChannel()
}
return super.onOptionsItemSelected(item)
}
private fun updateSort() {
val sortType = SharedPreferenceHelper.getInt(
Constants.CHATROOM_SORT_TYPE_KEY,
......@@ -269,11 +283,16 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
// }
}
private fun setupToolbar() {
(activity as AppCompatActivity?)?.supportActionBar?.title = getString(R.string.title_chats)
override fun setupToolbar(serverName: String) {
(activity as AppCompatActivity).setSupportActionBar(toolbar)
text_server_name.text = serverName
}
private fun setupListeners() {
text_server_name.setOnClickListener {
// TO DO
}
text_sort_by.setOnClickListener {
SortByBottomSheetFragment()
.show(activity?.supportFragmentManager, TAG)
......
......@@ -35,7 +35,6 @@ class CreateChannelPresenter @Inject constructor(
view.disableUserInput()
try {
client.createChannel(roomType, channelName, usersList, readOnly)
view.prepareToShowChatList()
view.showChannelCreatedSuccessfullyMessage()
toChatList()
} catch (exception: RocketChatException) {
......
......@@ -28,12 +28,6 @@ interface CreateChannelView : LoadingView, MessageView {
*/
fun hideSuggestionViewInProgress()
/**
* Shows the navigation drawer with the chat item checked before showing the chat list.
* This function is invoked after successfully created the channel.
*/
fun prepareToShowChatList()
/**
* Shows a message that a channel was successfully created.
*/
......
......@@ -9,7 +9,6 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.ActionMode
import androidx.core.view.isVisible
import androidx.core.view.postDelayed
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
......@@ -32,6 +31,7 @@ import com.google.android.material.chip.Chip
import dagger.android.support.AndroidSupportInjection
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.app_bar.*
import kotlinx.android.synthetic.main.fragment_create_channel.*
import java.util.concurrent.TimeUnit
import javax.inject.Inject
......@@ -165,20 +165,6 @@ class CreateChannelFragment : Fragment(), CreateChannelView, ActionMode.Callback
view_member_suggestion_loading.isVisible = false
}
override fun prepareToShowChatList() {
with(activity as MainActivity) {
// setCheckedNavDrawerItem(R.id.menu_action_chats)
// openDrawer()
// getDrawerLayout().postDelayed(1000) {
// closeDrawer()
// createChannelPresenter.toChatList()
// }
}
}
override fun showChannelCreatedSuccessfullyMessage() {
showMessage(getString(R.string.msg_channel_created_successfully))
}
......@@ -194,8 +180,14 @@ class CreateChannelFragment : Fragment(), CreateChannelView, ActionMode.Callback
}
private fun setupToolBar() {
(activity as AppCompatActivity?)?.supportActionBar?.title =
getString(R.string.title_create_channel)
with((activity as AppCompatActivity)) {
with(toolbar) {
setSupportActionBar(toolbar)
title = getString(R.string.title_create_channel)
setNavigationIcon(R.drawable.ic_arrow_back_white_24dp)
setNavigationOnClickListener { activity?.onBackPressed() }
}
}
}
private fun setupViewListeners() {
......
......@@ -4,7 +4,6 @@ import androidx.lifecycle.LifecycleOwner
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.dagger.scope.PerActivity
import chat.rocket.android.main.presentation.MainNavigator
import chat.rocket.android.main.presentation.MainView
import chat.rocket.android.main.ui.MainActivity
import dagger.Module
import dagger.Provides
......@@ -13,16 +12,13 @@ import kotlinx.coroutines.Job
@Module
class MainModule {
@Provides
@PerActivity
fun provideJob() = Job()
@Provides
@PerActivity
fun provideMainNavigator(activity: MainActivity) = MainNavigator(activity)
@Provides
fun provideMainView(activity: MainActivity): MainView = activity
@PerActivity
fun provideJob() = Job()
@Provides
fun provideLifecycleOwner(activity: MainActivity): LifecycleOwner = activity
......
......@@ -14,6 +14,7 @@ import chat.rocket.android.server.ui.changeServerIntent
import chat.rocket.android.settings.ui.SettingsFragment
import chat.rocket.android.settings.ui.TAG_SETTINGS_FRAGMENT
import chat.rocket.android.util.extensions.addFragment
import chat.rocket.android.util.extensions.addFragmentBackStack
import chat.rocket.android.webview.adminpanel.ui.AdminPanelWebViewFragment
class MainNavigator(internal val activity: MainActivity) {
......@@ -24,8 +25,14 @@ class MainNavigator(internal val activity: MainActivity) {
}
}
fun toSettings() {
activity.addFragmentBackStack(TAG_SETTINGS_FRAGMENT, R.id.fragment_container) {
SettingsFragment.newInstance()
}
}
fun toCreateChannel() {
activity.addFragment(TAG_CREATE_CHANNEL_FRAGMENT, R.id.fragment_container) {
activity.addFragmentBackStack(TAG_CREATE_CHANNEL_FRAGMENT, R.id.fragment_container) {
CreateChannelFragment.newInstance()
}
}
......@@ -36,12 +43,6 @@ class MainNavigator(internal val activity: MainActivity) {
}
}
fun toSettings() {
activity.addFragment(TAG_SETTINGS_FRAGMENT, R.id.fragment_container) {
SettingsFragment.newInstance()
}
}
fun toAdminPanel(webPageUrl: String, userToken: String) {
activity.addFragment("AdminPanelWebViewFragment", R.id.fragment_container) {
AdminPanelWebViewFragment.newInstance(webPageUrl, userToken)
......
package chat.rocket.android.main.presentation
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.db.DatabaseManagerFactory
import chat.rocket.android.infrastructure.LocalRepository
import chat.rocket.android.push.GroupedPush
import chat.rocket.android.server.domain.GetAccountsInteractor
import chat.rocket.android.server.domain.GetCurrentServerInteractor
import chat.rocket.android.server.domain.RefreshPermissionsInteractor
import chat.rocket.android.server.domain.RefreshSettingsInteractor
import chat.rocket.android.server.domain.RemoveAccountInteractor
import chat.rocket.android.server.domain.TokenRepository
import chat.rocket.android.server.infraestructure.ConnectionManagerFactory
import chat.rocket.android.server.infraestructure.RocketChatClientFactory
import chat.rocket.android.server.presentation.CheckServerPresenter
import chat.rocket.android.util.extension.launchUI
import chat.rocket.common.RocketChatAuthException
import chat.rocket.common.util.ifNull
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Named
class MainPresenter @Inject constructor(
private val mainView: MainView,
private val cancelStrategy: CancelStrategy,
@Named("currentServer") private val currentServerUrl: String,
private val mainNavigator: MainNavigator,
val getCurrentServerInteractor: GetCurrentServerInteractor,
private val groupedPush: GroupedPush,
private val getAccountsInteractor: GetAccountsInteractor,
rocketChatClientFactory: RocketChatClientFactory,
localRepository: LocalRepository,
removeAccountInteractor: RemoveAccountInteractor,
tokenRepository: TokenRepository,
private val connectionManagerFactory: ConnectionManagerFactory,
databaseManagerFactory: DatabaseManagerFactory,
private val refreshSettingsInteractor: RefreshSettingsInteractor,
private val refreshPermissionsInteractor: RefreshPermissionsInteractor
/*
private val navHeaderMapper: NavHeaderUiModelMapper,
private val saveAccountInteractor: SaveAccountInteractor,
private val getAccountsInteractor: GetAccountsInteractor,
private val groupedPush: GroupedPush,
serverInteractor: GetCurrentServerInteractor,
getSettingsInteractor: GetSettingsInteractor,
*/
) : CheckServerPresenter(
strategy = cancelStrategy,
factory = rocketChatClientFactory,
serverInteractor = getCurrentServerInteractor,
localRepository = localRepository,
removeAccountInteractor = removeAccountInteractor,
tokenRepository = tokenRepository,
managerFactory = connectionManagerFactory,
dbManagerFactory = databaseManagerFactory,
tokenView = mainView,
navigator = mainNavigator
private val refreshPermissionsInteractor: RefreshPermissionsInteractor,
private val connectionManagerFactory: ConnectionManagerFactory,
private val groupedPush: GroupedPush
) {
fun clearNotificationsForChatRoom(chatRoomId: String?) {
if (chatRoomId == null) return
getCurrentServerInteractor.get()?.let { currentServer ->
groupedPush.hostToPushMessageList[currentServer].let { list ->
list?.removeAll { it.info.roomId == chatRoomId }
}
}
}
fun connect() {
getCurrentServerInteractor.get()?.let { currentServer ->
refreshSettingsInteractor.refreshAsync(currentServer)
refreshPermissionsInteractor.refreshAsync(currentServer)
connectionManagerFactory.create(currentServer).connect()
}
refreshSettingsInteractor.refreshAsync(currentServerUrl)
refreshPermissionsInteractor.refreshAsync(currentServerUrl)
connectionManagerFactory.create(currentServerUrl).connect()
}
fun getCurrentServerName() {
getCurrentServerInteractor.get()?.let { currentServer ->
mainView.setupToolbar(currentServer)
}
}
fun clearNotificationsForChatRoom(chatRoomId: String?) {
if (chatRoomId == null) return
fun getAllServers() {
launchUI(cancelStrategy) {
try {
mainView.setupServerListView(getAccountsInteractor.get())
} catch (exception: Exception) {
Timber.e(exception, "Error while getting all servers")
when (exception) {
is RocketChatAuthException -> logout()
else -> {
exception.message?.let {
mainView.showMessage(it)
}.ifNull {
mainView.showGenericErrorMessage()
}
}
}
}
groupedPush.hostToPushMessageList[currentServerUrl].let { list ->
list?.removeAll { it.info.roomId == chatRoomId }
}
}
fun showChatList(chatRoomId: String? = null) = mainNavigator.toChatList(chatRoomId)
fun showSettings() = mainNavigator.toSettings()
fun logout() {
getCurrentServerInteractor.get()?.let { currentServer ->
setupConnectionInfo(currentServer)
}
}
}
}
\ No newline at end of file
package chat.rocket.android.main.presentation
import chat.rocket.android.core.behaviours.MessageView
import chat.rocket.android.server.domain.model.Account
import chat.rocket.android.server.presentation.TokenView
interface MainView : TokenView, MessageView {
/**
* Setups the toolbar with the current logged in server name.
*
* @param serverName The current logged in server name to show on Toolbar.
*/
fun setupToolbar(serverName: String)
/**
* Setups the server list view with all server list.
*
* @param serverList The server list to show on server list.
*/
fun setupServerListView(serverList: List<Account>)
}
\ No newline at end of file
......@@ -8,21 +8,16 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import chat.rocket.android.R
import chat.rocket.android.main.presentation.MainPresenter
import chat.rocket.android.main.presentation.MainView
import chat.rocket.android.push.refreshPushToken
import chat.rocket.android.server.domain.model.Account
import chat.rocket.android.server.ui.INTENT_CHAT_ROOM_ID
import chat.rocket.android.util.extensions.showToast
import chat.rocket.android.util.invalidateFirebaseToken
import dagger.android.AndroidInjection
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
import dagger.android.HasActivityInjector
import dagger.android.support.HasSupportFragmentInjector
import kotlinx.android.synthetic.main.app_bar_main.*
import javax.inject.Inject
class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
class MainActivity : AppCompatActivity(), HasActivityInjector,
HasSupportFragmentInjector {
@Inject
lateinit var activityDispatchingAndroidInjector: DispatchingAndroidInjector<Activity>
......@@ -30,7 +25,6 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
lateinit var fagmentDispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>
@Inject
lateinit var presenter: MainPresenter
private var chatRoomId: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
AndroidInjection.inject(this)
......@@ -38,17 +32,14 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
setContentView(R.layout.activity_main)
refreshPushToken()
chatRoomId = intent.getStringExtra(INTENT_CHAT_ROOM_ID)
with(presenter) {
clearNotificationsForChatRoom(chatRoomId)
connect()
getCurrentServerName()
getAllServers()
showChatList(chatRoomId)
intent.getStringExtra(INTENT_CHAT_ROOM_ID).let {
clearNotificationsForChatRoom(it)
showChatList(it)
}
}
setupListeners()
}
override fun onResume() {
......@@ -62,30 +53,6 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
override fun supportFragmentInjector(): AndroidInjector<Fragment> =
fagmentDispatchingAndroidInjector
override fun setupToolbar(serverName: String) {
setSupportActionBar(toolbar)
text_server_name.text = serverName
}
override fun setupServerListView(serverList: List<Account>) {
// TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun invalidateToken(token: String) = invalidateFirebaseToken(token)
override fun showMessage(resId: Int) = showToast(resId)
override fun showMessage(message: String) = showToast(message)
override fun showGenericErrorMessage() = showMessage(getString(R.string.msg_generic_error))
private fun clearAppNotifications() =
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).cancelAll()
private fun setupListeners() {
text_server_name.setOnClickListener {
// SortByBottomSheetFragment().show(supportFragmentManager, TAG)
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/AppTheme"
tools:context=".main.ui.MainActivity">
<include
android:id="@+id/layout_app_bar_main"
layout="@layout/app_bar_main" />
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
tools:context=".main.ui.MainActivity" />
\ No newline at end of file
......@@ -3,13 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary">
android:background="@color/colorPrimary"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
......
......@@ -6,6 +6,11 @@
android:layout_height="match_parent"
tools:context=".chatrooms.ui.ChatRoomsFragment">
<include
android:id="@+id/layout_app_bar_chat_room"
layout="@layout/app_bar_chat_rooms"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_sort_by"
android:layout_width="match_parent"
......@@ -22,7 +27,7 @@
android:textStyle="normal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/layout_app_bar_chat_room" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
......@@ -41,6 +46,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_sort_by"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -4,10 +4,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:focusableInTouchMode="true"
tools:context="createchannel.ui.CreateChannelFragment">
<include
android:id="@+id/layout_app_bar"
layout="@layout/app_bar"
app:layout_constraintTop_toTopOf="parent" />
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading"
android:layout_width="wrap_content"
......@@ -18,23 +21,26 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_app_bar"
tools:visibility="visible" />
<TextView
android:id="@+id/text_channel_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@string/msg_public_channel"
android:textColor="@color/colorPrimaryText"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/layout_app_bar" />
<TextView
android:id="@+id/text_channel_type_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/msg_public_channel_description"
android:textColor="@color/colorSecondaryText"
android:textSize="12sp"
......@@ -45,6 +51,7 @@
android:id="@+id/switch_channel_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="@+id/text_channel_type_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/text_channel_type" />
......@@ -53,6 +60,8 @@
android:id="@+id/text_read_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@string/msg_ready_only_channel"
android:textColor="@color/colorPrimaryText"
......@@ -64,6 +73,8 @@
android:id="@+id/text_read_only_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/msg_ready_only_channel_description"
android:textColor="@color/colorSecondaryText"
android:textSize="12sp"
......@@ -74,6 +85,8 @@
android:id="@+id/switch_read_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="@+id/text_read_only_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/text_read_only" />
......@@ -81,7 +94,9 @@
<ImageView
android:id="@+id/image_channel_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="22dp"
android:src="@drawable/ic_hashtag_black_12dp"
app:layout_constraintStart_toStartOf="parent"
......@@ -91,6 +106,8 @@
android:id="@+id/text_channel_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:backgroundTint="@color/colorDim"
android:hint="@string/msg_channel_name"
android:inputType="text"
......@@ -107,6 +124,7 @@
android:id="@+id/image_invite_member"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:src="@drawable/ic_at_black_20dp"
app:layout_constraintStart_toStartOf="parent"
......@@ -116,6 +134,8 @@
android:id="@+id/text_invite_members"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:backgroundTint="@color/colorDim"
android:hint="@string/msg_invite_members"
android:inputType="text"
......
......@@ -35,7 +35,7 @@ class AnswersAnalytics : Analytics {
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) =
Answers.getInstance()
.logCustom(
CustomEvent("message_actionsent")
CustomEvent("message_sent")
.putCustomAttribute("subscription_type", event.subscriptionTypeName)
.putCustomAttribute("server", serverUrl)
)
......
......@@ -56,7 +56,7 @@ ext {
glide : '4.8.0',
glideTransformations : '4.0.0',
jitsi : '+', // TODO Avoid using + (https://github.com/jitsi/jitsi-meet/issues/3987)
jitsi : '1.21.0',
// For testing
junit : '4.12',
......
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