Merge branch 'master' of github.com:osmandapp/Osmand

This commit is contained in:
Victor Shcherb 2015-01-21 10:56:37 +01:00
commit c90d37fcab
5 changed files with 16 additions and 4 deletions

View file

@ -120,7 +120,10 @@
android:text="@string/download_files"
android:visibility="gone" />
<net.osmand.plus.activities.search.toolbar.SplitToolbar
android:id="@+id/bottomControls"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</TabHost>

View file

@ -131,6 +131,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu();
MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_light,
R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS
| MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);

View file

@ -9,6 +9,7 @@ import java.util.ArrayList;
import android.content.Intent;
import android.os.Build;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.Window;
import net.osmand.plus.GpxSelectionHelper;
@ -53,9 +54,6 @@ public class FavouritesActivity extends ActionBarActivity {
//class in com.actionbarsherlock.view and NOT android.view
((OsmandApplication) getApplication()).applyTheme(this);
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
}
super.onCreate(icicle);
setSupportProgressBarIndeterminateVisibility(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@ -140,6 +138,13 @@ public class FavouritesActivity extends ActionBarActivity {
}
}
public Toolbar getClearToolbar(boolean visible) {
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
tb.setTitle(null);
tb.getMenu().clear();
tb.setVisibility(visible? View.VISIBLE : View.GONE);
return tb;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {

View file

@ -30,6 +30,7 @@ import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.ColorDialogs;
@ -299,6 +300,7 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu();
MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_light,
R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS
| MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);

View file

@ -243,6 +243,7 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
((FavouritesActivity) getActivity()).getClearToolbar(false);
// MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_light,
// R.drawable.ic_action_search_dark, MenuItem.SHOW_AS_ACTION_ALWAYS
// | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);