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
708f2871
Commit
708f2871
authored
May 23, 2013
by
Alexander Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace base list activity with fragment activity.
parent
7c187aba
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
12 deletions
+22
-12
android-support-v4.jar
libs/android-support-v4.jar
+0
-0
AccountList.java
src/com/xabber/android/ui/AccountList.java
+1
-2
StatusEditor.java
src/com/xabber/android/ui/StatusEditor.java
+6
-5
ContactListAdapter.java
src/com/xabber/android/ui/adapter/ContactListAdapter.java
+2
-2
BaseListEditor.java
src/com/xabber/android/ui/helper/BaseListEditor.java
+1
-1
ManagedListActivity.java
src/com/xabber/android/ui/helper/ManagedListActivity.java
+12
-2
No files found.
libs/android-support-v4.jar
0 → 100644
View file @
708f2871
File added
src/com/xabber/android/ui/AccountList.java
View file @
708f2871
...
...
@@ -28,7 +28,6 @@ import com.xabber.android.data.account.AccountManager;
import
com.xabber.android.data.account.OnAccountChangedListener
;
import
com.xabber.android.ui.adapter.AccountListAdapter
;
import
com.xabber.android.ui.adapter.BaseListEditorAdapter
;
import
com.xabber.android.ui.adapter.UpdatableAdapter
;
import
com.xabber.android.ui.helper.BaseListEditor
;
import
com.xabber.androiddev.R
;
...
...
@@ -119,7 +118,7 @@ public class AccountList extends BaseListEditor<String> implements
@Override
public
void
onAccountsChanged
(
Collection
<
String
>
accounts
)
{
((
UpdatableAdapter
)
getListAdapter
())
.
onChange
();
adapter
.
onChange
();
}
@Override
...
...
src/com/xabber/android/ui/StatusEditor.java
View file @
708f2871
...
...
@@ -40,7 +40,6 @@ import com.xabber.android.data.account.StatusMode;
import
com.xabber.android.data.intent.AccountIntentBuilder
;
import
com.xabber.android.ui.adapter.StatusEditorAdapter
;
import
com.xabber.android.ui.adapter.StatusModeAdapter
;
import
com.xabber.android.ui.adapter.UpdatableAdapter
;
import
com.xabber.android.ui.helper.ManagedListActivity
;
import
com.xabber.androiddev.R
;
...
...
@@ -61,6 +60,7 @@ public class StatusEditor extends ManagedListActivity implements
private
EditText
statusTextView
;
private
SavedStatus
actionWithItem
;
private
StatusEditorAdapter
adapter
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -87,7 +87,8 @@ public class StatusEditor extends ManagedListActivity implements
listView
.
addHeaderView
(
header
,
null
,
false
);
listView
.
setOnItemClickListener
(
this
);
registerForContextMenu
(
listView
);
setListAdapter
(
new
StatusEditorAdapter
(
this
));
adapter
=
new
StatusEditorAdapter
(
this
);
setListAdapter
(
adapter
);
statusTextView
=
(
EditText
)
header
.
findViewById
(
R
.
id
.
status_text
);
statusModeView
=
(
Spinner
)
header
.
findViewById
(
R
.
id
.
status_mode
);
...
...
@@ -146,7 +147,7 @@ public class StatusEditor extends ManagedListActivity implements
@Override
protected
void
onResume
()
{
super
.
onResume
();
((
UpdatableAdapter
)
getListAdapter
())
.
onChange
();
adapter
.
onChange
();
}
@Override
...
...
@@ -164,7 +165,7 @@ public class StatusEditor extends ManagedListActivity implements
switch
(
item
.
getItemId
())
{
case
OPTION_MENU_CLEAR_STATUSES_ID:
AccountManager
.
getInstance
().
clearSavedStatuses
();
((
UpdatableAdapter
)
getListAdapter
())
.
onChange
();
adapter
.
onChange
();
return
true
;
}
return
false
;
...
...
@@ -202,7 +203,7 @@ public class StatusEditor extends ManagedListActivity implements
return
true
;
case
CONTEXT_MENU_REMOVE_STATUS_ID:
AccountManager
.
getInstance
().
removeSavedStatus
(
actionWithItem
);
((
UpdatableAdapter
)
getListAdapter
())
.
onChange
();
adapter
.
onChange
();
return
true
;
}
return
false
;
...
...
src/com/xabber/android/ui/adapter/ContactListAdapter.java
View file @
708f2871
...
...
@@ -22,7 +22,6 @@ import java.util.Date;
import
java.util.Map.Entry
;
import
java.util.TreeMap
;
import
android.app.ListActivity
;
import
android.os.Handler
;
import
android.view.View
;
import
android.view.animation.Animation
;
...
...
@@ -42,6 +41,7 @@ import com.xabber.android.data.roster.AbstractContact;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.RosterContact
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.helper.ManagedListActivity
;
import
com.xabber.androiddev.R
;
/**
...
...
@@ -114,7 +114,7 @@ public class ContactListAdapter extends
*/
private
Date
nextRefresh
;
public
ContactListAdapter
(
ListActivity
activity
)
{
public
ContactListAdapter
(
Managed
ListActivity
activity
)
{
super
(
activity
,
activity
.
getListView
(),
new
ChatContactInflater
(
activity
),
GroupManager
.
getInstance
());
infoView
=
activity
.
findViewById
(
R
.
id
.
info
);
...
...
src/com/xabber/android/ui/helper/BaseListEditor.java
View file @
708f2871
...
...
@@ -52,7 +52,7 @@ public abstract class BaseListEditor<T> extends ManagedListActivity implements
private
T
actionWith
;
pr
ivate
BaseListEditorAdapter
<
T
>
adapter
;
pr
otected
BaseListEditorAdapter
<
T
>
adapter
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
src/com/xabber/android/ui/helper/ManagedListActivity.java
View file @
708f2871
...
...
@@ -14,9 +14,11 @@
*/
package
com
.
xabber
.
android
.
ui
.
helper
;
import
android.app.ListActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.v4.app.FragmentActivity
;
import
android.widget.ListAdapter
;
import
android.widget.ListView
;
import
com.xabber.android.data.ActivityManager
;
...
...
@@ -28,7 +30,7 @@ import com.xabber.android.data.ActivityManager;
* @author alexander.ivanov
*
*/
public
abstract
class
ManagedListActivity
extends
Lis
tActivity
{
public
abstract
class
ManagedListActivity
extends
Fragmen
tActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -79,4 +81,12 @@ public abstract class ManagedListActivity extends ListActivity {
super
.
startActivityForResult
(
intent
,
requestCode
);
}
public
ListView
getListView
()
{
return
(
ListView
)
findViewById
(
android
.
R
.
id
.
list
);
}
public
void
setListAdapter
(
ListAdapter
adapter
)
{
getListView
().
setAdapter
(
adapter
);
}
}
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