diff --git a/OsmAnd/res/drawable/divider.xml b/OsmAnd/res/drawable/divider.xml new file mode 100644 index 0000000000..9a12eb87e0 --- /dev/null +++ b/OsmAnd/res/drawable/divider.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/sherpafy_browse_tour.xml b/OsmAnd/res/layout/sherpafy_browse_tour.xml index 3105af7b84..20dc2ee28b 100644 --- a/OsmAnd/res/layout/sherpafy_browse_tour.xml +++ b/OsmAnd/res/layout/sherpafy_browse_tour.xml @@ -14,7 +14,7 @@ android:layout_height="match_parent" android:layout_gravity="start" android:choiceMode="singleChoice" - android:divider="@android:color/transparent" - android:dividerHeight="0dp" - android:background="#111"/> + android:divider="@drawable/divider" + android:dividerHeight="1px" + android:background="#b1b1b1"/> \ No newline at end of file diff --git a/OsmAnd/res/layout/sherpafy_drawer_list_item.xml b/OsmAnd/res/layout/sherpafy_drawer_list_item.xml new file mode 100644 index 0000000000..455227c3ec --- /dev/null +++ b/OsmAnd/res/layout/sherpafy_drawer_list_item.xml @@ -0,0 +1,39 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/sherpafy_list_tour_item.xml b/OsmAnd/res/layout/sherpafy_list_tour_item.xml index 455227c3ec..5eae06c9a4 100644 --- a/OsmAnd/res/layout/sherpafy_list_tour_item.xml +++ b/OsmAnd/res/layout/sherpafy_list_tour_item.xml @@ -2,38 +2,52 @@ + android:layout_marginBottom="10dp" + android:layout_marginTop="15dp" + android:background="#fafafa" + android:orientation="vertical" + android:paddingBottom="10dp" + android:paddingLeft="5dp" + android:paddingRight="5dp" > - - - + + + + + + + + + + android:maxLines="3" + android:paddingLeft="5dp" + android:paddingRight="5dp" + android:paddingTop="10dp" + android:textSize="18sp" /> \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java index e8f1255fcf..a9e88c995b 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyLoadingFragment.java @@ -20,7 +20,12 @@ public class SherpafyLoadingFragment extends SherlockFragment { public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) { view = inflater.inflate(R.layout.sherpafy_loading, container, false); - + return view; + } + + @Override + public void onViewCreated(final View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); app.checkApplicationIsBeingInitialized(getActivity(), (TextView) view.findViewById(R.id.ProgressMessage), (ProgressBar) view.findViewById(R.id.ProgressBar), new Runnable() { @Override @@ -30,7 +35,6 @@ public class SherpafyLoadingFragment extends SherlockFragment { ((TourViewActivity)getSherlockActivity()).loadingFinished(); } }); - return view; } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java index 4d002d0360..cee7385efd 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyToursFragment.java @@ -50,6 +50,7 @@ public class SherpafyToursFragment extends SherlockListFragment { custom = (SherpafyCustomization) app.getAppCustomization(); TourAdapter tourAdapter = new TourAdapter(custom.getTourInformations()); setListAdapter(tourAdapter); + getListView().setBackgroundColor(0x00eeeeee); } @Override @@ -58,10 +59,11 @@ public class SherpafyToursFragment extends SherlockListFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - OsmandApplication app = (OsmandApplication) getActivity().getApplication(); - boolean light = true; //app.getSettings().isLightActionBar(); + com.actionbarsherlock.view.MenuItem menuItem = menu.add(0, ACTION_DOWNLOAD, 0, R.string.download_tours).setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); +// OsmandApplication app = (OsmandApplication) getActivity().getApplication(); +// boolean light = true; //app.getSettings().isLightActionBar(); //menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gdirections_light : R.drawable.ic_action_gdirections_dark); menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java index 916ed5e503..1896532c48 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/TourViewActivity.java @@ -12,13 +12,8 @@ import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.activities.DownloadIndexActivity; import net.osmand.plus.sherpafy.TourInformation.StageInformation; import android.app.Activity; -import android.app.AlertDialog; -import android.app.AlertDialog.Builder; -import android.app.ProgressDialog; -import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.res.Configuration; @@ -26,41 +21,31 @@ import android.graphics.Bitmap; import android.graphics.Point; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.ActionBarDrawerToggle; -import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; -import android.support.v4.widget.DrawerLayout.DrawerListener; import android.text.Html; import android.text.Html.ImageGetter; import android.util.TypedValue; import android.view.Gravity; -import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.inputmethod.EditorInfo; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; -import android.widget.Button; import android.widget.CompoundButton; -import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.ListView; -import android.widget.ProgressBar; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.ScrollView; import android.widget.TextView; -import android.widget.Toast; import android.widget.ToggleButton; -import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; @@ -153,6 +138,7 @@ public class TourViewActivity extends SherlockFragmentActivity { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { selectMenu(position, drawerAdapter.getItem(position)); + mDrawerLayout.closeDrawer(mDrawerList); } }); @@ -163,20 +149,7 @@ public class TourViewActivity extends SherlockFragmentActivity { .commit(); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer_light, - R.string.default_buttons_other_actions, R.string.close) { - - @Override - public void onDrawerOpened(View view) { - super.onDrawerOpened(view); - invalidateOptionsMenu(); - } - - @Override - public void onDrawerClosed(View view) { - super.onDrawerOpened(view); - invalidateOptionsMenu(); - } - }; + R.string.default_buttons_other_actions, R.string.close); } protected void selectMenu(int position, Object item) { @@ -260,20 +233,6 @@ public class TourViewActivity extends SherlockFragmentActivity { @Override protected void onResume() { super.onResume(); - - // TourInformation selectedTour = customization.getSelectedTour(); - // if (selectedTour == null || currentTourInformations.contains(selectedTour)) { - // for (TourInformation i : customization.getTourInformations()) { - // if (!currentTourInformations.contains(i)) { - // currentTourInformations.add(i); - // selectedTour = i; - // } - // } - // if (selectedTour != null) { - // selectTourAsync(selectedTour); - // // startTourView(); - // } - // } } private void setTourInfoContent() { @@ -392,19 +351,11 @@ public class TourViewActivity extends SherlockFragmentActivity { @Override public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) { - if (state == STATE_TOUR_VIEW) { // createMenuItem(menu, ACTION_GO_TO_MAP, R.string.start_tour, 0, 0,/* R.drawable.ic_action_marker_light, */ // MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); // createMenuItem(menu, ACTION_SETTINGS_ID, R.string.settings, R.drawable.ic_action_settings_light, // R.drawable.ic_action_settings_dark, MenuItem.SHOW_AS_ACTION_IF_ROOM // | MenuItem.SHOW_AS_ACTION_WITH_TEXT); - } else if (state == STATE_SELECT_TOUR) { - if (customization.isTourSelected()) { - createMenuItem(menu, ACTION_TOUR_ID, R.string.default_buttons_ok, R.drawable.ic_action_ok_light, - R.drawable.ic_action_ok_dark, MenuItem.SHOW_AS_ACTION_IF_ROOM - | MenuItem.SHOW_AS_ACTION_WITH_TEXT); - } - } return super.onCreateOptionsMenu(menu); }