use of com.cmput301w18t05.taskzilla.controller.ViewTaskController in project Taskzilla by CMPUT301W18T05.
the class ViewTaskActivity method onCreate.
/**
*onCreate
* Retrieve the task using the task id that was sent using
* intent into the activity updating the information on the
* activity_ViewTaskActivity while checking if the task has
* a provider, what the status is and if the user viewing
* is the owner of the task
*
* @param savedInstanceState
* @author Micheal-Nguyen, myapplestory
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_task);
appColors = AppColors.getInstance();
ActionBar actionBar = getSupportActionBar();
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor(appColors.getActionBarColor())));
actionBar.setTitle(Html.fromHtml("<font color='" + appColors.getActionBarTextColor() + "'>Taskzilla</font>"));
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.dragdropMap);
mapFragment.getMapAsync(this);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
findViews();
// starts the activity at the very top
scrollView.setFocusableInTouchMode(true);
scrollView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
// gets the task id
this.viewTaskController = new ViewTaskController(this.findViewById(android.R.id.content), this);
taskID = getIntent().getStringExtra("TaskId");
setValues();
setRequesterField();
setProviderField();
photos = task.getPhotos();
NoLocation = findViewById(R.id.NoLocationText);
NoLocation.setVisibility(View.INVISIBLE);
if (task.getLocation() == null) {
NoLocation.setVisibility(View.VISIBLE);
// mapFragment.s
}
linearLayout = findViewById(R.id.Photos);
recyclerPhotosView = findViewById(R.id.listOfPhotos);
layoutManager = new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.HORIZONTAL, false);
recyclerPhotosView.setLayoutManager(layoutManager);
recyclerPhotosViewAdapter = new RecyclerViewAdapter(getApplicationContext(), photos, new CustomOnItemClick() {
@Override
public void onColumnClicked(int position) {
Intent intent = new Intent(getApplicationContext(), ZoomImageActivity.class);
intent.putExtra("Photo", photos.get(position).toString());
startActivity(intent);
}
});
recyclerPhotosView.setAdapter(recyclerPhotosViewAdapter);
setVisibility();
setUpBidsList();
}
Aggregations