Android Open Source - audioplayer Manage Display View






From Project

Back to project page audioplayer.

License

The source code is released under:

GNU General Public License

If you think the Android project audioplayer 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 fr.julien_dumortier.simplemusicplayer.thememanager;
/*ww  w.j a  va2 s.  c  o m*/
import fr.julien_dumortier.simplemusicplayer.DevInfo;
import fr.julien_dumortier.simplemusicplayer.R;
import fr.julien_dumortier.simplemusicplayer.notifynews.NotifyNews;
import android.app.ActionBar;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;

public class ManageDisplayView extends PreferenceActivity {
  
  public static final int MANAGE_DISPLAY_VIEW = 24;
  private ListPreference mListPrefNbColumn, mListPrefSortType;
  private CheckBoxPreference mAutoSave, mColorAlternate, mDarkTheme, mCoverEditor;
  
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar actionBar = getActionBar();
    if(actionBar!=null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
      actionBar.setDisplayShowTitleEnabled(false);
      actionBar.setBackgroundDrawable(DisplayManager2.getActionBarDrawable(this));
    } 
    addPreferencesFromResource(R.xml.settings);
    PreferenceManager prefs = getPreferenceManager();
    
    /* ColorPreference */
    /*mColorPreference = (ColorPreference) prefs.findPreference("theme_color");*/
    /* Nombre de colonnes */
    mListPrefNbColumn = (ListPreference) prefs.findPreference("nb_column");
    CharSequence[] entryValues = mListPrefNbColumn.getEntryValues();
    int lastNbColunm = DisplayManager2.getNbColumn(this);
    
    for(int i=0; i<entryValues.length; i++)
      if(entryValues[i].equals(Integer.toString(lastNbColunm)))
        mListPrefNbColumn.setValueIndex(i);
    
    mListPrefNbColumn.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        DisplayManager2.setNbColumn(ManageDisplayView.this, Integer.parseInt(newValue.toString()));  
        return true;
      }
    });
    
    
    /* Enregistrement automatique */
    mAutoSave = (CheckBoxPreference) prefs.findPreference("active_last_playlist");
    mAutoSave.setChecked(DisplayManager2.getActiveLastPlaylist(this));
    mAutoSave.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        DisplayManager2.setActiveLastPlaylist(ManageDisplayView.this, (Boolean) newValue);
        return true;
      }
    });
    
    /* Alterner les couleurs */
    mColorAlternate = (CheckBoxPreference) prefs.findPreference("active_color_alternate");
    mColorAlternate.setChecked(DisplayManager2.getActiveColorAlternate(this));
    mColorAlternate.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        DisplayManager2.setActiveColorAlternate(ManageDisplayView.this, (Boolean) newValue);
        return true;
      }
    });
    
    /* Theme sombre */
    mDarkTheme = (CheckBoxPreference) prefs.findPreference("active_dark_theme");
    mDarkTheme.setChecked(DisplayManager2.getActiveDarkTheme(this));
    mDarkTheme.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        DisplayManager2.setActiveDarkTheme(ManageDisplayView.this, (Boolean) newValue);
        return true;
      }
    });
    
    /* Editeur de jaquette */
    mCoverEditor = (CheckBoxPreference) prefs.findPreference("show_cover_menu");
    mCoverEditor.setChecked(DisplayManager2.getActiveEditCoverMode(this));
    mCoverEditor.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        DisplayManager2.setActiveEditCoverMode(ManageDisplayView.this, (Boolean) newValue);
        return true;
      }
    });

    /* Type de tris */
    mListPrefSortType = (ListPreference) prefs.findPreference("sort_type");
    CharSequence[] sortEntryValues = mListPrefSortType.getEntryValues();
    int lastSortType = DisplayManager2.getSortType(this);
    final String [] entries = ManageDisplayView.this.getResources().getStringArray(R.array.sort_entries);
    
    for(int i=0; i<sortEntryValues.length; i++)
      if(sortEntryValues[i].equals(entries[lastSortType]))
        mListPrefSortType.setValueIndex(i);
    
    mListPrefSortType.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
      public boolean onPreferenceChange(Preference preference, Object newValue) {
        
        final String val = newValue.toString();
        int pos = 0;
        for(int i=0;i<entries.length;i++) {
          if(val.equals(entries[i])) {
            pos = i;
          }
        }
        DisplayManager2.setSortType(ManageDisplayView.this, pos);  
        return true;
      }
    });
    

    /* A propos de */
    Preference pa = prefs.findPreference("purchase"); 
    pa.setOnPreferenceClickListener(new OnPreferenceClickListener() {
      public boolean onPreferenceClick(Preference preference) {
        NotifyNews.showPurchase(ManageDisplayView.this);
        return false;
      }
    });
    
    /* A propos de */
    Preference p = prefs.findPreference("about"); 
    p.setOnPreferenceClickListener(new OnPreferenceClickListener() {
      public boolean onPreferenceClick(Preference preference) {
        new DevInfo(ManageDisplayView.this).show();
        return false;
      }
    });
  }

  public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
    ActionBar actionBar = getActionBar();
    if(actionBar!=null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
      actionBar.setDisplayShowTitleEnabled(false);
      actionBar.setBackgroundDrawable(DisplayManager2.getActionBarDrawable(this));
    } 
  }
    
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.nothing, menu);
    ImageView v = (ImageView) findViewById(android.R.id.home);
    v.setImageResource(R.drawable.ic_casque);
    return true;
  }

  public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case android.R.id.home:
          finish();
                  return true;
            default:
                    return super.onOptionsItemSelected(item);
          }
  }
}




