Commit 6fbbc0bd authored by willschabel's avatar willschabel
Browse files

Fixed some bugs and added license and testing message

parent c6b0c084
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
"temperatureControl": false, "temperatureControl": false,
"snapEligible": false, "snapEligible": false,
"testingRequired": false, "testingRequired": false,
"regulation": "Should be sold at <45F. Cartons should be clean and labeled properly. (Temperature control and labeling strongly suggested for establishments with fewer than 50 hens; temperature control and labeling required for farms with 51 to 249 hens, must be ungraded. Licensing (and grading) required with > 249 hens or if selling graded eggs.)" "regulation": "Should be sold at <45F. Cartons should be clean and labeled properly. (Temperature control and labeling strongly suggested for establishments with fewer than 50 hens; temperature control and labeling required for farms with 51 to 249 hens, must be ungraded. Licensing (and grading) required with > 249 hens or if selling graded eggs.)"
}, },
{ {
"entryId": "homeCannedFruitAndJellies", "entryId": "homeCannedFruitAndJellies",
......
...@@ -88,7 +88,8 @@ namespace AndroidMasterDetail ...@@ -88,7 +88,8 @@ namespace AndroidMasterDetail
int currentLayout = 0; int currentLayout = 0;
//Reads the JSON, creates an object from it. //Reads the JSON, creates an object from it.
StreamReader strm = new StreamReader(Assets.Open("categories.json")); StreamReader strm = new StreamReader(Assets.Open("categories.json"));
string json = strm.ReadToEnd(); string json = JObject.Parse(strm.ReadToEnd()).ToString();
//string json = strm.ReadToEnd();
Root root = JsonConvert.DeserializeObject<Root>(json); Root root = JsonConvert.DeserializeObject<Root>(json);
//Declarations for buttons //Declarations for buttons
...@@ -138,7 +139,24 @@ namespace AndroidMasterDetail ...@@ -138,7 +139,24 @@ namespace AndroidMasterDetail
{ {
if(itemSelected == i.name) if(itemSelected == i.name)
{ {
alert.SetMessage(i.regulation); string message = i.regulation;
if (i.license == true)
{
message += "\nRequires License.";
}
else
{
message += "\nDoes Not Require License.";
}
if (i.testingRequired == true)
{
message += "\nRequires Testing.";
}
else
{
message += "\nDoes Not Require Testing.";
}
alert.SetMessage(message);
alert.Show(); alert.Show();
} }
} }
...@@ -161,13 +179,30 @@ namespace AndroidMasterDetail ...@@ -161,13 +179,30 @@ namespace AndroidMasterDetail
{ {
if (itemSelected == i.name) if (itemSelected == i.name)
{ {
alert.SetMessage(i.regulation); string message = i.regulation;
if(i.license == true)
{
message += "\nRequires License.";
}
else
{
message += "\nDoes Not Require License.";
}
if (i.testingRequired == true)
{
message += "\nRequires Testing.";
}
else
{
message += "\nDoes Not Require Testing.";
}
alert.SetMessage(message);
alert.Show(); alert.Show();
} }
} }
}; };
SearchView search = FindViewById<SearchView>(Resource.Id.search); SearchView search = FindViewById<SearchView>(Resource.Id.search);
search.SetQueryHint("Search for a food!"); search.SetQueryHint("Search for a food item...");
search.QueryTextChange += sv_QueryTextChange; search.QueryTextChange += sv_QueryTextChange;
void sv_QueryTextChange(object sender, SearchView.QueryTextChangeEventArgs e) void sv_QueryTextChange(object sender, SearchView.QueryTextChangeEventArgs e)
{ {
...@@ -177,7 +212,7 @@ namespace AndroidMasterDetail ...@@ -177,7 +212,7 @@ namespace AndroidMasterDetail
secondClick.Visibility = ViewStates.Gone; secondClick.Visibility = ViewStates.Gone;
thirdClick.Visibility = ViewStates.Gone; thirdClick.Visibility = ViewStates.Gone;
fourthClick.Visibility = ViewStates.Gone; fourthClick.Visibility = ViewStates.Gone;
listLayout2.Visibility = ViewStates.Gone; listLayout.Visibility = ViewStates.Gone;
listLayout2.Visibility = ViewStates.Visible; listLayout2.Visibility = ViewStates.Visible;
adapter.Filter.InvokeFilter(e.NewText); adapter.Filter.InvokeFilter(e.NewText);
currentLayout = 13; currentLayout = 13;
...@@ -427,6 +462,7 @@ namespace AndroidMasterDetail ...@@ -427,6 +462,7 @@ namespace AndroidMasterDetail
secondClick.Visibility = ViewStates.Gone; secondClick.Visibility = ViewStates.Gone;
thirdClick.Visibility = ViewStates.Gone; thirdClick.Visibility = ViewStates.Gone;
fourthClick.Visibility = ViewStates.Gone; fourthClick.Visibility = ViewStates.Gone;
listLayout.Visibility = ViewStates.Gone;
listLayout2.Visibility = ViewStates.Gone; listLayout2.Visibility = ViewStates.Gone;
search.SetIconifiedByDefault(false); search.SetIconifiedByDefault(false);
search.ClearFocus(); search.ClearFocus();
......
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:id="@+id/fifthButton" /> android:id="@+id/fifthButton" />
<Button <Button
android:text="Other-Sampling of Foods Products" android:text="Other-Sampling of Food Products"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="13dp" android:textSize="11dp"
android:background="@drawable/button" android:background="@drawable/button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment