Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release-1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Klein committed Aug 7, 2014
2 parents e1ee956 + 84c195b commit d52f70f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import sbt.Keys._
object Build extends sbt.Build
{
val main = Project( "communicator", file( "." ) ).settings(
name := "Communicator",
organization := "com.taig.communicator",
version := "1.0.1",
name := "android-communicator",
organization := "com.taig",
version := "1.0.2",
autoScalaLibrary := false,
libraryDependencies += "com.google.android" % "android" % "4.3" % "provided" from ( "file://" + System.getenv( "ANDROID_HOME" ) + "/platforms/android-18/android.jar" )
libraryDependencies += "com.google.android" % "android" % "4.4" % "provided" from ( "file://" + System.getenv( "ANDROID_HOME" ) + "/platforms/android-19/android.jar" )
)
}
22 changes: 22 additions & 0 deletions src/main/java/com/taig/communicator/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ protected void onCancel( InterruptedIOException exception )
//
}

/**
* Triggers only once, right before the actual sending process starts.
*
* @param total The total amount of bytes to send or <code>-1</code> if unknown.
*/
protected void onSend( long total )
{
//
}

/**
* Triggers every time the {@link Request Request's} {@link OutputStream} sends an {@link Stream.Output#update()}.
*
Expand All @@ -103,6 +113,16 @@ protected void onSend( int progress )
//
}

/**
* Triggers only once, right before the actual sending process starts.
*
* @param total The total amount of bytes to receive or <code>-1</code> if unknown.
*/
protected void onReceive( long total )
{
//
}

/**
* Triggers every time the {@link Request Request's} {@link InputStream} sends an {@link Stream.Input#update()}.
* <p/>
Expand Down Expand Up @@ -286,6 +306,7 @@ public void run()
if( current == 0 )
{
onEvent( State.SEND );
onSend( total );
}

onSend( current, total );
Expand All @@ -308,6 +329,7 @@ public void run()
if( current == 0 )
{
onEvent( State.RECEIVE );
onReceive( total );
}

onReceive( current, total );
Expand Down

0 comments on commit d52f70f

Please sign in to comment.