Search in sources :

Example 1 with StepAdapter

use of cl.smartcities.isci.transportinspector.adapters.StepAdapter in project androidApp by InspectorIncognito.

the class RouterVectorMapFragment method onCreateView.

@NonNull
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.activity_router_map_fragment, container, false);
    mapView = view.findViewById(R.id.map_layout_id);
    slidingPanel = view.findViewById(R.id.sliding_layout);
    title = view.findViewById(R.id.header_title);
    ListView listView = view.findViewById(R.id.list_view);
    viewGroup = (LinearLayout) view.findViewById(R.id.dragView);
    routerOptionAdapter = new RouterOptionAdapter(this.getContext(), new CustomArrayAdapter.ItemClickListener<Integer>() {

        @Override
        public void onItemClick(Integer item) {
            if (slidingPanel.getPanelState().equals(SlidingUpPanelLayout.PanelState.COLLAPSED)) {
                slidingPanel.setPanelState(SlidingUpPanelLayout.PanelState.ANCHORED);
            } else {
                slidingPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
            }
        }
    });
    View defaultView = view.findViewById(R.id.subheader);
    routerOptionAdapter.setDefaultView(defaultView);
    View prevLayout = view.findViewById(R.id.prev_layout);
    View nextLayout = view.findViewById(R.id.next_layout);
    prevLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            contextListener.prevClicked();
        }
    });
    nextLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            contextListener.nextClicked();
        }
    });
    adapter = new StepAdapter(this.getContext(), this);
    listView.setAdapter(adapter);
    mapView.setVisibility(View.INVISIBLE);
    return view;
}
Also used : ListView(android.widget.ListView) StepAdapter(cl.smartcities.isci.transportinspector.adapters.StepAdapter) MapView(com.mapbox.mapboxsdk.maps.MapView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView) RouterOptionAdapter(cl.smartcities.isci.transportinspector.adapters.RouterOptionAdapter) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)1 View (android.view.View)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 RouterOptionAdapter (cl.smartcities.isci.transportinspector.adapters.RouterOptionAdapter)1 StepAdapter (cl.smartcities.isci.transportinspector.adapters.StepAdapter)1 MapView (com.mapbox.mapboxsdk.maps.MapView)1