Java Source Code List

fr.julien_dumortier.simplemusicplayer.DevInfo.java
fr.julien_dumortier.simplemusicplayer.DrawerListAdapter.java
fr.julien_dumortier.simplemusicplayer.IMusicMediaControllerGetter.java
fr.julien_dumortier.simplemusicplayer.MainActivity.java
fr.julien_dumortier.simplemusicplayer.browsemanager.BrowseCover.java
fr.julien_dumortier.simplemusicplayer.browsemanager.BrowseManager.java
fr.julien_dumortier.simplemusicplayer.coveralbumeditor.CoverAlbumEditor.java
fr.julien_dumortier.simplemusicplayer.coveralbumeditor.CoverAlbumGetter.java
fr.julien_dumortier.simplemusicplayer.coveralbumeditor.PromptCovers.java
fr.julien_dumortier.simplemusicplayer.equalizer.EqualizerActivity.java
fr.julien_dumortier.simplemusicplayer.equalizer.EqualizerConfigurationDataBase.java
fr.julien_dumortier.simplemusicplayer.equalizer.VerticalSeekBar.java
fr.julien_dumortier.simplemusicplayer.equalizer.preset.Preset.java
fr.julien_dumortier.simplemusicplayer.item.Album.java
fr.julien_dumortier.simplemusicplayer.item.Artist.java
fr.julien_dumortier.simplemusicplayer.item.Genre.java
fr.julien_dumortier.simplemusicplayer.item.Item.java
fr.julien_dumortier.simplemusicplayer.item.Playlist.java
fr.julien_dumortier.simplemusicplayer.item.Track.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.AlbumAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.ArtistAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.CurrentPlayAnimationManager.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.GenreAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.ItemAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.ItemClicManager.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.OrganisableTrackAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.PlayListAdapter.java
fr.julien_dumortier.simplemusicplayer.item.itemadapter.TrackAdapter.java
fr.julien_dumortier.simplemusicplayer.notifynews.NotifyNews.java
fr.julien_dumortier.simplemusicplayer.playerview.FullScreenPlayerViewController.java
fr.julien_dumortier.simplemusicplayer.playerview.IPlayerViewController.java
fr.julien_dumortier.simplemusicplayer.playerview.MiniPlayerViewController.java
fr.julien_dumortier.simplemusicplayer.playerview.TimeFormater.java
fr.julien_dumortier.simplemusicplayer.playlistview.MultiSelectManager.java
fr.julien_dumortier.simplemusicplayer.playlistview.PlayListManagerActivity.java
fr.julien_dumortier.simplemusicplayer.playlistview.SaveManagerView.java
fr.julien_dumortier.simplemusicplayer.playlistview.SavedPlaylistManager.java
fr.julien_dumortier.simplemusicplayer.service.BackgroundBinder.java
fr.julien_dumortier.simplemusicplayer.service.MusicPlayerService.java
fr.julien_dumortier.simplemusicplayer.service.bluetoohactionmanager.BluetoothReceiver.java
fr.julien_dumortier.simplemusicplayer.service.notificationplayer.NotificationManagerService.java
fr.julien_dumortier.simplemusicplayer.service.notificationplayer.NotificationPlayer.java
fr.julien_dumortier.simplemusicplayer.service.phonestatemanager.PhoneCallStateManager.java
fr.julien_dumortier.simplemusicplayer.service.playlist.EndOfPlayListException.java
fr.julien_dumortier.simplemusicplayer.service.playlist.IMediaPlayerController.java
fr.julien_dumortier.simplemusicplayer.service.playlist.MusicMediaPlayer.java
fr.julien_dumortier.simplemusicplayer.service.playlist.PlayListManager.java
fr.julien_dumortier.simplemusicplayer.thememanager.ColorPreferences.java
fr.julien_dumortier.simplemusicplayer.thememanager.DisplayManager2.java
fr.julien_dumortier.simplemusicplayer.thememanager.ManageDisplayView.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptActionByType.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptActionPlaylist.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptConfirmAddInNew.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptConfirmDeletePlaylist.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptConfirmExit.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptConfirmReplacePlaylist.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptDefineCoverAlbum.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptGetTextName.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptMoveTrack.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptPlaylistName.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptShowText.java
fr.julien_dumortier.simplemusicplayer.uiprompt.PromptSuppressConfirm.java
fr.julien_dumortier.simplemusicplayer.widget.AudioPlayerApplication.java
fr.julien_dumortier.simplemusicplayer.widget.AudioPlayerWidgetProvider.java
fr.julien_dumortier.simplemusicplayer.widget.AudioPlayerWidgetViewController.java
fr.julien_dumortier.simplemusicplayer.widget.WidgetView.java