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
f199fcc2
Commit
f199fcc2
authored
Mar 11, 2018
by
aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
8c8aa192
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
50 deletions
+58
-50
CreateNewChannelActivity.kt
...cket/android/createChannel/ui/CreateNewChannelActivity.kt
+22
-9
button_border.xml
app/src/main/res/drawable/button_border.xml
+2
-2
activity_create_new_channel.xml
app/src/main/res/layout/activity_create_new_channel.xml
+27
-35
fragment_chat_rooms.xml
app/src/main/res/layout/fragment_chat_rooms.xml
+1
-0
dimens.xml
app/src/main/res/values/dimens.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-2
styles.xml
app/src/main/res/values/styles.xml
+2
-2
No files found.
app/src/main/java/chat/rocket/android/createChannel/ui/CreateNewChannelActivity.kt
View file @
f199fcc2
...
...
@@ -16,10 +16,11 @@ import javax.inject.Inject
class
CreateNewChannelActivity
:
AppCompatActivity
(),
CreateNewChannelView
{
@Inject
lateinit
var
presenter
:
CreateNewChannelPresenter
private
var
channelType
:
String
=
"public"
override
fun
onOptionsItemSelected
(
item
:
MenuItem
?):
Boolean
{
when
(
item
?.
itemId
)
{
R
.
id
.
home
->
{
android
.
R
.
id
.
home
->
{
finish
()
return
true
}
...
...
@@ -38,38 +39,50 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
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.0
f
create_channel_action_text
.
isEnabled
=
text
.
isNotEmpty
()
if
(
text
.
isEmpty
()
)
create_channel_action_text
.
alpha
=
0.8
f
else
create_channel_action_text
.
alpha
=
0.5
f
create_channel_action_text
.
alpha
=
1.0
f
}
}
private
fun
setUpOnClickListeners
(){
public_channel
.
setOnClickListener
{
private
fun
setUpOnClickListeners
()
{
public_channel
.
setOnClickListener
{
channelType
=
"public"
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
{
private_channel
.
setOnClickListener
{
channelType
=
"private"
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
))
(
getDrawable
(
R
.
drawable
.
button_solid
)
as
GradientDrawable
).
setStroke
(
1
,
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
.
colorLightTheme
))
public_channel
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
red
))
}
...
...
app/src/main/res/drawable/button_border.xml
View file @
f199fcc2
...
...
@@ -2,8 +2,8 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<gradient
android:endColor=
"
#0000
"
android:startColor=
"
#0000
"
/>
android:endColor=
"
@color/colorLightTheme
"
android:startColor=
"
@color/colorLightTheme
"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/red"
/>
...
...
app/src/main/res/layout/activity_create_new_channel.xml
View file @
f199fcc2
...
...
@@ -6,40 +6,31 @@
<android.support.v7.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"0dp"
android:layout_height=
"56dp"
android:theme=
"@style/ToolbarTheme"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
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:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/title_create_new_channel"
android:textColor=
"@color/colorLightTheme"
android:textSize=
"20sp"
/>
<LinearLayout
<TextView
android:id=
"@+id/create_channel_action_text"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:layout_marginEnd=
"16dp"
android:layout_marginStart=
"16dp"
android:gravity=
"center"
android:orientation=
"horizontal"
>
android:alpha=
"0.7"
android:enabled=
"false"
android:gravity=
"end"
android:text=
"@string/create_new_channel_action"
android:textSize=
"16sp"
/>
<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:alpha=
"0.5"
android:textColor=
"@color/colorLightTheme"
android:background=
"?selectableItemBackground"
android:enabled=
"false"
android:gravity=
"end"
android:text=
"@string/create_new_channel_action"
android:textSize=
"16sp"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.constraint.ConstraintLayout
...
...
@@ -94,6 +85,7 @@
android:id=
"@+id/channel_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"@string/private_channel_type"
android:textColor=
"@color/black"
app:layout_constraintTop_toBottomOf=
"@id/public_channel"
/>
...
...
@@ -109,8 +101,8 @@
<View
android:id=
"@+id/separator"
android:layout_width=
"0dp"
android:layout_height=
"0.
1
dp"
android:layout_marginTop=
"
4
dp"
android:layout_height=
"0.
2
dp"
android:layout_marginTop=
"
8
dp"
android:background=
"@color/colorDividerMessageComposer"
app:layout_constraintTop_toBottomOf=
"@id/channel_description"
/>
...
...
@@ -118,7 +110,7 @@
android:id=
"@+id/placeholder"
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:layout_marginTop=
"
6
dp"
android:layout_marginTop=
"
8
dp"
android:src=
"@drawable/ic_hashtag_black"
app:layout_constraintBottom_toBottomOf=
"@id/channel_name_text_input_layout"
app:layout_constraintEnd_toStartOf=
"@id/channel_name_text_input_layout"
...
...
@@ -129,8 +121,8 @@
android:id=
"@+id/channel_name_text_input_layout"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"
6
dp"
android:layout_marginTop=
"
6
dp"
android:layout_marginStart=
"
8
dp"
android:layout_marginTop=
"
8
dp"
android:focusable=
"true"
android:hint=
"@string/new_channel_edit_text_hint"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
app/src/main/res/layout/fragment_chat_rooms.xml
View file @
f199fcc2
...
...
@@ -50,6 +50,7 @@
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
app:useCompatPadding=
"true"
android:layout_alignParentBottom=
"true"
android:src=
"@drawable/ic_add_24dp"
app:backgroundTint=
"@color/black"
...
...
app/src/main/res/values/dimens.xml
View file @
f199fcc2
...
...
@@ -20,6 +20,8 @@
<dimen
name=
"picker_padding_bottom"
>
16dp
</dimen>
<dimen
name=
"supposed_keyboard_height"
>
252dp
</dimen>
<!--Toolbar-->
<dimen
name=
"toolbar_height"
>
56dp
</dimen>
<!-- Message -->
<dimen
name=
"padding_quote"
>
8dp
</dimen>
<dimen
name=
"padding_mention"
>
4dp
</dimen>
...
...
app/src/main/res/values/strings.xml
View file @
f199fcc2
...
...
@@ -69,8 +69,8 @@
<string
name=
"msg_confirm_password"
>
Confirm New Password
</string>
<string
name=
"private_channel_type"
>
Private
</string>
<string
name=
"public_channel_type"
>
Public
</string>
<string
name=
"private_channel_type_description"
></string>
<string
name=
"public_channel_description"
></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=
"new_channel_edit_text_hint"
>
Channel Name
</string>
<string
name=
"create_new_channel_action"
>
CREATE
</string>
...
...
app/src/main/res/values/styles.xml
View file @
f199fcc2
...
...
@@ -11,8 +11,8 @@
<item
name=
"windowActionModeOverlay"
>
true
</item>
</style>
<style
name=
"ToolbarTheme"
parent=
"
ThemeOverlay.AppCompat.Dark.ActionB
ar"
>
<item
name=
"android:
background"
>
@color/colorPrimary
</item>
<style
name=
"ToolbarTheme"
parent=
"
Base.Widget.AppCompat.Toolb
ar"
>
<item
name=
"android:
colorAccent"
>
@color/colorLightTheme
</item>
</style>
<style
name=
"AuthenticationTheme"
parent=
"Theme.AppCompat.NoActionBar"
>
...
...
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