微信拍照Android控件(轻触拍照,长按摄像)
这是一个模仿微信拍照的Android开源控件
点击拍照
10s的视频大概1.9M左右
长按录视频(视频长度可设置)
长按录视频的时候,手指上滑可以放大视频
录制完视频可以浏览并且重复播放
前后摄像头的切换
可以设置小视频保存路径
添加下列代码到 module gradle
最新版本(1.1.9)更新内容:
compile 'cjt.library.wheel:camera:1.1.9'
//添加闪关灯,自定义左右按钮图标资源
如果获取依赖失败则添加下列代码到 project gradle
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.bintray.com/cjt/maven'
}
}
}
compile 'cjt.library.wheel:camera:1.1.6'
//修复BUG
compile 'cjt.library.wheel:camera:1.1.3'
//fix bug
…
//1.0.0+
<com.cjt2325.cameralibrary.JCameraView
android:id="@+id/jcameraview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:duration_max="10000"
app:iconMargin="20dp"
app:iconSize="30dp"
app:iconSrc="@drawable/ic_camera_enhance_black_24dp"/>
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
if (Build.VERSION.SDK_INT >= 19) {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
View decorView = getWindow().getDecorView();
int option = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(option);
}
…
@Override
protected void onResume() {
super.onResume();
mJCameraView.onResume();
}
@Override
protected void onPause() {
super.onPause();
mJCameraView.onPause();
}
扫码下载
二维码显示不出请点击 下载Demo
Copyright 2017 CJT2325
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.
暂无开放 Issues,或尚未同步最近议题。