<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#20000000"
android:endColor="@android:color/transparent"
<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#20000000"
android:endColor="@android:color/transparent"
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License.\r
+ limitations under the License.
-->
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/app_widget_large_alternate"
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Andrew Neal
-
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/**
* App-wide constants.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class Config {
* Used to turn off logging for jaudiotagger and free up memory when
* {@code #onLowMemory()} is called on pre-ICS devices. On post-ICS memory is
* released within {@link ImageCache}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class ElevenApplication extends Application {
void setShakeToPlayEnabled(boolean enabled);
void setLockscreenAlbumArt(boolean enabled);
}
-
/**
* This {@link ArrayAdapter} is used to display all of the albums on a user's
* device for {@link RecentsFragment} and {@link AlbumsFragment}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class AlbumAdapter extends BaseAdapter implements IPopupMenuCallback {
/**
* Constructor of <code>AlbumAdapter</code>
- *
+ *
* @param context The {@link Context} to use.
* @param layoutId The resource Id of the view to inflate.
* @param style Determines which layout to use and therefore which items to
/**
* This {@link ArrayAdapter} is used to display all of the artists on a user's
* device for {@link ArtistFragment}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
/**
/**
* Constructor of <code>ArtistAdapter</code>
- *
+ *
* @param context The {@link Context} to use.
* @param layoutId The resource Id of the view to inflate.
*/
/**
* Constructor of <code>PagerAdatper<code>
- *
+ *
* @param fragmentManager The supporting fragment manager
*/
public PagerAdapter(final Context context, final FragmentManager fragmentManager) {
/**
* Method that adds a new fragment class to the viewer (the fragment is
* internally instantiate)
- *
+ *
* @param className The full qualified name of fragment class.
* @param params The instantiate params.
*/
/**
* Method that returns the {@link Fragment} in the argument
* position.
- *
+ *
* @param position The position of the fragment to return.
* @return Fragment The {@link Fragment} in the argument position.
*/
/**
* Method that returns the current page position.
- *
+ *
* @return int The current page.
*/
public int getCurrentPage() {
/**
* Method that sets the current page position.
- *
+ *
* @param currentPage The current page.
*/
protected void setCurrentPage(final int currentPage) {
/**
* Constructor of <code>MusicFragments</code>
- *
+ *
* @param fragmentClass The fragment class
*/
private MusicFragments(final Class<? extends Fragment> fragmentClass) {
/**
* Method that returns the fragment class.
- *
+ *
* @return Class<? extends Fragment> The fragment class.
*/
public Class<? extends Fragment> getFragmentClass() {
/**
* This {@link ArrayAdapter} is used to display all of the playlists on a user's
* device for {@link PlaylistFragment}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class PlaylistAdapter extends ArrayAdapter<Playlist> implements IPopupMenuCallback {
/**
* Constructor of <code>PlaylistAdapter</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public PlaylistAdapter(final Context context) {
/**
* This {@link ArrayAdapter} is used to display the songs for a particular playlist
* {@link com.cyanogenmod.eleven.ui.fragments.PlaylistDetailFragment}
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class ProfileSongAdapter extends SongAdapter {
/**
* Constructor of <code>ProfileSongAdapter</code>
- *
+ *
* @param activity The {@link Activity} to use
* @param layoutId The resource Id of the view to inflate.
*/
* This {@link ArrayAdapter} is used to display all of the songs on a user's
* device for {@link SongFragment}. It is also used to show the queue in
* {@link QueueFragment}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class SongAdapter extends ArrayAdapter<Song>
/**
* Constructor of <code>SongAdapter</code>
- *
+ *
* @param context The {@link Context} to use.
* @param layoutId The resource Id of the view to inflate.
* @param sourceId The source id that the adapter is created from
/**
* Returns the ASCII characters up to but not including the next "\r\n", or
* "\n".
- *
+ *
* @throws java.io.EOFException if the stream is exhausted before the next
* newline character.
*/
/**
* Opens the cache in {@code directory}, creating a cache if none exists
* there.
- *
+ *
* @param directory a writable directory
* @param appVersion
* @param valueCount the number of values per cache entry. Must be positive.
/**
* Drops the entry for {@code key} if it exists and can be removed. Entries
* actively being edited cannot be removed.
- *
+ *
* @return true if an entry was removed.
*/
public synchronized boolean remove(final String key) throws IOException {
}
}
}
-
/**
* Caches {@code value} for {@code key}. The value is moved to the head of
* the queue.
- *
+ *
* @return the previous value mapped by {@code key}.
*/
public final V put(final K key, final V value) {
/**
* Removes the entry for {@code key} if it exists.
- *
+ *
* @return the previous value mapped by {@code key}.
*/
public final V remove(final K key) {
* <p>
* The method is called without synchronization: other threads may access
* the cache while this method is executing.
- *
+ *
* @param evicted true if the entry is being removed to make space, false if
* the removal was caused by a {@link #put} or {@link #remove}.
* @param newValue the new value for {@code key}, if it exists. If non-null,
* Calls {@link #DragSortController(DragSortListView, int)} with a 0 drag
* handle id, FLING_RIGHT_REMOVE remove mode, and ON_DOWN drag init. By
* default, sorting is enabled, and removal is disabled.
- *
+ *
* @param dslv The DSLV instance
*/
public DragSortController(DragSortListView dslv) {
/**
* By default, sorting is enabled, and removal is disabled.
- *
+ *
* @param dslv The DSLV instance
* @param dragHandleId The resource id of the View that represents the drag
* handle in a list item.
/**
* Set how a drag is initiated. Needs to be one of {@link ON_DOWN},
* {@link ON_DRAG}, or {@link ON_LONG_PRESS}.
- *
+ *
* @param mode The drag init mode.
*/
public void setDragInitMode(int mode) {
/**
* Enable/Disable list item sorting. Disabling is useful if only item
* removal is desired. Prevents drags in the vertical direction.
- *
+ *
* @param enabled Set <code>true</code> to enable list item sorting.
*/
public void setSortEnabled(boolean enabled) {
/**
* Set the resource id for the View that represents the drag handle in a
* list item.
- *
+ *
* @param id An android resource id.
*/
public void setDragHandleId(int id) {
* Sets flags to restrict certain motions of the floating View based on
* DragSortController settings (such as remove mode). Starts the drag on the
* DragSortListView.
- *
+ *
* @param position The list item position (includes headers).
* @param deltaX Touch x-coord minus left edge of floating View.
* @param deltaY Touch y-coord minus top edge of floating View.
* This function simply calls {@link #dragHandleHitPosition(MotionEvent)}.
* Override to change drag handle behavior; this function is called
* internally when an ACTION_DOWN event is detected.
- *
+ *
* @param ev The ACTION_DOWN MotionEvent.
* @return The list position to drag if a drag-init gesture is detected;
* MISS if unsuccessful.
* Checks for the touch of an item's drag handle (specified by
* {@link #setDragHandleId(int)}), and returns that item's position if a
* drag handle touch was detected.
- *
+ *
* @param ev The ACTION_DOWN MotionEvent.
* @return The list position of the item whose drag handle was touched; MISS
* if unsuccessful.
/**
* ListView subclass that mediates drag and drop resorting of items.
- *
+ *
* @author heycosmo
*/
public class DragSortListView extends ListView {
/**
* Set maximum drag scroll speed in positions/second. Only applies if using
* default ScrollSpeedProfile.
- *
+ *
* @param max Maximum scroll speed.
*/
public void setMaxScrollSpeed(final float max) {
* As opposed to {@link ListView#getAdapter()}, which returns a heavily
* wrapped ListAdapter (DragSortListView wraps the input ListAdapter {\emph
* and} ListView wraps the wrapped one).
- *
+ *
* @return The ListAdapter set as the argument of {@link setAdapter()}
*/
public ListAdapter getInputAdapter() {
/**
* Get the height of the given wrapped item and its child.
- *
+ *
* @param position Position from which item was obtained.
* @param item List item (usually obtained from
* {@link ListView#getChildAt()}).
* This function works for arbitrary positions (could be off-screen). If
* requested position is off-screen, this function calls
* <code>getView</code> to get height information.
- *
+ *
* @param position ListView position.
* @param heights Object to fill with heights of item at
* <code>position</code>.
/**
* Get the shuffle edge for item at position when top of item is at y-coord
* top
- *
+ *
* @param position
* @param top
* @param height Height of item at position. If -1, this function calculates
/**
* Stop a drag in progress. Pass <code>true</code> if you would like to
* remove the dragged item from the list.
- *
+ *
* @param remove Remove the dragged item from the list. Calls a registered
* DropListener, if one exists.
* @return True if the stop was successful.
/**
* Set the width of each drag scroll region by specifying a fraction of the
* ListView height.
- *
+ *
* @param heightFraction Fraction of ListView height. Capped at 0.5f.
*/
public void setDragScrollStart(final float heightFraction) {
/**
* Set the width of each drag scroll region by specifying a fraction of the
* ListView height.
- *
+ *
* @param upperFrac Fraction of ListView height for up-scroll bound. Capped
* at 0.5f.
* @param lowerFrac Fraction of ListView height for down-scroll bound.
* FloatViewManager. Calls through to
* {@link #startDrag(int,View,int,int,int)} after obtaining the floating
* View from the FloatViewManager.
- *
+ *
* @param position Item to drag.
* @param dragFlags Flags that restrict some movements of the floating View.
- * For example, set <code>dragFlags |=
+ * For example, set <code>dragFlags |=
* ~{@link #DRAG_NEG_X}</code> to allow dragging the floating View in all
* directions except off the screen to the left.
* @param deltaX Offset in x of the touch coordinate from the left edge of
/**
* Start a drag of item at <code>position</code> without using a
* FloatViewManager.
- *
+ *
* @param position Item to drag.
* @param floatView Floating View.
* @param dragFlags Flags that restrict some movements of the floating View.
- * For example, set <code>dragFlags |=
+ * For example, set <code>dragFlags |=
* ~{@link #DRAG_NEG_X}</code> to allow dragging the floating View in all
* directions except off the screen to the left.
* @param deltaX Offset in x of the touch coordinate from the left edge of
* {@link ViewGroup.LayoutParams} on this View; otherwise it will set
* some for you (with a width of FILL_PARENT and a height of
* WRAP_CONTENT).
- *
+ *
* @param position Position of item to drag (NOTE: <code>position</code>
* excludes header Views; thus, if you want to call
* {@link ListView#getChildAt(int)}, you will need to add
* can be changed here. Also, the upcoming location of the float View
* can be altered by setting <code>location.x</code> and
* <code>location.y</code>.
- *
+ *
* @param floatView The floating View.
* @param location The location (top-left; relative to DSLV top-left) at
* which the float View would like to appear, given the
* Called when the float View is dropped; lets you perform any necessary
* cleanup. The internal DSLV floating View reference is set to null
* immediately after this is called.
- *
+ *
* @param floatView The floating View passed to
* {@link #onCreateFloatView(int)}.
*/
* ListView. If enabled, items are draggable, where the drag init mode
* determines how items are lifted (see {@link setDragInitMode(int)}). If
* disabled, items cannot be dragged.
- *
+ *
* @param enabled Set <code>true</code> to enable list item dragging
*/
public void setDragEnabled(final boolean enabled) {
* for you; doesn't make sense to. Make sure
* {@link BaseAdapter#notifyDataSetChanged()} or something like it is called
* in your implementation.
- *
+ *
* @param l
*/
public void setDropListener(final DropListener l) {
* item removal occurs, DragSortListView relies on a redraw of all the items
* to recover invisible views and such. Strictly speaking, if you remove
* something, your dataset has changed...
- *
+ *
* @param l
*/
public void setRemoveListener(final RemoveListener l) {
* Your implementation of this has to reorder your ListAdapter! Make sure to
* call {@link BaseAdapter#notifyDataSetChanged()} or something like it in
* your implementation.
- *
+ *
* @author heycosmo
*/
public interface DropListener {
/**
* Make sure to call {@link BaseAdapter#notifyDataSetChanged()} or something
* like it in your implementation.
- *
+ *
* @author heycosmo
*/
public interface RemoveListener {
* Completely custom scroll speed profile. Default increases linearly with
* position and is constant in time. Create your own by implementing
* {@link DragSortListView.DragScrollProfile}.
- *
+ *
* @param ssp
*/
public void setDragScrollProfile(final DragScrollProfile ssp) {
* and time. Use
* {@link DragSortListView#setDragScrollProfile(DragScrollProfile)} to set
* custom profile.
- *
+ *
* @author heycosmo
*/
public interface DragScrollProfile {
/**
* Return a scroll speed in pixels/millisecond. Always return a positive
* number.
- *
+ *
* @param w Normalized position in scroll region (i.e. w \in [0,1]).
* Small w typically means slow scrolling.
* @param t Time (in milliseconds) since start of scroll (handy if you
/**
* Capitalizes the first character in a string
- *
+ *
* @param str The string to capitalize
* @param delimiters The delimiters
* @return A captitalized string
/**
* Is the character a delimiter.
- *
+ *
* @param ch the character to check
* @param delimiters the delimiters
* @return true if it is a delimiter
/**
* Sets the text on the given {@link TextView}, highlighting the word that
* matches the given prefix.
- *
+ *
* @param view The {@link TextView} on which to set the text
* @param text The string to use as the text
* @param prefix The prefix to look for
/**
* Returns a {@link CharSequence} which highlights the given prefix if found
* in the given text.
- *
+ *
* @param text the text to which to apply the highlight
* @param prefix the prefix to look for
*/
/**
* Finds the index of the first character that starts with the given prefix. If
* not found, returns -1.
- *
+ *
* @param text the text in which to search for the prefix
* @param prefix the text to find, in upper case letters
* @param wordOnly only search for word prefixes if true
/**
* Wrapper class for Album related API calls and Album Bean.
- *
+ *
* @author Janni Kovacs
*/
public class Album extends MusicEntry {
/**
* Get the metadata for an album on Last.fm using the album name or a
* musicbrainz id. See playlist.fetch on how to get the album playlist.
- *
+ *
* @param artist Artist's name
* @param albumOrMbid Album name or MBID
* @return Album metadata
/**
* Get the metadata for an album on Last.fm using the album name or a
* musicbrainz id. See playlist.fetch on how to get the album playlist.
- *
+ *
* @param artist Artist's name
* @param albumOrMbid Album name or MBID
* @param username The username for the context of the request. If supplied,
* This class contains static methods that executes API methods relating to
* artists.<br/>
* Method names are equivalent to the last.fm API method names.
- *
+ *
* @author Janni Kovacs
*/
public class Artist extends MusicEntry {
/**
* Retrieves detailed artist info for the given artist or mbid entry.
- *
+ *
* @param artistOrMbid Name of the artist or an mbid
* @return detailed artist info
*/
/**
* Retrieves detailed artist info for the given artist or mbid entry.
- *
+ *
* @param artistOrMbid Name of the artist or an mbid
* @param locale The language to fetch info in, or <code>null</code>
* @param apiKey The API key
* a correction to a canonical artist. This method returns a new
* {@link Artist} object containing the corrected data, or <code>null</code>
* if the supplied Artist was not found.
- *
+ *
* @param artist The artist name to correct
* @return a new {@link Artist}, or <code>null</code>
*/
* by the Java API are necessary this class may be used directly.<br/>
* Supports the setting of a custom {@link Proxy} and a custom
* <code>User-Agent</code> HTTP header.
- *
+ *
* @author Janni Kovacs
*/
public class Caller {
* <code>null</code> then an unauthenticated call is made.<br/>
* The <code>apiKey</code> parameter is always required, even when a valid
* session is passed to this method.
- *
+ *
* @param method The method to call
* @param apiKey A Last.fm API key
* @param params Parameters
/**
* Creates a new {@link HttpURLConnection}, sets the proxy, if available,
* and sets the User-Agent property.
- *
+ *
* @param url URL to connect to
* @return a new connection.
* @throws IOException if an I/O exception occurs.
/**
* <code>DomElement</code> wraps around an {@link Element} and provides
* convenience methods.
- *
+ *
* @author Janni Kovacs
*/
public class DomElement {
/**
* Creates a new wrapper around the given {@link Element}.
- *
+ *
* @param elem An w3c Element
*/
public DomElement(final Element elem) {
/**
* Tests if this element has an attribute with the specified name.
- *
+ *
* @param name Name of the attribute.
* @return <code>true</code> if this element has an attribute with the
* specified name.
/**
* Returns the attribute value to a given attribute name or
* <code>null</code> if the attribute doesn't exist.
- *
+ *
* @param name The attribute's name
* @return Attribute value or <code>null</code>
*/
/**
* Checks if this element has a child element with the given name.
- *
+ *
* @param name The child's name
* @return <code>true</code> if this element has a child element with the
* given name
/**
* Returns the child element with the given name or <code>null</code> if it
* doesn't exist.
- *
+ *
* @param name The child's name
* @return the child element or <code>null</code>
*/
* Returns the text content of a child node with the given name. If no such
* child exists or the child does not have text content, <code>null</code>
* is returned.
- *
+ *
* @param name The child's name
* @return the child's text content or <code>null</code>
*/
/**
* Returns all children of this element with the given tag name.
- *
+ *
* @param name The children's tag name
* @return all matching children
*/
/**
* Returns this element's tag name.
- *
+ *
* @return the tag name
*/
public String getTagName() {
* An <code>Image</code> contains metadata and URLs for an artist's image.
* Metadata contains title, votes, format and other. Images are available in
* various sizes, see {@link ImageSize} for all sizes.
- *
+ *
* @author Janni Kovacs
* @see ImageSize
* @see Artist#getImages(String, String)
/**
* Abstract superclass for all items that may contain images (such as
* {@link Artist}s, {@link Album}s or {@link Track}s).
- *
+ *
* @author Janni Kovacs
*/
public abstract class ImageHolder {
/**
* Returns a Set of all {@link ImageSize}s available.
- *
+ *
* @return all sizes
*/
public Set<ImageSize> availableSizes() {
/**
* Returns the URL of the image in the specified size, or <code>null</code>
* if not available.
- *
+ *
* @param size The preferred size
* @return an image URL
*/
* An <code>ItemFactory</code> can be used to instantiate a value object - such
* as Artist, Album, Track, Tag - from an XML element. Use the
* {@link ItemFactoryBuilder} to obtain item factories for a specific type.
- *
+ *
* @author Janni Kovacs
* @see com.cyanogenmod.eleven.lastfm.api.ItemFactoryBuilder
* @see ResponseBuilder
/**
* Create a new instance of the type <code>T</code>, based on the passed
* {@link DomElement}.
- *
+ *
* @param element the XML element
* @return a new object
*/
/**
* The <code>ItemFactoryBuilder</code> can be used to obtain {@link ItemFactory
* ItemFactories} for a specific type.
- *
+ *
* @author Janni Kovacs
* @see ItemFactory
*/
/**
* Retrieve the instance of the <code>ItemFactoryBuilder</code>.
- *
+ *
* @return the instance
*/
public static ItemFactoryBuilder getFactoryBuilder() {
/**
* Retrieves an {@link ItemFactory} for the given type, or <code>null</code>
* if no such factory was registered.
- *
+ *
* @param itemClass the type's Class object
* @return the <code>ItemFactory</code> or <code>null</code>
*/
/**
* Utility class to perform various operations on Maps.
- *
+ *
* @author Adrian Woodhead
*/
public final class MapUtilities {
/**
* Puts the passed key and value into the map only if the value is not null.
- *
+ *
* @param map Map to add key and value to.
* @param key Map key.
* @param value Map value, if null will not be added to map.
/**
* Puts the passed key and value into the map only if the value is not null.
- *
+ *
* @param map Map to add key and value to.
* @param key Map key.
* @param value Map value, if null will not be added to map.
/**
* Puts the passed key and value into the map only if the value is not -1.
- *
+ *
* @param map Map to add key and value to.
* @param key Map key.
* @param value Map value, if -1 will not be added to map.
/**
* Puts the passed key and value into the map only if the value is not -1.
- *
+ *
* @param map Map to add key and value to.
* @param key Map key.
* @param value Map value, if -1 will not be added to map.
* <code>MusicEntry</code> is the abstract superclass for {@link Track},
* {@link Artist} and {@link Album}. It encapsulates data and provides methods
* used in all subclasses, for example: name, playcount, images and more.
- *
+ *
* @author Janni Kovacs
*/
public abstract class MusicEntry extends ImageHolder {
* <li>image</li>
* <li>tags</li>
* </ul>
- *
+ *
* @param entry An entry
* @param element XML source element
*/
* be so large that it needs to be paginated. Each <code>PaginatedResult</code>
* contains the total number of result pages, the current page and a
* <code>Collection</code> of entries for the current page.
- *
+ *
* @author Janni Kovacs
*/
public class PaginatedResult<T> implements Iterable<T> {
/**
* Returns the page number of this result.
- *
+ *
* @return page number
*/
public int getPage() {
/**
* Returns the total number of pages available.
- *
+ *
* @return total pages
*/
public int getTotalPages() {
* Returns <code>true</code> if this Result contains no elements, which is
* the case for service calls that would have returned a
* <code>PaginatedResult</code> but fail.
- *
+ *
* @return <code>true</code> if this result contains no elements
*/
public boolean isEmpty() {
* This utility class can be used to generically generate Result objects
* (usually Lists or {@link PaginatedResult}s) from an XML response using
* {@link ItemFactory ItemFactories}.
- *
+ *
* @author Janni Kovacs
*/
public final class ResponseBuilder {
* The <code>Result</code> class contains the response sent by the server, i.e.
* the status (either ok or failed), an error code and message if failed and the
* xml response sent by the server.
- *
+ *
* @author Janni Kovacs
*/
public class Result {
/**
* Returns if the operation was successful. Same as
* <code>getStatus() == Status.OK</code>.
- *
+ *
* @return <code>true</code> if the operation was successful
*/
public boolean isSuccessful() {
/**
* Utilitiy class with methods to calculate an md5 hash and to encode URLs.
- *
+ *
* @author Janni Kovacs
*/
public final class StringUtilities {
/**
* Returns a 32 chararacter hexadecimal representation of an MD5 hash of the
* given String.
- *
+ *
* @param s the String to hash
* @return the md5 hash
*/
/**
* URL Encodes the given String <code>s</code> using the UTF-8 character
* encoding.
- *
+ *
* @param s a String
* @return url encoded string
*/
/**
* Decodes an URL encoded String <code>s</code> using the UTF-8 character
* encoding.
- *
+ *
* @param s an encoded String
* @return the decoded String
*/
/**
* Creates a Map out of an array with Strings.
- *
+ *
* @param strings input strings, key-value alternating
* @return a parameter map
*/
* file names. By default <tt>: / \ < > | ? " *</tt> are all replaced by
* <tt>-</tt>. Note that this is no guarantee that the returned name will be
* definately valid.
- *
+ *
* @param s the String to clean up
* @return the cleaned up String
*/
/**
* Tests if the given string <i>might</i> already be a 32-char md5 string.
- *
+ *
* @param s String to test
* @return <code>true</code> if the given String might be a md5 string
*/
/**
* Converts a Last.fm boolean result string to a boolean.
- *
+ *
* @param resultString A Last.fm boolean result string.
* @return <code>true</code> if the given String represents a true,
* <code>false</code> otherwise.
/**
* Converts from a boolean to a Last.fm boolean result string.
- *
+ *
* @param value A boolean value.
* @return A string representing a Last.fm boolean.
*/
/**
* Used to query {@link MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI} and return
* the albums on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class AlbumLoader extends SectionCreator.SimpleListLoader<Album> {
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @param artistId The artistId we want to find albums for or null if we want all albums
* @return The {@link Cursor} used to run the album query.
/**
* Used to query {@link MediaStore.Audio.Media.EXTERNAL_CONTENT_URI} and return
* the Song for a particular album.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class AlbumSongLoader extends WrappedAsyncTaskLoader<List<Song>> {
/**
* Constructor of <code>AlbumSongHandler</code>
- *
+ *
* @param context The {@link Context} to use.
* @param albumId The Id of the album the songs belong to.
*/
}
}
-
/**
* Used to query {@link MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI} and
* return the artists on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class ArtistLoader extends SectionCreator.SimpleListLoader<Artist> {
/**
* Constructor of <code>ArtistLoader</code>
- *
+ *
* @param context The {@link Context} to use
*/
public ArtistLoader(final Context context) {
}
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @return The {@link Cursor} used to run the artist query.
*/
/**
* Used to query {@link MediaStore.Audio.Media.EXTERNAL_CONTENT_URI} and return
* the Song the user added over the past four of weeks.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class LastAddedLoader extends SectionCreator.SimpleListLoader<Song> {
/**
* Constructor of <code>LastAddedHandler</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public LastAddedLoader(final Context context) {
/**
* Constructor of <code>NowPlayingCursor</code>
- *
+ *
* @param context The {@link Context} to use
*/
public NowPlayingCursor(final Context context) {
/**
* Used to query {@link MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI} and
* return the playlists on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class PlaylistLoader extends WrappedAsyncTaskLoader<List<Playlist>> {
/**
* Constructor of <code>PlaylistLoader</code>
- *
+ *
* @param context The {@link Context} to use
*/
public PlaylistLoader(final Context context) {
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @return The {@link Cursor} used to run the playlist query.
*/
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @param playlistID The playlist the songs belong to.
* @return The {@link Cursor} used to run the song query.
/**
* Used to return the current playlist or queue.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class QueueLoader extends WrappedAsyncTaskLoader<List<Song>> {
/**
* Constructor of <code>QueueLoader</code>
- *
+ *
* @param context The {@link Context} to use
*/
public QueueLoader(final Context context) {
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @return The {@link Cursor} used to run the song query.
*/
/**
* Constructor of <code>SongLoader</code>
- *
+ *
* @param context The {@link Context} to use
* @param query The search query
*/
/**
* * @param context The {@link Context} to use.
- *
+ *
* @param query The user's query.
* @return The {@link Cursor} used to perform the search.
*/
/**
* Used to query {@link MediaStore.Audio.Media.EXTERNAL_CONTENT_URI} and return
* the songs on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class SongLoader extends SectionCreator.SimpleListLoader<Song> {
/**
* Creates the {@link Cursor} used to run the query.
- *
+ *
* @param context The {@link Context} to use.
* @param selection Additional selection statement to use
* @return The {@link Cursor} used to run the song query.
/**
* <a href="http://code.google.com/p/android/issues/detail?id=14944">Issue
* 14944</a>
- *
+ *
* @author Alexander Blom
*/
public abstract class WrappedAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
/**
* Constructor of <code>WrappedAsyncTaskLoader</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public WrappedAsyncTaskLoader(Context context) {
/**
* A simple base class for the playlist dialogs.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public abstract class BasePlaylistDialog extends DialogFragment {
* Alert dialog used to delete tracks.
* <p>
* TODO: Remove albums from the recents list upon deletion.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class DeleteDialog extends DialogFragment {
/**
* Alert dialog used to rename playlits.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class RenamePlaylist extends BasePlaylistDialog {
/**
* A class that represents an album.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class Album {
/**
* Constructor of <code>Album</code>
- *
+ *
* @param albumId The Id of the album
* @param albumName The name of the album
* @param artistName The album artist
/**
* A class that represents an artist.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class Artist {
/**
* Constructor of <code>Artist</code>
- *
+ *
* @param artistId The Id of the artist
* @param artistName The artist name
* @param songNumber The number of songs for the artist
/**
* A class that represents a genre.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class Genre {
/**
* Constructor of <code>Genre</code>
- *
+ *
* @param genreId The Id of the genre
* @param genreName The genre name
*/
/**
* A class that represents a playlist.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class Playlist {
/**
* Constructor of <code>Genre</code>
- *
+ *
* @param playlistId The Id of the playlist
* @param playlistName The playlist name
*/
/**
* A class that represents a song.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class Song {
/**
* Constructor of <code>Song</code>
- *
+ *
* @param songId The Id of the song
* @param songName The name of the song
* @param artistName The song artist
/**
* Constructor of <code>RecentStore</code>
- *
+ *
* @param context The {@link Context} to use
*/
public RecentStore(final Context context) {
/**
* Used to store song IDs in the database.
- *
+ *
* @param songId The song id to store
*/
public void addSongId(final long songId) {
/**
* A @ {@link RecyclerListener} for {@link MusicHolder}'s views.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class RecycleHolder implements RecyclerListener {
/**
* Used to efficiently cache and recyle the {@link View}s used in the artist,
* album, song, playlist, and genre adapters.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class MusicHolder {
/**
* This is the first line displayed in the list or grid
- *
+ *
* @see {@code #getView()} of a specific adapter for more detailed info
*/
public WeakReference<TextView> mLineOne;
/**
* This is the second line displayed in the list or grid
- *
+ *
* @see {@code #getView()} of a specific adapter for more detailed info
*/
public WeakReference<TextView> mLineTwo;
/**
* Constructor of <code>ViewHolder</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public MusicHolder(final View view) {
/**
* This is the first line displayed in the list or grid
- *
+ *
* @see {@code #getView()} of a specific adapter for more detailed info
*/
public String mLineOne;
/**
* This is the second line displayed in the list or grid
- *
+ *
* @see {@code #getView()} of a specific adapter for more detailed info
*/
public String mLineTwo;
/**
* Provides the search interface for Apollo.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class SearchActivity extends FragmentActivity implements
/**
* This class is used to display all of the albums on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class AlbumFragment extends MusicBrowserFragment implements
/**
* Sets up various helpers for both the list and grid
- *
+ *
* @param list The list or grid
*/
private void initAbsListView(final AbsListView list) {
LoaderManager lm = getLoaderManager();
lm.restartLoader(ALBUM_LOADER_ID, arguments, mAlbumAdapter);
lm.restartLoader(SONG_LOADER_ID, arguments, mSongAdapter);
-
+
ImageFetcher.getInstance(getActivity()).loadArtistImage(mArtistName, mHero, true);
}
/**
* This class is used to display all of the artists on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class ArtistFragment extends MusicBrowserFragment implements
/**
* Sets up various helpers for both the list and grid
- *
+ *
* @param list The list or grid
*/
private void initAbsListView(final AbsListView list) {
/**
* This class is used to display all of the playlists on a user's device.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class PlaylistFragment extends MusicBrowserFragment implements
/**
* Mostly general and UI helpers.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class ApolloUtils {
/**
* Used to determine if the device is a tablet or not
- *
+ *
* @param context The {@link Context} to use.
* @return True if the device is a tablet, false otherwise.
*/
/**
* Used to determine if the device is currently in landscape mode
- *
+ *
* @param context The {@link Context} to use.
* @return True if the device is in landscape mode, false otherwise.
*/
/**
* Execute an {@link AsyncTask} on a thread pool
- *
+ *
* @param forceSerial True to force the task to run in serial order
* @param task Task to execute
* @param args Optional arguments to pass to
/**
* Used to determine if there is an active data connection and what type of
* connection it is if there is one
- *
+ *
* @param context The {@link Context} to use
* @return True if there is an active data connection, false otherwise.
* Also, if the user has checked to only download via Wi-Fi in the
/**
* Display a {@link Toast} letting the user know what an item does when long
* pressed.
- *
+ *
* @param view The {@link View} to copy the content description from.
*/
public static void showCheatSheet(final View view) {
/**
* Calculate whether a color is light or dark, based on a commonly known
* brightness formula.
- *
+ *
* @see {@literal http://en.wikipedia.org/wiki/HSV_color_space%23Lightness}
*/
public static final boolean isColorDark(final int color) {
/**
* Runs a piece of code after the next layout run
- *
+ *
* @param view The {@link View} used.
* @param runnable The {@link Runnable} used after the next layout run
*/
/**
* Creates a new instance of the {@link ImageCache} and {@link ImageFetcher}
- *
+ *
* @param activity The {@link Activity} to use.
* @return A new {@link ImageFetcher} used to fetch images asynchronously.
*/
/**
* {@link Bitmap} specific helpers.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class BitmapUtils {
/**
* Takes a bitmap and creates a new slightly blurry version of it.
- *
+ *
* @param sentBitmap The {@link Bitmap} to blur.
* @return A blurred version of the given {@link Bitmap}.
*/
/**
* This is only used when the launcher shortcut is created.
- *
+ *
* @param bitmap The artist, album, genre, or playlist image that's going to
* be cropped.
* @param size The new size.
* <p>
* <b>Note:</b> if you only need an <i>immutable</i> empty List, use
* {@link Collections#emptyList} instead.
- *
+ *
* @return a newly-created, initially-empty {@code ArrayList}
*/
public static final <E> ArrayList<E> newArrayList() {
* <p>
* <b>Note:</b> if you only need an <i>immutable</i> empty List, use
* {@link Collections#emptyList} instead.
- *
+ *
* @return a newly-created, initially-empty {@code LinkedList}
*/
public static final <E> LinkedList<E> newLinkedList() {
/**
* Various navigation helpers.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class NavUtils {
/**
* Opens the profile of an artist.
- *
+ *
* @param context The {@link Activity} to use.
* @param artistName The name of the artist
*/
/**
* Opens the profile of an album.
- *
+ *
* @param context The {@link Activity} to use.
* @param albumName The name of the album
* @param artistName The name of the album artist
/**
* Opens the sound effects panel or DSP manager in CM
- *
+ *
* @param context The {@link Activity} to use.
* @param requestCode The request code passed into startActivityForResult
*/
/**
* Opens to {@link SettingsActivity}.
- *
+ *
* @param activity The {@link Activity} to use.
*/
public static void openSettings(final Activity activity) {
/**
* Opens to {@link com.cyanogenmod.eleven.ui.activities.SearchActivity}.
- *
+ *
* @param activity The {@link Activity} to use.
* @param query The search query.
*/
/**
* Opens to {@link com.cyanogenmod.eleven.ui.activities.HomeActivity}.
- *
+ *
* @param activity The {@link Activity} to use.
*/
public static void goHome(final Activity activity, final int browseIndex) {
/**
* Create a new {@link AlertDialog} for easy playlist deletion
- *
+ *
* @param playlistName The title of the playlist being deleted
* @param playlistId The ID of the playlist being deleted
* @return A new {@link AlertDialog} used to delete playlists
/**
* A collection of helpers designed to get and set various preferences across
* Apollo.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class PreferenceUtils {
/**
* Constructor for <code>PreferenceUtils</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public PreferenceUtils(final Context context) {
/**
* Saves the current page the user is on when they close the app.
- *
+ *
* @param value The last page the pager was on when the onDestroy is called
* in {@link MusicBrowserPhoneFragment}.
*/
}
}, (Void[])null);
}
-
+
/**
* Set the listener for preference change
* @param listener
/**
* Returns the last page the user was on when the app was exited.
- *
+ *
* @return The page to start on when the app is opened.
*/
public final int getStartPage() {
/**
* Sets the new theme color.
- *
+ *
* @param value The new theme color to use.
*/
public void setDefaultThemeColor(final int value) {
/**
* Returns the current theme color.
- *
+ *
* @param context The {@link Context} to use.
* @return The default theme color.
*/
/**
* Saves the sort order for a list.
- *
+ *
* @param key Which sort order to change
* @param value The new sort order
*/
/**
* Sets the sort order for the artist list.
- *
+ *
* @param value The new sort order
*/
public void setArtistSortOrder(final String value) {
/**
* Sets the sort order for the artist song list.
- *
+ *
* @param value The new sort order
*/
public void setArtistSongSortOrder(final String value) {
/**
* Sets the sort order for the artist album list.
- *
+ *
* @param value The new sort order
*/
public void setArtistAlbumSortOrder(final String value) {
/**
* Sets the sort order for the album list.
- *
+ *
* @param value The new sort order
*/
public void setAlbumSortOrder(final String value) {
/**
* Sets the sort order for the album song list.
- *
+ *
* @param value The new sort order
*/
public void setAlbumSongSortOrder(final String value) {
/**
* Sets the sort order for the song list.
- *
+ *
* @param value The new sort order
*/
public void setSongSortOrder(final String value) {
public boolean getShowVisualizer() {
return mPreferences.getBoolean(SHOW_VISUALIZER, true);
}
-
+
public boolean getShakeToPlay() {
return mPreferences.getBoolean(SHAKE_TO_PLAY, false);
}
/**
* Holds all of the sort orders for each list type.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public final class SortOrder {
return hours * 60 * 60 * 1000 + minutes * 60 * 1000 + seconds * 1000 + millies;
}
}
-
* This drawable that draws a simple white and gray chess board pattern. It's
* pattern you will often see as a background behind a partly transparent image
* in many applications.
- *
+ *
* @author Daniel Nilsson
*/
public class AlphaPatternDrawable extends Drawable {
* This class draws a panel which which will be filled with a color which can be
* set. It can be used to show the currently selected color which you will get
* from the {@link ColorPickerView}.
- *
+ *
* @author Daniel Nilsson
*/
public class ColorPanelView extends View {
/**
* Set the color that should be shown by this view.
- *
+ *
* @param color
*/
public void setColor(final int color) {
/**
* Get the color currently show by this view.
- *
+ *
* @return
*/
public int getColor() {
/**
* Set the color of the border surrounding the panel.
- *
+ *
* @param color
*/
public void setBorderColor(final int color) {
* Displays a color picker to the user and allow them to select a color. A
* slider for the alpha channel is also available. Enable it by setting
* setAlphaSliderVisible(boolean) to true.
- *
+ *
* @author Daniel Nilsson
*/
public class ColorPickerView extends View {
/**
* Set a OnColorChangedListener to get notified when the color selected by
* the user has changed.
- *
+ *
* @param listener
*/
public void setOnColorChangedListener(final OnColorChangedListener listener) {
/**
* Set the color of the border surrounding all panels.
- *
+ *
* @param color
*/
public void setBorderColor(final int color) {
/**
* Get the current color this view is showing.
- *
+ *
* @return the current color.
*/
public int getColor() {
/**
* Set the color the view should show.
- *
+ *
* @param color The color that should be selected.
*/
public void setColor(final int color) {
/**
* Set the color this view should show.
- *
+ *
* @param color The color that should be selected.
* @param callback If you want to get a callback to your
* OnColorChangedListener.
* the distance from the side of a panel to the side of the view minus the
* padding. Useful if you want to have your own panel below showing the
* currently selected color and want to align it perfectly.
- *
+ *
* @return The offset in pixels.
*/
public float getDrawingOffset() {
/**
* Set if the user is allowed to adjust the alpha panel. Default is false.
* If it is set to false no alpha will be set.
- *
+ *
* @param visible
*/
public void setAlphaSliderVisible(final boolean visible) {
/**
* Set the text that should be shown in the alpha slider. Set to null to
* disable text.
- *
+ *
* @param res string resource id.
*/
public void setAlphaSliderText(final int res) {
/**
* Set the text that should be shown in the alpha slider. Set to null to
* disable text.
- *
+ *
* @param text Text that should be shown.
*/
public void setAlphaSliderText(final String text) {
/**
* Get the current value of the text that will be shown in the alpha slider.
- *
+ *
* @return
*/
public String getAlphaSliderText() {
public static BitmapWithColors createDefaultBitmap(Context context, String identifier,
ImageType type, boolean isCircle, boolean smallArtwork) {
initializeStaticVariables(context.getResources());
-
+
identifier = MusicUtils.getTrimmedName(identifier);
// get the default bitmap to determine what to draw to
/**
* A custom {@link ImageButton} that represents the "repeat" button.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class RepeatButton extends AudioButton {
/**
* Sets the listener to be called while the button is pressed and the
* interval in milliseconds with which it will be called.
- *
+ *
* @param l The listener that will be called
* @param interval The interval in milliseconds for calls
*/
/**
* Constructor of <code>SeparatedListAdapter</code>
- *
+ *
* @param context The {@link Context} to use.
*/
public SeparatedListAdapter(final Context context) {
/**
* Allow or disallow the user to flick right on the detail pane to expose
* the master pane.
- *
+ *
* @param enabled Whether or not to enable this interaction.
*/
public void setFlingToExposeMasterEnabled(final boolean enabled) {
/**
* Request the given listener be notified when the master pane is shown or
* hidden.
- *
+ *
* @param listener The listener to notify when the master pane is shown or
* hidden.
*/
/**
* Returns whether or not the master pane is visible.
- *
+ *
* @return True if the master pane is visible.
*/
public boolean isMasterVisible() {
/**
* Shows or hides the master pane.
- *
+ *
* @param show Whether or not to show the master pane.
* @param flags {@link #FLAG_IMMEDIATE} to show/hide immediately, or 0 to
* animate.
/**
* A custom {@link ImageView} that is sized to be a perfect square, otherwise
* functions like a typical {@link ImageView}.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class SquareImageView extends LayoutSuppressingImageView {
/**
* A custom {@link ViewGroup} used to make it's children into perfect squares.
* Useful when dealing with grid images and especially album art.
- *
+ *
* @author Andrew Neal (andrewdneal@gmail.com)
*/
public class SquareView extends ViewGroup {