Commit daabc489 authored by aniketsingh03's avatar aniketsingh03

adds layout for inviting new members to channel

parent a051ed24
package chat.rocket.android.createChannel.addMembers.di
import android.arch.lifecycle.LifecycleOwner
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.createChannel.addMembers.ui.AddMembersActivity
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.experimental.Job
@Module
class AddMembersModule {
@Provides
fun provideLifecycleOwner(activity: AddMembersActivity): LifecycleOwner {
return activity
}
@Provides
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
return CancelStrategy(owner, jobs)
}
}
\ No newline at end of file
package chat.rocket.android.createChannel.addMembers.di
import chat.rocket.android.createChannel.addMembers.ui.AddMembersActivity
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class AddMembersProvider {
@ContributesAndroidInjector(modules = [AddMembersModule::class])
abstract fun provideNewChannelActivity(): AddMembersActivity
}
\ No newline at end of file
package chat.rocket.android.createChannel.addMembers.presentation
class AddMembersPresenter {
}
\ No newline at end of file
package chat.rocket.android.createChannel.addMembers.presentation
import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView
interface AddMembersView : LoadingView, MessageView {
}
\ No newline at end of file
package chat.rocket.android.createChannel.addMembers.ui
import android.support.v7.app.AppCompatActivity
import chat.rocket.android.createChannel.addMembers.presentation.AddMembersPresenter
import chat.rocket.android.createChannel.addMembers.presentation.AddMembersView
import javax.inject.Inject
class AddMembersActivity : AppCompatActivity(), AddMembersView {
override fun showLoading() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun hideLoading() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showMessage(resId: Int) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showMessage(message: String) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showGenericErrorMessage() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@Inject
lateinit var presenter: AddMembersPresenter
}
\ No newline at end of file
...@@ -18,8 +18,4 @@ class CreateNewChannelModule { ...@@ -18,8 +18,4 @@ class CreateNewChannelModule {
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy { fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
return CancelStrategy(owner, jobs) return CancelStrategy(owner, jobs)
} }
} }
\ No newline at end of file
...@@ -10,10 +10,31 @@ import chat.rocket.android.createChannel.presentation.CreateNewChannelView ...@@ -10,10 +10,31 @@ import chat.rocket.android.createChannel.presentation.CreateNewChannelView
import com.jakewharton.rxbinding2.widget.RxTextView import com.jakewharton.rxbinding2.widget.RxTextView
import dagger.android.AndroidInjection import dagger.android.AndroidInjection
import kotlinx.android.synthetic.main.activity_create_new_channel.* import kotlinx.android.synthetic.main.activity_create_new_channel.*
import kotlinx.android.synthetic.main.layout_toolbar.*
import javax.inject.Inject import javax.inject.Inject
class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView { class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
override fun showLoading() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun hideLoading() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showMessage(resId: Int) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showMessage(message: String) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun showGenericErrorMessage() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@Inject @Inject
lateinit var presenter: CreateNewChannelPresenter lateinit var presenter: CreateNewChannelPresenter
private var channelType: String = "public" private var channelType: String = "public"
...@@ -39,13 +60,16 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView { ...@@ -39,13 +60,16 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
private fun setUpToolBar() { private fun setUpToolBar() {
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
toolbar_title.text = getString(R.string.title_create_new_channel)
toolbar_action_text.text = getString(R.string.action_create_new_channel)
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
RxTextView.textChanges(channel_name_edit_text).subscribe { text -> RxTextView.textChanges(channel_name_edit_text).subscribe { text ->
create_channel_action_text.isEnabled = text.isNotEmpty() toolbar_action_text.isEnabled = text.isNotEmpty()
if (text.isEmpty()) if (text.isEmpty())
create_channel_action_text.alpha = 0.8f toolbar_action_text.alpha = 0.8f
else else
create_channel_action_text.alpha = 1.0f toolbar_action_text.alpha = 1.0f
} }
} }
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar_layout"
layout="@layout/layout_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.ConstraintLayout
android:id="@+id/layout_container"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar_layout">
<EditText
android:id="@+id/search_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:backgroundTint="@color/colorLightTheme"
android:hint="@string/msg_search" />
<View
android:id="@+id/separator_1"
android:layout_width="match_parent"
android:layout_height="0.2dp"
android:background="@color/colorDividerMessageComposer"
app:layout_constraintTop_toBottomOf="@id/search_edit_text" />
<android.support.v7.widget.RecyclerView
android:id="@+id/search_results"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_constraintTop_toBottomOf="@id/separator_1" />
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -4,44 +4,24 @@ ...@@ -4,44 +4,24 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.Toolbar <include
android:id="@+id/toolbar" android:id="@+id/toolbar_layout"
layout="@layout/layout_toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height" android:layout_height="wrap_content"
android:background="@color/colorPrimary" app:layout_constraintBottom_toTopOf="@+id/layout_container"
app:layout_scrollFlags="scroll|enterAlways" app:layout_constraintTop_toTopOf="parent" />
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_create_new_channel"
android:textColor="@color/colorLightTheme"
android:textSize="20sp" />
<TextView
android:id="@+id/create_channel_action_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:alpha="0.7"
android:background="?selectableItemBackground"
android:enabled="false"
android:gravity="end"
android:text="@string/create_new_channel_action"
android:textSize="16sp" />
</android.support.v7.widget.Toolbar>
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/layout_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:padding="8dp" android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"> app:layout_constraintTop_toBottomOf="@id/toolbar_layout">
<android.support.constraint.Guideline <android.support.constraint.Guideline
android:id="@+id/button_top_guideline" android:id="@+id/button_top_guideline"
...@@ -126,7 +106,7 @@ ...@@ -126,7 +106,7 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:focusable="true" android:focusable="true"
android:hint="@string/new_channel_edit_text_hint" android:hint="@string/msg_channel_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/placeholder" app:layout_constraintStart_toEndOf="@id/placeholder"
app:layout_constraintTop_toBottomOf="@id/separator_1"> app:layout_constraintTop_toBottomOf="@id/separator_1">
...@@ -159,7 +139,7 @@ ...@@ -159,7 +139,7 @@
android:id="@+id/add_members_text" android:id="@+id/add_members_text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/add_members_helper_text" android:text="@string/msg_add_members"
android:textColor="@color/black" android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_chainStyle="spread" app:layout_constraintHorizontal_chainStyle="spread"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorLightTheme"
android:textSize="20sp" />
<TextView
android:id="@+id/toolbar_action_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:alpha="0.7"
android:background="?selectableItemBackground"
android:enabled="false"
android:gravity="end"
android:textSize="16sp" />
</android.support.v7.widget.Toolbar>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<!--Toolbar--> <!--Toolbar-->
<dimen name="toolbar_height">56dp</dimen> <dimen name="toolbar_height">56dp</dimen>
<!-- Message --> <!-- Message -->
<dimen name="padding_quote">8dp</dimen> <dimen name="padding_quote">8dp</dimen>
<dimen name="padding_mention">4dp</dimen> <dimen name="padding_mention">4dp</dimen>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<string name="title_password">Change Password</string> <string name="title_password">Change Password</string>
<string name="title_update_profile">Update profile</string> <string name="title_update_profile">Update profile</string>
<string name="title_create_new_channel">Create New Channel</string> <string name="title_create_new_channel">Create New Channel</string>
<string name="title_add_members">Invite Members</string>
<!-- Actions --> <!-- Actions -->
<string name="action_connect">Connect</string> <string name="action_connect">Connect</string>
...@@ -67,13 +68,14 @@ ...@@ -67,13 +68,14 @@
<string name="msg_utc_offset">UTC offset</string> <string name="msg_utc_offset">UTC offset</string>
<string name="msg_new_password">Enter New Password</string> <string name="msg_new_password">Enter New Password</string>
<string name="msg_confirm_password">Confirm New Password</string> <string name="msg_confirm_password">Confirm New Password</string>
<string name="msg_channel_name">Channel Name</string>
<string name="msg_add_members">Add Members</string>
<string name="msg_search">Search</string>
<string name="private_channel_type">Private</string> <string name="private_channel_type">Private</string>
<string name="public_channel_type">Public</string> <string name="public_channel_type">Public</string>
<string name="private_channel_type_description">Visible only to you and those whom you invite</string> <string name="private_channel_type_description">Visible only to you and those whom you invite</string>
<string name="public_channel_description">Visible to everyone</string> <string name="public_channel_description">Visible to everyone</string>
<string name="new_channel_edit_text_hint">Channel Name</string>
<string name="create_new_channel_action">CREATE</string>
<string name="add_members_helper_text">Add Members</string>
<!-- System messages --> <!-- System messages -->
<string name="message_room_name_changed">Room name changed to: %1$s by %2$s</string> <string name="message_room_name_changed">Room name changed to: %1$s by %2$s</string>
...@@ -96,6 +98,8 @@ ...@@ -96,6 +98,8 @@
<string name="action_msg_star">Star Message</string> <string name="action_msg_star">Star Message</string>
<string name="action_msg_share">Share</string> <string name="action_msg_share">Share</string>
<string name="action_title_editing">Editing Message</string> <string name="action_title_editing">Editing Message</string>
<string name="action_create_new_channel">CREATE</string>
<!-- Permission messages --> <!-- Permission messages -->
<string name="permission_editing_not_allowed">Editing is not allowed</string> <string name="permission_editing_not_allowed">Editing is not allowed</string>
......
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