refactoring 2

This commit is contained in:
madwasp79 2019-06-25 14:04:41 +03:00
parent 8bddc731a3
commit 507d1e9032
2 changed files with 11 additions and 6 deletions

View file

@ -92,7 +92,9 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
private View footerView;
private FavoritesListener favoritesListener;
String groupNameToShow = null;
@Override
public void onAttach(Context context) {
super.onAttach(context);
@ -207,7 +209,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
}
});
String groupNameToShow = null;
if (getArguments() != null) {
groupNameToShow = getArguments().getString(FavoritesActivity.GROUP_NAME_TO_SHOW);
}
@ -242,7 +243,9 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
super.onResume();
favouritesAdapter.synchronizeGroups();
initListExpandedState();
restoreState(getArguments());
if (groupNameToShow == null) {
restoreState(getArguments());
}
}
@Override

View file

@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.builders;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.Gravity;
@ -258,9 +259,10 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
public void onClick(View view) {
OsmAndAppCustomization appCustomization = app.getAppCustomization();
final Intent intent = new Intent(context, appCustomization.getFavoritesActivity());
intent.putExtra(FavoritesActivity.TAB_ID, FavoritesActivity.FAV_TAB);
intent.putExtra(FavoritesActivity.GROUP_NAME_TO_SHOW, group.name);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
Bundle b = new Bundle();
b.putInt(FavoritesActivity.TAB_ID, FavoritesActivity.FAV_TAB);
b.putString(FavoritesActivity.GROUP_NAME_TO_SHOW, group.name);
intent.putExtra(MapActivity.INTENT_PARAMS, b);
context.startActivity(intent);
}
});