forked from organicmaps/organicmaps
New design of bookmark categories activity.
This commit is contained in:
parent
f45db53526
commit
08eba39620
23 changed files with 167 additions and 87 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/ic_eye_pressed" />
|
||||
<item android:drawable="@drawable/ic_eye_normal" />
|
||||
android:drawable="@drawable/ic_show" />
|
||||
<item android:drawable="@drawable/ic_hide" />
|
||||
</selector>
|
|
@ -33,7 +33,7 @@
|
|||
android:textColor="@android:color/white"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/disclosure_image"
|
||||
android:id="@+id/tv__set_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/disclosure_image"
|
||||
android:id="@+id/tv__set_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
|
@ -3,36 +3,34 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="@dimen/margin_medium"
|
||||
android:paddingLeft="@dimen/margin_tiny_and_half"
|
||||
android:paddingRight="@dimen/margin_tiny_and_half"
|
||||
android:paddingTop="@dimen/margin_medium">
|
||||
android:minHeight="@dimen/height_item_oneline"
|
||||
android:paddingLeft="@dimen/margin_medium"
|
||||
android:paddingRight="@dimen/margin_medium">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/pin_set_visible"
|
||||
android:id="@+id/chb__set_visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:button="@drawable/eye"
|
||||
android:focusable="false"
|
||||
android:layout_marginLeft="@dimen/margin_tiny"
|
||||
android:padding="@dimen/margin_tiny_and_half"/>
|
||||
android:button="@drawable/btn_bookmark_visibility"
|
||||
android:focusable="false"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/psi_name"
|
||||
android:id="@+id/tv__set_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/margin_tiny_and_half"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/disclosure_image"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:id="@+id/tv__set_size"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:src="@drawable/ic_next_item"/>
|
||||
android:gravity="right"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,18 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<TextView
|
||||
android:id="@+id/tv__bookmarks_usage"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmarks_usage_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="@dimen/dp_x_3"
|
||||
android:paddingLeft="@dimen/dp_x_8"
|
||||
android:paddingRight="@dimen/dp_x_8"
|
||||
android:paddingTop="@dimen/dp_x_3"
|
||||
android:text="@string/bookmarks_usage_hint"
|
||||
android:textSize="@dimen/sp_x_3" />
|
||||
|
||||
</FrameLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="@dimen/dp_x_3"
|
||||
android:paddingLeft="@dimen/dp_x_8"
|
||||
android:paddingRight="@dimen/dp_x_8"
|
||||
android:paddingTop="@dimen/dp_x_3"
|
||||
android:text="@string/bookmarks_usage_hint"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"/>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<!-- base colors -->
|
||||
<!-- green tints -->
|
||||
<color name="base_green">#209952</color>
|
||||
<color name="base_green">#209852</color>
|
||||
<color name="base_green_darker">#188044</color>
|
||||
<color name="base_green_darkest">#146636</color>
|
||||
<color name="base_green_light">#24B460</color>
|
||||
|
|
|
@ -88,4 +88,6 @@
|
|||
<dimen name="text_direction_subtitle">22sp</dimen>
|
||||
<dimen name="text_direction_title">58sp</dimen>
|
||||
|
||||
<dimen name="height_item_oneline">56dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
17
android/res/values/font_sizes.xml
Normal file
17
android/res/values/font_sizes.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- we use slightly greater font sizes, then in default material styles -->
|
||||
<dimen name="text_size_display_3">64sp</dimen>
|
||||
<dimen name="text_size_display_2">48sp</dimen>
|
||||
<dimen name="text_size_display_1">36sp</dimen>
|
||||
<dimen name="text_size_headline">28sp</dimen>
|
||||
<dimen name="text_size_title">24sp</dimen>
|
||||
<dimen name="text_size_body_1">16sp</dimen>
|
||||
<dimen name="text_size_body_2">16sp</dimen>
|
||||
<dimen name="text_size_body_3">14sp</dimen>
|
||||
<dimen name="text_size_caption">14sp</dimen>
|
||||
<dimen name="text_size_icon_title">10sp</dimen>
|
||||
<dimen name="text_size_button">16sp</dimen>
|
||||
|
||||
</resources>
|
|
@ -2,6 +2,8 @@
|
|||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!-- Themes -->
|
||||
|
||||
<style name="MwmTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/base_green</item>
|
||||
<item name="clickableBackground">?attr/selectableItemBackground</item>
|
||||
|
@ -40,6 +42,12 @@
|
|||
<item name="android:windowBackground">@color/semitransparent_black</item>
|
||||
</style>
|
||||
|
||||
<!-- Themes -->
|
||||
|
||||
<!-- -->
|
||||
|
||||
<!-- Widgets -->
|
||||
|
||||
<style name="MwmWidget"/>
|
||||
|
||||
<style name="MwmWidget.MapButton" parent="android:Widget.ImageButton"/>
|
||||
|
@ -86,7 +94,6 @@
|
|||
</style>
|
||||
|
||||
<style name="MwmWidget.TextView" parent="android:Widget.TextView">
|
||||
<item name="android:fontFamily">@string/robotoRegular</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
|
@ -99,7 +106,7 @@
|
|||
<style name="MwmWidget.FrameLayout"/>
|
||||
|
||||
<style name="MwmWidget.FrameLayout.Elevation">
|
||||
<item name="android:foreground">@drawable/bottom_shadow</item>
|
||||
<item name="android:foreground">@drawable/bg_toolbar_bottom_shadow</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.Shadow">
|
||||
|
@ -122,4 +129,70 @@
|
|||
<item name="android:indeterminateDrawable">@drawable/rating_bar</item>
|
||||
</style>
|
||||
|
||||
<!-- Widgets -->
|
||||
|
||||
<!-- -->
|
||||
|
||||
<!-- Text appearance -->
|
||||
|
||||
<style name="MwmTextAppearance">
|
||||
<item name="android:textStyle">normal</item>
|
||||
<item name="android:fontFamily">@string/robotoRegular</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Display3">
|
||||
<item name="android:textSize">@dimen/text_size_display_3</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Display2">
|
||||
<item name="android:textSize">@dimen/text_size_display_2</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Display1">
|
||||
<item name="android:textSize">@dimen/text_size_display_1</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Headline">
|
||||
<item name="android:textSize">@dimen/text_size_headline</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Title">
|
||||
<item name="android:textSize">@dimen/text_size_title</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Body1">
|
||||
<item name="android:textSize">@dimen/text_size_body_1</item>
|
||||
<item name="android:textColor">@color/text_dark</item>
|
||||
<item name="android:fontFamily">@string/robotoRegular</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Body2">
|
||||
<item name="android:textSize">@dimen/text_size_body_2</item>
|
||||
<item name="android:textColor">@color/text_dark_subtitle</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Body3">
|
||||
<item name="android:textSize">@dimen/text_size_body_3</item>
|
||||
<item name="android:textColor">@color/text_dark_hint</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.IconTitle">
|
||||
<item name="android:textSize">@dimen/text_size_icon_title</item>
|
||||
<item name="android:textColor">@color/text_green</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTextAppearance.Button">
|
||||
<item name="android:textSize">@dimen/text_size_button</item>
|
||||
<item name="android:textColor">@color/text_green</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Text appearance -->
|
||||
|
||||
</resources>
|
|
@ -564,7 +564,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.map);
|
||||
setContentView(R.layout.activity_map);
|
||||
initViews();
|
||||
|
||||
// Log app start events - successful installation means that user has passed DownloadResourcesActivity
|
||||
|
@ -1542,12 +1542,12 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
if (requestCode == ChooseBookmarkCategoryActivity.REQUEST_CODE_EDIT_BOOKMARK)
|
||||
{
|
||||
final Point bmk = ((ParcelablePoint) data.getParcelableExtra(ChooseBookmarkCategoryActivity.PIN)).getPoint();
|
||||
final Point bmk = ((ParcelablePoint) data.getParcelableExtra(ChooseBookmarkCategoryActivity.BOOKMARK)).getPoint();
|
||||
onBookmarkActivated(bmk.x, bmk.y);
|
||||
}
|
||||
else if (requestCode == ChooseBookmarkCategoryActivity.REQUEST_CODE_SET)
|
||||
{
|
||||
final Point pin = ((ParcelablePoint) data.getParcelableExtra(ChooseBookmarkCategoryActivity.PIN)).getPoint();
|
||||
final Point pin = ((ParcelablePoint) data.getParcelableExtra(ChooseBookmarkCategoryActivity.BOOKMARK)).getPoint();
|
||||
final Bookmark bookmark = BookmarkManager.INSTANCE.getBookmark(pin.x, pin.y);
|
||||
mPlacePage.setMapObject(bookmark);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ public class BookmarkCategoriesActivity extends BaseMwmFragmentActivity
|
|||
setContentView(R.layout.activity_fragment_and_toolbar);
|
||||
final Toolbar toolbar = getToolbar();
|
||||
toolbar.setTitle(R.string.bookmarks);
|
||||
toolbar.inflateMenu(R.menu.bookmark_categories_context_menu);
|
||||
// TODO add menu with search
|
||||
// toolbar.inflateMenu(R.menu.bookmark_categories_context_menu);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ public class BookmarkCategoriesAdapter extends AbstractBookmarkCategoryAdapter
|
|||
super(context);
|
||||
}
|
||||
|
||||
private final static int ITEM = 0;
|
||||
private final static int HELP = 1;
|
||||
private final static int TYPE_ITEM = 0;
|
||||
private final static int TYPE_HELP = 1;
|
||||
|
||||
@Override
|
||||
public int getCount()
|
||||
|
@ -32,7 +32,7 @@ public class BookmarkCategoriesAdapter extends AbstractBookmarkCategoryAdapter
|
|||
@Override
|
||||
public int getItemViewType(int position)
|
||||
{
|
||||
return (position == getCount() - 1) ? HELP : ITEM;
|
||||
return (position == getCount() - 1) ? TYPE_HELP : TYPE_ITEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,62 +44,55 @@ public class BookmarkCategoriesAdapter extends AbstractBookmarkCategoryAdapter
|
|||
@Override
|
||||
public boolean isEnabled(int position)
|
||||
{
|
||||
return getItemViewType(position) != HELP;
|
||||
return getItemViewType(position) != TYPE_HELP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent)
|
||||
public View getView(final int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
if (getItemViewType(position) == HELP)
|
||||
if (getItemViewType(position) == TYPE_HELP)
|
||||
{
|
||||
final View hintView = LayoutInflater.from(getContext()).inflate(R.layout.item_bookmark_hint, parent, false);
|
||||
final TextView hintView = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.item_bookmark_hint, parent, false);
|
||||
if (super.getCount() > 0)
|
||||
((TextView) hintView.findViewById(R.id.bookmarks_usage_hint)).setText(R.string.bookmarks_usage_hint_import_only);
|
||||
hintView.setText(R.string.bookmarks_usage_hint_import_only);
|
||||
return hintView;
|
||||
}
|
||||
|
||||
if (convertView == null)
|
||||
{
|
||||
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_bookmark_category, parent, false);
|
||||
final PinSetHolder holder = new PinSetHolder((TextView) convertView.findViewById(R.id.psi_name),
|
||||
(CheckBox) convertView.findViewById(R.id.pin_set_visible));
|
||||
final ViewHolder holder = new ViewHolder(convertView);
|
||||
convertView.setTag(holder);
|
||||
holder.visibilityCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||
{
|
||||
BookmarkManager.INSTANCE
|
||||
.getCategoryById(holder.categoryId)
|
||||
.setVisibility(isChecked);
|
||||
BookmarkManager.INSTANCE.getCategoryById(position).setVisibility(isChecked);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
final PinSetHolder psh = (PinSetHolder) convertView.getTag();
|
||||
final ViewHolder holder = (ViewHolder) convertView.getTag();
|
||||
final BookmarkCategory set = getItem(position);
|
||||
// category ID
|
||||
psh.categoryId = position;
|
||||
// name
|
||||
psh.name.setText(set.getName() + " (" + String.valueOf(set.getSize()) + ")");
|
||||
// visibility
|
||||
psh.visibilityCheckBox.setChecked(set.isVisible());
|
||||
holder.name.setText(set.getName());
|
||||
holder.size.setText(String.valueOf(set.getSize()));
|
||||
holder.visibilityCheckBox.setChecked(set.isVisible());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
static class PinSetHolder
|
||||
static class ViewHolder
|
||||
{
|
||||
TextView name;
|
||||
CheckBox visibilityCheckBox;
|
||||
TextView size;
|
||||
|
||||
// Data
|
||||
int categoryId;
|
||||
|
||||
public PinSetHolder(TextView name, CheckBox visibilityCheckBox)
|
||||
public ViewHolder(View root)
|
||||
{
|
||||
this.name = name;
|
||||
this.visibilityCheckBox = visibilityCheckBox;
|
||||
name = (TextView) root.findViewById(R.id.tv__set_name);
|
||||
visibilityCheckBox = (CheckBox) root.findViewById(R.id.chb__set_visible);
|
||||
size = (TextView) root.findViewById(R.id.tv__set_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,13 +37,14 @@ public class BookmarkCategoriesFragment extends BaseMwmListFragment
|
|||
public void onListItemClick(ListView l, View v, int position, long id)
|
||||
{
|
||||
startActivity(new Intent(getActivity(), BookmarkListActivity.class)
|
||||
.putExtra(ChooseBookmarkCategoryActivity.PIN_SET, position));
|
||||
.putExtra(ChooseBookmarkCategoryActivity.BOOKMARK_SET, position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
|
||||
{
|
||||
mSelectedPosition = ((AdapterView.AdapterContextMenuInfo) menuInfo).position;
|
||||
|
||||
getActivity().getMenuInflater().inflate(R.menu.bookmark_categories_context_menu, menu);
|
||||
menu.setHeaderTitle(BookmarkManager.INSTANCE.getCategoryById(mSelectedPosition).getName());
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ 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.bookmark_categories_context_menu);
|
||||
UiUtils.showHomeUpButton(toolbar);
|
||||
displayToolbarAsActionBar();
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Initialize with passed edited set.
|
||||
mIndex = getArguments().getInt(ChooseBookmarkCategoryActivity.PIN_SET, -1);
|
||||
mIndex = getArguments().getInt(ChooseBookmarkCategoryActivity.BOOKMARK_SET, -1);
|
||||
mEditedSet = BookmarkManager.INSTANCE.getCategoryById(mIndex);
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
private void startPinActivity(int cat, int bmk)
|
||||
{
|
||||
startActivity(new Intent(getActivity(), ChooseBookmarkCategoryActivity.class)
|
||||
.putExtra(ChooseBookmarkCategoryActivity.PIN, new ParcelablePoint(cat, bmk)));
|
||||
.putExtra(ChooseBookmarkCategoryActivity.BOOKMARK, new ParcelablePoint(cat, bmk)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,11 +10,9 @@ import com.mapswithme.maps.base.BaseMwmFragmentActivity;
|
|||
|
||||
public class ChooseBookmarkCategoryActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
public static final String PIN = "pin";
|
||||
public static final String PIN_ICON_ID = "pin";
|
||||
public static final String PIN_SET = "pin_set";
|
||||
public static final String BOOKMARK = "pin";
|
||||
public static final String BOOKMARK_SET = "pin_set";
|
||||
public static final int REQUEST_CODE_SET = 0x1;
|
||||
public static final String BOOKMARK_NAME = "bookmark_name";
|
||||
public static final int REQUEST_CODE_EDIT_BOOKMARK = 0x2;
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +29,7 @@ public class ChooseBookmarkCategoryActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
setResult(Activity.RESULT_OK, new Intent().putExtra(PIN, getIntent().getParcelableExtra(PIN)));
|
||||
setResult(Activity.RESULT_OK, new Intent().putExtra(BOOKMARK, getIntent().getParcelableExtra(BOOKMARK)));
|
||||
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmListFragment
|
|||
final ListView listView = getListView();
|
||||
mFooterHelper = new FooterHelper(listView);
|
||||
// Set adapter only after FooterHandler is initialized and added into layout.
|
||||
mAdapter = new ChooseBookmarkCategoryAdapter(getActivity(), getArguments().getInt(ChooseBookmarkCategoryActivity.PIN_SET, 0));
|
||||
mAdapter = new ChooseBookmarkCategoryAdapter(getActivity(), getArguments().getInt(ChooseBookmarkCategoryActivity.BOOKMARK_SET, 0));
|
||||
setListAdapter(mAdapter);
|
||||
registerForContextMenu(listView);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmListFragment
|
|||
|
||||
final Bookmark bmk = getBookmarkFromIntent();
|
||||
bmk.setCategoryId(position);
|
||||
getActivity().getIntent().putExtra(ChooseBookmarkCategoryActivity.PIN,
|
||||
getActivity().getIntent().putExtra(ChooseBookmarkCategoryActivity.BOOKMARK,
|
||||
new ParcelablePoint(bmk.getCategoryId(), bmk.getBookmarkId()));
|
||||
|
||||
getActivity().onBackPressed();
|
||||
|
@ -57,7 +57,7 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmListFragment
|
|||
{
|
||||
// Note that Point result from the intent is actually a pair
|
||||
// of (category index, bookmark index in category).
|
||||
final Point cab = ((ParcelablePoint) getArguments().getParcelable(ChooseBookmarkCategoryActivity.PIN)).getPoint();
|
||||
final Point cab = ((ParcelablePoint) getArguments().getParcelable(ChooseBookmarkCategoryActivity.BOOKMARK)).getPoint();
|
||||
return BookmarkManager.INSTANCE.getBookmark(cab.x, cab.y);
|
||||
}
|
||||
|
||||
|
@ -113,11 +113,11 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmListFragment
|
|||
final int category = BookmarkManager.INSTANCE.createCategory(name);
|
||||
getBookmarkFromIntent().setCategoryId(category);
|
||||
|
||||
getActivity().getIntent().putExtra(ChooseBookmarkCategoryActivity.PIN_SET, category)
|
||||
.putExtra(ChooseBookmarkCategoryActivity.PIN, new ParcelablePoint(category, 0));
|
||||
getActivity().getIntent().putExtra(ChooseBookmarkCategoryActivity.BOOKMARK_SET, category)
|
||||
.putExtra(ChooseBookmarkCategoryActivity.BOOKMARK, new ParcelablePoint(category, 0));
|
||||
|
||||
getArguments().putInt(ChooseBookmarkCategoryActivity.PIN_SET, category);
|
||||
getArguments().putParcelable(ChooseBookmarkCategoryActivity.PIN, new ParcelablePoint(category, 0));
|
||||
getArguments().putInt(ChooseBookmarkCategoryActivity.BOOKMARK_SET, category);
|
||||
getArguments().putParcelable(ChooseBookmarkCategoryActivity.BOOKMARK, new ParcelablePoint(category, 0));
|
||||
|
||||
switchToAddButton();
|
||||
|
||||
|
|
|
@ -721,8 +721,8 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
|
|||
final Activity activity = (Activity) getContext();
|
||||
final Bookmark bookmark = (Bookmark) mMapObject;
|
||||
final Intent intent = new Intent(activity, ChooseBookmarkCategoryActivity.class)
|
||||
.putExtra(ChooseBookmarkCategoryActivity.PIN_SET, bookmark.getCategoryId())
|
||||
.putExtra(ChooseBookmarkCategoryActivity.PIN, new ParcelablePoint(bookmark.getCategoryId(), bookmark.getBookmarkId()));
|
||||
.putExtra(ChooseBookmarkCategoryActivity.BOOKMARK_SET, bookmark.getCategoryId())
|
||||
.putExtra(ChooseBookmarkCategoryActivity.BOOKMARK, new ParcelablePoint(bookmark.getCategoryId(), bookmark.getBookmarkId()));
|
||||
activity.startActivityForResult(intent, ChooseBookmarkCategoryActivity.REQUEST_CODE_SET);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue