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
6833d659
Commit
6833d659
authored
Jan 15, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BaseListEditor: add list item moved to app bar.
parent
94789fad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
BaseListEditor.java
...ain/java/com/xabber/android/ui/helper/BaseListEditor.java
+6
-15
No files found.
app/src/main/java/com/xabber/android/ui/helper/BaseListEditor.java
View file @
6833d659
...
...
@@ -19,14 +19,12 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.view.ContextMenu
;
import
android.view.ContextMenu.ContextMenuInfo
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView.AdapterContextMenuInfo
;
import
android.widget.ListView
;
import
android.widget.TextView
;
import
com.xabber.android.ui.adapter.BaseListEditorAdapter
;
import
com.xabber.android.ui.dialog.ConfirmDialogBuilder
;
...
...
@@ -65,11 +63,6 @@ public abstract class BaseListEditor<T> extends ManagedListActivity implements
else
actionWith
=
null
;
ListView
listView
=
getListView
();
LayoutInflater
inflater
=
(
LayoutInflater
)
getSystemService
(
LAYOUT_INFLATER_SERVICE
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
add_item
,
null
,
true
);
((
TextView
)
view
.
findViewById
(
android
.
R
.
id
.
message
))
.
setText
(
getAddTextResourceId
());
listView
.
addFooterView
(
view
,
null
,
true
);
listView
.
setOnItemClickListener
(
this
);
registerForContextMenu
(
listView
);
adapter
=
createListAdapter
();
...
...
@@ -125,8 +118,8 @@ public abstract class BaseListEditor<T> extends ManagedListActivity implements
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
super
.
onCreateOptionsMenu
(
menu
);
menu
.
add
(
0
,
OPTION_MENU_ADD_ID
,
0
,
getString
(
getAddTextResourceId
()))
.
setI
con
(
android
.
R
.
drawable
.
ic_menu_add
)
.
setIntent
(
getAddIntent
()
);
.
setI
ntent
(
getAddIntent
()
)
.
setShowAsAction
(
MenuItem
.
SHOW_AS_ACTION_ALWAYS
);
return
true
;
}
...
...
@@ -175,12 +168,10 @@ public abstract class BaseListEditor<T> extends ManagedListActivity implements
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
T
actionWith
=
(
T
)
parent
.
getAdapter
().
getItem
(
position
);
Intent
intent
;
if
(
actionWith
==
null
)
intent
=
getAddIntent
();
else
intent
=
getEditIntent
(
actionWith
);
startActivity
(
intent
);
if
(
actionWith
!=
null
)
{
Intent
intent
=
getEditIntent
(
actionWith
);
startActivity
(
intent
);
}
}
@Override
...
...
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