Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
09147980
Commit
09147980
authored
Jul 27, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConferenceAdd activity and fragment: "up" button intercepted, options menu iplemented in activity.
parent
43132231
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
23 deletions
+24
-23
ConferenceAdd.java
app/src/main/java/com/xabber/android/ui/ConferenceAdd.java
+23
-4
ConferenceAddFragment.java
...ain/java/com/xabber/android/ui/ConferenceAddFragment.java
+1
-19
No files found.
app/src/main/java/com/xabber/android/ui/ConferenceAdd.java
View file @
09147980
...
@@ -18,6 +18,8 @@ import android.content.Context;
...
@@ -18,6 +18,8 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
android.support.v7.widget.Toolbar
;
import
android.view.MenuItem
;
import
android.view.View
;
import
com.xabber.android.R
;
import
com.xabber.android.R
;
import
com.xabber.android.data.intent.AccountIntentBuilder
;
import
com.xabber.android.data.intent.AccountIntentBuilder
;
...
@@ -25,7 +27,7 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
...
@@ -25,7 +27,7 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
com.xabber.android.ui.helper.ManagedActivity
;
public
class
ConferenceAdd
extends
ManagedActivity
{
public
class
ConferenceAdd
extends
ManagedActivity
implements
Toolbar
.
OnMenuItemClickListener
{
private
static
final
String
SAVED_ACCOUNT
=
"com.xabber.android.ui.MUCEditor.SAVED_ACCOUNT"
;
private
static
final
String
SAVED_ACCOUNT
=
"com.xabber.android.ui.MUCEditor.SAVED_ACCOUNT"
;
private
static
final
String
SAVED_ROOM
=
"com.xabber.android.ui.MUCEditor.SAVED_ROOM"
;
private
static
final
String
SAVED_ROOM
=
"com.xabber.android.ui.MUCEditor.SAVED_ROOM"
;
...
@@ -56,9 +58,14 @@ public class ConferenceAdd extends ManagedActivity {
...
@@ -56,9 +58,14 @@ public class ConferenceAdd extends ManagedActivity {
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
setTitle
(
null
);
toolbar
.
inflateMenu
(
R
.
menu
.
add_conference
);
toolbar
.
setNavigationOnClickListener
(
new
View
.
OnClickListener
()
{
setSupportActionBar
(
toolbar
);
@Override
public
void
onClick
(
View
v
)
{
finish
();
}
});
toolbar
.
setOnMenuItemClickListener
(
this
);
BarPainter
barPainter
=
new
BarPainter
(
this
,
toolbar
);
BarPainter
barPainter
=
new
BarPainter
(
this
,
toolbar
);
barPainter
.
setDefaultColor
();
barPainter
.
setDefaultColor
();
...
@@ -89,4 +96,16 @@ public class ConferenceAdd extends ManagedActivity {
...
@@ -89,4 +96,16 @@ public class ConferenceAdd extends ManagedActivity {
outState
.
putString
(
SAVED_ACCOUNT
,
account
);
outState
.
putString
(
SAVED_ACCOUNT
,
account
);
outState
.
putString
(
SAVED_ROOM
,
room
);
outState
.
putString
(
SAVED_ROOM
,
room
);
}
}
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_add_conference
:
((
ConferenceAddFragment
)
getFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_container
)).
addConference
();
return
true
;
default
:
return
false
;
}
}
}
}
app/src/main/java/com/xabber/android/ui/ConferenceAddFragment.java
View file @
09147980
...
@@ -104,7 +104,7 @@ public class ConferenceAddFragment extends Fragment {
...
@@ -104,7 +104,7 @@ public class ConferenceAddFragment extends Fragment {
}
}
}
}
p
rivate
void
addConference
()
{
p
ublic
void
addConference
()
{
String
nick
=
nickView
.
getText
().
toString
();
String
nick
=
nickView
.
getText
().
toString
();
if
(
""
.
equals
(
nick
))
{
if
(
""
.
equals
(
nick
))
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
EMPTY_NICK_NAME
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
EMPTY_NICK_NAME
),
Toast
.
LENGTH_LONG
).
show
();
...
@@ -115,22 +115,4 @@ public class ConferenceAddFragment extends Fragment {
...
@@ -115,22 +115,4 @@ public class ConferenceAddFragment extends Fragment {
MUCManager
.
getInstance
().
createRoom
(
account
,
conferenceJid
,
nick
,
password
,
join
);
MUCManager
.
getInstance
().
createRoom
(
account
,
conferenceJid
,
nick
,
password
,
join
);
getActivity
().
finish
();
getActivity
().
finish
();
}
}
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
inflater
.
inflate
(
R
.
menu
.
add_conference
,
menu
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_add_conference
:
addConference
();
return
true
;
default
:
return
super
.
onOptionsItemSelected
(
item
);
}
}
}
}
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