public class BoxPreviewTracklistFragment
extends Fragment
implements android.widget.AdapterView.OnItemClickListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
BoxPreviewTracklistFragment.Listener |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANIMATED_ENTER |
static java.lang.String |
EXTRA_IS_PLAYING |
static java.lang.String |
EXTRA_LIST |
protected BoxAudioListAdapter |
mAdapter
The Adapter which will be used to populate the ListView/GridView with
Views.
|
protected boolean |
mAnimatedEnter
Set to true after the fragment has been created the first time, preventing the entrance
animation from happening again on device rotation.
|
protected java.util.ArrayList<BoxItem> |
mBoxListItems
List of Box Items passed into the fragment.
|
protected BoxPreviewFragment.BoxPreviewController |
mController
Used to access storage to retrieve ID3 tags in setTracklist().
|
protected int |
mEqualizerPosition
Location of the equalizer, indicating which audio file is currently selected.
|
protected java.util.List |
mTracklist
List of audio files used by the adapter.
|
| Constructor and Description |
|---|
BoxPreviewTracklistFragment()
Mandatory empty constructor for the fragment manager to instantiate the
fragment (e.g.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onCreate(android.os.Bundle savedInstanceState) |
android.view.animation.Animation |
onCreateAnimation(int transit,
boolean enter,
int nextAnim)
Logic to only show the entrance animation once so it won't be repeated on configuration
changed.
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onDestroyView() |
void |
onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id) |
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
pause() |
void |
play() |
void |
setController(BoxPreviewFragment.BoxPreviewController controller) |
void |
setEqualizerPosition(int position)
Updates the adapter with the newly selected song, and scrolls to keep it in view.
|
void |
setListener(BoxPreviewTracklistFragment.Listener listener) |
void |
setTracklist()
Populates mTracklist with BoxAudioFile's, including ID3 tags if they exist.
|
public static final java.lang.String ANIMATED_ENTER
public static final java.lang.String EXTRA_IS_PLAYING
public static final java.lang.String EXTRA_LIST
protected BoxAudioListAdapter mAdapter
protected java.util.List mTracklist
protected java.util.ArrayList<BoxItem> mBoxListItems
protected int mEqualizerPosition
protected boolean mAnimatedEnter
protected BoxPreviewFragment.BoxPreviewController mController
public BoxPreviewTracklistFragment()
public void setController(BoxPreviewFragment.BoxPreviewController controller)
public void onCreate(android.os.Bundle savedInstanceState)
public void setTracklist()
public android.view.animation.Animation onCreateAnimation(int transit,
boolean enter,
int nextAnim)
transit - resource id for transition (Not used).enter - true if the fragment is entering.nextAnim - Next animation resource (Not used).public android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
public void onDestroyView()
public void onSaveInstanceState(android.os.Bundle outState)
public void onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id)
onItemClick in interface android.widget.AdapterView.OnItemClickListenerpublic void setListener(BoxPreviewTracklistFragment.Listener listener)
public void setEqualizerPosition(int position)
position - position of currently selected songpublic void play()
public void pause()