Android Open Source - simpleplayer U I State Controller






From Project

Back to project page simpleplayer.

License

The source code is released under:

GNU General Public License

If you think the Android project simpleplayer 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 org.sergez.splayer.util;
/*from   w w  w.j  a v  a 2  s .  c o m*/
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import static org.sergez.splayer.util.PrefsConstants.*;

/**
 * @author Sergii Zhuk
 *         Date: 28.07.13
 *         Time: 16:21
 *
 *         Used to optimize calls to the Prefs as these prefs could be changed only
 *         from prefereces screen and it doesn't make sense to reload them every time
 */
public class UIStateController {

  private boolean showFileExtension;
  private boolean bigFont;
  private boolean readInternalMedia;

  private boolean playOnlyWhenButtonPressed;
  private boolean redLargeElapsedTime;

  public UIStateController(Context context) {;
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    showFileExtension = prefs.getBoolean(PREF_CHECKBOX_SHOW_EXTENSION, false);
    bigFont = prefs.getBoolean(PREF_CHECKBOX_BIG_FONT, false);
    redLargeElapsedTime = prefs.getBoolean(PREF_CHECKBOX_RED_ELAPSED, false);
    readInternalMedia = prefs.getBoolean(PREF_CHECKBOX_READ_INTERNAL_MEMORY, true);
    playOnlyWhenButtonPressed =  PrefsController.isPlayOnlyWhenButtonPressed(context);
  }

  public boolean isShowFileExtension() {
    return showFileExtension;
  }

  public boolean isReadInternalMedia(){
    return readInternalMedia;
  }

  public boolean isLargeRedElapsedTime() {
    return redLargeElapsedTime;
  }

  public boolean isBigFont() {
    return bigFont;
  }

  public boolean isPlayOnlyWhenButtonPressed() {
    return playOnlyWhenButtonPressed;
  }


}




Java Source Code List

org.sergez.splayer.activity.AnimationMakeGoneListener.java
org.sergez.splayer.activity.AudioFxDemo.java
org.sergez.splayer.activity.DonationActivity.java
org.sergez.splayer.activity.ListData.java
org.sergez.splayer.activity.PlayFileAdapter.java
org.sergez.splayer.activity.PreferencesActivity.java
org.sergez.splayer.activity.SimplePlayerActivity.java
org.sergez.splayer.enums.RepeatState.java
org.sergez.splayer.enums.ShuffleState.java
org.sergez.splayer.inappbilling.Base64DecoderException.java
org.sergez.splayer.inappbilling.Base64.java
org.sergez.splayer.inappbilling.IabException.java
org.sergez.splayer.inappbilling.IabHelper.java
org.sergez.splayer.inappbilling.IabResult.java
org.sergez.splayer.inappbilling.Inventory.java
org.sergez.splayer.inappbilling.Purchase.java
org.sergez.splayer.inappbilling.Security.java
org.sergez.splayer.inappbilling.SkuDetails.java
org.sergez.splayer.service.SimplePlayerService.java
org.sergez.splayer.util.Constants.java
org.sergez.splayer.util.DialogUtils.java
org.sergez.splayer.util.DurationAlbumID.java
org.sergez.splayer.util.FileFormat.java
org.sergez.splayer.util.MediaFileData.java
org.sergez.splayer.util.MediaFileUtil.java
org.sergez.splayer.util.PlayerState.java
org.sergez.splayer.util.PrefsConstants.java
org.sergez.splayer.util.PrefsController.java
org.sergez.splayer.util.SortIgnoreCase.java
org.sergez.splayer.util.UIStateController.java
org.sergez.splayer.util.Utils.java
org.sergez.splayer.view.ScrollingTextView.java