Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
8c8aa192
Commit
8c8aa192
authored
Mar 11, 2018
by
aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds layout for creating new channel
parent
c097f168
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
238 additions
and
134 deletions
+238
-134
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-2
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+1
-1
CreateNewChannelModule.kt
...rocket/android/createChannel/di/CreateNewChannelModule.kt
+5
-2
CreateNewChannelProvider.kt
...cket/android/createChannel/di/CreateNewChannelProvider.kt
+4
-3
CreateNewChannelPresenter.kt
...d/createChannel/presentation/CreateNewChannelPresenter.kt
+7
-0
CreateNewChannelView.kt
...ndroid/createChannel/presentation/CreateNewChannelView.kt
+1
-1
CreateNewChannelActivity.kt
...cket/android/createChannel/ui/CreateNewChannelActivity.kt
+77
-0
CreateNewChannelPresenter.kt
.../create_channel/presentation/CreateNewChannelPresenter.kt
+0
-7
CreateNewChannelActivity.kt
...ket/android/create_channel/ui/CreateNewChannelActivity.kt
+0
-38
ActivityBuilder.kt
...java/chat/rocket/android/dagger/module/ActivityBuilder.kt
+7
-0
activity_create_new_channel.xml
app/src/main/res/layout/activity_create_new_channel.xml
+128
-79
fragment_chat_rooms.xml
app/src/main/res/layout/fragment_chat_rooms.xml
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+1
-0
styles.xml
app/src/main/res/values/styles.xml
+4
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
8c8aa192
...
...
@@ -50,9 +50,9 @@
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"adjustResize|stateAlwaysHidden"
/>
<activity
android:name=
".create
_c
hannel.ui.CreateNewChannelActivity"
android:name=
".create
C
hannel.ui.CreateNewChannelActivity"
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"
adjustResize|
stateAlwaysHidden"
/>
android:windowSoftInputMode=
"stateAlwaysHidden"
/>
<activity
android:name=
".chatroom.ui.PinnedMessagesActivity"
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
8c8aa192
...
...
@@ -13,7 +13,7 @@ import android.view.*
import
chat.rocket.android.R
import
chat.rocket.android.chatrooms.presentation.ChatRoomsPresenter
import
chat.rocket.android.chatrooms.presentation.ChatRoomsView
import
chat.rocket.android.create
_c
hannel.ui.CreateNewChannelActivity
import
chat.rocket.android.create
C
hannel.ui.CreateNewChannelActivity
import
chat.rocket.android.server.domain.GetCurrentServerInteractor
import
chat.rocket.android.server.domain.SettingsRepository
import
chat.rocket.android.util.extensions.*
...
...
app/src/main/java/chat/rocket/android/create
_c
hannel/di/CreateNewChannelModule.kt
→
app/src/main/java/chat/rocket/android/create
C
hannel/di/CreateNewChannelModule.kt
View file @
8c8aa192
package
chat.rocket.android.create
_c
hannel.di
package
chat.rocket.android.create
C
hannel.di
import
android.arch.lifecycle.LifecycleOwner
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.create
_c
hannel.ui.CreateNewChannelActivity
import
chat.rocket.android.create
C
hannel.ui.CreateNewChannelActivity
import
dagger.Module
import
dagger.Provides
import
kotlinx.coroutines.experimental.Job
...
...
@@ -19,4 +19,7 @@ class CreateNewChannelModule {
return
CancelStrategy
(
owner
,
jobs
)
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/create
_c
hannel/di/CreateNewChannelProvider.kt
→
app/src/main/java/chat/rocket/android/create
C
hannel/di/CreateNewChannelProvider.kt
View file @
8c8aa192
package
chat.rocket.android.create
_c
hannel.di
package
chat.rocket.android.create
C
hannel.di
import
chat.rocket.android.create_channel.ui.CreateNewChannelActivity
import
chat.rocket.android.createChannel.ui.CreateNewChannelActivity
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
@Module
abstract
class
CreateNewChannelProvider
{
@ContributesAndroidInjector
(
modules
=
[
CreateNewChannelModule
::
class
])
abstract
fun
provideNewChannelActivity
():
CreateNewChannelActivity
...
...
app/src/main/java/chat/rocket/android/createChannel/presentation/CreateNewChannelPresenter.kt
0 → 100644
View file @
8c8aa192
package
chat.rocket.android.createChannel.presentation
import
javax.inject.Inject
class
CreateNewChannelPresenter
@Inject
constructor
()
{
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/create
_c
hannel/presentation/CreateNewChannelView.kt
→
app/src/main/java/chat/rocket/android/create
C
hannel/presentation/CreateNewChannelView.kt
View file @
8c8aa192
package
chat.rocket.android.create
_c
hannel.presentation
package
chat.rocket.android.create
C
hannel.presentation
interface
CreateNewChannelView
{
//TODO add functions to be implemented
...
...
app/src/main/java/chat/rocket/android/createChannel/ui/CreateNewChannelActivity.kt
0 → 100644
View file @
8c8aa192
package
chat.rocket.android.createChannel.ui
import
android.graphics.drawable.GradientDrawable
import
android.os.Bundle
import
android.support.v7.app.AppCompatActivity
import
android.view.MenuItem
import
chat.rocket.android.R
import
chat.rocket.android.createChannel.presentation.CreateNewChannelPresenter
import
chat.rocket.android.createChannel.presentation.CreateNewChannelView
import
com.jakewharton.rxbinding2.widget.RxTextView
import
dagger.android.AndroidInjection
import
kotlinx.android.synthetic.main.activity_create_new_channel.*
import
javax.inject.Inject
class
CreateNewChannelActivity
:
AppCompatActivity
(),
CreateNewChannelView
{
@Inject
lateinit
var
presenter
:
CreateNewChannelPresenter
override
fun
onOptionsItemSelected
(
item
:
MenuItem
?):
Boolean
{
when
(
item
?.
itemId
)
{
R
.
id
.
home
->
{
finish
()
return
true
}
}
return
super
.
onOptionsItemSelected
(
item
)
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_create_new_channel
)
setUpToolBar
()
setUpOnClickListeners
()
}
private
fun
setUpToolBar
()
{
setSupportActionBar
(
toolbar
)
supportActionBar
?.
title
=
getString
(
R
.
string
.
title_create_new_channel
)
supportActionBar
?.
setDisplayHomeAsUpEnabled
(
true
)
RxTextView
.
textChanges
(
channel_name_edit_text
).
subscribe
{
text
->
create_channel_action_text
.
isEnabled
=
text
!=
""
if
(
text
!=
""
)
create_channel_action_text
.
alpha
=
1.0f
else
create_channel_action_text
.
alpha
=
0.5f
}
}
private
fun
setUpOnClickListeners
(){
public_channel
.
setOnClickListener
{
channel_type
.
text
=
getString
(
R
.
string
.
public_channel_type
)
channel_description
.
text
=
getString
(
R
.
string
.
private_channel_type_description
)
placeholder
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_hashtag_black
))
(
getDrawable
(
R
.
drawable
.
button_border
)
as
GradientDrawable
).
setColor
(
resources
.
getColor
(
R
.
color
.
colorLightTheme
))
(
getDrawable
(
R
.
drawable
.
button_solid
)
as
GradientDrawable
).
setColor
(
resources
.
getColor
(
R
.
color
.
red
))
private_channel
.
background
=
getDrawable
(
R
.
drawable
.
button_border
)
public_channel
.
background
=
getDrawable
(
R
.
drawable
.
button_solid
)
private_channel
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
red
))
public_channel
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
colorLightTheme
))
}
private_channel
.
setOnClickListener
{
channel_type
.
text
=
getString
(
R
.
string
.
private_channel_type
)
channel_description
.
text
=
getString
(
R
.
string
.
public_channel_description
)
placeholder
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_room_lock
))
(
getDrawable
(
R
.
drawable
.
button_border
)
as
GradientDrawable
).
setColor
(
resources
.
getColor
(
R
.
color
.
red
))
(
getDrawable
(
R
.
drawable
.
button_solid
)
as
GradientDrawable
).
setColor
(
resources
.
getColor
(
R
.
color
.
colorLightTheme
))
private_channel
.
background
=
getDrawable
(
R
.
drawable
.
button_border
)
public_channel
.
background
=
getDrawable
(
R
.
drawable
.
button_solid
)
private_channel
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
colorLightTheme
))
public_channel
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
red
))
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/create_channel/presentation/CreateNewChannelPresenter.kt
deleted
100644 → 0
View file @
c097f168
package
chat.rocket.android.create_channel.presentation
/**
* Created by aniket on 9/3/18.
*/
class
CreateNewChannelPresenter
{
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/create_channel/ui/CreateNewChannelActivity.kt
deleted
100644 → 0
View file @
c097f168
package
chat.rocket.android.create_channel.ui
import
android.os.Bundle
import
android.support.v7.app.AppCompatActivity
import
android.view.MenuItem
import
chat.rocket.android.R
import
chat.rocket.android.create_channel.presentation.CreateNewChannelPresenter
import
chat.rocket.android.create_channel.presentation.CreateNewChannelView
import
dagger.android.AndroidInjection
import
javax.inject.Inject
class
CreateNewChannelActivity
:
AppCompatActivity
(),
CreateNewChannelView
{
override
fun
onOptionsItemSelected
(
item
:
MenuItem
?):
Boolean
{
when
(
item
?.
itemId
)
{
R
.
id
.
home
->
{
finish
()
return
true
}
}
return
super
.
onOptionsItemSelected
(
item
)
}
@Inject
var
presenter
:
CreateNewChannelPresenter
=
CreateNewChannelPresenter
()
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_create_new_channel
)
setUpToolBar
()
}
private
fun
setUpToolBar
()
{
supportActionBar
?.
title
=
getString
(
R
.
string
.
title_create_new_channel
)
supportActionBar
?.
setDisplayHomeAsUpEnabled
(
true
)
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/dagger/module/ActivityBuilder.kt
View file @
8c8aa192
...
...
@@ -12,6 +12,8 @@ import chat.rocket.android.chatroom.ui.ChatRoomActivity
import
chat.rocket.android.chatroom.ui.PinnedMessagesActivity
import
chat.rocket.android.chatrooms.di.ChatRoomsFragmentProvider
import
chat.rocket.android.chatrooms.di.ChatRoomsModule
import
chat.rocket.android.createChannel.di.CreateNewChannelProvider
import
chat.rocket.android.createChannel.ui.CreateNewChannelActivity
import
chat.rocket.android.dagger.scope.PerActivity
import
chat.rocket.android.main.di.MainActivityProvider
import
chat.rocket.android.main.di.MainModule
...
...
@@ -55,4 +57,9 @@ abstract class ActivityBuilder {
@PerActivity
@ContributesAndroidInjector
(
modules
=
[
PasswordFragmentProvider
::
class
])
abstract
fun
bindPasswordActivity
():
PasswordActivity
@PerActivity
@ContributesAndroidInjector
(
modules
=
[
CreateNewChannelProvider
::
class
])
abstract
fun
bindCreateNewChannelActivity
():
CreateNewChannelActivity
}
\ No newline at end of file
app/src/main/res/layout/activity_create_new_channel.xml
View file @
8c8aa192
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/fragment_chat_rooms.xml
View file @
8c8aa192
...
...
@@ -52,6 +52,6 @@
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
android:src=
"@drawable/ic_add_24dp"
a
ndroid
:backgroundTint=
"@color/black"
a
pp
:backgroundTint=
"@color/black"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
8c8aa192
...
...
@@ -72,6 +72,7 @@
<string
name=
"private_channel_type_description"
></string>
<string
name=
"public_channel_description"
></string>
<string
name=
"new_channel_edit_text_hint"
>
Channel Name
</string>
<string
name=
"create_new_channel_action"
>
CREATE
</string>
<!-- System messages -->
<string
name=
"message_room_name_changed"
>
Room name changed to: %1$s by %2$s
</string>
...
...
app/src/main/res/values/styles.xml
View file @
8c8aa192
...
...
@@ -11,6 +11,10 @@
<item
name=
"windowActionModeOverlay"
>
true
</item>
</style>
<style
name=
"ToolbarTheme"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
>
<item
name=
"android:background"
>
@color/colorPrimary
</item>
</style>
<style
name=
"AuthenticationTheme"
parent=
"Theme.AppCompat.NoActionBar"
>
<item
name=
"android:statusBarColor"
>
@color/colorPrimaryDark
</item>
<item
name=
"android:windowBackground"
>
@color/colorPrimary
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment