Added empty msgs to the directions list fragment

This commit is contained in:
2011-12-10 19:05:05 +00:00
parent eaf308a567
commit b9c29c1e56
7 changed files with 33 additions and 0 deletions

Binary file not shown.

View File

@@ -325,6 +325,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int description=0x7f050007;
public static int directions=0x7f05004b;
public static int directions_description=0x7f050059;
public static int directions_empty_msg=0x7f050073;
public static int distance=0x7f05002a;
public static int eula=0x7f050068;
public static int eulaagreement=0x7f050069;
@@ -352,6 +353,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int measurement_unit_dialog=0x7f050017;
public static int minutes=0x7f050031;
public static int my_location=0x7f05001e;
public static int nav_only_in_full=0x7f050074;
public static int new_button=0x7f050060;
public static int no=0x7f050027;
public static int no_gps_signal=0x7f050015;

View File

@@ -325,6 +325,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int description=0x7f050007;
public static int directions=0x7f05004b;
public static int directions_description=0x7f050059;
public static int directions_empty_msg=0x7f050073;
public static int distance=0x7f05002a;
public static int eula=0x7f050068;
public static int eulaagreement=0x7f050069;
@@ -352,6 +353,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int measurement_unit_dialog=0x7f050017;
public static int minutes=0x7f050031;
public static int my_location=0x7f05001e;
public static int nav_only_in_full=0x7f050074;
public static int new_button=0x7f050060;
public static int no=0x7f050027;
public static int no_gps_signal=0x7f050015;

View File

@@ -325,6 +325,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int description=0x7f050007;
public static int directions=0x7f05004b;
public static int directions_description=0x7f050059;
public static int directions_empty_msg=0x7f050073;
public static int distance=0x7f05002a;
public static int eula=0x7f050068;
public static int eulaagreement=0x7f050069;
@@ -352,6 +353,7 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static int measurement_unit_dialog=0x7f050017;
public static int minutes=0x7f050031;
public static int my_location=0x7f05001e;
public static int nav_only_in_full=0x7f050074;
public static int new_button=0x7f050060;
public static int no=0x7f050027;
public static int no_gps_signal=0x7f050015;

View File

@@ -108,5 +108,7 @@
<string name="saved">Saved</string>
<string name="map">Map</string>
<string name="settings">Settings</string>
<string name="directions_empty_msg">Your directions will appear here. Please select the Navigation Icon in the lower right of the map to use navigation.</string>
<string name="nav_only_in_full">The Navigation feature is used to display walking directions to your car. This fetaure is only available in the full version of Find My Car. Please visit the Android Market to purchase Find My Car. </string>
</resources>

View File

@@ -274,6 +274,15 @@ public class Main extends FragmentActivity implements RegistrationCallback, MapF
//Populate the pager
mPager = (CustomViewPager) findViewById(R.id.pager);
/*
* this hack is for displaying nav
* empty msg
*/
mPager.setCurrentItem(0);
mPager.setCurrentItem(2);
mPager.setCurrentItem(1);
if(mPager != null)
mPager.setAdapter(new TitledFragmentAdapter(this.getSupportFragmentManager(), mFragments, titles, icons));

View File

@@ -14,6 +14,8 @@ import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.TwentyCodes.android.FindMyCarLib.DirectionsAdapter;
import com.TwentyCodes.android.FindMyCarLib.Main;
import com.TwentyCodes.android.FindMyCarLib.R;
import com.TwentyCodes.android.FindMyCarLib.UI.DirectionsOverlay;
import com.google.android.maps.GeoPoint;
@@ -39,6 +41,20 @@ public class DirectionsListFragment extends ListFragment {
super();
}
/**
* (non-Javadoc)
* @see android.support.v4.app.Fragment#onStart()
*/
@Override
public void onStart() {
this.setListShown(true);
if(Main.isFull)
this.setEmptyText(getActivity().getText(R.string.directions_empty_msg));
else
this.setEmptyText(getActivity().getText(R.string.nav_only_in_full));
super.onStart();
}
/**
* Creates a new Directions List Fragment
* @param listener