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
8dc3027d
Commit
8dc3027d
authored
Jan 17, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into fix/validate-server-with-insecure-connection
parents
97d8fa39
57e4826a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
3 deletions
+45
-3
build.gradle
app/build.gradle
+1
-1
InputHostnameFragment.java
...android/fragment/server_config/InputHostnameFragment.java
+8
-0
SidebarMainFragment.java
.../rocket/android/fragment/sidebar/SidebarMainFragment.java
+9
-1
fragment_input_hostname.xml
app/src/main/res/layout/fragment_input_hostname.xml
+11
-0
fragment_sidebar_main.xml
app/src/main/res/layout/fragment_sidebar_main.xml
+14
-1
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/build.gradle
View file @
8dc3027d
...
...
@@ -35,7 +35,7 @@ android {
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
compileSdkVersion
versionCode
5
versionName
"1.0"
versionName
"1.0
-beta5
"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables
.
useSupportLibrary
=
true
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/InputHostnameFragment.java
View file @
8dc3027d
...
...
@@ -4,6 +4,7 @@ import android.support.design.widget.Snackbar;
import
android.widget.TextView
;
import
org.json.JSONObject
;
import
chat.rocket.android.BuildConfig
;
import
chat.rocket.android.R
;
import
chat.rocket.android.RocketChatCache
;
import
chat.rocket.android.api.rest.DefaultServerPolicyApi
;
...
...
@@ -35,11 +36,18 @@ public class InputHostnameFragment extends AbstractServerConfigFragment {
@Override
protected
void
onSetupView
()
{
setupVersionInfo
();
rootView
.
findViewById
(
R
.
id
.
btn_connect
).
setOnClickListener
(
view
->
handleConnect
());
serverConfigObserver
.
sub
();
}
private
void
setupVersionInfo
()
{
TextView
versionInfoView
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
version_info
);
versionInfoView
.
setText
(
getString
(
R
.
string
.
version_info_text
,
BuildConfig
.
VERSION_NAME
));
}
private
void
handleConnect
()
{
final
String
hostname
=
ServerPolicyHelper
.
enforceHostname
(
getHostname
());
...
...
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainFragment.java
View file @
8dc3027d
...
...
@@ -8,6 +8,7 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
chat.rocket.android.BuildConfig
;
import
chat.rocket.android.R
;
import
chat.rocket.android.RocketChatCache
;
import
chat.rocket.android.api.MethodCallHelper
;
...
...
@@ -71,7 +72,8 @@ public class SidebarMainFragment extends AbstractFragment {
if
(
realmHelper
!=
null
)
{
roomsObserver
=
realmHelper
.
createListObserver
(
realm
->
realm
.
where
(
RoomSubscription
.
class
).
equalTo
(
RoomSubscription
.
OPEN
,
true
).
findAll
())
realm
->
realm
.
where
(
RoomSubscription
.
class
).
equalTo
(
RoomSubscription
.
OPEN
,
true
)
.
findAll
())
.
setOnUpdateListener
(
list
->
roomListManager
.
setRooms
(
list
));
currentUserObserver
=
realmHelper
...
...
@@ -102,6 +104,7 @@ public class SidebarMainFragment extends AbstractFragment {
setupUserStatusButtons
();
setupLogoutButton
();
setupAddChannelButton
();
setupVersionInfo
();
roomListManager
=
new
RoomListManager
(
rootView
.
findViewById
(
R
.
id
.
unread_title
),
...
...
@@ -193,6 +196,11 @@ public class SidebarMainFragment extends AbstractFragment {
});
}
private
void
setupVersionInfo
()
{
TextView
versionInfoView
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
version_info
);
versionInfoView
.
setText
(
getString
(
R
.
string
.
version_info_text
,
BuildConfig
.
VERSION_NAME
));
}
private
void
showAddRoomDialog
(
DialogFragment
dialog
)
{
Bundle
args
=
new
Bundle
();
args
.
putString
(
"serverConfigId"
,
serverConfigId
);
...
...
app/src/main/res/layout/fragment_input_hostname.xml
View file @
8dc3027d
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"?attr/colorPrimaryDark"
>
...
...
@@ -49,4 +50,14 @@
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/version_info"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal|bottom"
android:layout_margin=
"@dimen/margin_8"
android:textColor=
"@android:color/white"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
tools:text=
"Version: 1.0"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_sidebar_main.xml
View file @
8dc3027d
...
...
@@ -165,7 +165,7 @@
android:background=
"?attr/colorPrimaryDark"
android:elevation=
"2dp"
android:visibility=
"gone"
tools:visibility=
"
gon
e"
>
tools:visibility=
"
visibl
e"
>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -236,6 +236,19 @@
android:text=
"@string/fragment_sidebar_main_logout_title"
android:textAppearance=
"?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
<chat.rocket.android.widget.DividerView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/version_info"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_margin=
"@dimen/margin_8"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
tools:text=
"Version: 1.0"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
app/src/main/res/values/strings.xml
View file @
8dc3027d
...
...
@@ -45,4 +45,6 @@
<string
name=
"input_hostname_invalid_server_message"
>
Invalid server version
</string>
<string
name=
"connection_error_try_later"
>
There\'s a connection error. Please try later.
</string>
<string
name=
"version_info_text"
>
Version: %s
</string>
</resources>
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