Skip to content

Commit

Permalink
add index to readme and minor code sample update
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeepw committed May 10, 2014
1 parent 4254978 commit 34daa51
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 41 deletions.
2 changes: 1 addition & 1 deletion AudioWifeDemo/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
android:paddingTop="5dp" >

<SeekBar
android:id="@+id/mediaSeekBar"
android:id="@+id/media_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
Expand Down
4 changes: 2 additions & 2 deletions AudioWifeDemo/src/nl/changer/audiowifedemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public void onClick(View v) {
}
});

// initialize the player contols
// initialize the player controls
mPlayMedia = findViewById(R.id.play);
mPauseMedia = findViewById(R.id.pause);
mMediaSeekBar = (SeekBar) findViewById(R.id.mediaSeekBar);
mMediaSeekBar = (SeekBar) findViewById(R.id.media_seekbar);
mPlaybackTime = (TextView) findViewById(R.id.playback_time);

mPlayMedia.setOnClickListener(new View.OnClickListener() {
Expand Down
96 changes: 58 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
Audio Wife
Index
==================
[Introduction](https://github.com/jaydeepw/audio-wife#audio-wife)
[Why this project?](https://github.com/jaydeepw/audio-wife#why-this-project)
[Including in your project](https://github.com/jaydeepw/audio-wife#including-in-your-project)
[Getting started](https://github.com/jaydeepw/audio-wife#getting-started)
[Add custom listeners](https://github.com/jaydeepw/audio-wife#add-custom-listeners)
[Why the name 'AudioWife'?](https://github.com/jaydeepw/audio-wife#why-the-name-audiowife)
[Contributing](https://github.com/jaydeepw/audio-wife#contributing)
[Developed by](https://github.com/jaydeepw/audio-wife#developed-by)
[Credits](https://github.com/jaydeepw/audio-wife#credits)
[License](https://github.com/jaydeepw/audio-wife#license)


[Stable Versions](https://github.com/changer/forge/wiki/Module-Documentation#wiki-stable-versions)

**API Methods**
* [addMessage](https://github.com/changer/forge/wiki/Module-Documentation#addmessage)


Audio Wife - Introduction
==========

A simple themable audio player library for Android. Helps you have an Audio Controller
Expand Down Expand Up @@ -33,10 +53,10 @@ Getting started
====================
```java

// initialize the player contols
// initialize the player controls
mPlayMedia = findViewById(R.id.play);
mPauseMedia = findViewById(R.id.pause);
mMediaSeekBar = (SeekBar) findViewById(R.id.mediaSeekBar);
mMediaSeekBar = (SeekBar) findViewById(R.id.media_seekbar);
mPlaybackTime = (TextView) findViewById(R.id.playback_time);

// initialize AudioWife
Expand Down Expand Up @@ -68,41 +88,41 @@ To extend the capabilities of AudioWife, custom click listeners can be attached.
Refer to source documentation for more details.

```java
AudioWife.getInstance().init(MainActivity.this, uri)
.setPlayView(mPlayMedia) // AudioWife takes care of click handler for play button
.setPauseView(mPauseMedia) // AudioWife takes care of click handler for pause button
.setSeekBar(mMediaSeekBar)
.setPlaytime(mPlaybackTime);
AudioWife.getInstance().addOnCompletionListener( new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
Toast.makeText(getBaseContext(), "Completed", Toast.LENGTH_SHORT)
.show();
// do you stuff
}
});
AudioWife.getInstance().addOnPlayClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getBaseContext(), "Play", Toast.LENGTH_SHORT)
.show();
// get-set-go. Lets dance.
}
});
AudioWife.getInstance().addOnPauseClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getBaseContext(), "Pause", Toast.LENGTH_SHORT)
.show();
// Your on audio pause stuff.
}
});
AudioWife.getInstance().init(MainActivity.this, uri)
.setPlayView(mPlayMedia) // AudioWife takes care of click handler for play button
.setPauseView(mPauseMedia) // AudioWife takes care of click handler for pause button
.setSeekBar(mMediaSeekBar)
.setPlaytime(mPlaybackTime);

AudioWife.getInstance().addOnCompletionListener( new MediaPlayer.OnCompletionListener() {

@Override
public void onCompletion(MediaPlayer mp) {
Toast.makeText(getBaseContext(), "Completed", Toast.LENGTH_SHORT)
.show();
// do you stuff
}
});

AudioWife.getInstance().addOnPlayClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Toast.makeText(getBaseContext(), "Play", Toast.LENGTH_SHORT)
.show();
// get-set-go. Lets dance.
}
});

AudioWife.getInstance().addOnPauseClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Toast.makeText(getBaseContext(), "Pause", Toast.LENGTH_SHORT)
.show();
// Your on audio pause stuff.
}
});
```

Why the name 'AudioWife'?
Expand Down

0 comments on commit 34daa51

Please sign in to comment.