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
e2d80203
Commit
e2d80203
authored
Jul 18, 2018
by
divyanshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connect server screen
parent
bd2591df
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
714 additions
and
460 deletions
+714
-460
OnBoardingFragment.kt
...t/android/authentication/onboarding/OnBoardingFragment.kt
+18
-2
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+4
-4
AuthenticationActivity.kt
...ocket/android/authentication/ui/AuthenticationActivity.kt
+1
-1
ic_onboarding.xml
app/src/main/res/drawable/ic_onboarding.xml
+517
-408
ic_server.xml
app/src/main/res/drawable/ic_server.xml
+69
-0
style_edit_text_authentication.xml
app/src/main/res/drawable/style_edit_text_authentication.xml
+1
-1
fragment_authentication_server.xml
app/src/main/res/layout/fragment_authentication_server.xml
+89
-40
fragment_on_boarding.xml
app/src/main/res/layout/fragment_on_boarding.xml
+4
-4
spinner_list.xml
app/src/main/res/layout/spinner_list.xml
+11
-0
No files found.
app/src/main/java/chat/rocket/android/authentication/onboarding/OnBoardingFragment.kt
View file @
e2d80203
...
...
@@ -7,12 +7,28 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.authentication.domain.model.getLoginDeepLinkInfo
import
chat.rocket.android.authentication.server.ui.ServerFragment
import
chat.rocket.android.authentication.ui.AuthenticationActivity
import
chat.rocket.android.util.extensions.addFragment
import
chat.rocket.android.util.extensions.addFragmentBackStack
import
chat.rocket.android.util.extensions.inflate
import
kotlinx.android.synthetic.main.fragment_on_boarding.*
class
OnBoardingFragment
:
Fragment
()
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_on_boarding
,
container
,
false
)
savedInstanceState
:
Bundle
?):
View
?
=
container
?.
inflate
(
R
.
layout
.
fragment_on_boarding
)
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
button_connect_server
.
setOnClickListener
{
val
deepLinkInfo
=
activity
?.
intent
?.
getLoginDeepLinkInfo
()
(
activity
as
AuthenticationActivity
).
addFragmentBackStack
(
"ServerFragment"
,
R
.
id
.
fragment_container
)
{
ServerFragment
.
newInstance
(
deepLinkInfo
)
}
}
}
companion
object
{
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
e2d80203
...
...
@@ -28,7 +28,7 @@ class ServerFragment : Fragment(), ServerView {
lateinit
var
presenter
:
ServerPresenter
private
var
deepLinkInfo
:
LoginDeepLinkInfo
?
=
null
private
val
layoutListener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
text_server_url
.
isCursorVisible
=
KeyboardHelper
.
isSoftKeyboardShown
(
relative
_layout
.
rootView
)
text_server_url
.
isCursorVisible
=
KeyboardHelper
.
isSoftKeyboardShown
(
constraint
_layout
.
rootView
)
}
companion
object
{
...
...
@@ -56,7 +56,7 @@ class ServerFragment : Fragment(), ServerView {
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
relative
_layout
.
viewTreeObserver
.
addOnGlobalLayoutListener
(
layoutListener
)
constraint
_layout
.
viewTreeObserver
.
addOnGlobalLayoutListener
(
layoutListener
)
setupOnClickListener
()
deepLinkInfo
?.
let
{
...
...
@@ -66,7 +66,7 @@ class ServerFragment : Fragment(), ServerView {
}
text_server_protocol
.
adapter
=
ArrayAdapter
<
String
>(
activity
,
android
.
R
.
layout
.
simple_dropdown_item_1line
,
arrayOf
(
"https://"
,
"http://"
))
R
.
layout
.
spinner_list
,
arrayOf
(
"https://"
,
"http://"
))
text_server_protocol
.
onItemSelectedListener
=
object
:
AdapterView
.
OnItemSelectedListener
{
override
fun
onItemSelected
(
parent
:
AdapterView
<
*
>?,
view
:
View
?,
position
:
Int
,
id
:
Long
)
{
when
(
position
)
{
...
...
@@ -104,7 +104,7 @@ class ServerFragment : Fragment(), ServerView {
override
fun
onDestroyView
()
{
super
.
onDestroyView
()
relative
_layout
.
viewTreeObserver
.
removeOnGlobalLayoutListener
(
layoutListener
)
constraint
_layout
.
viewTreeObserver
.
removeOnGlobalLayoutListener
(
layoutListener
)
}
override
fun
showInvalidServerUrlMessage
()
=
showMessage
(
getString
(
R
.
string
.
msg_invalid_server_url
))
...
...
app/src/main/java/chat/rocket/android/authentication/ui/AuthenticationActivity.kt
View file @
e2d80203
...
...
@@ -67,7 +67,7 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
}
fun
showServerInput
(
deepLinkInfo
:
LoginDeepLinkInfo
?)
{
addFragment
(
"
Server
Fragment"
,
R
.
id
.
fragment_container
,
allowStateLoss
=
true
)
{
addFragment
(
"
OnBoarding
Fragment"
,
R
.
id
.
fragment_container
,
allowStateLoss
=
true
)
{
// ServerFragment.newInstance(deepLinkInfo)
OnBoardingFragment
.
newInstance
()
}
...
...
app/src/main/res/drawable/ic_onboarding.xml
View file @
e2d80203
This diff is collapsed.
Click to expand it.
app/src/main/res/drawable/ic_server.xml
0 → 100644
View file @
e2d80203
This diff is collapsed.
Click to expand it.
app/src/main/res/drawable/style_edit_text_authentication.xml
View file @
e2d80203
...
...
@@ -3,7 +3,7 @@
android:shape=
"rectangle"
>
<solid
android:color=
"@color/color
PrimaryDark
"
/>
android:color=
"@color/color
White
"
/>
<corners
android:radius=
"2dp"
/>
...
...
app/src/main/res/layout/fragment_authentication_server.xml
View file @
e2d80203
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.constraintlayout.widget.Constraint
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"
android:id=
"@+id/
relative
_layout"
android:id=
"@+id/
constraint
_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:focusableInTouchMode=
"true"
android:background=
"@color/colorWhite"
tools:context=
".authentication.server.ui.ServerFragment"
>
<ImageView
android:id=
"@+id/image_server"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_server"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginTop=
"40dp"
/>
<TextView
android:id=
"@+id/text_headline"
style=
"@style/Authentication.Headline.TextView"
android:layout_centerHorizontal=
"true"
android:text=
"@string/title_sign_in_your_server"
/>
<EditText
android:id=
"@+id/text_server_url"
style=
"@style/Authentication.EditText"
android:layout_below=
"@id/text_headline"
android:layout_marginStart=
"-6dp"
android:layout_marginTop=
"32dp"
android:layout_toEndOf=
"@id/protocol_container"
android:cursorVisible=
"false"
android:hint=
"@string/default_server"
android:imeOptions=
"actionDone"
android:inputType=
"text|textUri"
android:paddingEnd=
"0dp"
/>
<FrameLayout
android:id=
"@+id/protocol_container"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/style_edit_text_authentication"
android:layout_marginStart=
"@dimen/screen_edge_left_and_right_margins"
android:layout_below=
"@id/text_headline"
android:layout_marginTop=
"32dp"
>
<Spinner
android:id=
"@+id/text_server_protocol"
android:spinnerMode=
"dropdown"
android:layout_width=
"120dp"
android:layout_height=
"50dp"
android:backgroundTint=
"@color/actionMenuColor"
/>
</FrameLayout>
android:textSize=
"22sp"
android:fontFamily=
"sans-serif"
android:textStyle=
"bold"
android:textColor=
"#2f343d"
android:lineSpacingExtra=
"6sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_server"
android:layout_marginTop=
"8dp"
android:text=
"@string/title_sign_in_your_server"
/>
<RelativeLayout
android:id=
"@+id/view_server"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:background=
"@drawable/rounded_border"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/text_headline"
android:layout_marginTop=
"24dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
>
<FrameLayout
android:id=
"@+id/protocol_container"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
>
<Spinner
android:id=
"@+id/text_server_protocol"
android:spinnerMode=
"dropdown"
android:layout_width=
"120dp"
android:layout_height=
"match_parent"
android:layout_margin=
"1dp"
android:backgroundTint=
"@color/actionMenuColor"
/>
</FrameLayout>
<EditText
android:id=
"@+id/text_server_url"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:cursorVisible=
"false"
android:hint=
"@string/default_server"
android:imeOptions=
"actionDone"
android:inputType=
"text|textUri"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_centerVertical=
"true"
android:textSize=
"17sp"
android:textColorHint=
"#9ea2a8"
android:textColor=
"#9ea2a8"
android:layout_toEndOf=
"@id/protocol_container"
android:background=
"@color/colorWhite"
/>
</RelativeLayout>
<Button
android:id=
"@+id/button_connect"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/view_server"
android:layout_marginTop=
"20dp"
android:text=
"@string/action_connect"
android:textSize=
"18sp"
android:textColor=
"@color/colorWhite"
android:background=
"@drawable/rounded_color_accent"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:textAllCaps=
"false"
/>
<com.wang.avi.AVLoadingIndicatorView
android:id=
"@+id/view_loading"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:visibility=
"gone"
app:indicatorName=
"BallPulseIndicator"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_connect"
style=
"@style/Authentication.Button"
android:layout_alignParentBottom=
"true"
android:text=
"@string/action_connect"
/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/fragment_on_boarding.xml
View file @
e2d80203
...
...
@@ -51,7 +51,7 @@
android:layout_marginTop=
"8dp"
/>
<RelativeLayout
android:id=
"@+id/
view
_connect_server"
android:id=
"@+id/
button
_connect_server"
android:layout_width=
"0dp"
android:layout_height=
"60dp"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -94,12 +94,12 @@
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/
view
_join_community"
android:id=
"@+id/
button
_join_community"
android:layout_width=
"0dp"
android:layout_height=
"60dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/
view
_connect_server"
app:layout_constraintTop_toBottomOf=
"@id/
button
_connect_server"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
android:layout_marginStart=
"16dp"
...
...
@@ -154,7 +154,7 @@
android:layout_height=
"60dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/
view
_join_community"
app:layout_constraintTop_toBottomOf=
"@id/
button
_join_community"
android:layout_marginTop=
"10dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
...
...
app/src/main/res/layout/spinner_list.xml
0 → 100644
View file @
e2d80203
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:textColor=
"@color/colorPrimaryText"
android:textAlignment=
"center"
android:background=
"@color/colorWhite"
android:padding=
"10dp"
tools:text=
"https"
/>
\ No newline at end of file
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