Skip to content

Commit

Permalink
Added RecordLock Listener
Browse files Browse the repository at this point in the history
  • Loading branch information
3llomi committed Feb 26, 2023
1 parent 787779f commit db1b5e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ recordView.setOnRecordListener(new OnRecordListener() {
//When the record time is less than One Second
Log.d("RecordView", "onLessThanSecond");
}

@Override
public void onLock() {
//When Lock gets activated
Log.d("RecordView", "onLock");
}

});

```
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/devlomi/recordview/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public void onLessThanSecond() {
Toast.makeText(MainActivity.this, "OnLessThanSecond", Toast.LENGTH_SHORT).show();
Log.d("RecordView", "onLessThanSecond");
}

@Override
public void onLock() {
Toast.makeText(MainActivity.this, "onLock", Toast.LENGTH_SHORT).show();
Log.d("RecordView", "onLock");
}
});


Expand Down
2 changes: 1 addition & 1 deletion record-view/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ afterEvaluate {
// You can then customize attributes of the publication as shown below.
groupId = 'com.devlomi.record-view'
artifactId = 'record-view'
version = '3.1.2'
version = '3.1.3'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public interface OnRecordListener {
void onCancel();
void onFinish(long recordTime,boolean limitReached);
void onLessThanSecond();
void onLock();
}
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ public void cancelRecord() {
public void onFractionReached() {
fractionReached = true;
switchToLockedMode();
if (recordListener != null) {
recordListener.onLock();
}
}
}

Expand Down

0 comments on commit db1b5e4

Please sign in to comment.