Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e4059299
authored
Aug 30, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
UOFLMA-38: Added dialog with complete description.
parent
7ae70cfd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
app/src/main/java/com/vsoft/uofl_catalogue/ui/MyIncidentScreen.java
app/src/main/java/com/vsoft/uofl_catalogue/ui/MyIncidentScreen.java
View file @
e4059299
package
com
.
vsoft
.
uofl_catalogue
.
ui
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.widget.Toolbar
;
import
android.view.MenuItem
;
...
...
@@ -17,6 +19,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnItemClick
;
/**
* Created by kunj on 30/8/16.
...
...
@@ -27,6 +30,7 @@ public class MyIncidentScreen extends AppCompatActivity {
@BindView
(
R
.
id
.
my_incidents_screen_list_view
)
ListView
mIncidentListView
;
private
CatalogueApplication
mApplication
;
private
List
<
Incident
>
mIncidentList
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -49,18 +53,43 @@ public class MyIncidentScreen extends AppCompatActivity {
}
MyIncidentsAdapter
adapter
=
new
MyIncidentsAdapter
(
MyIncidentScreen
.
this
);
List
<
Incident
>
i
ncidentList
=
new
ArrayList
<>(
5
);
mI
ncidentList
=
new
ArrayList
<>(
5
);
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Incident
incident
=
new
Incident
();
incident
.
setNumber
(
"INC000010"
);
incident
.
setShortDescription
(
"short description"
);
incident
.
setOpenedAt
(
"23 Aug 2016, 15.30PM"
);
i
ncidentList
.
add
(
incident
);
mI
ncidentList
.
add
(
incident
);
}
adapter
.
setIncidentList
(
i
ncidentList
);
adapter
.
setIncidentList
(
mI
ncidentList
);
mIncidentListView
.
setAdapter
(
adapter
);
}
@OnItemClick
(
R
.
id
.
my_incidents_screen_list_view
)
void
listViewOnClicked
(
int
position
)
{
Incident
incident
=
mIncidentList
.
get
(
position
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
"Number: "
);
stringBuilder
.
append
(
incident
.
getNumber
());
stringBuilder
.
append
(
"\n\n"
);
stringBuilder
.
append
(
"Opened At: "
);
stringBuilder
.
append
(
incident
.
getOpenedAt
());
stringBuilder
.
append
(
"\n\n"
);
stringBuilder
.
append
(
"Short Description: "
);
stringBuilder
.
append
(
incident
.
getShortDescription
());
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setMessage
(
stringBuilder
.
toString
())
.
setCancelable
(
false
)
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
id
)
{
dialog
.
dismiss
();
}
});
AlertDialog
alert
=
builder
.
create
();
alert
.
show
();
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
menuItem
)
{
if
(
menuItem
.
getItemId
()
==
android
.
R
.
id
.
home
)
{
...
...
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