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
7a6f5d19
Commit
7a6f5d19
authored
Sep 09, 2017
by
Rafael Kellermann Streit
Committed by
GitHub
Sep 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into chore/bump_version_2
parents
8b8fbb13
8fbdc0a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
37 deletions
+55
-37
google-services.json
app/google-services.json
+9
-22
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+29
-1
SidebarMainFragment.java
.../rocket/android/fragment/sidebar/SidebarMainFragment.java
+16
-13
apis_keys.xml
app/src/main/res/values/apis_keys.xml
+1
-1
No files found.
app/google-services.json
View file @
7a6f5d19
{
{
"project_info"
:
{
"project_info"
:
{
"project_number"
:
"
361979207101
"
,
"project_number"
:
"
1020987621558
"
,
"firebase_url"
:
"https://rocketchat
android-92e1
e.firebaseio.com"
,
"firebase_url"
:
"https://rocketchat
nativ
e.firebaseio.com"
,
"project_id"
:
"rocketchat
android-92e1
e"
,
"project_id"
:
"rocketchat
nativ
e"
,
"storage_bucket"
:
"rocketchat
android-92e1
e.appspot.com"
"storage_bucket"
:
"rocketchat
nativ
e.appspot.com"
},
},
"client"
:
[
"client"
:
[
{
{
"client_info"
:
{
"client_info"
:
{
"mobilesdk_app_id"
:
"1:
361979207101
:android:16da2e50aff9f0c9"
,
"mobilesdk_app_id"
:
"1:
1020987621558
:android:16da2e50aff9f0c9"
,
"android_client_info"
:
{
"android_client_info"
:
{
"package_name"
:
"chat.rocket.android"
"package_name"
:
"chat.rocket.android"
}
}
},
},
"oauth_client"
:
[
"oauth_client"
:
[
{
{
"client_id"
:
"361979207101-68jt4s85vqfidsgtb0jircio1s4l0la6.apps.googleusercontent.com"
,
"client_id"
:
"1020987621558-trk61fjrahho0ujtjap095p1jmi48pfq.apps.googleusercontent.com"
,
"client_type"
:
1
,
"android_info"
:
{
"package_name"
:
"chat.rocket.android"
,
"certificate_hash"
:
"5540F34145397BBDE62DEE1433BE7FF9D991D5A2"
}
},
{
"client_id"
:
"361979207101-tvvl8a3s98vd933svlepieo81mul17da.apps.googleusercontent.com"
,
"client_type"
:
3
"client_type"
:
3
}
}
],
],
"api_key"
:
[
"api_key"
:
[
{
{
"current_key"
:
"AIzaSy
CjInoCWiVXbC02aKgBPeH3EqiHGt6vGyE
"
"current_key"
:
"AIzaSy
Dc7VYUdU6kRkoRTToiCn1rh-W0wJvhLWk
"
}
}
],
],
"services"
:
{
"services"
:
{
...
@@ -37,13 +29,8 @@
...
@@ -37,13 +29,8 @@
"status"
:
1
"status"
:
1
},
},
"appinvite_service"
:
{
"appinvite_service"
:
{
"status"
:
2
,
"status"
:
1
,
"other_platform_oauth_client"
:
[
"other_platform_oauth_client"
:
[]
{
"client_id"
:
"361979207101-tvvl8a3s98vd933svlepieo81mul17da.apps.googleusercontent.com"
,
"client_type"
:
3
}
]
},
},
"ads_service"
:
{
"ads_service"
:
{
"status"
:
2
"status"
:
2
...
...
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
7a6f5d19
...
@@ -4,6 +4,7 @@ import android.os.Bundle;
...
@@ -4,6 +4,7 @@ import android.os.Bundle;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.Snackbar
;
import
android.support.design.widget.Snackbar
;
import
android.support.v4.widget.SlidingPaneLayout
;
import
android.support.v4.widget.SlidingPaneLayout
;
import
android.view.View
;
import
chat.rocket.android.LaunchUtil
;
import
chat.rocket.android.LaunchUtil
;
import
chat.rocket.android.R
;
import
chat.rocket.android.R
;
...
@@ -29,6 +30,7 @@ import hugo.weaving.DebugLog;
...
@@ -29,6 +30,7 @@ import hugo.weaving.DebugLog;
public
class
MainActivity
extends
AbstractAuthedActivity
implements
MainContract
.
View
{
public
class
MainActivity
extends
AbstractAuthedActivity
implements
MainContract
.
View
{
private
RoomToolbar
toolbar
;
private
RoomToolbar
toolbar
;
private
StatusTicker
statusTicker
;
private
StatusTicker
statusTicker
;
private
SlidingPaneLayout
pane
;
private
MainContract
.
Presenter
presenter
;
private
MainContract
.
Presenter
presenter
;
@Override
@Override
...
@@ -42,6 +44,8 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -42,6 +44,8 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
setContentView
(
R
.
layout
.
activity_main
);
setContentView
(
R
.
layout
.
activity_main
);
toolbar
=
(
RoomToolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
toolbar
=
(
RoomToolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
statusTicker
=
new
StatusTicker
();
statusTicker
=
new
StatusTicker
();
pane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sliding_pane
);
setupToolbar
();
}
}
@Override
@Override
...
@@ -61,10 +65,34 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -61,10 +65,34 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
super
.
onPause
();
super
.
onPause
();
}
}
private
void
setupToolbar
()
{
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
PanelSlideListener
()
{
@Override
public
void
onPanelSlide
(
View
view
,
float
v
)
{
//Ref: ActionBarDrawerToggle#setProgress
toolbar
.
setNavigationIconProgress
(
v
);
}
@Override
public
void
onPanelOpened
(
View
view
)
{
toolbar
.
setNavigationIconVerticalMirror
(
true
);
}
@Override
public
void
onPanelClosed
(
View
view
)
{
toolbar
.
setNavigationIconVerticalMirror
(
false
);
}
});
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
pane
.
openPane
();
}
});
}
private
boolean
closeSidebarIfNeeded
()
{
private
boolean
closeSidebarIfNeeded
()
{
// REMARK: Tablet UI doesn't have SlidingPane!
// REMARK: Tablet UI doesn't have SlidingPane!
SlidingPaneLayout
pane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sliding_pane
);
if
(
pane
!=
null
&&
pane
.
isSlideable
()
&&
pane
.
isOpen
())
{
if
(
pane
!=
null
&&
pane
.
isSlideable
()
&&
pane
.
isOpen
())
{
pane
.
closePane
();
pane
.
closePane
();
return
true
;
return
true
;
...
...
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainFragment.java
View file @
7a6f5d19
...
@@ -43,16 +43,18 @@ import com.jakewharton.rxbinding2.support.v7.widget.RxSearchView;
...
@@ -43,16 +43,18 @@ import com.jakewharton.rxbinding2.support.v7.widget.RxSearchView;
import
com.jakewharton.rxbinding2.widget.RxCompoundButton
;
import
com.jakewharton.rxbinding2.widget.RxCompoundButton
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
public
class
SidebarMainFragment
extends
AbstractFragment
implements
SidebarMainContract
.
View
{
public
class
SidebarMainFragment
extends
AbstractFragment
implements
SidebarMainContract
.
View
{
private
SidebarMainContract
.
Presenter
presenter
;
private
SidebarMainContract
.
Presenter
presenter
;
private
RoomListAdapter
adapter
;
private
RoomListAdapter
adapter
;
private
RecyclerView
recyclerView
;
private
SearchView
searchView
;
private
SearchView
searchView
;
private
TextView
loadMoreResultsText
;
private
TextView
loadMoreResultsText
;
private
List
<
RoomSidebar
>
roomSidebarList
;
private
List
<
RoomSidebar
>
roomSidebarList
;
private
Disposable
spotlightDisposable
;
private
String
hostname
;
private
String
hostname
;
private
static
final
String
HOSTNAME
=
"hostname"
;
private
static
final
String
HOSTNAME
=
"hostname"
;
...
@@ -139,7 +141,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -139,7 +141,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
}
}
});
});
recyclerView
=
rootView
.
findViewById
(
R
.
id
.
room_list_container
);
RecyclerView
recyclerView
=
rootView
.
findViewById
(
R
.
id
.
room_list_container
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
));
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
));
recyclerView
.
setAdapter
(
adapter
);
recyclerView
.
setAdapter
(
adapter
);
...
@@ -148,15 +150,17 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -148,15 +150,17 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
RxSearchView
.
queryTextChanges
(
searchView
)
RxSearchView
.
queryTextChanges
(
searchView
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
charSequence
->
{
.
subscribe
(
charSequence
->
{
adapter
.
setMode
(
RoomListAdapter
.
MODE_ROOM
);
if
(
spotlightDisposable
!=
null
&&
!
spotlightDisposable
.
isDisposed
())
{
spotlightDisposable
.
dispose
();
}
presenter
.
disposeSubscriptions
();
if
(
charSequence
.
length
()
==
0
)
{
if
(
charSequence
.
length
()
==
0
)
{
loadMoreResultsText
.
setVisibility
(
View
.
GONE
);
loadMoreResultsText
.
setVisibility
(
View
.
GONE
);
adapter
.
setMode
(
RoomListAdapter
.
MODE_ROOM
);
presenter
.
bindView
(
this
);
presenter
.
bindView
(
this
);
recyclerView
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
filterRoomSidebarList
(
charSequence
);
presenter
.
disposeSubscriptions
();
}
filterRoomSidebarList
(
charSequence
);
}
});
});
loadMoreResultsText
.
setOnClickListener
(
view
->
loadMoreResults
());
loadMoreResultsText
.
setOnClickListener
(
view
->
loadMoreResults
());
...
@@ -179,16 +183,16 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -179,16 +183,16 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
}
}
if
(
filteredRoomSidebarList
.
isEmpty
())
{
if
(
filteredRoomSidebarList
.
isEmpty
())
{
recyclerView
.
setVisibility
(
View
.
GONE
);
loadMoreResults
(
);
}
else
{
}
else
{
recyclerView
.
setVisibility
(
View
.
VISIBLE
);
loadMoreResultsText
.
setVisibility
(
View
.
VISIBLE
);
adapter
.
setMode
(
RoomListAdapter
.
MODE_ROOM
);
adapter
.
setRoomSidebarList
(
filteredRoomSidebarList
);
adapter
.
setRoomSidebarList
(
filteredRoomSidebarList
);
}
}
loadMoreResultsText
.
setVisibility
(
View
.
VISIBLE
);
}
}
private
void
loadMoreResults
()
{
private
void
loadMoreResults
()
{
presenter
.
searchSpotlight
(
searchView
.
getQuery
().
toString
())
spotlightDisposable
=
presenter
.
searchSpotlight
(
searchView
.
getQuery
().
toString
())
.
toObservable
()
.
toObservable
()
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
this
::
showSearchSuggestions
);
.
subscribe
(
this
::
showSearchSuggestions
);
...
@@ -198,7 +202,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -198,7 +202,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
loadMoreResultsText
.
setVisibility
(
View
.
GONE
);
loadMoreResultsText
.
setVisibility
(
View
.
GONE
);
adapter
.
setMode
(
RoomListAdapter
.
MODE_SPOTLIGHT
);
adapter
.
setMode
(
RoomListAdapter
.
MODE_SPOTLIGHT
);
adapter
.
setSpotlightList
(
spotlightList
);
adapter
.
setSpotlightList
(
spotlightList
);
recyclerView
.
setVisibility
(
View
.
VISIBLE
);
}
}
@SuppressLint
(
"RxLeakedSubscription"
)
@SuppressLint
(
"RxLeakedSubscription"
)
...
...
app/src/main/res/values/apis_keys.xml
View file @
7a6f5d19
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<string
name=
"gcm_sender_id"
>
YOUR-SENDER-ID
</string>
<string
name=
"gcm_sender_id"
>
673693445664
</string>
</resources>
</resources>
\ 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