-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79c61c8
commit adced5b
Showing
5 changed files
with
78 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
library/src/main/java/com/zhongjh/albumcamerarecorder/listener/OnMainListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.zhongjh.albumcamerarecorder.listener; | ||
|
||
|
||
/** | ||
* 首页的事件 | ||
*/ | ||
public interface OnMainListener { | ||
|
||
void onOpenFail(String errorMessage); | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
library/src/main/java/com/zhongjh/albumcamerarecorder/settings/RecordeSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.zhongjh.albumcamerarecorder.settings; | ||
|
||
public class RecordeSpec { | ||
|
||
private RecordeSpec() { | ||
} | ||
|
||
private static final class InstanceHolder { | ||
private static final RecordeSpec INSTANCE = new RecordeSpec(); | ||
} | ||
|
||
public static RecordeSpec getInstance() { | ||
return InstanceHolder.INSTANCE; | ||
} | ||
|
||
public static RecordeSpec getCleanInstance() { | ||
RecordeSpec recordeSpec = getInstance(); | ||
recordeSpec.reset(); | ||
return recordeSpec; | ||
} | ||
|
||
/** | ||
* 重置 | ||
*/ | ||
private void reset() { | ||
captureStrategy = null; | ||
} | ||
|
||
// region 属性 | ||
public CaptureStrategy captureStrategy; // 参数1 true表示拍照存储在共有目录,false表示存储在私有目录;参数2与 AndroidManifest中authorities值相同,用于适配7.0系统 必须设置 | ||
|
||
// endregion 属性 | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
library/src/main/java/com/zhongjh/albumcamerarecorder/settings/RecorderSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.zhongjh.albumcamerarecorder.settings; | ||
|
||
/** | ||
* 录音机 | ||
*/ | ||
public final class RecorderSetting { | ||
|
||
private final RecordeSpec mRecordeSpec; | ||
|
||
public RecorderSetting() { | ||
mRecordeSpec = RecordeSpec.getInstance(); | ||
} | ||
|
||
/** | ||
* 提供保存公有或者私有的文件路径 | ||
* 文件路径存储于 {@link android.support.v4.content.FileProvider}. | ||
* | ||
* @param captureStrategy {@link CaptureStrategy},仅仅启用时才需要 | ||
* @return {@link GlobalSetting} for fluent API. | ||
*/ | ||
public RecorderSetting captureStrategy(CaptureStrategy captureStrategy) { | ||
mRecordeSpec.captureStrategy = captureStrategy; | ||
return this; | ||
} | ||
|
||
} |