Android Open Source - Bussan Bus Departure Detail Activity






From Project

Back to project page Bussan.

License

The source code is released under:

Copyright 2011 Kristian Bendiksen. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...

If you think the Android project Bussan listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package no.kriben.bussan;
//from  ww  w .j a  v a 2  s . c o m
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.app.ActionBar;
import android.graphics.Paint;
import android.os.Bundle;
import android.widget.TextView;

public class BusDepartureDetailActivity extends SherlockActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bus_departure_detail);

        final TextView lineView = (TextView) findViewById(R.id.line);
        final TextView fromView = (TextView) findViewById(R.id.from);
        final TextView destinationView = (TextView) findViewById(R.id.destination);
        final TextView scheduledTimeView = (TextView) findViewById(R.id.scheduledtime);
        final TextView estimatedTimeView = (TextView) findViewById(R.id.estimatedtime);

        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            ActionBar actionBar = getSupportActionBar();
            actionBar.setTitle("Bussan: " + extras.getString("busstop"));
            lineView.setText(extras.getString("line"));
            fromView.setText(extras.getString("busstop"));
            destinationView.setText(extras.getString("destination"));

            final String scheduledTime = extras.getString("scheduledTime");
            final String estimatedTime = extras.getString("estimatedTime");
            scheduledTimeView.setText(scheduledTime);
            if (!estimatedTime.equals(scheduledTime)) {
                scheduledTimeView.setPaintFlags(scheduledTimeView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
            }
            estimatedTimeView.setText(estimatedTime);
        }
    }
}




Java Source Code List

no.kriben.bussan.AndroidFileStringCache.java
no.kriben.bussan.BusDepartureDetailActivity.java
no.kriben.bussan.BusStopAdapter.java
no.kriben.bussan.BusStopArrayAdapter.java
no.kriben.bussan.BusStopListActivity.java
no.kriben.bussan.BusStopMenuHandler.java
no.kriben.bussan.BusStopNameFormatter.java
no.kriben.bussan.BusStopWithDistance.java
no.kriben.bussan.BussanApplication.java
no.kriben.bussan.BussanAsyncTask.java
no.kriben.bussan.ConnectivityChecker.java
no.kriben.bussan.FindBusStopByDistanceActivity.java
no.kriben.bussan.FindBusStopByNameActivity.java
no.kriben.bussan.FrontpageActivity.java
no.kriben.bussan.PreferencesUtil.java
no.kriben.bussan.RealTimeActivity.java