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
d278102c
authored
Oct 04, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Plain Diff
UOFLMA-116: Fixed - Mandatory fields issue.
parents
7062c7e8
b73ee666
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
app/src/main/java/com/vsoft/uoflservicenow/ui/CatalogueVariableScreen.java
app/src/main/res/values/strings.xml
app/src/main/java/com/vsoft/uoflservicenow/ui/CatalogueVariableScreen.java
View file @
d278102c
...
@@ -30,6 +30,7 @@ import android.support.v7.widget.Toolbar;
...
@@ -30,6 +30,7 @@ import android.support.v7.widget.Toolbar;
import
android.text.Html
;
import
android.text.Html
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.text.method.LinkMovementMethod
;
import
android.text.method.LinkMovementMethod
;
import
android.util.StringBuilderPrinter
;
import
android.util.TypedValue
;
import
android.util.TypedValue
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
...
@@ -308,20 +309,18 @@ public class CatalogueVariableScreen extends AppCompatActivity {
...
@@ -308,20 +309,18 @@ public class CatalogueVariableScreen extends AppCompatActivity {
childLabelViewLayoutParams
.
topMargin
=
(
int
)
getResources
().
getDimension
(
R
.
dimen
.
small_margin
);
childLabelViewLayoutParams
.
topMargin
=
(
int
)
getResources
().
getDimension
(
R
.
dimen
.
small_margin
);
mContainerLayout
.
addView
(
label
,
childLabelViewLayoutParams
);
mContainerLayout
.
addView
(
label
,
childLabelViewLayoutParams
);
}
else
{
}
else
{
/*Create label with mandatory value*/
/*Create labelWithMandatory with mandatory value*/
LinearLayout
labelLayout
=
new
LinearLayout
(
CatalogueVariableScreen
.
this
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
labelLayout
.
setOrientation
(
LinearLayout
.
HORIZONTAL
);
stringBuilder
.
append
(
catalogueVariable
.
getQuestionText
());
TextView
label
=
new
TextView
(
CatalogueVariableScreen
.
this
);
stringBuilder
.
append
(
getString
(
R
.
string
.
variable_form_view_mandatory_sign_string
));
label
.
setText
(
catalogueVariable
.
getQuestionText
());
childLabelViewLayoutParams
.
topMargin
=
(
int
)
getResources
().
getDimension
(
R
.
dimen
.
small_margin
);
labelLayout
.
addView
(
label
,
childLabelViewLayoutParams
);
TextView
mandatory
=
new
TextView
(
CatalogueVariableScreen
.
this
);
mandatory
.
setText
(
"*"
);
mandatory
.
setTextColor
(
ContextCompat
.
getColor
(
CatalogueVariableScreen
.
this
,
R
.
color
.
error_color
));
labelLayout
.
addView
(
mandatory
);
mContainerLayout
.
addView
(
labelLayout
);
TextView
labelWithMandatory
=
new
TextView
(
CatalogueVariableScreen
.
this
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
N
)
{
labelWithMandatory
.
setText
(
Html
.
fromHtml
(
stringBuilder
.
toString
(),
Html
.
FROM_HTML_MODE_LEGACY
));
}
else
{
labelWithMandatory
.
setText
(
Html
.
fromHtml
(
stringBuilder
.
toString
()));
}
mContainerLayout
.
addView
(
labelWithMandatory
,
childLabelViewLayoutParams
);
}
}
}
}
...
@@ -415,7 +414,8 @@ public class CatalogueVariableScreen extends AppCompatActivity {
...
@@ -415,7 +414,8 @@ public class CatalogueVariableScreen extends AppCompatActivity {
jsonColumnValue
=
Util
.
getDateTime
(
Util
.
getDateTimeFromString
(
value
));
jsonColumnValue
=
Util
.
getDateTime
(
Util
.
getDateTimeFromString
(
value
));
}
}
if
(
viewType
!=
ViewType
.
SELECT_BOX
&&
viewType
!=
ViewType
.
UI_PAGE
)
{
if
(
catalogueVariable
.
isMandatory
())
{
if
(
viewType
!=
ViewType
.
SELECT_BOX
&&
viewType
!=
ViewType
.
UI_PAGE
)
{
if
(
TextUtils
.
isEmpty
(
jsonColumnValue
))
{
if
(
TextUtils
.
isEmpty
(
jsonColumnValue
))
{
hasErrors
=
true
;
hasErrors
=
true
;
// show error view
// show error view
...
@@ -438,6 +438,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
...
@@ -438,6 +438,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
errorView
.
setVisibility
(
View
.
GONE
);
errorView
.
setVisibility
(
View
.
GONE
);
}
}
}
}
}
try
{
try
{
jsonObject
.
put
(
catalogueVariable
.
getName
(),
jsonColumnValue
);
jsonObject
.
put
(
catalogueVariable
.
getName
(),
jsonColumnValue
);
...
...
app/src/main/res/values/strings.xml
View file @
d278102c
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
<!--Variable Screen-->
<!--Variable Screen-->
<string
name=
"variable_form_misc_info_string"
>
%1$s [add %2$s]
</string>
<string
name=
"variable_form_misc_info_string"
>
%1$s [add %2$s]
</string>
<string
name=
"variable_form_header_string"
>
Submit Order
</string>
<string
name=
"variable_form_header_string"
>
Submit Order
</string>
<string
name=
"variable_form_view_mandatory_sign_string"
>
<
font color="#FF0000"
>
*
<
/font
>
</string>
<string
name=
"variable_form_reference_dialog_title_string"
>
Search \'%s\'
</string>
<string
name=
"variable_form_reference_dialog_title_string"
>
Search \'%s\'
</string>
<string
name=
"variable_form_radio_text_string"
>
%d
</string>
<string
name=
"variable_form_radio_text_string"
>
%d
</string>
<string
name=
"variable_form_ui_page_button_label_string"
>
Add Attachment
</string>
<string
name=
"variable_form_ui_page_button_label_string"
>
Add Attachment
</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