forked from organicmaps/organicmaps
Share button for bookmarks group.
This commit is contained in:
parent
db96d0cddb
commit
ce04e10418
5 changed files with 13 additions and 27 deletions
9
android/res/menu/option_menu_bookmarks.xml
Normal file
9
android/res/menu/option_menu_bookmarks.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item android:id="@+id/set_share"
|
||||
android:icon="@drawable/ic_share_bookmark"
|
||||
android:title="@string/share"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
</menu>
|
|
@ -11,8 +11,6 @@
|
|||
<item name="colorControlNormal">@color/text_dark_hint</item>
|
||||
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
|
||||
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
|
||||
<item name="android:contentInsetStart">150dp</item>
|
||||
<item name="android:contentInsetLeft">150dp</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
|
|
|
@ -18,9 +18,7 @@ public class BookmarkCategoriesActivity extends BaseMwmFragmentActivity
|
|||
|
||||
setContentView(R.layout.activity_fragment_and_toolbar);
|
||||
final Toolbar toolbar = getToolbar();
|
||||
toolbar.setTitle(R.string.bookmarks);
|
||||
// TODO add menu with search
|
||||
// toolbar.inflateMenu(R.menu.menu_bookmark_categories);
|
||||
toolbar.setTitle(R.string.bookmark_sets);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ public class BookmarkListActivity extends BaseMwmFragmentActivity
|
|||
setContentView(R.layout.activity_fragment_and_toolbar);
|
||||
final Toolbar toolbar = getToolbar();
|
||||
toolbar.setTitle(R.string.bookmarks);
|
||||
// TODO add menu with search
|
||||
// toolbar.inflateMenu(R.menu.menu_bookmark_categories);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@ import android.net.Uri;
|
|||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.ContextMenu;
|
||||
|
@ -34,7 +32,6 @@ import com.mapswithme.util.ShareAction;
|
|||
public class BookmarksListFragment extends BaseMwmListFragment
|
||||
{
|
||||
public static final String TAG = BookmarksListFragment.class.getSimpleName();
|
||||
private static final int ID_SEND_BY_EMAIL = 0x01;
|
||||
private static final int MENU_DELETE_TRACK = 0x42;
|
||||
|
||||
private BookmarkCategory mCategory;
|
||||
|
@ -42,8 +39,6 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
private int mSelectedPosition;
|
||||
private BookmarkListAdapter mAdapter;
|
||||
|
||||
private ActionBar mActionBar;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
|
@ -67,11 +62,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
setListAdapter(mAdapter);
|
||||
registerForContextMenu(getListView());
|
||||
setHasOptionsMenu(true);
|
||||
if (getActivity() instanceof AppCompatActivity)
|
||||
{
|
||||
mActionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
||||
mActionBar.setTitle(mCategory.getName());
|
||||
}
|
||||
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(mCategory.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,14 +88,6 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
mAdapter.startLocationUpdate();
|
||||
}
|
||||
|
||||
private void assignCategoryParams()
|
||||
{
|
||||
// TODO add dialog to edit category name
|
||||
// final String name = mSetName.getText().toString();
|
||||
// if (!name.equals(mCategory.getName()))
|
||||
// BookmarkManager.INSTANCE.setCategoryName(mCategory, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListItemClick(ListView l, View v, int position, long id)
|
||||
{
|
||||
|
@ -231,13 +214,13 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
|
||||
{
|
||||
// TODO add options menu
|
||||
inflater.inflate(R.menu.option_menu_bookmarks, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item)
|
||||
{
|
||||
if (item.getItemId() == ID_SEND_BY_EMAIL)
|
||||
if (item.getItemId() == R.id.set_share)
|
||||
{
|
||||
sendBookmarkMail();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue