Android Open Source - track-to-speech Prefs Activity






From Project

Back to project page track-to-speech.

License

The source code is released under:

MIT License

If you think the Android project track-to-speech 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 uk.co.jordanrobinson.tracktospeech;
/*from ww  w  .  j a  v  a 2 s.c o m*/
import android.app.NotificationManager;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class PrefsActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {

  @SuppressWarnings("deprecation") //TODO: update to something that works this time
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
  }

  @Override
  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    if (getString(R.string.pref_notify_key).equals(key)) {
      if (MainActivity.showNotifier) {
        NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        notificationManager.cancel(0);
        MainActivity.showNotifier = false;
      }
      else {
        MainActivity.showNotifier = true;
      }
    }
        else if (getString(R.string.pref_pattern_key).equals(key)) {
            //TODO: pattern logic
        }
  }
}




Java Source Code List

com.example.user.myapplication.ApplicationTest.java
uk.co.jordanrobinson.tracktospeech.MainActivity.java
uk.co.jordanrobinson.tracktospeech.NotificationActivity.java
uk.co.jordanrobinson.tracktospeech.PrefsActivity.java
uk.co.jordanrobinson.tracktospeech.TrackToSpeechService.java
uk.co.jordanrobinson.tracktospeech.handlers.EZFolderPlayer.java
uk.co.jordanrobinson.tracktospeech.handlers.GooglePlayMusic.java
uk.co.jordanrobinson.tracktospeech.handlers.PlayerHandler.java
uk.co.jordanrobinson.tracktospeech.handlers.Spotify.java