/* * Copyright 2012 Tallinn University Centre for Educational Technology * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ee.htk.dippler.app; import android.app.Activity; import android.os.Bundle; import android.text.Html; import android.text.method.LinkMovementMethod; import android.widget.TextView; import ee.htk.dippler.app.entities.Assignment; public class TaskDetailsActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); Assignment task = extras.getParcelable("dippler-task"); setContentView(R.layout.task_detail_view); TextView task_title = (TextView) findViewById(R.id.task_title); task_title.setText(task.getTitle()); TextView task_deadline = (TextView) findViewById(R.id.task_deadline); task_deadline.setText(task.getDeadline()); TextView task_points = (TextView) findViewById(R.id.task_points); task_points.setText(task.getPoints()); TextView task_type = (TextView) findViewById(R.id.task_type); task_type.setText(task.getType(getApplicationContext())); TextView task_late_submission = (TextView) findViewById(R.id.task_late_submission); task_late_submission.setText(task.getLate_submission().equalsIgnoreCase("true") ? getString(R.string.task_late_enabled) : getString(R.string.task_late_disabled)); TextView task_visibility = (TextView) findViewById(R.id.task_visibility); task_visibility.setText(task.getVisibility().equalsIgnoreCase("true") ? getString(R.string.task_public) : getString(R.string.task_private)); TextView task_content = (TextView) findViewById(R.id.task_content); task_content.setText(Html.fromHtml(task.getContent())); task_content.setMovementMethod(LinkMovementMethod.getInstance()); } }