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
3d54444d
authored
Sep 27, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
UOFLMA-106 - Shown a dialog with item description.
parent
0fbca9d9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
136 additions
and
9 deletions
app/src/main/java/com/vsoft/uoflservicenow/adapters/MyRequestAdapter.java
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequest.java
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestCatItem.java → app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestOpenedBy.java
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestRequest.java
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestShortDes.java
app/src/main/java/com/vsoft/uoflservicenow/ui/MyRequestActivity.java
app/src/main/res/values/strings.xml
app/src/main/java/com/vsoft/uoflservicenow/adapters/MyRequestAdapter.java
View file @
3d54444d
...
...
@@ -74,7 +74,7 @@ public class MyRequestAdapter extends BaseAdapter {
MyRequest
req
=
mReqList
.
get
(
position
);
holder
.
number
.
setText
(
req
.
getNumber
());
holder
.
shortDescription
.
setText
(
req
.
get
CatItem
().
getDisplayValue
());
holder
.
shortDescription
.
setText
(
req
.
get
ShortDescription
().
getDisplayValue
());
if
(!
req
.
getApproval
().
isEmpty
())
{
if
(
req
.
getApproval
().
equalsIgnoreCase
(
"requested"
))
{
...
...
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequest.java
View file @
3d54444d
...
...
@@ -15,17 +15,24 @@ public class MyRequest {
@SerializedName
(
"number"
)
@Expose
private
String
number
;
@SerializedName
(
"sys_updated_on"
)
// @Expose
private
long
updateOn
;
@SerializedName
(
"approval"
)
@Expose
String
approval
;
@SerializedName
(
"cat_item"
)
@Expose
MyRequestCatItem
catItem
;
MyRequestShortDes
shortDescription
;
@SerializedName
(
"request"
)
@Expose
MyRequestRequest
request
;
@SerializedName
(
"opened_by"
)
@Expose
MyRequestRequest
openedBy
;
@SerializedName
(
"stage"
)
@Expose
String
stage
;
public
String
getNumber
()
{
return
number
;
...
...
@@ -43,12 +50,12 @@ public class MyRequest {
this
.
updateOn
=
updateOn
;
}
public
MyRequest
CatItem
getCatItem
()
{
return
catItem
;
public
MyRequest
ShortDes
getShortDescription
()
{
return
shortDescription
;
}
public
void
set
CatItem
(
MyRequestCatItem
catItem
)
{
this
.
catItem
=
catItem
;
public
void
set
ShortDescription
(
MyRequestShortDes
shortDescription
)
{
this
.
shortDescription
=
shortDescription
;
}
public
String
getApproval
()
{
...
...
@@ -59,6 +66,30 @@ public class MyRequest {
this
.
approval
=
approval
;
}
public
MyRequestRequest
getRequest
()
{
return
request
;
}
public
void
setRequest
(
MyRequestRequest
request
)
{
this
.
request
=
request
;
}
public
MyRequestRequest
getOpenedBy
()
{
return
openedBy
;
}
public
void
setOpenedBy
(
MyRequestRequest
openedBy
)
{
this
.
openedBy
=
openedBy
;
}
public
String
getStage
()
{
return
stage
;
}
public
void
setStage
(
String
stage
)
{
this
.
stage
=
stage
;
}
public
void
parseJson
(
JSONObject
jsonObject
)
{
String
dueDate
=
null
;
try
{
...
...
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequest
CatItem
.java
→
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequest
OpenedBy
.java
View file @
3d54444d
...
...
@@ -6,7 +6,7 @@ import com.google.gson.annotations.SerializedName;
/**
* Created by kvemulavada on 8/30/2016.
*/
public
class
MyRequest
CatItem
{
public
class
MyRequest
OpenedBy
{
@SerializedName
(
"display_value"
)
@Expose
...
...
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestRequest.java
0 → 100644
View file @
3d54444d
package
com
.
vsoft
.
uoflservicenow
.
db
.
models
;
import
com.google.gson.annotations.Expose
;
import
com.google.gson.annotations.SerializedName
;
/**
* Created by kvemulavada on 8/30/2016.
*/
public
class
MyRequestRequest
{
@SerializedName
(
"display_value"
)
@Expose
private
String
displayValue
;
@SerializedName
(
"link"
)
@Expose
private
String
link
;
public
String
getDisplayValue
()
{
return
displayValue
;
}
public
void
setDisplayValue
(
String
displayValue
)
{
this
.
displayValue
=
displayValue
;
}
public
String
getLink
()
{
return
link
;
}
public
void
setLink
(
String
link
)
{
this
.
link
=
link
;
}
}
app/src/main/java/com/vsoft/uoflservicenow/db/models/MyRequestShortDes.java
0 → 100644
View file @
3d54444d
package
com
.
vsoft
.
uoflservicenow
.
db
.
models
;
import
com.google.gson.annotations.Expose
;
import
com.google.gson.annotations.SerializedName
;
/**
* Created by kvemulavada on 8/30/2016.
*/
public
class
MyRequestShortDes
{
@SerializedName
(
"display_value"
)
@Expose
private
String
displayValue
;
@SerializedName
(
"link"
)
@Expose
private
String
link
;
public
String
getDisplayValue
()
{
return
displayValue
;
}
public
void
setDisplayValue
(
String
displayValue
)
{
this
.
displayValue
=
displayValue
;
}
public
String
getLink
()
{
return
link
;
}
public
void
setLink
(
String
link
)
{
this
.
link
=
link
;
}
}
app/src/main/java/com/vsoft/uoflservicenow/ui/MyRequestActivity.java
View file @
3d54444d
...
...
@@ -8,6 +8,7 @@ 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.text.Html
;
import
android.view.MenuItem
;
import
android.widget.ListView
;
...
...
@@ -28,6 +29,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnItemClick
;
/**
* Created by kvemulavada on 8/30/2016.
...
...
@@ -67,6 +69,7 @@ public class MyRequestActivity extends AppCompatActivity {
DialogUtils
.
showNoConnectionDialogWithCloseActivity
(
MyRequestActivity
.
this
);
}
}
class
FetchMyRequestData
extends
AsyncTask
<
String
,
Void
,
SyncStatus
>
{
private
ProgressDialog
progressDialog
;
...
...
@@ -104,6 +107,30 @@ public class MyRequestActivity extends AppCompatActivity {
}
}
@OnItemClick
(
R
.
id
.
request_screen_list_view
)
void
listViewOnClicked
(
int
position
)
{
MyRequest
myRequest
=
mMyRequestList
.
get
(
position
);
String
messageString
=
String
.
format
(
getResources
().
getString
(
R
.
string
.
my_incidents_item_text_string
),
myRequest
.
getNumber
(),
myRequest
.
getShortDescription
().
getDisplayValue
(),
Util
.
getDateTimeFromLong
(
myRequest
.
getUpdateOn
()),
myRequest
.
getRequest
().
getDisplayValue
(),
myRequest
.
getOpenedBy
().
getDisplayValue
(),
myRequest
.
getStage
());
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setMessage
(
Html
.
fromHtml
(
messageString
))
.
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
();
}
private
void
setData
(
final
List
<
MyRequest
>
reqList
)
{
MyRequestAdapter
adapter
=
new
MyRequestAdapter
(
MyRequestActivity
.
this
);
...
...
app/src/main/res/values/strings.xml
View file @
3d54444d
...
...
@@ -75,6 +75,7 @@
<!--My Incidents-->
<string
name=
"my_incidents_text_string"
>
My Incidents
</string>
<string
name=
"my_incidents_item_text_string"
>
<![CDATA[<b>Number: </b>%1$s<br><br><b>Short Description: </b>%2$s<br><br><b>Opened: </b>%3$s<br><br><b>Request: </b>%4$s<br><br><b>Opened by: </b>%5$s<br><br><b>Stage: </b>%6$s]]>
</string>
<string
name=
"connection_alert_dialog_title"
>
No Connection Available
</string>
<string
name=
"connection_alert_dialog_message"
>
Please check your device settings to ensure you have a working internet connection.
</string>
...
...
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