相冊

godlibrary-gallery

https://github.com/abook23/godlibrary-gallery


#簡介

1.相冊選取圖片,圖片按照選擇順序排序

2.圖片預覽

3.點擊拍照,長按錄像

###Image

#使用方法

##Stop1

compile 'com.abook23:godlibrary-gallery:1.2.0'

##Stop2

PhotoActivity.startActivityForResult(Activity ac, int checkMax, ArrayList checkPath, int resultCode);

CameraVideoActivity.startForResult(Activity activity, int requestCode);

CameraVideoActivity.startForResult(Activity activity, int checkMax, int requestCode);


##示例

//PhotoActivity.CHECK_BUTTON_COLOR = R.color.;//選擇按鈕顏色

//PhotoActivity.COLOR_BACK_BUTTON = R.color.;// 頂部背景顏色

PhotoActivity.startActivityForResult(this, 9, null, 0)

@Override

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

super.onActivityResult(requestCode, resultCode, data);

if (resultCode == RESULT_OK) {

if (requestCode == 0) {

ArrayList list = data.getStringArrayListExtra(PhotoActivity.DATA);

if (list.size() == 0) {

return;

}

StringBuffer sb = new StringBuffer();

for (String s : list) {

sb.append("\n").append(s);

}

L.d(sb.toString());

}

}

}


#圖片墻

ImageInfoActivity.start(Context context, int position, ArrayList urls)


自義相機

CameraVideoFragment videoFragment = CameraVideoFragment.newInstance();

//沒特殊要求,sd 就可以了,HD 的視頻有點大,微信就相當于SD模式

videoFragment.setDefinition(CameraVideoFragment.Definition.SD);

videoFragment.setVideoMaxDuration(60 * 1000);//最大錄入時間,默認10s

videoFragment.setVideoRatio(0.8f);//視頻質(zhì)量 ----微信視頻 質(zhì)量大概在 0.8f 左右, 要清晰一點,就調(diào)節(jié)大一些

//videoFragment.setVideoMaxZie(50 * 1024 * 1024);//默認50MB

videoFragment.setOnCameraVideoListener(new CameraVideoFragment.OnCameraVideoListener() {

@Override

public void onFragmentResult(String path, String type) {

L.d(path);

}

});

FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

transaction.add(R.id.videoFragment, videoFragment);

transaction.commit();

#第三方 引用 dependencies

```html

dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')

compile 'com.android.support:support-v4:25.1.0'

compile 'com.github.bumptech.glide:glide:3.7.0'

compile 'com.sprylab.android.texturevideoview:texturevideoview:1.2.1'

compile 'com.android.support:recyclerview-v7:25.1.0'

}

```

License

-------

Copyright 2017 Wasabeef

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.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容