Android Open Source - WeatherMate Settings Activity






From Project

Back to project page WeatherMate.

License

The source code is released under:

Apache License

If you think the Android project WeatherMate 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 com.brightr.weathermate.activities;
//from  ww  w.  j a  v  a2 s  .  c o m
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.brightr.weathermate.R;

import android.graphics.Color;
import android.os.Bundle;
import android.preference.DialogPreference;
import android.preference.PreferenceCategory;

public class SettingsActivity extends SherlockPreferenceActivity {

  ActionBar actionBar;
  private PreferenceCategory weather;
  private PreferenceCategory flights;
  private PreferenceCategory news;

  //PreferenceCategory weather = new PreferenceCategory(this);
  //PreferenceCategory flights = new PreferenceCategory(this);
  //PreferenceCategory news = new PreferenceCategory(this);
  
  DialogPreference dialogPref;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    
    weather = new PreferenceCategory(this);
    flights = new PreferenceCategory(this);
    news = new PreferenceCategory(this);

    actionBar = getSupportActionBar();
    actionBar.setTitle("Settings");
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setIcon(getResources().getDrawable(R.drawable.icon_settings));
    actionBar.setBackgroundDrawable(getResources().getDrawable(
        R.drawable.weathermate_actionbar_4));

    // Setting the list's background to be white
    findViewById(android.R.id.list).setBackgroundResource(
        R.drawable.weathermate_wp1);

    addPreferencesFromResource(R.xml.prerences);
    // getListView().setBackgroundResource(android.R.color.transparent);
    getListView().setCacheColorHint(Color.TRANSPARENT);
    getListView().setScrollingCacheEnabled(false);
    getListView().setSelector(R.drawable.grid_selector);
    getListView().setDivider(getResources().getDrawable(R.drawable.layout_color));
    getListView().setDividerHeight(10);
    
    dialogPref = (DialogPreference) findPreference("dialogPref");
    
    
    

    
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {

    MenuInflater inflater = getSupportMenuInflater();
    return super.onCreateOptionsMenu(menu);
  }

  @Override
  public boolean onMenuItemSelected(int featureId, MenuItem item) {

    switch (item.getItemId()) {

    case android.R.id.home:
      super.onBackPressed();

      break;
    }

    return super.onOptionsItemSelected(item);
  }

}




Java Source Code List

.PullToRefreshListView.java
com.brightr.listeners.FlingGestureListener.java
com.brightr.listeners.OnFlingGestureListener.java
com.brightr.listeners.SimpleGestureFilter.java
com.brightr.weathermate.activities.LocationMapview.java
com.brightr.weathermate.activities.MainActivity.java
com.brightr.weathermate.activities.MyFlightsActivity.java
com.brightr.weathermate.activities.NewsViewerActivity.java
com.brightr.weathermate.activities.SearchLocationsActivity.java
com.brightr.weathermate.activities.SettingsActivity.java
com.brightr.weathermate.activities.SocialMediaActivity.java
com.brightr.weathermate.activities.WebsiteViewActivity.java
com.brightr.weathermate.adapters.FlightListAdapter.java
com.brightr.weathermate.adapters.LocationListAdapter.java
com.brightr.weathermate.adapters.MenuAdapter.java
com.brightr.weathermate.adapters.MyPagerAdapter.java
com.brightr.weathermate.adapters.NewsPagerAdapter.java
com.brightr.weathermate.adapters.SavedFlightsAdapter.java
com.brightr.weathermate.adapters.SearchListAdapter.java
com.brightr.weathermate.adapters.TweetAdapter.java
com.brightr.weathermate.adapters.WeatherAdapter.java
com.brightr.weathermate.databases.FlightStorage.java
com.brightr.weathermate.databases.LocationStorage.java
com.brightr.weathermate.databases.NewsStorage.java
com.brightr.weathermate.fragments.EntertainmentNewsFragment.java
com.brightr.weathermate.fragments.GeneralNewsFragment.java
com.brightr.weathermate.fragments.MainWeatherFragment.java
com.brightr.weathermate.fragments.MenuFragment.java
com.brightr.weathermate.fragments.PoliticalNewsFragment.java
com.brightr.weathermate.fragments.SidePanelFragment.java
com.brightr.weathermate.fragments.SportsNewsFragment.java
com.brightr.weathermate.parsers.FlightTrackingParser.java
com.brightr.weathermate.parsers.JSONParser.java
com.brightr.weathermate.parsers.JSONTrafficParser.java
com.brightr.weathermate.parsers.TwitterFeedParser.java
com.brightr.weathermate.providers.FlightTrackingProvider.java
com.brightr.weathermate.providers.LocationSearchProvider.java
com.brightr.weathermate.providers.TrafficIncidentProvider.java
com.brightr.weathermate.providers.WeatherProvider.java
com.brightr.weathermate.utils.AirlineNamesCollection.java
com.brightr.weathermate.views.CustomDialogPreference.java
com.brightr.weathermate.views.CustomPreferenceCategory.java