Configuring a menu with AppConfig
public class MenuFragment extends Fragment {
private List<MPMenuInfo> mMenuInfos = null;
private MapsActivity mMapActivity = null;
public static MenuFragment newInstance(List<MPMenuInfo> menuInfos, MapsActivity mapsActivity) {
final MenuFragment fragment = new MenuFragment();
fragment.mMenuInfos = menuInfos;
fragment.mMapActivity = mapsActivity;
return fragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
// For the brevity of this guide, we will reuse the bottom sheet used in the searchFragment
return inflater.inflate(R.layout.fragment_search_list, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
final RecyclerView recyclerView = (RecyclerView) view;
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(new MenuItemAdapter(mMenuInfos, mMapActivity));
}
}Last updated
Was this helpful?