Advertisement
Guest User

Untitled

a guest
Jul 17th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.53 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:minWidth="25px"
  4. android:minHeight="25px"
  5. android:layout_width="match_parent"
  6. android:layout_height="wrap_content"
  7. android:id="@+id/tripViewTableLayout"
  8. android:showDividers="beginning">
  9. <TableRow
  10. android:id="@+id/tripViewTableRow1"
  11. android:layout_width="match_parent"
  12. android:showDividers="none"
  13. android:gravity="left">
  14. <TextView
  15. android:text="Servive Level"
  16. android:textAppearance="?android:attr/textAppearanceSmall"
  17. android:id="@+id/tripViewServiceLevel"
  18. android:textSize="10dp"
  19. android:layout_column="0"
  20. android:layout_gravity="left"
  21. android:layout_weight="0.4"
  22. android:maxEms="1"
  23. android:lines="1"
  24. android:editable="false"
  25. android:singleLine="true" />
  26. <TextView
  27. android:text="Package Type"
  28. android:textAppearance="?android:attr/textAppearanceSmall"
  29. android:id="@+id/tripViewPackageType"
  30. android:textSize="10dp"
  31. android:layout_gravity="left"
  32. android:layout_weight="0.4"
  33. android:maxEms="1"
  34. android:lines="1"
  35. android:editable="false"
  36. android:singleLine="true"
  37. android:layout_column="1" />
  38. <TextView
  39. android:text="Weight"
  40. android:textAppearance="?android:attr/textAppearanceSmall"
  41. android:id="@+id/tripViewWeight"
  42. android:textSize="10dp"
  43. android:ellipsize="end"
  44. android:gravity="left"
  45. android:layout_gravity="left"
  46. android:layout_weight="0.1"
  47. android:maxEms="1"
  48. android:lines="1"
  49. android:editable="false"
  50. android:singleLine="true"
  51. android:layout_column="2" />
  52. <TextView
  53. android:text="Due Time"
  54. android:textAppearance="?android:attr/textAppearanceSmall"
  55. android:id="@+id/tripViewDueTime"
  56. android:textSize="10dp"
  57. android:gravity="left"
  58. android:editable="false"
  59. android:lines="1"
  60. android:ellipsize="end"
  61. android:singleLine="true"
  62. android:layout_gravity="left"
  63. android:layout_weight="0.1"
  64. android:includeFontPadding="false"
  65. android:layout_width="match_parent"
  66. android:maxEms="1"
  67. android:layout_marginTop="3dp"
  68. android:layout_column="3" />
  69. </TableRow>
  70. <TableRow
  71. android:id="@+id/tripViewTableRow2"
  72. android:layout_width="match_parent"
  73. android:minWidth="25px"
  74. android:minHeight="25px">
  75. <ImageView
  76. android:src="@drawable/orangebar"
  77. android:layout_column="0"
  78. android:id="@+id/tripViewImageBar"
  79. android:layout_height="match_parent"
  80. android:scaleType="fitStart"
  81. android:cropToPadding="false"
  82. android:layout_width="5dp" />
  83. <LinearLayout
  84. android:orientation="vertical"
  85. android:minWidth="25px"
  86. android:minHeight="25px"
  87. android:id="@+id/tripViewLinearLayout1"
  88. android:layout_column="1"
  89. android:layout_span="3"
  90. android:layout_weight="1"
  91. android:layout_gravity="left"
  92. android:layout_width="match_parent">
  93. <TextView
  94. android:text="Company"
  95. android:textAppearance="?android:attr/textAppearanceMedium"
  96. android:id="@+id/tripViewCompanyName"
  97. android:layout_width="match_parent"
  98. android:layout_height="wrap_content"
  99. android:textSize="15dp"
  100. android:lines="1"
  101. android:maxEms="1"
  102. android:editable="false" />
  103. <TextView
  104. android:text="Address"
  105. android:textAppearance="?android:attr/textAppearanceSmall"
  106. android:layout_width="match_parent"
  107. android:layout_height="wrap_content"
  108. android:id="@+id/tripViewCompanyAddress"
  109. android:editable="false"
  110. android:maxLines="1" />
  111. </LinearLayout>
  112. </TableRow>
  113. </TableLayout>
  114.  
  115. using System.Collections.Generic;
  116. using Android.App;
  117. using Android.Views;
  118. using Android.Widget;
  119. using RemoteService.Model;
  120.  
  121. namespace Driod2.Trips
  122. {
  123. public class TripListAdapter : BaseAdapter<Trip>
  124. {
  125. private readonly List<Trip> Trips;
  126. private readonly Activity Context;
  127.  
  128. public override long GetItemId( int position ) { return position; }
  129.  
  130. public override View GetView( int position, View convertView, ViewGroup parent )
  131. {
  132. var T = Trips[ position ];
  133.  
  134. var Row = convertView ?? Context.LayoutInflater.Inflate( Resource.Layout.TripListViewRow, null ); // re-use an existing view, if one is available
  135.  
  136. Row.FindViewById<TextView>( Resource.Id.tripViewServiceLevel ).Text = T.ServiceLevel;
  137. Row.FindViewById<TextView>( Resource.Id.tripViewPackageType ).Text = T.PackageType;
  138.  
  139. // !!!! The Error Happens here !!!!!!
  140. Row.FindViewById<TextView>( Resource.Id.tripViewWeight ).Text = T.Weight.ToString( "F" );
  141.  
  142.  
  143. // !!!! If I don't get the error the the next 4 never change !!!!!!
  144. Row.FindViewById<TextView>( Resource.Id.tripViewDueTime ).Text = T.DueTime.ToShortTimeString();
  145. Row.FindViewById<ImageView>( Resource.Id.tripViewImageBar ).SetImageResource( Resource.Drawable.BlueBar );
  146. Row.FindViewById<TextView>( Resource.Id.tripViewCompanyName ).Text = T.DeliveryCompany;
  147. Row.FindViewById<TextView>( Resource.Id.tripViewCompanyAddress ).Text = T.DeliveryCompanyAddressId.ToString();
  148.  
  149. return Row;
  150. }
  151.  
  152. public override int Count => Trips.Count;
  153.  
  154. public override Trip this[ int position ] => Trips[ position ];
  155.  
  156. public TripListAdapter( Activity context, List<Trip> trips )
  157. {
  158. Context = context;
  159. Trips = trips;
  160. }
  161. }
  162. }
  163.  
  164. #pragma warning disable 1591
  165. //------------------------------------------------------------------------------
  166. // <auto-generated>
  167. // This code was generated by a tool.
  168. // Runtime Version:4.0.30319.42000
  169. //
  170. // Changes to this file may cause incorrect behavior and will be lost if
  171. // the code is regenerated.
  172. // </auto-generated>
  173. //------------------------------------------------------------------------------
  174.  
  175. [assembly: global::Android.Runtime.ResourceDesignerAttribute("Driod2.Resource", IsApplication=true)]
  176.  
  177. namespace Driod2
  178. {
  179.  
  180.  
  181. [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
  182. public partial class Resource
  183. {
  184.  
  185. static Resource()
  186. {
  187. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  188. }
  189.  
  190. public static void UpdateIdValues()
  191. {
  192. global::IdsRemoteService.Resource.String.ApplicationName = global::Driod2.Resource.String.ApplicationName;
  193. global::IdsRemoteService.Resource.String.Hello = global::Driod2.Resource.String.Hello;
  194. global::RemoteService.Resource.String.ApplicationName = global::Driod2.Resource.String.ApplicationName;
  195. global::RemoteService.Resource.String.Hello = global::Driod2.Resource.String.Hello;
  196. }
  197.  
  198. public partial class Attribute
  199. {
  200.  
  201. static Attribute()
  202. {
  203. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  204. }
  205.  
  206. private Attribute()
  207. {
  208. }
  209. }
  210.  
  211. public partial class Color
  212. {
  213.  
  214. // aapt resource value: 0x7f060000
  215. public const int AliceBlue = 2131099648;
  216.  
  217. // aapt resource value: 0x7f060001
  218. public const int SteelBlue = 2131099649;
  219.  
  220. static Color()
  221. {
  222. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  223. }
  224.  
  225. private Color()
  226. {
  227. }
  228. }
  229.  
  230. public partial class Drawable
  231. {
  232.  
  233. // aapt resource value: 0x7f020000
  234. public const int BlueBar = 2130837504;
  235.  
  236. // aapt resource value: 0x7f020001
  237. public const int BottomBorder = 2130837505;
  238.  
  239. // aapt resource value: 0x7f020002
  240. public const int CaratDownWhite = 2130837506;
  241.  
  242. // aapt resource value: 0x7f020003
  243. public const int CloudWhite = 2130837507;
  244.  
  245. // aapt resource value: 0x7f020004
  246. public const int ForwardWhite = 2130837508;
  247.  
  248. // aapt resource value: 0x7f020005
  249. public const int Icon = 2130837509;
  250.  
  251. // aapt resource value: 0x7f020006
  252. public const int offline32x32 = 2130837510;
  253.  
  254. // aapt resource value: 0x7f020007
  255. public const int online32x32 = 2130837511;
  256.  
  257. // aapt resource value: 0x7f020008
  258. public const int OrangeBar = 2130837512;
  259.  
  260. static Drawable()
  261. {
  262. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  263. }
  264.  
  265. private Drawable()
  266. {
  267. }
  268. }
  269.  
  270. public partial class Id
  271. {
  272.  
  273. // aapt resource value: 0x7f07000c
  274. public const int accountId = 2131165196;
  275.  
  276. // aapt resource value: 0x7f070003
  277. public const int appTitle = 2131165187;
  278.  
  279. // aapt resource value: 0x7f070000
  280. public const int baseLayout = 2131165184;
  281.  
  282. // aapt resource value: 0x7f07000a
  283. public const int button1 = 2131165194;
  284.  
  285. // aapt resource value: 0x7f070014
  286. public const int filter1Button = 2131165204;
  287.  
  288. // aapt resource value: 0x7f070015
  289. public const int filter2Button = 2131165205;
  290.  
  291. // aapt resource value: 0x7f070016
  292. public const int filter3Button = 2131165206;
  293.  
  294. // aapt resource value: 0x7f070001
  295. public const int frameLayout1 = 2131165185;
  296.  
  297. // aapt resource value: 0x7f070002
  298. public const int gridLayout1 = 2131165186;
  299.  
  300. // aapt resource value: 0x7f070005
  301. public const int linearLayout2 = 2131165189;
  302.  
  303. // aapt resource value: 0x7f070013
  304. public const int linearLayout3 = 2131165203;
  305.  
  306. // aapt resource value: 0x7f070008
  307. public const int loginLayout = 2131165192;
  308.  
  309. // aapt resource value: 0x7f070007
  310. public const int mainViewFlipper = 2131165191;
  311.  
  312. // aapt resource value: 0x7f070010
  313. public const int password = 2131165200;
  314.  
  315. // aapt resource value: 0x7f070006
  316. public const int pingIcon = 2131165190;
  317.  
  318. // aapt resource value: 0x7f070011
  319. public const int signInButton = 2131165201;
  320.  
  321. // aapt resource value: 0x7f070009
  322. public const int textView2 = 2131165193;
  323.  
  324. // aapt resource value: 0x7f07000b
  325. public const int textView3 = 2131165195;
  326.  
  327. // aapt resource value: 0x7f07000d
  328. public const int textView4 = 2131165197;
  329.  
  330. // aapt resource value: 0x7f07000f
  331. public const int textView5 = 2131165199;
  332.  
  333. // aapt resource value: 0x7f070004
  334. public const int tripCount = 2131165188;
  335.  
  336. // aapt resource value: 0x7f070012
  337. public const int tripLayout = 2131165202;
  338.  
  339. // aapt resource value: 0x7f070017
  340. public const int tripListView = 2131165207;
  341.  
  342. // aapt resource value: 0x7f070022
  343. public const int tripViewCompanyAddress = 2131165218;
  344.  
  345. // aapt resource value: 0x7f070021
  346. public const int tripViewCompanyName = 2131165217;
  347.  
  348. // aapt resource value: 0x7f07001d
  349. public const int tripViewDueTime = 2131165213;
  350.  
  351. // aapt resource value: 0x7f07001f
  352. public const int tripViewImageBar = 2131165215;
  353.  
  354. // aapt resource value: 0x7f070020
  355. public const int tripViewLinearLayout1 = 2131165216;
  356.  
  357. // aapt resource value: 0x7f07001b
  358. public const int tripViewPackageType = 2131165211;
  359.  
  360. // aapt resource value: 0x7f07001a
  361. public const int tripViewServiceLevel = 2131165210;
  362.  
  363. // aapt resource value: 0x7f070018
  364. public const int tripViewTableLayout = 2131165208;
  365.  
  366. // aapt resource value: 0x7f070019
  367. public const int tripViewTableRow1 = 2131165209;
  368.  
  369. // aapt resource value: 0x7f07001e
  370. public const int tripViewTableRow2 = 2131165214;
  371.  
  372. // aapt resource value: 0x7f07001c
  373. public const int tripViewWeight = 2131165212;
  374.  
  375. // aapt resource value: 0x7f07000e
  376. public const int userName = 2131165198;
  377.  
  378. static Id()
  379. {
  380. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  381. }
  382.  
  383. private Id()
  384. {
  385. }
  386. }
  387.  
  388. public partial class Layout
  389. {
  390.  
  391. // aapt resource value: 0x7f030000
  392. public const int Main = 2130903040;
  393.  
  394. // aapt resource value: 0x7f030001
  395. public const int TripListViewRow = 2130903041;
  396.  
  397. static Layout()
  398. {
  399. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  400. }
  401.  
  402. private Layout()
  403. {
  404. }
  405. }
  406.  
  407. public partial class Raw
  408. {
  409.  
  410. // aapt resource value: 0x7f040000
  411. public const int BadScan = 2130968576;
  412.  
  413. // aapt resource value: 0x7f040001
  414. public const int DeletedTrip = 2130968577;
  415.  
  416. // aapt resource value: 0x7f040002
  417. public const int NewTrip = 2130968578;
  418.  
  419. static Raw()
  420. {
  421. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  422. }
  423.  
  424. private Raw()
  425. {
  426. }
  427. }
  428.  
  429. public partial class String
  430. {
  431.  
  432. // aapt resource value: 0x7f050001
  433. public const int ApplicationName = 2131034113;
  434.  
  435. // aapt resource value: 0x7f050000
  436. public const int Hello = 2131034112;
  437.  
  438. static String()
  439. {
  440. global::Android.Runtime.ResourceIdManager.UpdateIdValues();
  441. }
  442.  
  443. private String()
  444. {
  445. }
  446. }
  447. }
  448. }
  449. #pragma warning restore 1591
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement