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
cb412ce2
Commit
cb412ce2
authored
May 14, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/1.0.6'
parents
37a5ad52
4e4de7f5
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
486 additions
and
263 deletions
+486
-263
build.gradle
app/build.gradle
+2
-2
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-8
RoomAuthorizationError.java
...er/android/data/extension/muc/RoomAuthorizationError.java
+2
-2
AccountAdd.java
app/src/main/java/com/xabber/android/ui/AccountAdd.java
+3
-3
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+38
-55
ConferenceAdd.java
app/src/main/java/com/xabber/android/ui/ConferenceAdd.java
+119
-0
ConferenceAddFragment.java
...ain/java/com/xabber/android/ui/ConferenceAddFragment.java
+231
-0
ContactAdd.java
app/src/main/java/com/xabber/android/ui/ContactAdd.java
+3
-3
ContactList.java
app/src/main/java/com/xabber/android/ui/ContactList.java
+1
-1
GroupEditor.java
app/src/main/java/com/xabber/android/ui/GroupEditor.java
+2
-2
MUCInvite.java
app/src/main/java/com/xabber/android/ui/MUCInvite.java
+1
-1
ChatMessageAdapter.java
...ava/com/xabber/android/ui/adapter/ChatMessageAdapter.java
+1
-1
ChatExportDialogFragment.java
...om/xabber/android/ui/dialog/ChatExportDialogFragment.java
+19
-23
ContextMenuHelper.java
.../java/com/xabber/android/ui/helper/ContextMenuHelper.java
+2
-2
AccountEditor.java
...java/com/xabber/android/ui/preferences/AccountEditor.java
+3
-3
BasePhrasePreferences.java
.../xabber/android/ui/preferences/BasePhrasePreferences.java
+2
-2
ChatEditor.java
...in/java/com/xabber/android/ui/preferences/ChatEditor.java
+2
-2
ChatSettings.java
.../java/com/xabber/android/ui/preferences/ChatSettings.java
+2
-2
ConnectionSettings.java
...com/xabber/android/ui/preferences/ConnectionSettings.java
+2
-2
ContactListSettings.java
...om/xabber/android/ui/preferences/ContactListSettings.java
+2
-2
DebugSettings.java
...java/com/xabber/android/ui/preferences/DebugSettings.java
+2
-2
NotificationsSettings.java
.../xabber/android/ui/preferences/NotificationsSettings.java
+2
-2
PhraseAdder.java
...n/java/com/xabber/android/ui/preferences/PhraseAdder.java
+1
-1
PhraseEditor.java
.../java/com/xabber/android/ui/preferences/PhraseEditor.java
+1
-1
PreferenceEditor.java
...a/com/xabber/android/ui/preferences/PreferenceEditor.java
+2
-2
SecuritySettings.java
...a/com/xabber/android/ui/preferences/SecuritySettings.java
+2
-2
account_add.xml
app/src/main/res/layout/account_add.xml
+0
-22
activity_with_toolbar_and_container.xml
...c/main/res/layout/activity_with_toolbar_and_container.xml
+13
-0
conference_add_fragment.xml
app/src/main/res/layout/conference_add_fragment.xml
+25
-48
contact_add.xml
app/src/main/res/layout/contact_add.xml
+0
-35
group_editor.xml
app/src/main/res/layout/group_editor.xml
+0
-32
No files found.
app/build.gradle
View file @
cb412ce2
...
...
@@ -7,8 +7,8 @@ android {
defaultConfig
{
minSdkVersion
14
targetSdkVersion
22
versionCode
17
7
versionName
'1.0.
5
'
versionCode
17
8
versionName
'1.0.
6
'
}
compileOptions
{
...
...
app/src/main/AndroidManifest.xml
View file @
cb412ce2
...
...
@@ -19,13 +19,6 @@
<uses-feature
android:name=
"android.hardware.location"
android:required=
"false"
/>
<uses-feature
android:name=
"android.hardware.location.gps"
android:required=
"false"
/>
<uses-permission
android:name=
"android.permission.READ_CONTACTS"
/>
<uses-permission
android:name=
"android.permission.WRITE_CONTACTS"
/>
<uses-permission
android:name=
"android.permission.AUTHENTICATE_ACCOUNTS"
/>
<uses-permission
android:name=
"android.permission.MANAGE_ACCOUNTS"
/>
<uses-permission
android:name=
"android.permission.GET_ACCOUNTS"
/>
<uses-permission
android:name=
"android.permission.READ_SYNC_SETTINGS"
/>
<uses-permission
android:name=
"android.permission.WRITE_SYNC_SETTINGS"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
...
...
@@ -174,7 +167,7 @@
android:label=
"@string/account_oauth"
/>
<activity
android:name=
"
com.xabber.android.ui.MUCEditor
"
android:name=
"
.ui.ConferenceAdd
"
android:label=
"@string/muc_add"
android:parentActivityName=
"com.xabber.android.ui.ContactList"
>
...
...
app/src/main/java/com/xabber/android/data/extension/muc/RoomAuthorizationError.java
View file @
cb412ce2
...
...
@@ -20,7 +20,7 @@ import com.xabber.android.R;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.entity.BaseEntity
;
import
com.xabber.android.data.notification.EntityNotificationItem
;
import
com.xabber.android.ui.
MUCEditor
;
import
com.xabber.android.ui.
ConferenceAdd
;
public
class
RoomAuthorizationError
extends
BaseEntity
implements
EntityNotificationItem
{
...
...
@@ -31,7 +31,7 @@ public class RoomAuthorizationError extends BaseEntity implements
@Override
public
Intent
getIntent
()
{
return
MUCEditor
.
createIntent
(
Application
.
getInstance
(),
return
ConferenceAdd
.
createIntent
(
Application
.
getInstance
(),
account
,
user
);
}
...
...
app/src/main/java/com/xabber/android/ui/AccountAdd.java
View file @
cb412ce2
...
...
@@ -43,10 +43,10 @@ public class AccountAdd extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
ac
count_add
);
setContentView
(
R
.
layout
.
ac
tivity_with_toolbar_and_container
);
if
(
savedInstanceState
==
null
)
{
getSupportFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
container
,
AccountAddFragment
.
newInstance
()).
commit
();
getSupportFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
fragment_
container
,
AccountAddFragment
.
newInstance
()).
commit
();
}
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -73,7 +73,7 @@ public class AccountAdd extends ManagedActivity {
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_add_account
:
((
AccountAddFragment
)
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
container
)).
addAccount
();
((
AccountAddFragment
)
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_
container
)).
addAccount
();
return
true
;
...
...
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
cb412ce2
...
...
@@ -12,11 +12,9 @@ import android.support.v7.widget.RecyclerView;
import
android.support.v7.widget.Toolbar
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.view.ContextMenu
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -73,11 +71,11 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
private
ChatViewerFragmentListener
listener
;
private
Animation
shakeAnimation
=
null
;
private
int
contextMenuItemPosition
;
private
RecyclerView
recyclerView
;
private
View
contactTitleView
;
private
AbstractContact
abstractContact
;
private
LinearLayoutManager
layoutManager
;
private
MessageItem
clickedMessageItem
;
public
static
ChatViewerFragment
newInstance
(
String
account
,
String
user
)
{
ChatViewerFragment
fragment
=
new
ChatViewerFragment
();
...
...
@@ -361,52 +359,6 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
}
}
@Override
public
void
onCreateContextMenu
(
ContextMenu
menu
,
View
view
,
ContextMenu
.
ContextMenuInfo
menuInfo
)
{
super
.
onCreateContextMenu
(
menu
,
view
,
menuInfo
);
int
itemViewType
=
chatMessageAdapter
.
getItemViewType
(
contextMenuItemPosition
);
if
(
itemViewType
==
ChatMessageAdapter
.
VIEW_TYPE_INCOMING_MESSAGE
||
itemViewType
==
ChatMessageAdapter
.
VIEW_TYPE_OUTGOING_MESSAGE
)
{
MenuInflater
inflater
=
getActivity
().
getMenuInflater
();
inflater
.
inflate
(
R
.
menu
.
chat_context_menu
,
menu
);
if
(
chatMessageAdapter
.
getMessageItem
(
contextMenuItemPosition
).
isError
())
{
menu
.
findItem
(
R
.
id
.
action_message_repeat
).
setVisible
(
true
);
}
}
}
@Override
public
boolean
onContextItemSelected
(
MenuItem
item
)
{
final
MessageItem
message
=
chatMessageAdapter
.
getMessageItem
(
contextMenuItemPosition
);
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_message_repeat
:
sendMessage
(
message
.
getText
());
return
true
;
case
R
.
id
.
action_message_copy
:
((
ClipboardManager
)
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
))
.
setPrimaryClip
(
ClipData
.
newPlainText
(
message
.
getSpannable
(),
message
.
getSpannable
()));
return
true
;
case
R
.
id
.
action_message_quote
:
setInputText
(
"> "
+
message
.
getText
()
+
"\n"
);
return
true
;
case
R
.
id
.
action_message_remove
:
MessageManager
.
getInstance
().
removeMessage
(
message
);
updateChat
();
return
true
;
default
:
return
super
.
onContextItemSelected
(
item
);
}
}
public
void
updateChat
()
{
ContactTitleInflater
.
updateTitle
(
contactTitleView
,
getActivity
(),
abstractContact
);
int
itemCountBeforeUpdate
=
recyclerView
.
getAdapter
().
getItemCount
();
...
...
@@ -496,7 +448,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
return
true
;
case
R
.
id
.
action_authorization_settings
:
startActivity
(
MUCEditor
.
createIntent
(
getActivity
(),
account
,
user
));
startActivity
(
ConferenceAdd
.
createIntent
(
getActivity
(),
account
,
user
));
return
true
;
case
R
.
id
.
action_close_chat
:
...
...
@@ -533,6 +485,25 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
startActivity
(
OccupantList
.
createIntent
(
getActivity
(),
account
,
user
));
return
true
;
/* message popup menu */
case
R
.
id
.
action_message_repeat
:
sendMessage
(
clickedMessageItem
.
getText
());
return
true
;
case
R
.
id
.
action_message_copy
:
((
ClipboardManager
)
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
))
.
setPrimaryClip
(
ClipData
.
newPlainText
(
clickedMessageItem
.
getSpannable
(),
clickedMessageItem
.
getSpannable
()));
return
true
;
case
R
.
id
.
action_message_quote
:
setInputText
(
"> "
+
clickedMessageItem
.
getText
()
+
"\n"
);
return
true
;
case
R
.
id
.
action_message_remove
:
MessageManager
.
getInstance
().
removeMessage
(
clickedMessageItem
);
updateChat
();
return
true
;
default
:
return
false
;
...
...
@@ -608,11 +579,23 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
@Override
public
void
onMessageClick
(
View
caller
,
int
position
)
{
registerForContextMenu
(
caller
);
this
.
contextMenuItemPosition
=
position
;
caller
.
setOnCreateContextMenuListener
(
this
);
caller
.
showContextMenu
();
unregisterForContextMenu
(
caller
);
int
itemViewType
=
chatMessageAdapter
.
getItemViewType
(
position
);
if
(
itemViewType
==
ChatMessageAdapter
.
VIEW_TYPE_INCOMING_MESSAGE
||
itemViewType
==
ChatMessageAdapter
.
VIEW_TYPE_OUTGOING_MESSAGE
)
{
clickedMessageItem
=
chatMessageAdapter
.
getMessageItem
(
position
);
PopupMenu
popup
=
new
PopupMenu
(
getActivity
(),
caller
);
popup
.
inflate
(
R
.
menu
.
chat_context_menu
);
popup
.
setOnMenuItemClickListener
(
this
);
if
(
chatMessageAdapter
.
getMessageItem
(
position
).
isError
())
{
popup
.
getMenu
().
findItem
(
R
.
id
.
action_message_repeat
).
setVisible
(
true
);
}
popup
.
show
();
}
}
public
void
playIncomingAnimation
()
{
...
...
app/src/main/java/com/xabber/android/ui/ConferenceAdd.java
0 → 100644
View file @
cb412ce2
/**
* Copyright (c) 2013, Redsolution LTD. All rights reserved.
*
* This file is part of Xabber project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, Version 3.
*
* Xabber is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License,
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package
com
.
xabber
.
android
.
ui
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
com.xabber.android.R
;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.intent.AccountIntentBuilder
;
import
com.xabber.android.data.intent.EntityIntentBuilder
;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
java.util.Collection
;
public
class
ConferenceAdd
extends
ManagedActivity
implements
ConferenceAddFragment
.
Listener
{
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
BarPainter
barPainter
;
private
String
account
;
private
String
room
;
public
static
Intent
createIntent
(
Context
context
)
{
return
ConferenceAdd
.
createIntent
(
context
,
null
,
null
);
}
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
room
)
{
return
new
EntityIntentBuilder
(
context
,
ConferenceAdd
.
class
).
setAccount
(
account
).
setUser
(
room
).
build
();
}
private
static
String
getAccount
(
Intent
intent
)
{
return
AccountIntentBuilder
.
getAccount
(
intent
);
}
private
static
String
getUser
(
Intent
intent
)
{
return
EntityIntentBuilder
.
getUser
(
intent
);
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
isFinishing
())
{
return
;
}
setContentView
(
R
.
layout
.
activity_with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
setTitle
(
null
);
setSupportActionBar
(
toolbar
);
barPainter
=
new
BarPainter
(
this
,
toolbar
);
barPainter
.
setDefaultColor
();
Intent
intent
=
getIntent
();
account
=
null
;
room
=
null
;
if
(
savedInstanceState
!=
null
)
{
account
=
savedInstanceState
.
getString
(
SAVED_ACCOUNT
);
room
=
savedInstanceState
.
getString
(
SAVED_ROOM
);
}
else
{
account
=
getAccount
(
intent
);
room
=
getUser
(
intent
);
}
if
(
account
==
null
)
{
Collection
<
String
>
accounts
=
AccountManager
.
getInstance
().
getAccounts
();
if
(
accounts
.
size
()
==
1
)
{
account
=
accounts
.
iterator
().
next
();
}
}
if
(
account
!=
null
)
{
barPainter
.
updateWithAccountName
(
account
);
}
if
(
savedInstanceState
==
null
)
{
getFragmentManager
()
.
beginTransaction
()
.
add
(
R
.
id
.
fragment_container
,
ConferenceAddFragment
.
newInstance
(
account
,
room
))
.
commit
();
}
}
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
outState
.
putString
(
SAVED_ACCOUNT
,
account
);
outState
.
putString
(
SAVED_ROOM
,
room
);
}
@Override
public
void
onAccountSelected
(
String
account
)
{
barPainter
.
updateWithAccountName
(
account
);
this
.
account
=
account
;
}
}
app/src/main/java/com/xabber/android/ui/
MUCEditor
.java
→
app/src/main/java/com/xabber/android/ui/
ConferenceAddFragment
.java
View file @
cb412ce2
/**
* Copyright (c) 2013, Redsolution LTD. All rights reserved.
*
* This file is part of Xabber project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, Version 3.
*
* Xabber is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License,
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package
com
.
xabber
.
android
.
ui
;
import
android.
content.Context
;
import
android.
content.Int
ent
;
import
android.
app.Activity
;
import
android.
app.Fragm
ent
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
android.support.annotation.Nullable
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView.OnItemSelectedListener
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.Spinner
;
...
...
@@ -33,123 +20,92 @@ import com.xabber.android.R;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.extension.muc.MUCManager
;
import
com.xabber.android.data.extension.muc.RoomInvite
;
import
com.xabber.android.data.intent.AccountIntentBuilder
;
import
com.xabber.android.data.intent.EntityIntentBuilder
;
import
com.xabber.android.data.message.MessageManager
;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.ui.adapter.AccountChooseAdapter
;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
org.jivesoftware.smack.util.StringUtils
;
import
java.util.Collection
;
public
class
ConferenceAddFragment
extends
Fragment
implements
AdapterView
.
OnItemSelectedListener
{
public
class
MUCEditor
extends
ManagedActivity
implements
OnItemSelectedListener
{
protected
static
final
String
ARG_ACCOUNT
=
"com.xabber.android.ui.ConferenceAddFragment.ARG_ACCOUNT"
;
protected
static
final
String
ARG_ROOM
=
"com.xabber.android.ui.ConferenceAddFragment.ARG_ROOM"
;
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
String
account
;
private
String
room
;
/**
* Last selected account.
*/
private
int
selectedAccount
;
/**
* Views.
*/
private
Spinner
accountView
;
private
EditText
serverView
;
private
EditText
roomView
;
private
EditText
nickView
;
private
EditText
passwordView
;
private
CheckBox
joinCheckBox
;
private
BarPainter
barPainter
;
private
int
selectedAccount
;
public
static
Intent
createIntent
(
Context
context
)
{
return
MUCEditor
.
createIntent
(
context
,
null
,
null
);
}
private
String
account
=
null
;
private
String
room
=
null
;
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
room
)
{
return
new
EntityIntentBuilder
(
context
,
MUCEditor
.
class
).
setAccount
(
account
).
setUser
(
room
).
build
();
}
private
Listener
listener
;
private
static
String
getAccount
(
Intent
intent
)
{
return
AccountIntentBuilder
.
getAccount
(
intent
);
public
static
ConferenceAddFragment
newInstance
(
String
account
,
String
room
)
{
ConferenceAddFragment
fragment
=
new
ConferenceAddFragment
();
Bundle
args
=
new
Bundle
();
args
.
putString
(
ARG_ACCOUNT
,
account
);
args
.
putString
(
ARG_ROOM
,
room
);
fragment
.
setArguments
(
args
);
return
fragment
;
}
private
static
String
getUser
(
Intent
intent
)
{
return
EntityIntentBuilder
.
getUser
(
intent
);
@Override
public
void
onAttach
(
Activity
activity
)
{
super
.
onAttach
(
activity
);
listener
=
(
Listener
)
activity
;
}
@Override
p
rotected
void
onCreate
(
Bundle
savedInstanceState
)
{
p
ublic
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
isFinishing
())
{
return
;
}
setContentView
(
R
.
layout
.
muc_editor
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
setTitle
(
null
);
if
(
getArguments
()
!=
null
)
{
account
=
getArguments
().
getString
(
ARG_ACCOUNT
);
room
=
getArguments
().
getString
(
ARG_ROOM
);
}
}
setSupportActionBar
(
toolbar
);
barPainter
=
new
BarPainter
(
this
,
toolbar
);
barPainter
.
setDefaultColor
();
@Nullable
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
conference_add_fragment
,
container
,
false
);
accountView
=
(
Spinner
)
findViewById
(
R
.
id
.
contact_account
);
serverView
=
(
EditText
)
findViewById
(
R
.
id
.
muc_server
);
roomView
=
(
EditText
)
findViewById
(
R
.
id
.
muc_room
);
nickView
=
(
EditText
)
findViewById
(
R
.
id
.
muc_nick
);
passwordView
=
(
EditText
)
findViewById
(
R
.
id
.
muc_password
);
accountView
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
contact_account
);
serverView
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
muc_server
);
roomView
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
muc_room
);
nickView
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
muc_nick
);
passwordView
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
muc_password
);
joinCheckBox
=
(
CheckBox
)
view
.
findViewById
(
R
.
id
.
muc_join
);
accountView
.
setAdapter
(
new
AccountChooseAdapter
(
this
));
accountView
.
setAdapter
(
new
AccountChooseAdapter
(
getActivity
()
));
accountView
.
setOnItemSelectedListener
(
this
);
Intent
intent
=
getIntent
();
if
(
savedInstanceState
!=
null
)
{
account
=
savedInstanceState
.
getString
(
SAVED_ACCOUNT
);
room
=
savedInstanceState
.
getString
(
SAVED_ROOM
);
}
else
{
account
=
getAccount
(
intent
);
room
=
getUser
(
intent
);
if
(
room
!=
null
)
{
serverView
.
setText
(
StringUtils
.
parseServer
(
room
));
roomView
.
setText
(
StringUtils
.
parseName
(
room
));
}
if
(
account
!=
null
&&
room
!=
null
)
{
MUCManager
.
getInstance
()
.
removeAuthorizationError
(
account
,
room
);
nickView
.
setText
(
MUCManager
.
getInstance
().
getNickname
(
account
,
room
));
String
password
;
RoomInvite
roomInvite
=
MUCManager
.
getInstance
().
getInvite
(
account
,
room
);
if
(
roomInvite
!=
null
)
{
password
=
roomInvite
.
getPassword
();
}
else
{
password
=
MUCManager
.
getInstance
().
getPassword
(
account
,
room
);
}
passwordView
.
setText
(
password
);
}
if
(
room
!=
null
)
{
serverView
.
setText
(
StringUtils
.
parseServer
(
room
));
roomView
.
setText
(
StringUtils
.
parseName
(
room
));
}
if
(
account
==
null
)
{
Collection
<
String
>
accounts
=
AccountManager
.
getInstance
().
getAccounts
();
if
(
accounts
.
size
()
==
1
)
{
account
=
accounts
.
iterator
().
next
();
if
(
account
!=
null
&&
room
!=
null
)
{
MUCManager
.
getInstance
().
removeAuthorizationError
(
account
,
room
);
nickView
.
setText
(
MUCManager
.
getInstance
().
getNickname
(
account
,
room
));
String
password
;
RoomInvite
roomInvite
=
MUCManager
.
getInstance
().
getInvite
(
account
,
room
);
if
(
roomInvite
!=
null
)
{
password
=
roomInvite
.
getPassword
();
}
else
{
password
=
MUCManager
.
getInstance
().
getPassword
(
account
,
room
);
}
passwordView
.
setText
(
password
);
}
if
(
account
!=
null
)
{
barPainter
.
updateWithAccountName
(
account
);
for
(
int
position
=
0
;
position
<
accountView
.
getCount
();
position
++)
{
if
(
account
.
equals
(
accountView
.
getItemAtPosition
(
position
)))
{
accountView
.
setSelection
(
position
);
...
...
@@ -161,65 +117,85 @@ public class MUCEditor extends ManagedActivity implements OnItemSelectedListener
nickView
.
setText
(
getNickname
(((
String
)
accountView
.
getSelectedItem
())));
}
}
setHasOptionsMenu
(
true
);
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
account
=
(
String
)
accountView
.
getSelectedItem
();
outState
.
putString
(
SAVED_ACCOUNT
,
account
);
outState
.
putString
(
SAVED_ROOM
,
room
);
return
view
;
}
@Override
p
rotected
void
onResume
()
{
p
ublic
void
onResume
()
{
super
.
onResume
();
selectedAccount
=
accountView
.
getSelectedItemPosition
();
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
MenuInflater
inflater
=
getMenuInflater
();
inflater
.
inflate
(
R
.
menu
.
add_conference
,
menu
);
public
void
onDetach
()
{
super
.
onDetach
();
listener
=
null
;
}
return
true
;
@Override
public
void
onItemSelected
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
String
current
=
nickView
.
getText
().
toString
();
String
previous
;
if
(
selectedAccount
==
AdapterView
.
INVALID_POSITION
)
{
previous
=
""
;
}
else
{
previous
=
getNickname
((
String
)
accountView
.
getAdapter
().
getItem
(
selectedAccount
));
}
if
(
current
.
equals
(
previous
))
{
nickView
.
setText
(
getNickname
((
String
)
accountView
.
getSelectedItem
()));
}
selectedAccount
=
accountView
.
getSelectedItemPosition
();
listener
.
onAccountSelected
((
String
)
accountView
.
getSelectedItem
());
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_add_conference
:
addConference
();
return
true
;
public
void
onNothingSelected
(
AdapterView
<?>
parent
)
{
selectedAccount
=
accountView
.
getSelectedItemPosition
();
}
default
:
return
super
.
onOptionsItemSelected
(
item
);
/**
* @param account
* @return Suggested nickname in the room.
*/
private
String
getNickname
(
String
account
)
{
if
(
account
==
null
)
{
return
""
;
}
String
nickname
=
AccountManager
.
getInstance
().
getNickName
(
account
);
String
name
=
StringUtils
.
parseName
(
nickname
);
if
(
""
.
equals
(
name
))
{
return
nickname
;
}
else
{
return
name
;
}
}
private
void
addConference
()
{
String
account
=
(
String
)
accountView
.
getSelectedItem
();
if
(
account
==
null
)
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
EMPTY_ACCOUNT
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
()
,
getString
(
R
.
string
.
EMPTY_ACCOUNT
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
String
server
=
serverView
.
getText
().
toString
();
if
(
""
.
equals
(
server
))
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
EMPTY_SERVER_NAME
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
()
,
getString
(
R
.
string
.
EMPTY_SERVER_NAME
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
String
room
=
roomView
.
getText
().
toString
();
if
(
""
.
equals
(
room
))
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
EMPTY_ROOM_NAME
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
()
,
getString
(
R
.
string
.
EMPTY_ROOM_NAME
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
String
nick
=
nickView
.
getText
().
toString
();
if
(
""
.
equals
(
nick
))
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
EMPTY_NICK_NAME
),
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
()
,
getString
(
R
.
string
.
EMPTY_NICK_NAME
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
String
password
=
passwordView
.
getText
().
toString
();
boolean
join
=
((
CheckBox
)
findViewById
(
R
.
id
.
muc_join
))
.
isChecked
();
boolean
join
=
joinCheckBox
.
isChecked
();
room
=
room
+
"@"
+
server
;
if
(
this
.
account
!=
null
&&
this
.
room
!=
null
)
{
if
(!
account
.
equals
(
this
.
account
)
||
!
room
.
equals
(
this
.
room
))
{
...
...
@@ -229,45 +205,27 @@ public class MUCEditor extends ManagedActivity implements OnItemSelectedListener
}
}
MUCManager
.
getInstance
().
createRoom
(
account
,
room
,
nick
,
password
,
join
);
finish
();
getActivity
().
finish
();
}
/**
* @param account
* @return Suggested nickname in the room.
*/
private
String
getNickname
(
String
account
)
{
if
(
account
==
null
)
{
return
""
;
}
String
nickname
=
AccountManager
.
getInstance
().
getNickName
(
account
);
String
name
=
StringUtils
.
parseName
(
nickname
);
if
(
""
.
equals
(
name
))
{
return
nickname
;
}
else
{
return
name
;
}
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
inflater
.
inflate
(
R
.
menu
.
add_conference
,
menu
);
}
@Override
public
void
onItemSelected
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
String
current
=
nickView
.
getText
().
toString
();
String
previous
;
if
(
selectedAccount
==
AdapterView
.
INVALID_POSITION
)
{
previous
=
""
;
}
else
{
previous
=
getNickname
((
String
)
accountView
.
getAdapter
().
getItem
(
selectedAccount
));
}
if
(
current
.
equals
(
previous
))
{
nickView
.
setText
(
getNickname
((
String
)
accountView
.
getSelectedItem
()));
}
selectedAccount
=
accountView
.
getSelectedItemPosition
();
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_add_conference
:
addConference
();
return
true
;
barPainter
.
updateWithAccountName
((
String
)
accountView
.
getSelectedItem
());
default
:
return
super
.
onOptionsItemSelected
(
item
);
}
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
parent
)
{
selectedAccount
=
accountView
.
getSelectedItemPosition
();
interface
Listener
{
void
onAccountSelected
(
String
account
);
}
}
app/src/main/java/com/xabber/android/ui/ContactAdd.java
View file @
cb412ce2
...
...
@@ -55,7 +55,7 @@ public class ContactAdd extends ManagedActivity implements ContactAddFragment.Li
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
contact_add
);
setContentView
(
R
.
layout
.
activity_with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
setTitle
(
null
);
...
...
@@ -70,14 +70,14 @@ public class ContactAdd extends ManagedActivity implements ContactAddFragment.Li
if
(
savedInstanceState
==
null
)
{
getSupportFragmentManager
()
.
beginTransaction
()
.
add
(
R
.
id
.
container
,
ContactAddFragment
.
newInstance
(
getAccount
(
intent
),
getUser
(
intent
)))
.
add
(
R
.
id
.
fragment_
container
,
ContactAddFragment
.
newInstance
(
getAccount
(
intent
),
getUser
(
intent
)))
.
commit
();
}
}
private
void
addContact
()
{
((
ContactAddFragment
)
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
container
)).
addContact
();
((
ContactAddFragment
)
getSupportFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_
container
)).
addContact
();
}
@Override
...
...
app/src/main/java/com/xabber/android/ui/ContactList.java
View file @
cb412ce2
...
...
@@ -414,7 +414,7 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
closeAllChats
();
return
true
;
case
R
.
id
.
action_join_conference
:
startActivity
(
MUCEditor
.
createIntent
(
this
));
startActivity
(
ConferenceAdd
.
createIntent
(
this
));
return
true
;
case
R
.
id
.
action_chat_list
:
startActivity
(
ChatViewer
.
createRecentChatsIntent
(
this
));
...
...
app/src/main/java/com/xabber/android/ui/GroupEditor.java
View file @
cb412ce2
...
...
@@ -59,7 +59,7 @@ public class GroupEditor extends ManagedActivity implements OnContactChangedList
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
group_edito
r
);
setContentView
(
R
.
layout
.
activity_with_toolbar_and_containe
r
);
contactTitleActionBarInflater
=
new
ContactTitleActionBarInflater
(
this
,
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
));
contactTitleActionBarInflater
.
setUpActionBarView
();
...
...
@@ -75,7 +75,7 @@ public class GroupEditor extends ManagedActivity implements OnContactChangedList
if
(
savedInstanceState
==
null
)
{
getSupportFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
container
,
GroupEditorFragment
.
newInstance
(
account
,
user
)).
commit
();
.
add
(
R
.
id
.
fragment_
container
,
GroupEditorFragment
.
newInstance
(
account
,
user
)).
commit
();
}
}
...
...
app/src/main/java/com/xabber/android/ui/MUCInvite.java
View file @
cb412ce2
...
...
@@ -67,7 +67,7 @@ public class MUCInvite extends ManagedDialog {
@Override
public
void
onAccept
()
{
super
.
onAccept
();
startActivity
(
MUCEditor
.
createIntent
(
this
,
account
,
room
));
startActivity
(
ConferenceAdd
.
createIntent
(
this
,
account
,
room
));
finish
();
}
...
...
app/src/main/java/com/xabber/android/ui/adapter/ChatMessageAdapter.java
View file @
cb412ce2
...
...
@@ -318,7 +318,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
@Override
public
void
onClick
(
View
v
)
{
onClickListener
.
onMessageClick
(
v
,
getPosition
());
onClickListener
.
onMessageClick
(
messageBalloon
,
getPosition
());
}
public
interface
MessageClickListener
{
...
...
app/src/main/java/com/xabber/android/ui/dialog/ChatExportDialogFragment.java
View file @
cb412ce2
...
...
@@ -14,6 +14,7 @@
*/
package
com
.
xabber
.
android
.
ui
.
dialog
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.app.AlertDialog.Builder
;
import
android.app.DialogFragment
;
...
...
@@ -42,29 +43,26 @@ public class ChatExportDialogFragment extends ConfirmDialogFragment {
private
String
user
;
private
EditText
nameView
;
private
CheckBox
sendView
;
private
Activity
activity
;
/**
* @param account
* @param user
* @return
*/
public
static
DialogFragment
newInstance
(
String
account
,
String
user
)
{
return
new
ChatExportDialogFragment
().
putAgrument
(
ACCOUNT
,
account
).
putAgrument
(
USER
,
user
);
}
@Override
protected
Builder
getBuilder
()
{
activity
=
getActivity
();
account
=
getArguments
().
getString
(
ACCOUNT
);
user
=
getArguments
().
getString
(
USER
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
()
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
activity
);
builder
.
setTitle
(
R
.
string
.
export_chat_title
);
View
layout
=
getActivity
().
getLayoutInflater
().
inflate
(
R
.
layout
.
export_chat
,
null
);
View
layout
=
activity
.
getLayoutInflater
().
inflate
(
R
.
layout
.
export_chat
,
null
);
nameView
=
(
EditText
)
layout
.
findViewById
(
R
.
id
.
name
);
sendView
=
(
CheckBox
)
layout
.
findViewById
(
R
.
id
.
send
);
nameView
.
setText
(
getString
(
R
.
string
.
export_chat_mask
,
AccountManager
.
getInstance
().
getVerboseName
(
account
),
RosterManager
.
getInstance
().
getName
(
account
,
user
)));
nameView
.
setText
(
getString
(
R
.
string
.
export_chat_mask
,
AccountManager
.
getInstance
().
getVerboseName
(
account
),
RosterManager
.
getInstance
().
getName
(
account
,
user
)));
builder
.
setView
(
layout
);
return
builder
;
}
...
...
@@ -72,10 +70,10 @@ public class ChatExportDialogFragment extends ConfirmDialogFragment {
@Override
protected
boolean
onPositiveClick
()
{
String
name
=
nameView
.
getText
().
toString
();
if
(
""
.
equals
(
name
))
if
(
""
.
equals
(
name
))
{
return
false
;
new
ChatExportAsyncTask
(
account
,
user
,
name
,
sendView
.
isChecked
())
.
execute
();
}
new
ChatExportAsyncTask
(
account
,
user
,
name
,
sendView
.
isChecked
())
.
execute
();
return
true
;
}
...
...
@@ -86,8 +84,7 @@ public class ChatExportDialogFragment extends ConfirmDialogFragment {
private
final
String
name
;
private
final
boolean
send
;
public
ChatExportAsyncTask
(
String
account
,
String
user
,
String
name
,
boolean
send
)
{
public
ChatExportAsyncTask
(
String
account
,
String
user
,
String
name
,
boolean
send
)
{
this
.
account
=
account
;
this
.
user
=
user
;
this
.
name
=
name
;
...
...
@@ -97,8 +94,7 @@ public class ChatExportDialogFragment extends ConfirmDialogFragment {
@Override
protected
File
doInBackground
(
Void
...
params
)
{
try
{
return
MessageManager
.
getInstance
().
exportChat
(
account
,
user
,
name
);
return
MessageManager
.
getInstance
().
exportChat
(
account
,
user
,
name
);
}
catch
(
NetworkException
e
)
{
Application
.
getInstance
().
onError
(
e
);
return
null
;
...
...
@@ -107,19 +103,19 @@ public class ChatExportDialogFragment extends ConfirmDialogFragment {
@Override
public
void
onPostExecute
(
File
result
)
{
if
(
result
==
null
)
if
(
result
==
null
||
activity
==
null
)
{
return
;
}
// TODO: Use notification bar to notify about success.
if
(
send
)
{
Intent
intent
=
new
Intent
(
android
.
content
.
Intent
.
ACTION_SEND
);
intent
.
setType
(
"text/plain"
);
Uri
uri
=
Uri
.
fromFile
(
result
);
intent
.
putExtra
(
android
.
content
.
Intent
.
EXTRA_STREAM
,
uri
);
startActivity
(
Intent
.
createChooser
(
intent
,
getString
(
R
.
string
.
export_chat
)));
activity
.
startActivity
(
Intent
.
createChooser
(
intent
,
activity
.
getString
(
R
.
string
.
export_chat
)));
}
else
{
Toast
.
makeText
(
getActivity
(),
R
.
string
.
export_chat_done
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
R
.
string
.
export_chat_done
,
Toast
.
LENGTH_LONG
).
show
();
}
}
...
...
app/src/main/java/com/xabber/android/ui/helper/ContextMenuHelper.java
View file @
cb412ce2
...
...
@@ -38,11 +38,11 @@ import com.xabber.android.data.roster.GroupManager;
import
com.xabber.android.data.roster.PresenceManager
;
import
com.xabber.android.data.roster.ShowOfflineMode
;
import
com.xabber.android.ui.ChatViewer
;
import
com.xabber.android.ui.ConferenceAdd
;
import
com.xabber.android.ui.ContactAdd
;
import
com.xabber.android.ui.ContactEditor
;
import
com.xabber.android.ui.ContactViewer
;
import
com.xabber.android.ui.GroupEditor
;
import
com.xabber.android.ui.MUCEditor
;
import
com.xabber.android.ui.StatusEditor
;
import
com.xabber.android.ui.adapter.UpdatableAdapter
;
import
com.xabber.android.ui.dialog.ContactDeleteDialogFragment
;
...
...
@@ -81,7 +81,7 @@ public class ContextMenuHelper {
if
(
MUCManager
.
getInstance
().
hasRoom
(
account
,
user
))
{
if
(!
MUCManager
.
getInstance
().
inUse
(
account
,
user
))
menu
.
add
(
R
.
string
.
muc_edit
).
setIntent
(
MUCEditor
.
createIntent
(
activity
,
account
,
user
));
ConferenceAdd
.
createIntent
(
activity
,
account
,
user
));
menu
.
add
(
R
.
string
.
muc_delete
).
setOnMenuItemClickListener
(
new
MenuItem
.
OnMenuItemClickListener
()
{
@Override
...
...
app/src/main/java/com/xabber/android/ui/preferences/AccountEditor.java
View file @
cb412ce2
...
...
@@ -71,12 +71,12 @@ public class AccountEditor extends ManagedActivity implements
token
=
accountItem
.
getConnectionSettings
().
getPassword
();
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
AccountEditorFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
AccountEditorFragment
()).
commit
();
}
else
{
token
=
savedInstanceState
.
getString
(
SAVED_TOKEN
);
}
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
setSupportActionBar
(
toolbar
);
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
...
...
@@ -109,7 +109,7 @@ public class AccountEditor extends ManagedActivity implements
}
((
AccountEditorFragment
)
getFragmentManager
().
findFragmentById
(
R
.
id
.
preferences_activity
_container
)).
onOAuthChange
();
R
.
id
.
fragment
_container
)).
onOAuthChange
();
}
}
}
...
...
app/src/main/java/com/xabber/android/ui/preferences/BasePhrasePreferences.java
View file @
cb412ce2
...
...
@@ -18,7 +18,7 @@ public abstract class BasePhrasePreferences extends ManagedActivity
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -30,7 +30,7 @@ public abstract class BasePhrasePreferences extends ManagedActivity
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
PhraseEditorFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
PhraseEditorFragment
()).
commit
();
}
}
...
...
app/src/main/java/com/xabber/android/ui/preferences/ChatEditor.java
View file @
cb412ce2
...
...
@@ -62,7 +62,7 @@ public class ChatEditor extends ManagedActivity
return
;
}
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
setSupportActionBar
(
toolbar
);
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
...
...
@@ -72,7 +72,7 @@ public class ChatEditor extends ManagedActivity
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
ChatEditorFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
ChatEditorFragment
()).
commit
();
}
}
...
...
app/src/main/java/com/xabber/android/ui/preferences/ChatSettings.java
View file @
cb412ce2
...
...
@@ -16,7 +16,7 @@ public class ChatSettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -31,7 +31,7 @@ public class ChatSettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
ChatSettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
ChatSettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/ConnectionSettings.java
View file @
cb412ce2
...
...
@@ -16,7 +16,7 @@ public class ConnectionSettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -31,7 +31,7 @@ public class ConnectionSettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
ConnectionSettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
ConnectionSettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/ContactListSettings.java
View file @
cb412ce2
...
...
@@ -15,7 +15,7 @@ public class ContactListSettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -30,7 +30,7 @@ public class ContactListSettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
ContactListSettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
ContactListSettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/DebugSettings.java
View file @
cb412ce2
...
...
@@ -16,7 +16,7 @@ public class DebugSettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -31,7 +31,7 @@ public class DebugSettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
DebugSettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
DebugSettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/NotificationsSettings.java
View file @
cb412ce2
...
...
@@ -17,7 +17,7 @@ public class NotificationsSettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -32,7 +32,7 @@ public class NotificationsSettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
NotificationsSettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
NotificationsSettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/PhraseAdder.java
View file @
cb412ce2
...
...
@@ -36,7 +36,7 @@ public class PhraseAdder extends BasePhrasePreferences {
case
R
.
id
.
action_save
:
boolean
success
=
((
PhraseEditorFragment
)
getFragmentManager
()
.
findFragmentById
(
R
.
id
.
preferences_activity
_container
)).
saveChanges
();
.
findFragmentById
(
R
.
id
.
fragment
_container
)).
saveChanges
();
if
(
success
)
{
finish
();
...
...
app/src/main/java/com/xabber/android/ui/preferences/PhraseEditor.java
View file @
cb412ce2
...
...
@@ -67,7 +67,7 @@ public class PhraseEditor extends BasePhrasePreferences {
super
.
onPause
();
((
PhraseEditorFragment
)
getFragmentManager
()
.
findFragmentById
(
R
.
id
.
preferences_activity
_container
)).
saveChanges
();
.
findFragmentById
(
R
.
id
.
fragment
_container
)).
saveChanges
();
}
private
Integer
getPhraseIndex
(
Intent
intent
)
{
...
...
app/src/main/java/com/xabber/android/ui/preferences/PreferenceEditor.java
View file @
cb412ce2
...
...
@@ -40,7 +40,7 @@ public class PreferenceEditor extends ManagedActivity
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
setSupportActionBar
(
toolbar
);
barPainter
=
new
BarPainter
(
this
,
toolbar
);
...
...
@@ -48,7 +48,7 @@ public class PreferenceEditor extends ManagedActivity
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
PreferencesFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
PreferencesFragment
()).
commit
();
}
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
...
...
app/src/main/java/com/xabber/android/ui/preferences/SecuritySettings.java
View file @
cb412ce2
...
...
@@ -16,7 +16,7 @@ public class SecuritySettings extends ManagedActivity {
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_
preferences
);
setContentView
(
R
.
layout
.
activity_
with_toolbar_and_container
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
...
...
@@ -31,7 +31,7 @@ public class SecuritySettings extends ManagedActivity {
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity
_container
,
new
SecuritySettingsFragment
()).
commit
();
.
add
(
R
.
id
.
fragment
_container
,
new
SecuritySettingsFragment
()).
commit
();
}
}
}
app/src/main/res/layout/account_add.xml
deleted
100644 → 0
View file @
37a5ad52
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/toolbar_default"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_alignParentTop=
"true"
android:id=
"@+id/toolbar_default"
/>
<FrameLayout
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/toolbar_default"
>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/activity_
preferences
.xml
→
app/src/main/res/layout/activity_
with_toolbar_and_container
.xml
View file @
cb412ce2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<include
layout=
"@layout/toolbar_default"
/>
<include
layout=
"@layout/toolbar_default"
/>
<RelativeLayout
android:id=
"@+id/fragment_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/preferences_activity_container"
/>
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/
muc_editor
.xml
→
app/src/main/res/layout/
conference_add_fragment
.xml
View file @
cb412ce2
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/toolbar_default"
/>
android:layout_height=
"match_parent"
>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:padding=
"16dp"
>
android:layout_below=
"@+id/toolbar_default"
android:orientation=
"vertical"
android:padding=
"16dp"
>
<TextView
android:text=
"@string/contact_account"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:text=
"@string/contact_account"
/>
<com.xabber.android.ui.widget.NoDefaultSpinner
android:id=
"@+id/contact_account"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:prompt=
"@string/choose_account"
/>
android:prompt=
"@string/choose_account"
/>
<TextView
android:text=
"@string/muc_server"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:text=
"@string/muc_server"
/>
<EditText
android:id=
"@+id/muc_server"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/muc_server_hint"
android:singleLine=
"true"
android:inputType=
"textEmailAddress"
/>
android:singleLine=
"true"
/>
<TextView
android:text=
"@string/muc_room"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:text=
"@string/muc_room"
/>
<EditText
android:id=
"@+id/muc_room"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
<TextView
android:text=
"@string/muc_nick"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:text=
"@string/muc_nick"
/>
<EditText
android:id=
"@+id/muc_nick"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:hint=
"@string/muc_nick_hint"
/>
android:singleLine=
"true"
/>
<TextView
android:text=
"@string/muc_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:text=
"@string/muc_password"
/>
<EditText
android:id=
"@+id/muc_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:password=
"true"
android:singleLine=
"true"
android:hint=
"@string/muc_password_hint"
/>
android:inputType=
"textPassword"
android:singleLine=
"true"
/>
<CheckBox
android:id=
"@+id/muc_join"
android:checked=
"true"
android:text=
"@string/muc_join"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:checked=
"true"
android:text=
"@string/muc_join"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
app/src/main/res/layout/contact_add.xml
deleted
100644 → 0
View file @
37a5ad52
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/toolbar_default"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_alignParentTop=
"true"
android:id=
"@+id/toolbar_default"
/>
<FrameLayout
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/toolbar_default"
>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/group_editor.xml
deleted
100644 → 0
View file @
37a5ad52
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/toolbar_default"
android:id=
"@+id/toolbar_default"
/>
<FrameLayout
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/toolbar_default"
>
</FrameLayout>
</RelativeLayout>
\ 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