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
5828a694
Commit
5828a694
authored
Apr 06, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several unused adapter and dialog classes removed.
parent
a1e95b4f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
489 deletions
+0
-489
OnTextChangedListener.java
.../com/xabber/android/ui/adapter/OnTextChangedListener.java
+0
-28
SaveStateAdapter.java
.../java/com/xabber/android/ui/adapter/SaveStateAdapter.java
+0
-52
AccountChooseDialogBuilder.java
.../xabber/android/ui/dialog/AccountChooseDialogBuilder.java
+0
-81
ExportChatDialogBuilder.java
...com/xabber/android/ui/dialog/ExportChatDialogBuilder.java
+0
-65
GroupAddDialogBuilder.java
...a/com/xabber/android/ui/dialog/GroupAddDialogBuilder.java
+0
-64
GroupAddDialogFragment.java
.../com/xabber/android/ui/dialog/GroupAddDialogFragment.java
+0
-79
GroupRenameDialogBuilder.java
...om/xabber/android/ui/dialog/GroupRenameDialogBuilder.java
+0
-55
StatusPreference.java
...n/java/com/xabber/android/ui/widget/StatusPreference.java
+0
-65
No files found.
app/src/main/java/com/xabber/android/ui/adapter/OnTextChangedListener.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
adapter
;
import
android.widget.EditText
;
/**
* Listener for text to be changed.
*
* @author alexander.ivanov
*/
public
interface
OnTextChangedListener
{
void
onTextChanged
(
EditText
editText
,
CharSequence
text
);
}
app/src/main/java/com/xabber/android/ui/adapter/SaveStateAdapter.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
adapter
;
import
android.view.View
;
import
android.widget.Adapter
;
/**
* Adapter that can save state of view on activity paused or on element removed
* from layout.
* <p/>
* Warning: This interface is to be removed.
*
* @author alexander.ivanov
*/
public
interface
SaveStateAdapter
extends
Adapter
{
/**
* Will be called before view will replaced with another or before activity
* will be paused.
*
* @param view
*/
void
saveState
(
View
view
);
/**
* Requests to hide pages indicator.
*
* @param view
*/
void
hidePages
(
View
view
);
/**
* Show pages indicator.
*
* @param view
*/
void
showPages
(
View
view
);
}
app/src/main/java/com/xabber/android/ui/dialog/AccountChooseDialogBuilder.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
dialog
;
import
java.util.ArrayList
;
import
android.app.Activity
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface.OnClickListener
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.xabber.android.data.roster.RosterContact
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.adapter.AccountChooseAdapter
;
public
class
AccountChooseDialogBuilder
extends
ListenableDialogBuilder
{
private
final
String
user
;
private
String
selected
;
public
AccountChooseDialogBuilder
(
Activity
activity
,
int
dialogId
,
final
ConfirmDialogListener
listener
,
String
user
)
{
super
(
activity
,
dialogId
);
this
.
user
=
user
;
this
.
selected
=
null
;
setOnCancelListener
(
listener
);
setOnDeclineListener
(
listener
);
final
Adapter
adapter
=
new
Adapter
(
activity
);
setSingleChoiceItems
(
adapter
,
-
1
,
new
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
selected
=
(
String
)
adapter
.
getItem
(
which
);
dialog
.
dismiss
();
listener
.
onAccept
(
AccountChooseDialogBuilder
.
this
);
}
});
}
/**
* @return <code>null</code> can be returned.
*/
public
String
getSelected
()
{
return
selected
;
}
private
class
Adapter
extends
AccountChooseAdapter
{
public
Adapter
(
Activity
activity
)
{
super
(
activity
);
ArrayList
<
String
>
available
=
new
ArrayList
<
String
>();
for
(
RosterContact
check
:
RosterManager
.
getInstance
()
.
getContacts
())
if
(
check
.
isEnabled
()
&&
check
.
getUser
().
equals
(
user
))
available
.
add
(
check
.
getAccount
());
if
(!
available
.
isEmpty
())
{
accounts
.
clear
();
accounts
.
addAll
(
available
);
}
}
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
return
getDropDownView
(
position
,
convertView
,
parent
);
}
}
}
app/src/main/java/com/xabber/android/ui/dialog/ExportChatDialogBuilder.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
dialog
;
import
android.app.Activity
;
import
android.content.DialogInterface
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.Toast
;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.androiddev.R
;
public
class
ExportChatDialogBuilder
extends
ConfirmDialogBuilder
{
private
final
EditText
nameView
;
private
final
CheckBox
sendView
;
public
ExportChatDialogBuilder
(
Activity
activity
,
int
dialogId
,
ConfirmDialogListener
listener
,
String
account
,
String
user
)
{
super
(
activity
,
dialogId
,
listener
);
setTitle
(
R
.
string
.
export_chat_title
);
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
(
activity
.
getString
(
R
.
string
.
export_chat_mask
,
AccountManager
.
getInstance
().
getVerboseName
(
account
),
RosterManager
.
getInstance
().
getName
(
account
,
user
)));
setView
(
layout
);
}
@Override
public
void
onAccept
(
DialogInterface
dialog
)
{
if
(
""
.
equals
(
getName
()))
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
group_is_empty
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
super
.
onAccept
(
dialog
);
}
public
String
getName
()
{
return
nameView
.
getText
().
toString
();
}
public
boolean
isSendChecked
()
{
return
sendView
.
isChecked
();
}
}
app/src/main/java/com/xabber/android/ui/dialog/GroupAddDialogBuilder.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
dialog
;
import
java.util.Collection
;
import
android.app.Activity
;
import
android.content.DialogInterface
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.Toast
;
import
com.xabber.androiddev.R
;
public
class
GroupAddDialogBuilder
extends
ConfirmDialogBuilder
{
private
final
Collection
<
String
>
groups
;
private
final
EditText
nameView
;
public
GroupAddDialogBuilder
(
Activity
activity
,
int
dialogId
,
ConfirmDialogListener
listener
,
Collection
<
String
>
groups
)
{
super
(
activity
,
dialogId
,
listener
);
setTitle
(
R
.
string
.
group_add
);
this
.
groups
=
groups
;
View
layout
=
activity
.
getLayoutInflater
().
inflate
(
R
.
layout
.
group_name
,
null
);
nameView
=
(
EditText
)
layout
.
findViewById
(
R
.
id
.
group_name
);
setView
(
layout
);
}
@Override
public
void
onAccept
(
DialogInterface
dialog
)
{
String
name
=
nameView
.
getText
().
toString
();
if
(
""
.
equals
(
name
))
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
group_is_empty
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
if
(
groups
.
contains
(
name
))
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
group_exists
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
super
.
onAccept
(
dialog
);
}
public
String
getName
()
{
return
nameView
.
getText
().
toString
();
}
}
app/src/main/java/com/xabber/android/ui/dialog/GroupAddDialogFragment.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
dialog
;
import
android.app.AlertDialog
;
import
android.app.AlertDialog.Builder
;
import
android.app.DialogFragment
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.Toast
;
import
com.xabber.androiddev.R
;
import
java.util.ArrayList
;
public
class
GroupAddDialogFragment
extends
ConfirmDialogFragment
{
private
static
final
String
GROUPS
=
"GROUPS"
;
/**
* @param account can be <code>null</code> to be used for all accounts.
* @param group can be <code>null</code> to be used for "no group".
* @return
*/
public
static
DialogFragment
newInstance
(
ArrayList
<
String
>
groups
)
{
return
new
GroupAddDialogFragment
().
putAgrument
(
GROUPS
,
groups
);
}
private
ArrayList
<
String
>
groups
;
private
EditText
nameView
;
@Override
protected
Builder
getBuilder
()
{
groups
=
getArguments
().
getStringArrayList
(
GROUPS
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
builder
.
setTitle
(
R
.
string
.
group_add
);
View
layout
=
getActivity
().
getLayoutInflater
().
inflate
(
R
.
layout
.
group_name
,
null
);
nameView
=
(
EditText
)
layout
.
findViewById
(
R
.
id
.
group_name
);
builder
.
setView
(
layout
);
return
builder
;
}
@Override
protected
boolean
onPositiveClick
()
{
String
group
=
nameView
.
getText
().
toString
();
if
(
""
.
equals
(
group
))
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
group_is_empty
),
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
if
(
groups
.
contains
(
group
))
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
group_exists
),
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
((
OnGroupAddConfirmed
)
getActivity
()).
onGroupAddConfirmed
(
group
);
return
true
;
}
public
interface
OnGroupAddConfirmed
{
void
onGroupAddConfirmed
(
String
group
);
}
}
app/src/main/java/com/xabber/android/ui/dialog/GroupRenameDialogBuilder.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
dialog
;
import
android.app.Activity
;
import
android.content.DialogInterface
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.Toast
;
import
com.xabber.androiddev.R
;
public
class
GroupRenameDialogBuilder
extends
ConfirmDialogBuilder
{
private
final
EditText
nameView
;
public
GroupRenameDialogBuilder
(
Activity
activity
,
int
dialogId
,
ConfirmDialogListener
listener
,
String
group
)
{
super
(
activity
,
dialogId
,
listener
);
setTitle
(
R
.
string
.
group_rename
);
View
layout
=
activity
.
getLayoutInflater
().
inflate
(
R
.
layout
.
group_name
,
null
);
nameView
=
(
EditText
)
layout
.
findViewById
(
R
.
id
.
group_name
);
nameView
.
setText
(
group
);
setView
(
layout
);
}
@Override
public
void
onAccept
(
DialogInterface
dialog
)
{
if
(
""
.
equals
(
getName
()))
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
group_is_empty
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
super
.
onAccept
(
dialog
);
}
public
String
getName
()
{
return
nameView
.
getText
().
toString
();
}
}
app/src/main/java/com/xabber/android/ui/widget/StatusPreference.java
deleted
100644 → 0
View file @
a1e95b4f
/**
* 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
.
widget
;
import
android.content.Context
;
import
android.preference.Preference
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.widget.ImageView
;
import
com.xabber.android.data.account.StatusMode
;
import
com.xabber.androiddev.R
;
/**
* Preference to show status mode icon.
*
* @author alexander.ivanov
*/
public
class
StatusPreference
extends
Preference
{
private
StatusMode
statusMode
;
public
StatusPreference
(
Context
context
)
{
super
(
context
);
init
();
}
public
StatusPreference
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
();
}
public
StatusPreference
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
init
();
}
private
void
init
()
{
setWidgetLayoutResource
(
R
.
layout
.
preference_status_widget
);
}
public
void
setStatusMode
(
StatusMode
statusMode
)
{
this
.
statusMode
=
statusMode
;
}
@Override
protected
void
onBindView
(
View
view
)
{
super
.
onBindView
(
view
);
((
ImageView
)
view
.
findViewById
(
R
.
id
.
status_icon
))
.
setImageLevel
(
statusMode
.
getStatusLevel
());
}
}
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