Android Open Source - EdmontonWifi Construction View Activity






From Project

Back to project page EdmontonWifi.

License

The source code is released under:

MIT License

If you think the Android project EdmontonWifi 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 hey.rich.edmontonwifi.activities;
//from w  ww . ja v  a2s  .  c  om
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

import hey.rich.edmontonwifi.EdmontonWifi;
import hey.rich.edmontonwifi.Objects.Construction;
import hey.rich.edmontonwifi.R;

public class ConstructionViewActivity extends Activity {

    public static final String CONSTRUCTION_ID = "construction";
    private static final String TAG = ConstructionViewActivity.class.getName();
    private Construction construction;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_construction);

        Intent i = getIntent();
        int position = i.getExtras().getInt(CONSTRUCTION_ID, -1);
        try {
            this.construction = EdmontonWifi.getConstruction(this, position);
        } catch (IndexOutOfBoundsException e) {
            Log.i(TAG, "Got passed an invalid position for a Construction in the constructionlist"
                    + position);
            Toast.makeText(this, "An error occurred.\n Please try again", Toast.LENGTH_SHORT).show();
            finish();
        }

        setupButtons();
        setupTextView();

    }

    private void setupButtons() {
        // Allocation buttons
        // TODO: add buttons
    }

    private void setupTextView() {
        TextView address = (TextView) findViewById(R.id.construction_view_address);
        TextView asset = (TextView) findViewById(R.id.construction_view_asset);
        TextView startYear = (TextView) findViewById(R.id.construction_view_start_year);
        TextView startDate = (TextView) findViewById(R.id.construction_view_start_date);
        TextView finishDate = (TextView) findViewById(R.id.construction_view_finish_date);
        TextView limits = (TextView) findViewById(R.id.construction_view_limits);
        TextView supervisor = (TextView) findViewById(R.id.construction_view_supervisor);
        TextView phoneNumber = (TextView) findViewById(R.id.construction_view_phone_number);
        TextView ward = (TextView) findViewById(R.id.construction_view_ward);

        address.setText(this.construction.getAddress());
        asset.setText(this.construction.getAssetText());
        startYear.setText(this.construction.getStartYearText());
        startDate.setText(this.construction.getStartDateText());
        limits.setText(this.construction.getLimitsText());
        finishDate.setText(this.construction.getFinishDateText());
        supervisor.setText(this.construction.getSupervisorText());
        phoneNumber.setText(this.construction.getPhoneNumberText());
        ward.setText(this.construction.getWardText());
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.construction, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

hey.rich.edmontonwifi.EdmontonWifi.java
hey.rich.edmontonwifi.Objects.ConstructionList.java
hey.rich.edmontonwifi.Objects.Construction.java
hey.rich.edmontonwifi.Objects.Data.java
hey.rich.edmontonwifi.Objects.WifiList.java
hey.rich.edmontonwifi.Objects.Wifi.java
hey.rich.edmontonwifi.activities.ConstructionViewActivity.java
hey.rich.edmontonwifi.activities.MainActivity.java
hey.rich.edmontonwifi.activities.SearchActivity.java
hey.rich.edmontonwifi.activities.WifiViewActivity.java
hey.rich.edmontonwifi.adapters.ConstructionArrayAdapter.java
hey.rich.edmontonwifi.adapters.WifiArrayAdapter.java
hey.rich.edmontonwifi.fragments.ClearSearchHistoryDialogFragment.java
hey.rich.edmontonwifi.fragments.ConstructionFragment.java
hey.rich.edmontonwifi.fragments.NavigationDrawerFragment.java
hey.rich.edmontonwifi.fragments.SettingsFragment.java
hey.rich.edmontonwifi.fragments.WifiFragment.java
hey.rich.edmontonwifi.utils.JsonReader.java
hey.rich.edmontonwifi.utils.Sorters.java
hey.rich.edmontonwifi.utils.WifiSearchRecentSuggestionsProvider.java