<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Intersoft Solutions Corporate Blog &#187; Development</title>
	<atom:link href="http://blog.intersoftsolutions.com/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.intersoftsolutions.com</link>
	<description>All about development productivity – ASP.NET, Silverlight, WPF, iOS, Android, Windows Phone, Windows 8</description>
	<lastBuildDate>Sat, 21 Apr 2018 06:57:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.33</generator>
	<item>
		<title>Redesigning Xamarin Field Service Sample with Crosslight &#8211; Part 2</title>
		<link>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/</link>
		<comments>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/#comments</comments>
		<pubDate>Fri, 08 Apr 2016 04:03:36 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[Crosslight 5]]></category>
		<category><![CDATA[Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=7614</guid>
		<description><![CDATA[Back in November 2015 I wrote a blog post on Redesigning Xamarin Field Service Sample &#8211; Part 1. Well, in that post I&#8217;ve discussed various design quirks and what improvements can be made to made the overall Xamarin Field Service sample better. First of all, we&#8217;re glad to receive many [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-detail1-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="assignment-detail" style="float:right; margin:0 0 10px 10px;" /><p>Back in November 2015 I wrote a blog post on <a href="http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/" target="_blank">Redesigning Xamarin Field Service Sample &#8211; Part 1</a>. Well, in that post I&#8217;ve discussed various design quirks and what improvements can be made to made the overall <a href="https://blog.xamarin.com/the-xamarin-field-service-app-a-cross-platform-starter-kit/" target="_blank">Xamarin Field Service</a> sample better. First of all, we&#8217;re glad to receive many positive responses towards that post and very happy to see many Crosslight developers are taking UI and UX very seriously in designing their cross-platform apps.</p>
<p>Many of you have asked when will the blogpost see the light of day. Well, now it is. We&#8217;re very excited to announce that the sample is now available for you guys to check out and experiment for yourself. It is available here: <a href="http://git.intersoftsolutions.com/projects/CS/repos/app-fieldservice/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/app-fieldservice/browse</a>. Before I can delve into the technical aspects of this sample, in this second part of the post, I would like to re-highlight what we&#8217;ve promised in the first post and see it in action, in the form of shots and videos, with codes if possible. We tried to retain the business logic as much as we can to adhere to the original sample.</p>
<h1>Better Device Compatibility</h1>
<p>When you try to run the original sample, you won&#8217;t be able to run the sample on phone devices, which is kind of disappointing. But not with Crosslight. You can definitely deploy the sample on phones and tablet devices.</p>
<p><img class="alignnone size-full wp-image-7634" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/device-compatibility.png" alt="device-compatibility.png" width="1790" height="768" /></p>
<p>With this, you can easily target more devices as phone devices are greater in number when compared to tablets. One note: we&#8217;re discarding Windows-based platforms for now due to low market receptivity. Once it has gained more traction amongst cross-platform mobile developers, we&#8217;ll definitely revive the Windows lineup.</p>
<h1>The Login Screen</h1>
<p>First, let&#8217;s take a look at the original sample login screen experience.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/FZr02qsNqHU?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>One thing&#8217;s for sure: I can&#8217;t definitely use this screen on landscape orientation. When I try to focus on the username text box, the login box just flies away from the screen up to the point I can&#8217;t see where the text box is and input my username. You can still use this screen on portrait orientation though. Which is weird. Let&#8217;s take a look at Crosslight&#8217;s login screen.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/qMsxGoHeo4Y?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>No matter how you rotate it, it works consistently on both portrait and landscape orientation, on phones as well.</p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-7707" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/android-login.png" alt="android-login.png" width="2000" height="716" /></p>
<p>&nbsp;</p>
<h1>The Assignment List Screen</h1>
<p>The assignment screen is pretty much the same, except for a few changes:</p>
<p><img class="alignnone size-full wp-image-7714" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-list.png" alt="assignment-list.png" width="2000" height="992" /></p>
<ol>
<li>We don&#8217;t feel that the &#8220;sticky&#8221; header feels common in modern mobile apps, therefore we opted for &#8220;grouped&#8221; assignments instead. Sticky headers tend to take too much space, obstructing the user&#8217;s view and may cause confusion. Active assignments are put on the top of the list, followed by Completed assignments and Pending assignments. On iOS, you can easily tap the status bar to get to the topmost part of the TableView (this is the default behavior of the TableView) to see the Active Assignment quickly.</li>
<li>We removed the the button click behavior from the &#8220;assignment status&#8221;. Instead, we opted for swipe gesture, as this is more commonly used in mobile apps. If the assignment is On Hold, you can only see Active and Complete as options (as shown in the shot above). It feels counter-intuitive to have two clickable UI elements inside an assignment. The user might wonder if there&#8217;s any additional UI elements that can be clicked in addition to the &#8220;Play&#8221; button.</li>
<li>Also notice that you can&#8217;t perform the swipe gesture if the assignment isn&#8217;t accepted yet, or is currently the running assignment. The secret lies in the <strong>AssignmentListViewModel.cs</strong> inside <strong>FieldService.Core/ViewModels</strong> folder.<span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> Determines whether the edit command can be executed.</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">remarks</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> Allow users to perform swipe actions only when:</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> 1. The item status is Active or Pending</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> 2. The active assignment is not currently running.</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">remarks</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">CanExecuteEdit</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">editingParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">editingParameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;"> </span><span style="color: #333333;">item</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">editingParameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">item</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">IsStarted</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">item</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Active</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> || </span><span style="color: #333333;">item</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Pending</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span></span><span style="color: #333333;">    </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></li>
</ol>
<h1>The Assignment Detail Screen</h1>
<p>This is where things get pretty interesting.</p>
<p><img class="alignnone size-full wp-image-7748" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-detail.png" alt="assignment-detail.png" width="2000" height="649" /></p>
<p>&nbsp;</p>
<p>As promised, on tablets, we&#8217;ve used the new Dialog Presenter that will slide from the right hand side that will cover at least 3/4 of the screen. You can easily dismiss the detail by hitting the back button on Android or tapping on the area outside the dialog. On phones, normal push navigation is used. To use the Dialog Presenter on iPad, at the TabViewController&#8217;s constructor, simply use this code:</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentDetailTabViewController</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">isPad</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIDevice</span><span style="color: #333333;">.</span><span style="color: #333333;">CurrentDevice</span><span style="color: #333333;">.</span><span style="color: #333333;">UserInterfaceIdiom</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIUserInterfaceIdiom</span><span style="color: #333333;">.</span><span style="color: #333333;">Pad</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ConfigurePresenter</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PreferredContentSize</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CGSize</span><span style="color: #333333;">(</span><span style="color: #f57d00;">640</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">768</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PreferredContentSizeLandscape</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CGSize</span><span style="color: #333333;">(</span><span style="color: #f57d00;">704</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">768</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">DismissOnTap</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isPad</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PresentationStyle</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ContentPresentationStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Edge</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">EdgePresentationPosition</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EdgePresentationPosition</span><span style="color: #333333;">.</span><span style="color: #333333;">Right</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">EntryTransition</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">SlideFromRightTransition</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                FadeOutSource </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">ContentShadowRadius</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">10</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></p>
<p>And when navigating, you can do something similar as follows:</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">on</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">phone</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">perform</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">standard</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">while</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">on</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">tablet</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">show</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">dialog</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">presenter</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">for</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">better</span><span style="font-style: italic; color: #888888;"> experience</span><br />
<span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">GetService</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">IApplicationService</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">.</span><span style="color: #333333;">GetContext</span><span style="color: #333333;">()</span><span style="color: #333333;">.</span><span style="color: #333333;">Device</span><span style="color: #333333;">.</span><span style="color: #333333;">Kind</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DeviceKind</span><span style="color: #333333;">.</span><span style="color: #333333;">Phone</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">&gt;(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span><br />
<span style="color: #009695;">else</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">DialogPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">ShowAsync</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogOptions</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        HideButtons </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>You can see more detail on that inside the <strong>FieldService.Core/ViewModels/AssignmentViewModel.cs</strong> file.</p>
<p><strong>Special and very important note for iOS</strong>: When using the TabViewController after push navigation, you must hide the root navigation controller in order for many correct UX to work properly, for example, the navigation controller transitions, search bar controller, and much more. This needs to be done because the TabViewController has its own NavigationController. It is simply done by calling the following code in the <strong>AssignmentDetailTabViewController</strong>.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">EnsureNavigationContext</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeView</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">InitializeView</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Important</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Hide</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">root</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">bar</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">since</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">tab</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">will</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">have</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">its</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">own</span><span style="font-style: italic; color: #888888;">.</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationController</span><span style="color: #333333;">.</span><span style="color: #333333;">SetNavigationBarHidden</span><span style="color: #333333;">(</span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></p>
<p>We also added a little touch.</p>
<p><img class="alignnone size-full wp-image-7856" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/call-map-ios.png" alt="call-map-ios.png" width="300" height="1136" /></p>
<p>You can click the call button to immediately call the specified number, or click on the address to launch Maps with immediate directions to the specified location. If you try to click any of the documents below, the report will be displayed in a modal ViewController.</p>
<p><img class="alignnone size-full wp-image-7866" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/report-ios.png" alt="report-ios.png" width="1388" height="1136" /></p>
<p>To launch the report on Android devices, you&#8217;ll need a PDF viewer installed to the emulator or device.</p>
<p><img class="alignnone size-full wp-image-7869" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/report-android.png" alt="report-android.png" width="1388" height="1136" /></p>
<p>&nbsp;</p>
<h1>The Footer View Template</h1>
<p>On iOS, notice that the new FooterViewTemplate is used, which resembles Apple-music style view template. On Android, since the tabs are placed on the top, the view template is used at the bottom of the screen.</p>
<p><img class="alignnone size-full wp-image-7817" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/footer-view-template.png" alt="footer-view-template.png" width="1519" height="918" /></p>
<p>The FooterViewTemplate is a new feature added in Crosslight 5.1. In iOS, to use thew new <strong>FotoerViewTemplate</strong>, simply override the property in the TabViewController and return the Nib file.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;"> </span><span style="color: #333333;">FooterViewTemplate</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;">(</span><span style="color: #3364a4;">AssignmentDetailTabFooter</span><span style="color: #333333;">.</span><span style="color: #333333;">Nib</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>If you&#8217;d like, you can also apply the translucent blur effect to the FooterViewTemplate by providing a <strong>Visual Effect View</strong> element using Xcode.</p>
<p><img class="alignnone size-full wp-image-7824" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/Screen-Shot-2016-03-29-at-4.15.07-PM.png" alt="Screen Shot 2016-03-29 at 4.15.07 PM.png" width="2264" height="1204" /></p>
<p>Here&#8217;s the result when applied.</p>
<p><video style="width: 300px; height: 100%;" src="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" preload="metadata" controls="controls" width="700" height="150"><source type="video/mp4" src="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" /><a href="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2"> http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2 </a></video></p>
<p>Also note that when you use the <strong>FooterViewTemplate</strong>, Crosslight.iOS automatically calculates the height of the <strong>FooterViewTemplate</strong> and readjusts the content bounds above it, so that the contents not &#8220;overlayed&#8221; and obscured by the <strong>FooterViewTemplate</strong>. Very nifty.</p>
<p>On Android, you would simply override the <strong>ContentLayoutId</strong> of the <strong>AssignmentDetailTabFragment</strong> and return the layout you would like to use.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">&lt;?</span><span style="color: #333333;">xml</span><span style="color: #333333;"> </span><span style="color: #333333;">version</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">encoding</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">utf</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">8</span><span style="color: #f57d00;">&#8220;</span><span style="color: #009695;">?&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:android</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:app</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">auto</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.TabLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">tab_layout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">app:tabTextAppearance</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@style</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">CustomTabText</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">fragment_container</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">50dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:paddingLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:paddingRight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">DADADA</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">50dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">StartButtonLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ImageButton</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">StartButton</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:scaleType</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">fitCenter</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">00000000</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:src</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Start</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">FrameLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterElapsedTimeLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ElapsedTime</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterNameLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textStyle</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">bold</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterContactPersonLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ContactPerson</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">ActivePendingLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">70dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">|</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ACTIVE</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">3BD606</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">|</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">70dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularTextViewGreen</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">AcceptRejectLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">80dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">✓</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">ffffff</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">22sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularButtonBlue</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">X</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">ffffff</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">22sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularButtonRed</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">FrameLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span></span></p>
<p>One thing to note is the middle FrameLayout with the ID <strong>fragment_container</strong>. You&#8217;ll need to provide this or the fragment transaction would not work properly.</p>
<h1>Single-Responsibility Principle</h1>
<p>Before we proceed, I want you to think about this problem for a second: since an assignment can be manipulated from so many places: the list screen, the detail screen and the map screen, what design approach is best used to &#8220;sync&#8221; the assignment state from any screens, but in an elegant way? For example, the user can start an assignment from the list screen, then from the detail screen, the user pauses, changes the assignment status, then go back to the map screen, plays the assignment once more, change the assignment status to Active, and so on.</p>
<p>We need to access the assignment from various ViewModels across the app, but we must ensure that the assignment states are correct whenever it is accessed anywhere. In this sample, we&#8217;ve used the <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle" target="_blank">Single-Responsibility Principle</a> to address this problem, exhibited by <strong>AssignmentViewModel.cs</strong> located inside <strong>FieldService.Core/ViewModels</strong> folder. This single class holds a unified information for the Active Assignment as well as any other commands that can interact with the assignment, such as accepting, rejecting, starting, changing status, etc.</p>
<p>Crosslight provides an elegant solution to this problem with the IoC (Inversion of Control) pattern. By registering the ViewModel once in the Container class, you can easily resolve and use this ViewModel anywhere. To begin with, open the <strong>AppService.cs</strong> file inside <strong>FieldService.Core/Infrastructure</strong> folder where you&#8217;ll an entry that looks similar to the following.</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">assignment</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">model</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">streamlines</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">all</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">assignment</span><span style="font-style: italic; color: #888888;">&#8211;</span><span style="font-style: italic; color: #888888;">related</span><span style="font-style: italic; color: #888888;"> logics</span><br />
<span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">which</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">is</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">resolved</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">numerous</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">ViewModels</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">such</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">as</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">list</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">map</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">and</span><span style="font-style: italic; color: #888888;"> detail</span><br />
<span style="color: #3364a4;">Container</span><span style="color: #333333;">.</span><span style="color: #333333;">Current</span><span style="color: #333333;">.</span><span style="color: #333333;">Register</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">&gt;(</span><span style="color: #333333;">c</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">())</span><span style="color: #333333;">.</span><span style="color: #333333;">WithLifetimeManager</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ContainerLifetime</span><span style="color: #333333;">())</span><span style="color: #333333;">;</span></span></p>
<p>To resolve the registered ViewModel anyhwere, all you need to do is create a getter-only property that resolves the ViewModel from the Container. For example, as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">AssignmentViewModel</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Container</span><span style="color: #333333;">.</span><span style="color: #333333;">Current</span><span style="color: #333333;">.</span><span style="color: #333333;">Resolve</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>Once this is done, you can easily use the object inside your BindingProvider and ensure that the data bindings work flawlessly across screens.</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Command</span><span style="font-style: italic; color: #888888;"> bindings</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">ChangeStatusCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">RejectCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">AcceptCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">StartButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">StartCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></span></p>
<p>Very simple and elegant.</p>
<h1>The Items Screen</h1>
<p>Let&#8217;s take a brief look at the Items screen.</p>
<p><img class="alignnone size-full wp-image-7876" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/items-screen.png" alt="items-screen.png" width="1332" height="1136" /></p>
<p>At a first glance, there&#8217;s nothing quite special in the Items screen. Until you try to swipe down.</p>
<p><img class="alignnone size-full wp-image-7881" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/search.png" alt="search.png" width="1416" height="1136" /></p>
<p>&nbsp;</p>
<p>Notice that when you hit on the search bar, the status bar color changes according to the overridden <strong>PreferredStatusBarStyle.</strong></p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIStatusBarStyle</span><span style="color: #333333;"> </span><span style="color: #333333;">PreferredStatusBarStyle</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SearchDisplayController</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SearchDisplayController</span><span style="color: #333333;">.</span><span style="color: #333333;">Active</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIStatusBarStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Default</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIAppearanceSettings</span><span style="color: #333333;">.</span><span style="color: #333333;">StatusBarStyle</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>When you try to run this project on an iPad, you&#8217;ll get a popover controller when you try to add an item, and when you edit an item, you&#8217;ll get a nice modal ViewController that is displayed in the middle of the screen.</p>
<p><img class="alignnone size-full wp-image-7887" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/items-ipad.png" alt="items-ipad.png" width="2000" height="756" /></p>
<p>This corresponds to the BindingProvider defined for this view.</p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isTablet</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">SelectedCommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">NavigateToEditorCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailNavigationTargetProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationTarget</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">AssignmentExpenseEditorViewModel</span><span style="color: #333333;">))</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></span></p>
<p>And in the ViewModel, the <strong>NavigateToEditorCommand</strong> invokes the following method.</p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteNavigateToEditor</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">DialogPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">ShowAsync</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentItemsEditorViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogOptions</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            NeutralButtonStyle </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogButtonStyle</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Colors</span><span style="color: #333333;">.</span><span style="color: #333333;">Red</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>When executing the Add command:</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteAdd</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">     </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentItemsEditorViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">TabViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            NavigationMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationMode</span><span style="color: #333333;">.</span><span style="color: #333333;">Modal</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            EnsureNavigationContext </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            ModalPresentationStyle </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ModalPresentationStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">FormSheet</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            PreferPopover </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            CommandId </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Add</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Labor Hours Screen</h1>
<p>In the Labor Hours screen, the experience is pretty similar when adding or editing an item.</p>
<p><img class="alignnone size-full wp-image-7902" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours-ipad.png" alt="labor-hours-ipad.png" width="2000" height="730" /></p>
<p>Perhaps one particular interesting technique is how to update the footer total Labor Hours at runtime. If you notice closely, when you edit any of the labor hours or add a new entry with a specified Labor Hours, the total labor hours sums up automatically.</p>
<p><img class="alignnone size-full wp-image-7926" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours.png" alt="labor-hours.png" width="2000" height="618" /></p>
<p>To achieve that effect, we provide the <strong>FooterViewTemplate</strong> for the Labor Hours screen.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;"> </span><span style="color: #333333;">FooterViewTemplate</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;">(</span><span style="color: #3364a4;">DetailFooterLayout</span><span style="color: #333333;">.</span><span style="color: #333333;">Nib</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>And here&#8217;s the <strong>DetailFooterLayout</strong>.</p>
<p><img class="alignnone size-full wp-image-7916" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/status-label-ios.png" alt="status-label-ios.png" width="1822" height="1080" /></p>
<p>Then in the BindingProvider, we bind the label to.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">StatusLabel</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">TextProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingDescription</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TabViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">TotalLaborHours</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> StringFormat </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Labor</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Hours</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">(</span><span style="color: #f57d00;">{</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">}</span><span style="color: #f57d00;">)</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span></span></p>
<p>Which corresponds to the parent ViewModel (TabViewModel) property&#8217;s active Assignment with its <strong>TotalLaborHours</strong> property.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">IgnoreDataMember</span><span style="color: #333333;">]</span><br />
<span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">double</span><span style="color: #333333;"> </span><span style="color: #333333;">TotalLaborHours</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TimeSpan</span><span style="color: #333333;">.</span><span style="color: #333333;">FromTicks</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Labors</span><span style="color: #333333;">.</span><span style="color: #333333;">Sum</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">Ticks</span><span style="color: #333333;">))</span><span style="color: #333333;">.</span><span style="color: #333333;">TotalHours</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>This way, we should be able to centralize the labor hours binding to the same property, eliminating unnecessary workarounds to elegantly achieve this effect.</p>
<h1>Validating Input Using Form Validation Metadata</h1>
<p>When you input a new labor hour entry, or edit an existing one. If you open the <strong>FieldServiceModel.Metadata.cs</strong> file inside <strong>FieldService.Core/DomainModels</strong> folder, you&#8217;ll see the following.</p>
<p><img class="alignnone size-full wp-image-7937" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/validation-metadata.png" alt="validation-metadata.png" width="1976" height="960" /></p>
<p>If you notice there, there are two validation metadata, one is for the Expense entry and one is for the Labor entry. In this example, we&#8217;ve ensured that the Ticks property is a Required Entry and the minimum number for the ticks is 1. Once these conditions are satisfied, then the form is considered a vaild entry and the changes will be saved. Similar to the Expense entry, we&#8217;ve enforced that the Price should be greater than 1.</p>
<p><img class="alignnone size-full wp-image-7944" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours-validation.png" alt="labor-hours-validation.png" width="1496" height="1136" /></p>
<p>The important thing to ensure that the validation metadata works properly is that you create a partial class from the model that you want to validate, and decorate it with the <strong>EntityMetadataAttribute</strong>.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">EntityMetadata</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Labor</span><span style="color: #333333;">.</span><span style="color: #3364a4;">LaborValidationMetadata</span><span style="color: #333333;">))]</span><br />
<span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Labor</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LaborValidationMetadata</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Required</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Min</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #009695;">long</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> ErrorMessage </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Hours</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">must</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">be</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">greater</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">than</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">long</span><span style="color: #333333;"> </span><span style="color: #333333;">Ticks</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">get</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #009695;">set</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Expense Screen</h1>
<p>The Expense screen also uses pretty much the same technique with the Items and Labor Hours screen, which uses popover for adding new items and modal ViewController for the editing screen.</p>
<p><img class="alignnone size-full wp-image-7959" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/expense-screen-ios.png" alt="expense-screen-ios.png" width="1938" height="1458" /></p>
<p>When you go to the editor screen, we improved on the Form Builder experience a bit to support the image editor detail scenario as follows.</p>
<p><img class="alignnone size-full wp-image-7964" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/edit-image-form-builder.png" alt="edit-image-form-builder.png" width="2000" height="1417" /></p>
<p>And in Android,</p>
<p><img class="alignnone size-full wp-image-7966" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/image-editor-android.png" alt="image-editor-android.png" width="2000" height="1239" /></p>
<p>The FormMetadata is as simply as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSection</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Editor</span><span style="color: #333333;">(</span><span style="color: #333333;">EditorType</span><span style="color: #333333;">.</span><span style="color: #333333;">Image</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Layout</span><span style="color: #333333;">(</span><span style="color: #333333;">Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> LayoutStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailOnly</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Image</span><span style="color: #333333;">(</span><span style="color: #333333;">Height </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">200</span><span style="color: #333333;">,</span><span style="color: #333333;"> Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">photo</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">png</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> Padding </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">8</span><span style="color: #333333;">,</span><span style="color: #333333;"> ScaleMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> ImageScaleMode</span><span style="color: #333333;">.</span><span style="color: #333333;">ScaleAspectFill</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">ImagePicker</span><span style="color: #333333;">(</span><span style="color: #333333;">ImageResultMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> ImageResultMode</span><span style="color: #333333;">.</span><span style="color: #333333;">Both</span><span style="color: #333333;">,</span><span style="color: #333333;"> UseThumbnailResult </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">,</span><span style="color: #333333;"> PickerResultCommand </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">FinishImagePickerCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">byte</span><span style="color: #333333;">[]</span><span style="color: #333333;"> </span><span style="color: #333333;">Image</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>Jump to Complete Screen</h1>
<p>Another interesting interaction in this app is how you can directly jump to the Complete screen when you decide Complete the assignment, either from the List screen, Map screen, or from the assignment detail.</p>
<p><img class="alignnone size-full wp-image-7970" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/jump-complete-android.png" alt="jump-complete-android.png" width="2000" height="620" /></p>
<p>Due to the Single Responsibility principle that we&#8217;ve used in this application, achieving this scenario is very easy. In the <strong>AssignmentViewModel</strong>, simply navigate to the Confirmation screen.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">isFromConfirmationPage</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isFromConfirmationPage</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecutePendingOrComplete</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">already</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">detail</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">focus</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">confirmation</span><span style="font-style: italic; color: #888888;"> screen</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetDetailSelectedIndex</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">we</span><span style="font-style: italic; color: #888888;">&#8216;</span><span style="font-style: italic; color: #888888;">re</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">main</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">perform</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> detail</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AutoFocusToConfirmation</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecuteNavigateToDetail</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Completion Screen</h1>
<p>In the Completion screen, you&#8217;ll be greeted with two major UI elements: the Photos Grid/Collection View and a Signature Pad. If you try to complete the assignment immediately without entering any signature, you&#8217;ll get a toast message as follows.</p>
<p><img class="alignnone size-full wp-image-7989" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/android-completion.png" alt="android-completion.png" width="1783" height="1136" /></p>
<p>You can add additional photos when completing the assignment for extra information.</p>
<p><img class="alignnone size-full wp-image-7992" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/add-photo-completion.png" alt="add-photo-completion.png" width="1784" height="1136" /></p>
<p>The code to execute the completion of an assignment is pretty straightforward.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">This</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">already</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">completed</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><span style="color: #333333;"> </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Active</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">To</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">complete</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">this</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;">,</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">please</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">draw</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">your</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">sign</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">in</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">the</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">signature</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">pad</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">TabViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSignatureImageViewVisible</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSignatureCanvasVisible</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">CompleteCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddPhotoCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ClearSignatureCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">completed</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">You</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">need</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">to</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">activate</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">the</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">first</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>You can also clear the signature you&#8217;ve entered by hitting the Clear button above the Signature Pad.</p>
<h1>Disable Editing After Completed</h1>
<p>After you&#8217;ve completed an assignment, you won&#8217;t be able to make any changes to any of the items available in the Assignment Detail. This includes Items, Labor Hours, Expenses, Photos and Signature. This is possible because we simply need to check for the current Assignment&#8217;s Status and see if an operation can be completed.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">MaxLength</span><span style="color: #333333;">(</span><span style="color: #f57d00;">255</span><span style="color: #333333;">)]</span><br />
<span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">{</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;">)</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">GetValue</span><span style="color: #333333;">(</span><span style="color: #333333;">StatusPropertyMetadata</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">set</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetValue</span><span style="color: #333333;">(</span><span style="color: #333333;">StatusPropertyMetadata</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">}</span></span></p>
<p>In the ViewModel, you would simply override the CanExecute method and see if the assignment is completed before executing your method.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">CanExecuteSave</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNewItem</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">    </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">CanExecuteSave</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>This is done so elegantly that you don&#8217;t have to access any of the platform-specific views to accomplish this.</p>
<h1>Wrapping Up</h1>
<p>Hopefully this post provides you with even more insights on what&#8217;s happening behind the scenes with the new Crosslight Field Service sample. If you&#8217;d like to see more Xamarin samples to be converted to Crosslight, please do let us know in the comments section below.</p>
<p>Till next post,<br />
Nicholas Lie</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" length="406271" type="video/mp4" />
		</item>
		<item>
		<title>Creating Dockable View for iOS and Android</title>
		<link>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/#comments</comments>
		<pubDate>Mon, 23 Nov 2015 11:51:49 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R2]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[2015 r2]]></category>
		<category><![CDATA[dockable]]></category>
		<category><![CDATA[dockable view]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[Mobile Development]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5182</guid>
		<description><![CDATA[In my previous post, I&#8217;ve shown you how to use a header and footer with custom views in a list/table view. Now, what if I want to show a dockable view at the bottom of the screen? Let’s take the previous sample a bit further [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Screen Shot 2015-11-23 at 1.05.53 PM" style="float:right; margin:0 0 10px 10px;" /><p>In my previous <a href="http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/">post</a>, I&#8217;ve shown you how to use a header and footer with custom views in a list/table view. Now, what if I want to show a dockable view at the bottom of the screen? Let’s take the previous sample a bit further to look like the following.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.06.12-PM.png"><img class="alignnone size-large wp-image-5196" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.06.12-PM-1024x853.png" alt="Screen Shot 2015-11-23 at 2.06.12 PM" width="604" height="503" /></a></p>
<h1>Starting off</h1>
<p>To start off, I’ll just copy off the previous sample. If you haven’t read the <a href="http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/" target="_blank">previous post</a> on how to provide header and footer to your TableView / ListView, it is highly recommended for you to do so before continuing.</p>
<p>If you have done so, let’s move on.</p>
<h1>Creating dockable view on iOS</h1>
<p>To create the dockable view on iOS, you’ll need to do the following:</p>
<ul>
<li>Preparing custom table root view</li>
<li>Modifying the View</li>
<li>Modifying the View Controller</li>
</ul>
<h2>Preparing custom table root view</h2>
<p>To provide the custom table root view, you’ll need to create a new <strong>Crosslight iOS View for iPhone</strong>, which is accessible from the Item Templates, available after you’ve successfully installed Crosslight.</p>
<p>Right click on the Views in HeaderAndFooter.iOS/Views folder and select <strong>Add</strong>, <strong>New Item.</strong></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.09.45-PM.png"><img class="alignnone size-full wp-image-5197" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.09.45-PM.png" alt="Screen Shot 2015-11-23 at 2.09.45 PM" width="970" height="408" /></a></p>
<p>Then choose, <strong>Crosslight iOS View for iPhone</strong>. Give it a name of <strong>CustomTableRootView</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.13.23-PM.png"><img class="alignnone size-large wp-image-5198" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.13.23-PM-1024x786.png" alt="Screen Shot 2015-11-23 at 2.13.23 PM" width="604" height="464" /></a></p>
<p>First, let’s try to create a the custom table root view. Open the <strong>CustomTableRootView.xib </strong>in Xcode Interface Builder.</p>
<h3>Adding the Docked View</h3>
<p>Drag a new <strong>View</strong> from the <strong>Object library</strong>, set the outlet as <strong>DockedView</strong>, and provide the following constraints:</p>
<ul>
<li><strong>Horizontal Space </strong><strong>Constraint</strong>: from <em>Superview.Trailing</em> equal to the <em>View.Trailing</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.08-AM.png"><img class="alignnone size-large wp-image-5199" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.08-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.08 AM" width="604" height="365" /></a></li>
<li><strong>Vertical Space Constraint</strong>: from <em>Superview.Bottom</em> equal to the <em>View.Bottom</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.10-AM.png"><img class="alignnone size-large wp-image-5200" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.10-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.10 AM" width="604" height="365" /></a></li>
<li><strong>Horizontal Space Constraint</strong>: from <em>DockedView.Leading</em> equal to the <em>Superview.Leading</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.12-AM.png"><img class="alignnone size-large wp-image-5201" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.12-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.12 AM" width="604" height="365" /></a></li>
</ul>
<p>Now that the docked view is ready, let’s drag a <strong>Label</strong>, set the outlet as <strong>TxtHeader</strong>, and drag a button, set the outlet as <strong>BthHeader</strong>. Both of them are given the previous outlet names, so that no code changes will be required in the <strong>BindingProvider</strong> side. If you wish, you can set the following constraints:</p>
<ul>
<li>Give the DockedView a height of 45.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM.png"><img class="alignnone size-large wp-image-5202" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM-1024x619.png" alt="Screen Shot 2015-11-23 at 1.05.53 PM" width="604" height="365" /></a></li>
<li>Vertically align the label as well as the button.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.19.44-PM.png"><img class="alignnone size-large wp-image-5203" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.19.44-PM-1024x774.png" alt="Screen Shot 2015-11-23 at 2.19.44 PM" width="604" height="457" /></a></li>
<li>Give an inner padding of 20.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.20.49-PM.png"><img class="alignnone size-large wp-image-5204" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.20.49-PM-1024x767.png" alt="Screen Shot 2015-11-23 at 2.20.49 PM" width="604" height="452" /></a></li>
</ul>
<p>That’s pretty much it. Let’s modify the View a bit.</p>
<h2>Modifying the View</h2>
<p>Let’s open the <strong>CustomTableRootView.cs </strong>and modify that a bit by adding a new <strong>ResizeTableView</strong> method.</p><pre class="crayon-plain-tag">using System;
using System.Drawing;
using System.Linq;
using CoreGraphics;
using Foundation;
using UIKit;

namespace HeaderAndFooter.iOS
{
    public partial class CustomTableRootView : UIView
    {
        #region Constructors

        public CustomTableRootView(IntPtr handle) : base(handle)
        {
        }

        #endregion

        #region Fields

        public static readonly UINib Nib = UINib.FromName("CustomTableRootView", NSBundle.MainBundle);

        #endregion

        #region Methods

        public static CustomTableRootView Create()
        {
            return (CustomTableRootView) Nib.Instantiate(null, null)[0];
        }


        internal void ResizeTableView(nfloat top)
        {
            var tableView = this.Subviews.FirstOrDefault(o =&gt; o is UITableView);
            tableView.Frame = new CGRect(0, top, tableView.Bounds.Width, this.Bounds.Height - top - this.DockedView.Bounds.Height);
        }

        #endregion
    }
}</pre><p>Here, we prepare a handy method to resize the table view when the view is used, called <strong>ResizeTableView</strong>. By calling this method, the <strong>TableView</strong> that contains this dock view will have its bounds re-adjusted. This is done so that the scrolling container in the <strong>TableView</strong> does not exceed the docked view. Take a closer a look at the contents of the method.</p>
<p>In line 36, we first search for the TableView that is added as a subview of the <strong>ViewController</strong>. In line 37, we set a new bounds for it, not changing the width at all, but just by adjusting the height by taking account the <strong>DockedView.Bounds.Height</strong> as well.</p>
<h2>Modifying the View Controller</h2>
<p>Next, open up the <strong>MainViewController.cs</strong>. Here’s the contents.</p><pre class="crayon-plain-tag">using CoreGraphics;
using Foundation;
using HeaderAndFooter.ViewModels;
using Intersoft.Crosslight;
using Intersoft.Crosslight.iOS;
using UIKit;

namespace HeaderAndFooter.iOS.ViewControllers
{
    [Register("MainViewController")]
    [ImportBinding(typeof(MainBindingProvider))]
    public class MainViewController : UITableViewController&lt;MainViewModel&gt;
    {
        #region Properties

        public override UIViewTemplate FooterViewTemplate
        {
            get { return new UIViewTemplate(CustomFooter.Nib); }
        }

        public override TableViewInteraction InteractionMode
        {
            get { return TableViewInteraction.Navigation; }
        }

        public override bool ShowGroupHeader
        {
            get { return false; }
        }

        public override UITableViewStyle TableViewStyle
        {
            get { return UITableViewStyle.Plain; }
        }

        public override bool UseCustomRootView
        {
            get { return true; }
        }

        #endregion

        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            // set navigation title
            this.NavigationItem.Title = "Crosslight App";
        }

        protected override UIView GetCustomRootView()
        {
            return CustomTableRootView.Create();
        }

        public override void ViewWillLayoutSubviews()
        {
            base.ViewWillLayoutSubviews();

            // adjust tableview frame based on top layout guide	
            ((CustomTableRootView)this.View).ResizeTableView(this.TopLayoutGuide.Length);
        }

        #endregion
    }
}</pre><p>Here, we removed the overridden property for <strong>HeaderViewTemplate</strong>, since we’re going to use the new <strong>DockedView</strong> to replace the header. Therefore, we then override a new property called <strong>UseCustomRootView</strong> and return true.</p>
<p>After we&#8217;ve done that, we then override the <strong>GetCustomRootView()</strong> method to return the CustomTableRootView that we’ve just created by calling <strong>CustomTableRootView.Create()</strong>;</p>
<blockquote><p>The custom root view is one of the unique features introduced in Crosslight&#8217;s advanced <a href="http://developer.intersoftsolutions.com/display/crosslight/iOS+Table+View">UITableViewController</a>. It allows you to easily replace the root view with a custom one with just a few property sets, while still retaining the developer experience and automatic binding feature. In the case above, when <strong>UseCustomRootView</strong> is returning a true value, the <strong>GetCustomRootView</strong> method will be automatically called when the controller is initializing.</p></blockquote>
<p>Lastly, we override the <strong>ViewWillLayoutSubviews</strong> method. This method is called when a new subview is added to the <strong>ViewController</strong>, which can be done at any time, whether during <strong>ViewController</strong> creation or programmatically adding a subview at runtime, therefore, when the <strong>DockedView</strong> is added, we then call our handy method to resize the TableView so that the scrolling container wouldn’t “bleed” past the <strong>DockedView</strong>.</p>
<p>That’s it. Run the project and you should get the result similar to the following video.</p>
<div style="width: 400px; " class="wp-video"><!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->
<video class="wp-video-shortcode" id="video-5182-1" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4?_=1" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4</a></video></div>
<h1>Creating dockable view on Android</h1>
<p>Now that we’ve finished the iOS version, let’s create the Android version. To create the docakble view on Android, you’ll need to complete the following:</p>
<ul>
<li>Preparing custom layout</li>
<li>Replacing the content layout in Activity</li>
</ul>
<h2>Preparing custom layout</h2>
<p>First things first, let’s create a new Android Layout, and let’s name it <strong>CustomLayout.axml</strong>. To do this, right click on the <strong>HeaderAndFooter.Android/Resources/layout</strong> folder.</p>
<p><img class="alignnone size-full wp-image-5208" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.11-PM.png" alt="Screen Shot 2015-11-23 at 2.47.11 PM" width="952" height="516" /></p>
<p>Select <strong>Add</strong>, <strong>New Item</strong>. Under <strong>Android</strong>, select <strong>Layout</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.50-PM.png"><img class="alignnone size-large wp-image-5209" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.50-PM-1024x785.png" alt="Screen Shot 2015-11-23 at 2.47.50 PM" width="604" height="463" /></a></p>
<p>Provide the layout for the <strong>CustomLayout.axml</strong> as follows.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &lt;LinearLayout
        android:id="@+id/Footer"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="vertical"&gt;
        &lt;LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="1px"
            android:background="#f2f2f2" /&gt;
        &lt;LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"&gt;
            &lt;TextView
                android:id="@+id/TxtHeader"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_weight="1"
                android:gravity="left"
                android:textSize="20sp" /&gt;
            &lt;Button
                android:id="@+id/BtnHeader"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;
    &lt;ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/Footer" /&gt;
&lt;/RelativeLayout&gt;</pre><p>Let’s take a closer look. Here, we’ve used a <strong>RelativeLayout</strong> as the root <strong>ViewGroup </strong>and we’ve added 2 major elements to the <strong>RelativeLayout</strong>, which is a <strong>LinearLayout</strong> that will act as our <strong>DockedView</strong> and <strong>ListView</strong>.</p>
<blockquote><p>At a glance, you might be wondering why the <strong>ListView</strong> is defined after the <strong>LinearLayout</strong>. This is purely for build purposes. The XML parser parses the text from top to bottom. Since in the <strong>ListView</strong>, we’ve defined<strong> android:layout_above=“@id/Footer”,</strong> the build will fail if the LinearLayout is not defined beforehand. Hence, the <strong>ListView</strong> is defined after the <strong>LinearLayout</strong>.</p></blockquote>
<p>One important thing to notice that the <strong>ListView’s</strong> id is set to<strong> @android:id/list</strong>. This conforms the standard method to override the built-in ListActivity&#8217;s layout in native Android development itself. For more information on that topic, click <a href="http://developer.android.com/reference/android/app/ListActivity.html" target="_blank">here</a>. This is done because in the <strong>ListActivity</strong> class, you can reference the <strong>ListView</strong> as simply as calling <strong>this.ListView</strong>, however since you’ve overridden the whole layout, then the <strong>ListView</strong> must be re-referenced this way so that the Android understands. Everything else is just standard Android layouting process.</p>
<h2>Replacing the content layout in Activity</h2>
<p>After the layout is prepared, let’s modify some codes in the Activity. Open up <strong>MainActivity.cs</strong> inside <strong>HeaderAndFooter.Android/Activities</strong> folder and see the contents as follows.</p><pre class="crayon-plain-tag">using Android.App;
using HeaderAndFooter.ViewModels;
using Intersoft.Crosslight;
using Intersoft.Crosslight.Android;

namespace HeaderAndFooter.Android
{
    [Activity(Label = "Crosslight App", Icon = "@drawable/icon")]
    [ImportBinding(typeof(MainBindingProvider))]
    public class MainActivity : ListActivity&lt;MainViewModel&gt;
    {
        #region Properties

        protected override int ContentLayoutId
        {
			get { return Resource.Layout.CustomLayout; }
        }

        protected override int FooterLayoutId
        {
            get { return Resource.Layout.CustomFooter; }
        }

        public override ListViewInteraction InteractionMode
        {
            get { return ListViewInteraction.Navigation; }
        }

        #endregion

        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            this.RegisterViewIdentifier("TableView", this.ListView);
        }

        #endregion
    }
}</pre><p>In the <strong>ContentLayoutId </strong>property, we’ve replaced the old layout to the new <strong>CustomLayout</strong> that we’ve created earlier and we’ve also removed the <strong>HeaderLayoutId</strong>. You’ve completed the Android version. Let’s run this project and you should get the result similar to the following.</p>
<div style="width: 400px; " class="wp-video"><video class="wp-video-shortcode" id="video-5182-2" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4?_=2" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4</a></video></div>
<h1>Wrapping Up</h1>
<p>You’ve seen how easy and elegant it is to provide a dockable view to your table view on iOS as well as list view on Android. Achieving the same task without Crosslight would be really tedious and time consuming. The dockable view also comes with automatic binding support, so you can take advantage of native binding process with whatever layout you have. Nice and simple.</p>
<p>You can find the code to the sample here:<br />
<a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightdockableview/browse" target="_blank">http://git.intersoftsolutions.com/projects/CT/repos/crosslightdockableview/browse</a>. To use this sample, you’ll need at least <a href="http://git.intersoftsolutions.com/projects/CROS/repos/updates/browse/Crosslight4_0_5000_323" target="_blank">Crosslight build 4.0.5000.323</a> and above.</p>
<p>See you in the next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4" length="668912" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4" length="305590" type="video/mp4" />
		</item>
		<item>
		<title>Extending Crosslight Form Builder</title>
		<link>http://blog.intersoftsolutions.com/2015/11/extending-crosslight-form-builder-2/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/extending-crosslight-form-builder-2/#comments</comments>
		<pubDate>Tue, 17 Nov 2015 07:00:18 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[form builder]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5101</guid>
		<description><![CDATA[Since you’ve managed to get started with Crosslight Form Builder, let’s move on a bit to see how we can extend the capabilities of the Crosslight Form Builder beyond its original capabilities. In this post we’re going to learn how to add an option to [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled.001-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Untitled.001" style="float:right; margin:0 0 10px 10px;" /><p>Since you’ve managed to <a href="http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/">get started with Crosslight Form Builder</a>, let’s move on a bit to see how we can extend the capabilities of the Crosslight Form Builder beyond its original capabilities. In this post we’re going to learn how to add an option to choose the driver in <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightformbuilder/browse">CrosslightFormBuilder sample</a>, as well as showing a custom view with the driver’s photo in the form, with the driver&#8217;s phone number, which when tapped, will initiate a call to the driver.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled.001.png"><img class="alignnone size-large wp-image-5108" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled.001-1024x768.png" alt="Untitled.001" width="604" height="453" /></a></p>
<p>&nbsp;</p>
<p>There are two major enhancements to be done:</p>
<ul>
<li>Providing driver selection</li>
<li>Providing custom driver view</li>
</ul>
<h1>Providing Driver Selection</h1>
<p>Let&#8217;s try to create the <strong>Driver</strong> selection. At a quick overview, here&#8217;s a list of subtasks to be done in order to achieve this functionality:</p>
<ul>
<li>Prepare the <strong>Driver</strong> model</li>
<li>Prepare the <strong>Driver Repository</strong> that populates the list of drivers.</li>
<li>Prepare the <strong>DriverListViewModel </strong>that populates the items from the repository.</li>
<li>Update the <strong>Form Metadata </strong>and connect the <strong>DriverListViewModel</strong>.</li>
</ul>
<p>Let&#8217;s go through each one, step-by-step.</p>
<h2>Prepare the Driver model</h2>
<p>To create the <strong>Driver</strong> model, let&#8217;s create a new file named <em>Driver.cs</em> under <strong>CrosslightFormBuilder.Core/Models</strong> folder. The contents are as follows.</p><pre class="crayon-plain-tag">#region Usings

using CrosslightFormBuilder.Models;

#endregion

namespace CrosslightFormBuilder.Core.Models
{
    public class Driver : ModelBase
    {
        #region Constructors

        public Driver(int id, string name, string phone, byte[] image)
        {
            this.Id = id;
            this.Name = name;
            this.Phone = phone;
            this.Image = image;
        }

        #endregion

        #region Fields

        private int _id;
        private byte[] _image;
        private string _name;
        private string _phone;

        #endregion

        #region Properties

        public int Id
        {
            get { return _id; }
            set
            {
                if (_id != value)
                {
                    _id = value;
                    OnPropertyChanged("Id");
                }
            }
        }

        public byte[] Image
        {
            get { return _image; }
            set
            {
                if (_image != value)
                {
                    _image = value;
                    OnPropertyChanged("Image");
                }
            }
        }

        public string Name
        {
            get { return _name; }
            set
            {
                if (_name != value)
                {
                    _name = value;
                    OnPropertyChanged("Name");
                }
            }
        }

        public string Phone
        {
            get { return _phone; }
            set
            {
                if (_phone != value)
                {
                    _phone = value;
                    OnPropertyChanged("Phone");
                }
            }
        }

        #endregion
    }
}</pre><p>The Driver model contain 4 MVVM-ready properties: <strong>ID</strong> (<em>int</em>), <strong>Image</strong> (<em>byte[]</em>), <strong>Name </strong>(<em>string</em>), and <strong>Phone</strong> (<em>string</em>). That&#8217;s basically it. I&#8217;ve also prepared a constructor for quick and easy initialization. Now your Driver model is ready. Let&#8217;s move on.</p>
<h2>Prepare the Driver Repository</h2>
<p>Upon reading the heading, you might have two questions: What is this repository thingy and why do I need it? The repository pattern is more of a best-practice design pattern that handles the actual data processing for your applications. A data repository for your app.</p>
<p>For example, right now your app might currently retrieve data by performing queries to a database server, then one day you decided to change the data retrieval process. Rather than making changes to each and every <em>ViewModel</em>, you can do so by just replacing the data repository. No changes in ViewModel needed. To learn more about the Repository Pattern, check out our Developer Center documentation <a href="http://developer.intersoftsolutions.com/display/crosslight/Repository+Pattern">here</a>.</p>
<p>So, let&#8217;s get started in creating our <strong>Driver repository</strong>. First thing you need to do is define the interfaces needed for the repository. Create a new interface in <em>CrosslightFormBuilder.Core/ModelServices</em>, named <strong>IDataRepository.cs</strong>, also creating the folder as necessary. The contents of the file are as follows.</p><pre class="crayon-plain-tag">public interface IDataRepository&lt;TEntity, in TKey&gt; where TEntity : class
{
    #region Methods

    TEntity Get(TKey id);
    IEnumerable&lt;TEntity&gt; GetAll();

    #endregion
}</pre><p>We&#8217;ll prepare an interface to get the <em>Driver</em> entity based on the given ID. Notice that everything is defined as generic here. Also another interface to return all entities when calling <em>GetAll()</em> method.</p>
<p>Proceed by creating the interface for the <em>Driver</em> repository in <em>CrosslightFormBuilder.Core/ModelServices </em>folder, named <strong>IDriverRepository.cs</strong>, also creating the folder as necessary.</p><pre class="crayon-plain-tag">public interface IDriverRepository : IDataRepository&lt;Driver, int&gt;
{
    #region Methods

    Driver GetByName(string name);

    #endregion
}</pre><p>There&#8217;s nothing much to see here, we simply added a new method to get the <em>Driver</em> entity by the driver&#8217;s <em>Name </em>by subclassing the previously created <em>IDataRepository</em> interface. Let&#8217;s move on by creating the concrete <em>DriverRepository</em> implementation. Create a new file called <strong>DriverRepository.cs </strong>inside <em>CrosslightFormBuilder.Core/ModelServices</em> folder.</p><pre class="crayon-plain-tag">public class DriverRepository : IDriverRepository
{
    #region Properties

    public List&lt;Driver&gt; _items { get; set; }

    #endregion

    #region Methods

    public Driver Get(int id)
    {
        return this.GetAll().FirstOrDefault(o =&gt; o.Id == id);
    }

    public IEnumerable&lt;Driver&gt; GetAll()
    {
        if (_items == null)
        {
            _items = new List&lt;Driver&gt;();
            _items.Add(new Driver(1, "John", "+123456", this.GetType().Assembly.GetManifestResourceStream("CrosslightFormBuilder.Core.Assets.john.png").ToByte()));
            _items.Add(new Driver(2, "Brad", "+134567", this.GetType().Assembly.GetManifestResourceStream("CrosslightFormBuilder.Core.Assets.brad.png").ToByte()));
            _items.Add(new Driver(2, "Charles", "+145678", this.GetType().Assembly.GetManifestResourceStream("CrosslightFormBuilder.Core.Assets.charles.png").ToByte()));
        }

        return _items;
    }

    public Driver GetByName(string name)
    {
        return this.GetAll().FirstOrDefault(o =&gt; o.Name == name);
    }

    #endregion
}</pre><p>Here, you can then provide the real implementation to retrieve the list of drivers, also getting the drivers by name and ID. The highlighted line shows how the list of <em>Drivers</em> are populated, by utilizing the constructor we&#8217;ve provided for our <em>Driver</em> model earlier. Also notice that we&#8217;ve provided the image to be used for each driver. Oh yeah, before we forget, let&#8217;s go ahead and use these images for the drivers and put it inside the <strong>CrosslightFormBuilder.Core/Assets</strong> folder, also creating the folder as needed.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/brad.png"><img class=" size-full wp-image-5118 alignleft" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/brad.png" alt="brad" width="200" height="200" /></a>  <a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/charles.png"><img class=" size-large wp-image-5119 alignleft" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/charles.png" alt="charles" width="200" height="200" /></a>  <a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/john.png"><img class=" size-large wp-image-5120 alignleft" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/john.png" alt="john" width="200" height="200" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Make sure that these images&#8217; <em>BuildAction</em> is set to <em>EmbeddedResource</em> so that they can be used in your application. Also, if you try to build the project now, you might get an error on the <em>ToByte()</em> method. To fix this, create a new file that contains an extension method to convert a <em>Stream</em> to array of bytes. Create a file named <em>StreamExtensions.cs, </em>and put it inside the <strong>CrosslightFormBuilder.Core/Extensions</strong> folder.</p><pre class="crayon-plain-tag">public static class StreamExtensions
{
    #region Methods

    public static byte[] ToByte(this Stream input)
    {
        using (MemoryStream ms = new MemoryStream())
        {
            input.CopyTo(ms);
            return ms.ToArray();
        }
    }

    #endregion
}</pre><p>A handy tip for you: these extension method provides an easy way to extend the functionalities of a certain class, that is reusable within your application. For example, if you wish to create an extension, for let&#8217;s say, converting a <em>string </em>to a <em>byte[]</em>, you can definitely do something similar to this.</p>
<p>Now that you&#8217;ve the got the repository part ready, let&#8217;s hook it up to the <em>ViewModel</em>.</p>
<h2>Prepare the DriverListViewModel</h2>
<p>Start by creating a new ViewModel file called <strong>DriverListViewModel.cs</strong> and put it inside <strong>CrosslightFormBuilder.Core/ViewModels</strong> folder. Here&#8217;s the contents of the file.</p><pre class="crayon-plain-tag">public class DriverListViewModel : ListViewModelBase&lt;Driver&gt;
{
    #region Constructors

    public DriverListViewModel()
    {
        this.SourceItems = this.Repository.GetAll().ToObservable();
    }

    #endregion

    #region Properties

    private IDriverRepository Repository
    {
        get
        {
            if (Container.Current.CanResolve&lt;IDriverRepository&gt;())
                return Container.Current.Resolve&lt;IDriverRepository&gt;();
            return new DriverRepository();
        }
    }

    #endregion
}</pre><p>Here, we populate the <em>SourceItems</em> when the <strong>DriverListViewModel</strong> is constructed, just by calling the previously created <em>GetAll()</em> method from our interface. Also notice that we&#8217;ve provided the <em>Repository</em> property which is resolved upon the property&#8217;s getter. This is also called as <em>IoC</em> (Inversion of Control). To use the <em>IoC</em> pattern, you&#8217;ll need to register the previously created <em>DriverRepository</em> to be used globally in the application. To do this, open up the <strong>AppService.cs</strong> file in the <em>CrosslightFormBuilder.Core/Infrastructure</em> folder and add this line in the constructor.</p><pre class="crayon-plain-tag">public CrosslightAppAppService(IApplicationContext context) : base(context)
{
    Container.Current.Register&lt;IDriverRepository, DriverRepository&gt;().WithLifetimeManager(new ContainerLifetime());
}</pre><p>Your <em>ViewModel</em> is now ready to be used to populate the list of <em>Drivers</em>.</p>
<h2>Update the FormMetadata</h2>
<p>Since you already have the list of drivers properly populated from the DriverListViewModel, we&#8217;ll need to modify the <strong>OrderFormMetadata</strong> a bit. From the initial <strong>OrderFormMetadata </strong>class in the <em>Order.cs </em>file, let&#8217;s modify the <strong>TaxiChoiceSection</strong> class to include the driver selection.</p><pre class="crayon-plain-tag">public class TaxiChoiceSection
{
    #region Fields

    [Display(Caption = "Car Type")]
    [Editor(EditorType.AutoDetect)]
    [Layout(Style = LayoutStyle.RightDetail)]
    public CarType CarType;

    [Editor(EditorType.Selection)]
    [SelectedItemBinding(Path = "Driver")]
    [Binding(Path = "Driver.Name")]
    [SelectionInput(SelectionMode.Single, DisplayMemberPath = "Name", ListSourceType = typeof(DriverListViewModel))]
    public Driver Driver;

    [Display(Caption = "Airport?")]
    [Editor(EditorType.Switch)]
    [Layout(Style = LayoutStyle.RightDetail)]
    public bool IsAirport;

    #endregion
}</pre><p>The highlighted lines above shows the added definition for the driver selection. Let&#8217;s inspect this line by line.</p>
<ul>
<li><em>[Editor(EditorType.Selection)]</em><br />
This determines which editor type to be used.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/selection.002.png"><img class="alignnone size-large wp-image-5122" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/selection.002-1024x768.png" alt="selection.002" width="604" height="453" /></a></li>
<li><em>[SelectedItemBinding(Path = &#8220;Driver&#8221;)]</em><br />
This attribute determines which binding path for the selected item used in the Form Builder. In this case, the item for the Form Builder is of type <strong>Order</strong>, which has the <strong>Driver</strong> property. That&#8217;s where we&#8217;re going to bind our selection into. (<strong>OrderViewModel.Item.Driver</strong>)</li>
<li><em>[Binding(Path = &#8220;Driver.Name&#8221;)]</em><br />
The <strong>BindingAttribute</strong> determines which property of the <strong>Driver</strong> model that is going to be displayed in the form after selection has completed.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/binding.png"><img class="alignnone size-full wp-image-5123" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/binding.png" alt="binding" width="491" height="232" /></a></li>
<li><em>[SelectionInput(SelectionMode.Single, DisplayMemberPath = &#8220;Name&#8221;, ListSourceType = typeof(DriverListViewModel))]</em><strong><br />
</strong>The <strong>SelectionInputAttribute </strong>determines the selection editor behavior, which <em>ViewModel</em> provides the items source for the list, as well as the property to be displayed on the list of selection, or also often known as <strong>DisplayMemberPath</strong>.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/selection-editor.png"><img class="alignnone size-full wp-image-5124" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/selection-editor.png" alt="selection editor" width="476" height="192" /></a></li>
</ul>
<p>By now, you&#8217;ve successfully provided a driver selection for the Form Builder. How about adding the custom view on the bottom of the form?</p>
<h1>Providing Custom Driver View</h1>
<p>After the user has selected the driver, it&#8217;s best for us to show the driver that the user has selected by providing a custom view at the bottom of the form. Let&#8217;s learn how you can use a custom view resource to be used along with the Form Builder, complete with data binding capabilities. In overall, there are several steps needed to achieve this:</p>
<ul>
<li>Provide the custom driver view for iOS</li>
<li>Update the Form Metadata</li>
<li>Provide the Binding Provider</li>
<li>Bind to ViewModel</li>
<li>Provide the custom driver view for Android</li>
</ul>
<p>Let&#8217;s go through each step, one-by-one.</p>
<h2>Provide the Custom Driver View for iOS</h2>
<p>To provide the custom driver view for iOS, all you need to do is creating a new Crosslight view for iPhone. To do this, you can utilize the item template shipped with Crosslight. In your iOS project, in the <em>Views</em> folder, right-click and add a new file. Under <strong>Crosslight</strong>, choose <strong>Crosslight iOS View for iPhone</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-13-at-6.27.32-PM.png"><img class="alignnone size-large wp-image-5125" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-13-at-6.27.32-PM-1024x669.png" alt="Screen Shot 2015-11-13 at 6.27.32 PM" width="604" height="395" /></a></p>
<p>Let&#8217;s give it a name of <strong>CallDriverButton</strong>. What this will do is Crosslight will create two files, namely <strong>CallDriverButton.xib</strong> and <strong>CallDriverButton.cs</strong>. All you need to do is create a new layout by opening the <strong>CallDriverButton.xib</strong> in <em>Xcode Interface Builder</em>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/xcode-interface-builder.png"><img class="alignnone size-large wp-image-5126" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/xcode-interface-builder-1024x282.png" alt="xcode-interface-builder" width="604" height="166" /></a></p>
<p>Create your layout any way you want it. Just create an <em>ImageView</em>, a <em>Label</em>, and a <em>Button</em>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/outlet1.png"><img class="alignnone size-full wp-image-5128" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/outlet1.png" alt="outlet" width="1021" height="449" /></a></p>
<p>Set the outlet for each.</p>
<ul>
<li><strong>ImageView</strong>: DriverImage</li>
<li><strong>Label</strong>: DriverName</li>
<li><strong>Button</strong>: CallButton</li>
</ul>
<p>I know, my layout looks awful. But all I really want to show you is how you can inject your own custom views into the form using the Form Builder. So, after your layout&#8217;s done, save it and go back to Xamarin Studio.</p>
<h2>Update the Form Metadata</h2>
<p>Now that your layout is done, let&#8217;s update our <strong>OrderFormMetadata</strong> a bit to include this new view in our form layout. Open up <strong>Order.cs</strong>, and let&#8217;s create a new section and call it <strong>CallDriverSection</strong>, or anything you want.</p><pre class="crayon-plain-tag">public class CallDriverSection
{
    [Editor(EditorType.Custom, CustomEditorIdentifier = "CallDriverButton")]
    public object CallDriver;
}</pre><p>Now I&#8217;d like you to pay attention how easy it is to embed a custom view into a Crosslight Form. From the definition above, you can see that we simply set the editor type to custom, then set the <strong>CustomEditorIdentifier</strong> set to <strong>CallDriverButton</strong>. In iOS, this corresponds to the name of the XIB that we&#8217;ve defined for our custom view. While on Android, this also corresponds to the name of the Android Layout file we&#8217;ve defined for our custom view layout. Simple as that.</p>
<blockquote><p>We&#8217;ve made it super easy for developers to create a beautiful platform-specific data form by combining robust pre-built editors for common input and flexible custom views for more complex user interface. This allows you to mix and match what works best for you, and let Crosslight do the magic at runtime.</p></blockquote>
<p>After you&#8217;ve created this section, let&#8217;s add this at the bottom of our form.</p><pre class="crayon-plain-tag">[Form(Title = "Order Form")]
public class OrderFormMetadata
{
    #region Fields

    [Section(Header = "Passenger Details")]
    public PassengerDetailsSection PassengerDetails;

    [Section(Header = "Taxi Choice")]
    public TaxiChoiceSection TaxiChoiceSection;

    [Section]
    public CallDriverSection CallDriverSection;

    #endregion
}</pre><p>You&#8217;re done with the form metadata. But there&#8217;s something missing. What about those outlets we&#8217;ve defined earlier? How can we bind data to it?</p>
<h2>Provide the Binding Provider</h2>
<p>Simple. It&#8217;s basically the way you would do any data binding with Crosslight. Yes, you should provide a <strong>BindingProvider</strong> for the form. In addition to automatic bindings, Form Builder also supports natural data binding process through the use of <strong>BindingProvider</strong>. In this case, let&#8217;s create a new <strong>BindingProvider</strong> called <strong>OrderBindingProvider.cs</strong>. Let&#8217;s put this under <strong>CrosslightFormBuilder.Core/BindingProviders</strong> folder. The contents of the <strong>OrderBindingProvider</strong> are as follows.</p><pre class="crayon-plain-tag">public class OrderBindingProvider : BindingProvider
{
    #region Constructors

    public OrderBindingProvider()
    {
        this.AddBinding("DriverImage", BindableProperties.ImageProperty, "Item.Driver.Image");
        this.AddBinding("DriverName", BindableProperties.TextProperty, "Item.Driver.Name");
        this.AddBinding("CallButton", BindableProperties.TextProperty, "Item.Driver.Phone");
        this.AddBinding("CallButton", BindableProperties.CommandProperty, "CallCommand");
    }

    #endregion
}</pre><p>Here, we&#8217;ve simply used the outlets we&#8217;ve defined earlier and bind them automatically to the selected Driver in the form. We&#8217;ve also added a binding from the <strong>CallButton</strong> to the <strong>CallCommand</strong> in the ViewModel, which can be used to call the driver immediately upon click. And don&#8217;t forget to use the newly created <strong>OrderBindingProvider</strong> in your <strong>OrderViewController</strong>.</p>
<blockquote><p>Again, Crosslight does a lot of magic behind the scene which enables you to define data binding in such a simple definition. Looking back, we just need to create a view, define the outlets, and provide the bindings. Crosslight takes care the connection between all those layers at runtime.</p></blockquote>
<p></p><pre class="crayon-plain-tag">[Register("OrderViewController")]
[ImportBinding(typeof(OrderBindingProvider))]
public class OrderViewController : UIFormViewController&lt;OrderViewModel&gt;
{
    ...
}</pre><p></p>
<h2>Bind to ViewModel</h2>
<p>Afterwards, in the <strong>OrderViewModel</strong>, we simply add a new DelegateCommand for the phone number.</p><pre class="crayon-plain-tag">public class OrderViewModel : EditorViewModelBase&lt;Order&gt;
{
    #region Properties

    /// &lt;summary&gt;
    /// Gets the type of the form metadata associated to the editor.
    /// &lt;/summary&gt;
    /// &lt;value&gt;
    /// The type of the form metadata.
    /// &lt;/value&gt;
    public override Type FormMetadataType
    {
        get { return typeof(OrderFormMetadata); }
    }
    
    public DelegateCommand CallCommand { get; set; }

    #endregion
    
    #region Constructors
    
    public OrderViewModel()
    {
        this.CallCommand = new DelegateCommand(ExecuteCall);
    }
    
    #endregion

    #region Methods
    
    private void ExecuteCall(object obj)
    {
        this.MobileService.Telephony.Call(this.Item.Driver.Phone);
    }

    /// &lt;summary&gt;
    /// Executes the save command.
    /// &lt;/summary&gt;
    /// &lt;param name="parameter"&gt;Parameter.&lt;/param&gt;
    protected override void ExecuteSave(object parameter)
    {
        this.Validate();

        if (!this.HasErrors)
        {
            StringBuilder passengerDetails = new StringBuilder();
            passengerDetails.Append("Name: " + this.Item.Name + "\n");
            passengerDetails.Append("Pickup Time: " + this.Item.PickupTime + "\n");
            passengerDetails.Append("Going to the airport? " + this.Item.IsAirport + "\n");
            passengerDetails.Append("Car Type: " + this.Item.CarType + "\n");
            passengerDetails.Append("Driver: " + this.Item.Driver.Name);

            this.MessagePresenter.Show(passengerDetails.ToString(), "Confirm Order", new[] {"Yes", "No"}, selection =&gt;
            {
                if (selection == 0) //Yes
                {
                    this.ToastPresenter.Show("Your order has been placed.");
                }
                else
                {
                    this.ToastPresenter.Show("You cancelled the order.");
                }
            });
        }
        else
        {
            this.MessagePresenter.Show(this.ErrorMessage);
        }

    }
    

    /// &lt;summary&gt;
    /// Called when this instance is navigated.
    /// &lt;/summary&gt;
    /// &lt;param name="parameter"&gt;Parameter.&lt;/param&gt;
    public override void Navigated(NavigatedParameter parameter)
    {
        base.Navigated(parameter);

        this.Item = new Order();
        this.Item.PickupTime = DateTime.Now;
    }

    #endregion
}</pre><p>Everything seems pretty much the same, except for the additional <strong>CallCommand</strong> we&#8217;ve defined for the <strong>CallButton</strong>. Run the project and you should now see iOS version is now working properly. Try selecting a driver and that driver detail will be automatically shown in the custom view you&#8217;ve defined. When you run this on an iPhone, you can even immediately perform a phone call to the driver&#8217;s number directly.</p>
<div style="width: 400px; " class="wp-video"><video class="wp-video-shortcode" id="video-5101-3" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS.mp4?_=3" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS.mp4</a></video></div>
<p>&nbsp;</p>
<p>What about Android?</p>
<h2>Provide the Custom Driver View for Android</h2>
<p>This is where the Form Builder excels. Since you&#8217;ve completed the iOS version, all you need to do is just provide the custom layout and use the previously created <strong>OrderBindingProvider</strong>. Let&#8217;s take a look how to achieve this.</p>
<p>First, create a new Android Layout file by right clicking on the <strong>CrosslightFormBuilder.Android/Resources/layout</strong> folder. Then choose <strong>Add</strong>, <strong>New Item</strong>. Select <strong>Android, Layout</strong>. Remember to give it a name of <strong>CallDriverButton</strong>, as this corresponds to the <strong>CustomViewIdentifier</strong> defined in the FormMetadata earlier.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-13-at-9.49.39-PM.png"><img class="alignnone size-large wp-image-5134" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-13-at-9.49.39-PM-1024x579.png" alt="Screen Shot 2015-11-13 at 9.49.39 PM" width="604" height="342" /></a></p>
<p>Provide the layout as follows.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"&gt;
    &lt;LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"&gt;
        &lt;ImageView
            android:id="@+id/DriverImage"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_gravity="center" /&gt;
        &lt;TextView
            android:id="@+id/DriverName"
            android:layout_width="wrap_content"
            android:layout_height="20sp"
            android:layout_gravity="center" /&gt;
        &lt;Button
            android:id="@+id/CallButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" /&gt;
    &lt;/LinearLayout&gt;
&lt;/RelativeLayout&gt;</pre><p>After ensuring the IDs are correct, you&#8217;re only left to hook up the <strong>OrderBindingProvider</strong> in your <strong>OrderActivity</strong>. Let&#8217;s do that now.</p><pre class="crayon-plain-tag">[Activity(Label = "Order Form")]
[ImportBinding(typeof(OrderBindingProvider))]
public class OrderActivity : FormActivity&lt;OrderViewModel&gt;
{
    ...
}</pre><p>You&#8217;re done. Run the project and you&#8217;ll get the same result with iOS version.</p>
<div style="width: 400px; " class="wp-video"><video class="wp-video-shortcode" id="video-5101-4" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android.mp4?_=4" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android.mp4</a></video></div>
<p>&nbsp;</p>
<p>Beautiful, isn&#8217;t it?</p>
<h1>Wrapping Up</h1>
<p>The entire project for this tutorial can be found <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightformbuilderextended/browse">here</a>. To use this sample, you&#8217;ll need to use at least Crosslight <a href="http://git.intersoftpt.com/projects/CROS/repos/updates/browse/Crosslight4_0_5000_321">4.0.5000.321</a> and above. Hopefully this will help you learn more about the Crosslight Form Builder.</p>
<p>You&#8217;ve seen how you can easily inject a custom view to the form by using the ViewResource custom editor. Probably some time in the future I&#8217;ll add a custom ViewBuilder tutorial as well. This will be very useful for those of you who wants to build a custom control that works seamlessly with the FormBuilder. We&#8217;ve also used this approach in building Crosslight Form Builder for each platform inside Crosslight framework.</p>
<p>Cheers,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/extending-crosslight-form-builder-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS.mp4" length="608488" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android.mp4" length="562423" type="video/mp4" />
		</item>
		<item>
		<title>Video Tutorials: Understanding Data Access Design Patterns in Crosslight</title>
		<link>http://blog.intersoftsolutions.com/2014/05/video-tutorials-understanding-data-access-design-patterns-in-crosslight/</link>
		<comments>http://blog.intersoftsolutions.com/2014/05/video-tutorials-understanding-data-access-design-patterns-in-crosslight/#comments</comments>
		<pubDate>Tue, 27 May 2014 00:27:30 +0000</pubDate>
		<dc:creator><![CDATA[ansoesil]]></dc:creator>
				<category><![CDATA[2014 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://intersoftpt.wordpress.com/?p=3719</guid>
		<description><![CDATA[When building applications, I always encourage the team in-charge, to look up and apply the appropriate design patterns for the application. In our latest release (Crosslight 2), we introduced several new services such as RestClient, SQLite, EntityContextProvider, EntityContainer, etc, enabling you to easily create data [...]]]></description>
				<content:encoded><![CDATA[<img width="436" height="250" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/08/12.png" class="attachment-post-thumbnail wp-post-image" alt="12" style="float:right; margin:0 0 10px 10px;" /><p>When building applications, I always encourage the team in-charge, to look up and apply the appropriate design patterns for the application.</p>
<p>In our latest release (Crosslight 2), we introduced several new services such as RestClient, SQLite, EntityContextProvider, EntityContainer, etc, enabling you to easily create data aware apps across multiple mobile platforms.</p>
<p>These are the tools that can get the job done. However using all these services without applying design patterns can make your code redundant and much harder to manage.</p>
<p>I&#8217;ve created a video explaining several new design patterns to tackle data access challenges using Crosslight. Check it out below.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/Opx9P-Z4Uxs?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span>
<p>These design patterns are also extensively used in our Enterprise App Framework. In the next video, I&#8217;ll show you how to create data aware application from scratch using the new tools provided in Crosslight 2 and Enterprise App Framework which leverage the design patterns you just learn in this video.</p>
<p>To learn how to work with data using Crosslight, see our online documentation at<br />
http://developer.intersoftpt.com/display/crosslight/Working+with+Data</p>
<p>With Regards,<br />
Andry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2014/05/video-tutorials-understanding-data-access-design-patterns-in-crosslight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorials: Understanding Screen Navigation in Crosslight &#8211; 2</title>
		<link>http://blog.intersoftsolutions.com/2014/02/video-tutorials-understanding-screen-navigation-in-crosslight-2/</link>
		<comments>http://blog.intersoftsolutions.com/2014/02/video-tutorials-understanding-screen-navigation-in-crosslight-2/#comments</comments>
		<pubDate>Mon, 03 Feb 2014 07:14:40 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2014 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Windows Store]]></category>

		<guid isPermaLink="false">https://intersoftpt.wordpress.com/?p=3668</guid>
		<description><![CDATA[We have posted another video tutorial to help you better understand how screen navigation works in Crosslight apps. In this video we covered the tabbed navigation and the most popular navigation pattern seen in mobile apps nowadays, the navigation drawer. This video will highlight the [...]]]></description>
				<content:encoded><![CDATA[<img width="436" height="250" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/08/Video-tutor-436x270.png" class="attachment-post-thumbnail wp-post-image" alt="Video-tutor-436x270" style="float:right; margin:0 0 10px 10px;" /><p>We have posted another video tutorial to help you better understand how screen navigation works in Crosslight apps. In this video we covered the tabbed navigation and the most popular navigation pattern seen in mobile apps nowadays, the navigation drawer. This video will highlight the features of the two and also how you can easily integrate the navigation drawer into your Crosslight-enabled apps. See the rest of the video for more details.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/DQfnQL1AR6E?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span>
<p>You have seen how Crosslight greatly takes care of the intricate details of the navigation in overall mobile apps development: whether it is push, modal, list, tabbed, or the navigation drawer, so you can focus on what is really important for your app, all done right within the centralised and streamlined view model development pattern. So, grab a copy of Mobile Studio on <a href="http://www.intersoftpt.com/RequestTrial">our site</a> to see for yourself! In the next video, I will explain how you can create your own custom service into Crosslight development.</p>
<p>To learn more about Crosslight navigation, check out <a href="http://www.intersoftpt.com/Support/Crosslight/Documentation/#_Toc366253989">Designing Consistent Navigation Interface</a> in our online documentation. Should you have any further questions, feel free to raise a thread in our forum. Stay tuned for more Crosslight video tutorials. Don’t forget to subscribe to our <a href="http://www.youtube.com/user/intersoftpt">YouTube channel</a> as well!</p>
<p>Cheers,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2014/02/video-tutorials-understanding-screen-navigation-in-crosslight-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
