Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Trying to get the Add Trip layout to appear.

  • Loading branch information...
commit 3bb219772cbee3d4840b4848761212aa1e5488c8 1 parent c5b3f29
@topgenorth authored
View
2  dotnet/net.opgenorth.mytrips.m4a/Resources/Layout/activity_main.axml
@@ -9,7 +9,7 @@
android:layout_weight="20"
android:layout_width="0dp"
android:layout_height="match_parent" />
- <FrameLayout android:id="@+id/trip"
+ <FrameLayout android:id="@+id/mainactivity_frame"
android:layout_weight="80"
android:layout_width ="0dp"
android:layout_height="match_parent"
View
2  dotnet/net.opgenorth.mytrips.m4a/Resources/Layout/vehicle_list_row.axml
@@ -4,7 +4,7 @@
android:orientation="horizontal"
android:padding="4dip" >
- <TextView android:id="@+id/vehicle_row_name"
+ <TextView android:id="@+id/vehiclelistrow_name_of_vehicle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
View
19 dotnet/net.opgenorth.mytrips.m4a/Resources/Resource.Designer.cs
@@ -52,8 +52,8 @@ public partial class Id
// aapt resource value: 0x7f060008
public const int addVehicleButton = 2131099656;
- // aapt resource value: 0x7f06000d
- public const int add_vehicle = 2131099661;
+ // aapt resource value: 0x7f06000e
+ public const int add_vehicle = 2131099662;
// aapt resource value: 0x7f060005
public const int businessCheck = 2131099653;
@@ -61,8 +61,11 @@ public partial class Id
// aapt resource value: 0x7f060003
public const int description = 2131099651;
- // aapt resource value: 0x7f06000c
- public const int export_files = 2131099660;
+ // aapt resource value: 0x7f06000d
+ public const int export_files = 2131099661;
+
+ // aapt resource value: 0x7f06000a
+ public const int mainactivity_frame = 2131099658;
// aapt resource value: 0x7f060002
public const int odometerEnd = 2131099650;
@@ -76,8 +79,8 @@ public partial class Id
// aapt resource value: 0x7f060006
public const int saveNewTripButton = 2131099654;
- // aapt resource value: 0x7f06000a
- public const int trip = 2131099658;
+ // aapt resource value: 0x7f06000b
+ public const int trip = 2131099659;
// aapt resource value: 0x7f060009
public const int vehicleListFragment = 2131099657;
@@ -88,8 +91,8 @@ public partial class Id
// aapt resource value: 0x7f060000
public const int vehicleSpinner = 2131099648;
- // aapt resource value: 0x7f06000b
- public const int vehicle_row_name = 2131099659;
+ // aapt resource value: 0x7f06000c
+ public const int vehiclelistrow_name_of_vehicle = 2131099660;
private Id()
{
View
36 dotnet/net.opgenorth.mytrips.m4a/net.opgenorth.mytrips.m4a.csproj
@@ -108,11 +108,6 @@
<Compile Include="Data\VehicleListAdapter.cs" />
</ItemGroup>
<ItemGroup>
- <AndroidResource Include="Resources\Layout\activity_add_vehicle.axml" />
- <AndroidResource Include="Resources\Layout\activity_add_trip.axml" />
- <AndroidResource Include="Resources\Layout\autotext_list_item.axml">
- <SubType>AndroidResource</SubType>
- </AndroidResource>
<AndroidResource Include="Resources\drawable-hdpi\ic_menu_add_data.png" />
<AndroidResource Include="Resources\drawable\Icon.png" />
<AndroidResource Include="Resources\drawable\add_data1.png" />
@@ -121,10 +116,22 @@
<AndroidResource Include="Resources\drawable-ldpi\ic_menu_add_data.png" />
<AndroidResource Include="Resources\drawable-mdpi\ic_menu_add_data.png" />
<AndroidResource Include="Resources\drawable-xhdpi\ic_menu_add_data.png" />
+ <AndroidResource Include="Resources\Layout\activity_add_trip.axml" />
+ <AndroidResource Include="Resources\Layout\activity_add_vehicle.axml" />
+ <AndroidResource Include="Resources\Layout\activity_main.axml">
+ <SubType>Designer</SubType>
+ </AndroidResource>
+ <AndroidResource Include="Resources\Layout\autotext_list_item.axml">
+ <SubType>AndroidResource</SubType>
+ </AndroidResource>
+ <AndroidResource Include="Resources\Layout\fragment_add_trip.axml">
+ <SubType>AndroidResource</SubType>
+ </AndroidResource>
+ <AndroidResource Include="Resources\Layout\vehicle_list_row.axml">
+ <SubType>AndroidResource</SubType>
+ </AndroidResource>
<AndroidResource Include="Resources\menu\main_menu.xml" />
<AndroidResource Include="Resources\drawable\car_add.png" />
- </ItemGroup>
- <ItemGroup>
<AndroidResource Include="Resources\Values\Strings.xml">
<SubType>Designer</SubType>
</AndroidResource>
@@ -149,21 +156,6 @@
</AndroidResource>
</ItemGroup>
<ItemGroup>
- <AndroidResource Include="Resources\Layout\vehicle_list_row.axml">
- <SubType>AndroidResource</SubType>
- </AndroidResource>
- </ItemGroup>
- <ItemGroup>
- <AndroidResource Include="Resources\Layout\activity_main.axml">
- <SubType>Designer</SubType>
- </AndroidResource>
- </ItemGroup>
- <ItemGroup>
- <AndroidResource Include="Resources\Layout\fragment_add_trip.axml">
- <SubType>AndroidResource</SubType>
- </AndroidResource>
- </ItemGroup>
- <ItemGroup>
<AndroidResource Include="Resources\layout-large-land\activity_main.axml">
<SubType>Designer</SubType>
</AndroidResource>
View
2  dotnet/net.opgenorth.mytrips.m4a/net.opgenorth.mytrips.m4a.csproj.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <ProjectView>ProjectFiles</ProjectView>
+ <ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
View
10 dotnet/net.opgenorth.mytrips.m4a/views/AddTripFragment.cs
@@ -9,15 +9,15 @@ namespace net.opgenorth.mytrips.m4a.views
{
public class AddTripFragment : Fragment
{
- public override void OnCreate(Bundle p0)
+ public override void OnCreate(Bundle savedInstanceState)
{
- base.OnCreate(p0);
-
+ base.OnCreate(savedInstanceState);
+ SetHasOptionsMenu(false);
}
- public override View OnCreateView(LayoutInflater p0, ViewGroup p1, Bundle p2)
+ public override View OnCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle savedInstanceState)
{
- return base.OnCreateView(p0, p1, p2);
+ return layoutInflater.Inflate(Resource.Layout.fragment_add_trip, container, false);
}
}
}
View
2  dotnet/net.opgenorth.mytrips.m4a/views/IListenForVehicleSelection.cs
@@ -2,6 +2,6 @@
{
public interface IListenForVehicleSelection
{
-
+ void OnVehicleSelected(string vehicleName);
}
}
View
22 dotnet/net.opgenorth.mytrips.m4a/views/MainActivity.cs
@@ -4,6 +4,7 @@
using Android.Support.V4.App;
using Android.Util;
using Android.Views;
+using Android.Widget;
namespace net.opgenorth.mytrips.m4a.views
{
@@ -20,6 +21,14 @@ protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.activity_main);
+
+// var vehicleListFragment = (VehicleListFragment) SupportFragmentManager.FindFragmentById(Resource.Id.vehicleListFragment);
+// LunchFragment lunch
+// = (LunchFragment)getSupportFragmentManager()
+// .findFragmentById(R.id.lunch);
+// lunch.setOnRestaurantListener(this);
+
+
Log.Verbose(TAG, "Main activity is started.");
}
@@ -50,7 +59,18 @@ public override bool OnOptionsItemSelected(IMenuItem item)
default:
return true;
}
-
+ }
+
+ public void OnVehicleSelected(string vehicleName)
+ {
+ if (FindViewById<FrameLayout>(Resource.Id.mainactivity_frame) == null)
+ {
+ Toast.MakeText(this, "Activity", ToastLength.Short).Show();
+ }
+ else
+ {
+ Toast.MakeText(this, "Fragment", ToastLength.Short).Show();
+ }
}
}
}
View
2  dotnet/net.opgenorth.mytrips.m4a/views/SimpleVehicleListRowHelper.cs
@@ -13,7 +13,7 @@ public class SimpleVehicleListRowHelper: Java.Lang.Object
private readonly TextView _textView;
public SimpleVehicleListRowHelper(View view)
{
- _textView = view.FindViewById<TextView>(Resource.Id.vehicle_row_name);
+ _textView = view.FindViewById<TextView>(Resource.Id.vehiclelistrow_name_of_vehicle);
}
public void PopulateFrom(ICursor c)
View
4 dotnet/net.opgenorth.mytrips.m4a/views/VehicleListFragment.cs
@@ -20,6 +20,7 @@ public class VehicleListFragment : ListFragment
public override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
+
SetHasOptionsMenu(true);
}
@@ -32,7 +33,8 @@ public override void OnResume()
public override void OnListItemClick(ListView list, View view, int position, long id)
{
- base.OnListItemClick(list, view, position, id);
+ var txtView = list.FindViewById<TextView>(Resource.Id.vehiclelistrow_name_of_vehicle);
+ Toast.MakeText(Activity, "Selected Vehicle " + txtView.Text, ToastLength.Short).Show();
}
public override void OnCreateOptionsMenu(IMenu menu, MenuInflater menuInflater)
Please sign in to comment.
Something went wrong with that request. Please try again.