Route displays name
This commit is contained in:
@@ -7,11 +7,16 @@ import androidx.fragment.app.Fragment;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Route;
|
||||||
|
|
||||||
public class RouteDetailFragment extends Fragment {
|
public class RouteDetailFragment extends Fragment {
|
||||||
|
|
||||||
|
private Route route;
|
||||||
|
private TextView routeDetailText;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -19,9 +24,16 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||||
// Inflate the layout for this fragment
|
if(getArguments().getParcelable("route") != null) {
|
||||||
return inflater.inflate(R.layout.fragment_route_detail, container, false);
|
this.route = getArguments().getParcelable("route");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.routeDetailText = view.findViewById(R.id.routeDetailText);
|
||||||
|
this.routeDetailText.setText(this.route.getName());
|
||||||
|
|
||||||
|
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user