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
0b087b61
Commit
0b087b61
authored
Aug 29, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the add button at the sidebar clickable and responding to a call to AddServerActivity
parent
6341fe2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+18
-7
sidebar.xml
app/src/main/res/layout/sidebar.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
0b087b61
package
chat
.
rocket
.
android
.
activity
;
package
chat
.
rocket
.
android
.
activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
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
android.view.View
;
import
android.widget.Button
;
import
chat.rocket.android.LaunchUtil
;
import
chat.rocket.android.LaunchUtil
;
import
chat.rocket.android.R
;
import
chat.rocket.android.R
;
...
@@ -70,15 +72,18 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -70,15 +72,18 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
}
}
final
SlidingPaneLayout
subPane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sub_sliding_pane
);
final
SlidingPaneLayout
subPane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sub_sliding_pane
);
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
SimplePanelSlideListener
()
{
if
(
subPane
!=
null
)
{
@Override
Button
addServerButton
=
subPane
.
findViewById
(
R
.
id
.
btn_add_server
);
public
void
onPanelClosed
(
View
panel
)
{
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
SimplePanelSlideListener
()
{
super
.
onPanelClosed
(
panel
);
@Override
if
(
subPane
!=
null
)
{
public
void
onPanelClosed
(
View
panel
)
{
super
.
onPanelClosed
(
panel
);
subPane
.
closePane
();
subPane
.
closePane
();
}
}
}
});
});
addServerButton
.
setOnClickListener
(
view
->
showAddServerActivity
());
}
toolbar
.
setNavigationOnClickListener
(
view
->
{
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
...
@@ -106,6 +111,12 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -106,6 +111,12 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
});
});
}
}
private
void
showAddServerActivity
()
{
Intent
intent
=
new
Intent
(
this
,
AddServerActivity
.
class
);
intent
.
putExtra
(
AddServerActivity
.
EXTRA_FINISH_ON_BACK_PRESS
,
true
);
startActivity
(
intent
);
}
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
);
SlidingPaneLayout
pane
=
(
SlidingPaneLayout
)
findViewById
(
R
.
id
.
sliding_pane
);
...
...
app/src/main/res/layout/sidebar.xml
View file @
0b087b61
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<!-- FIXME replace this mock with real server -->
<ImageButton
<ImageButton
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width=
"80dp"
android:layout_width=
"80dp"
...
@@ -26,6 +27,7 @@
...
@@ -26,6 +27,7 @@
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:id=
"@+id/btn_add_server"
android:layout_width=
"80dp"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_height=
"80dp"
android:layout_margin=
"@dimen/margin_8"
android:layout_margin=
"@dimen/margin_8"
...
...
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