This commit is contained in:
Sem van der Hoeven
2021-01-06 13:59:59 +01:00
34 changed files with 714 additions and 69 deletions

View File

@@ -8,6 +8,7 @@ import androidx.fragment.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -15,13 +16,14 @@ import android.widget.Toast;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.RouteHandler;
import com.a1.nextlocation.data.StaticData;
import com.a1.nextlocation.network.ApiHandler;
public class RouteDetailFragment extends Fragment {
private Route route;
private TextView routeDetailText;
private TextView routeName;
private ImageButton imageButton;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -36,8 +38,18 @@ public class RouteDetailFragment extends Fragment {
this.route = getArguments().getParcelable("route");
}
this.routeName = view.findViewById(R.id.route_title);
this.routeName.setText(this.route.getName());
this.routeDetailText = view.findViewById(R.id.reoute_detail_tekst);
this.routeDetailText.setText(this.route.getName());
this.routeDetailText.setText(this.route.getDescription());
this.imageButton = view.findViewById(R.id.route_detail_back_button);
this.imageButton.setOnClickListener(v -> {
RouteFragment routeFragment = new RouteFragment();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
});
Button startButton = view.findViewById(R.id.start_route_button);
startButton.setOnClickListener(this::startRoute);