Published v1

pull/17/head
Florent CHAMPIGNY 8 years ago
parent fd1f9791f9
commit bf492ff687
  1. 7
      README.md
  2. 26
      app/build.gradle
  3. 15
      build.gradle
  4. 58
      camerafragment/build.gradle
  5. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/CameraFragmentApi.java
  6. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/PreviewActivity.java
  7. 8
      camerafragment/src/main/java/com/github/florent37/camerafragment/configuration/Configuration.java
  8. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/configuration/ConfigurationProvider.java
  9. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/configuration/ConfigurationProviderImpl.java
  10. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/controller/CameraController.java
  11. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/controller/impl/Camera1Controller.java
  12. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/controller/impl/Camera2Controller.java
  13. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/controller/view/CameraView.java
  14. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/CameraManager.java
  15. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/BaseCameraManager.java
  16. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera1Manager.java
  17. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera2Manager.java
  18. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/listener/CameraCloseListener.java
  19. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/listener/CameraOpenListener.java
  20. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/listener/CameraPhotoListener.java
  21. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/listener/CameraVideoListener.java
  22. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/timer/CountdownTask.java
  23. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/timer/TimerTask.java
  24. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/timer/TimerTaskBase.java
  25. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/BaseAnncaFragment.java
  26. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/model/PhotoQualityOption.java
  27. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/model/VideoQualityOption.java
  28. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/view/AspectFrameLayout.java
  29. 4
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/view/AutoFitSurfaceView.java
  30. 4
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/view/AutoFitTextureView.java
  31. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/CameraHelper.java
  32. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/DateTimeUtils.java
  33. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/ImageLoader.java
  34. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/ImageSaver.java
  35. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/Size.java
  36. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/utils/Utils.java
  37. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/listeners/CameraFragmentControlsListener.java
  38. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/listeners/CameraFragmentResultListener.java
  39. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/listeners/CameraFragmentStateListener.java
  40. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/listeners/CameraFragmentVideoRecordTextListener.java
  41. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/widgets/CameraSettingsView.java
  42. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/widgets/CameraSwitchView.java
  43. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/widgets/FlashSwitchView.java
  44. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/widgets/MediaActionSwitchView.java
  45. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/widgets/RecordButton.java
  46. 52
      gradle/bintray-android-v1.gradle
  47. 49
      gradle/bintray-java-v1.gradle
  48. 44
      gradle/install-v1.gradle

@ -131,6 +131,13 @@ CameraFragment comes with some default views
[![png](https://raw.githubusercontent.com/florent37/CameraFragment/master/media/buttons.png)](https://github.com/florent37/CameraFragment)
#Download
In your module [![Download](https://api.bintray.com/packages/florent37/maven/CameraFragment/images/download.svg)](https://bintray.com/florent37/maven/CameraFragment/_latestVersion)
```groovy
compile 'com.github.florent37:camerafragment:1.0.0'
```
#Community
Forked from [https://github.com/memfis19/Annca](https://github.com/memfis19/Annca)

@ -1,28 +1,20 @@
apply plugin: 'com.android.application'
ext {
PUBLISH_VERSION = '1.2.0'
PUBLISH_VERSION_CODE = 3
SUPPORT_VERSION = '25.1.0'
TARGET_SDK = 24
MIN_SDK = 10
BUILD_TOOLS = "24.0.3"
}
android {
compileSdkVersion TARGET_SDK
buildToolsVersion BUILD_TOOLS
compileSdkVersion project.sdk
buildToolsVersion project.buildTools
defaultConfig {
minSdkVersion MIN_SDK
targetSdkVersion TARGET_SDK
versionCode PUBLISH_VERSION_CODE
versionName PUBLISH_VERSION
minSdkVersion project.minSdk
targetSdkVersion project.sdk
versionCode 1
versionName "1.0"
}
}
dependencies {
compile "com.android.support:appcompat-v7:$SUPPORT_VERSION"
compile "com.android.support:appcompat-v7:" + project.supportVersion
compile 'com.jakewharton:butterknife:7.0.1'
compile project(':camerafragment')
}
}

@ -1,11 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@ -14,9 +14,14 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
sdk = 25
buildTools = "24.0.3"
minSdk = 10
libraryVersion = "1.0.0"
supportVersion = "25.1.0"
}

@ -1,32 +1,54 @@
apply plugin: 'com.android.library'
ext {
PUBLISH_VERSION = '0.3.2'
PUBLISH_VERSION_CODE = 6
SUPPORT_VERSION = '25.1.0'
TARGET_SDK = 24
MIN_SDK = 10
BUILD_TOOLS = "24.0.3"
}
android {
compileSdkVersion TARGET_SDK
buildToolsVersion BUILD_TOOLS
compileSdkVersion project.sdk
buildToolsVersion project.buildTools
defaultConfig {
minSdkVersion MIN_SDK
targetSdkVersion TARGET_SDK
versionCode PUBLISH_VERSION_CODE
versionName PUBLISH_VERSION
minSdkVersion project.minSdk
targetSdkVersion project.sdk
versionCode 1
versionName "1.0"
}
}
dependencies {
compile "com.android.support:support-v4:$SUPPORT_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_VERSION"
compile "com.android.support:support-v4:"+ project.supportVersion
compile "com.android.support:appcompat-v7:"+ project.supportVersion
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
ext {
bintrayRepo = 'maven'
bintrayName = 'CameraFragment'
orgName = 'florent37'
publishedGroupId = 'com.github.florent37'
libraryName = 'CameraFragment'
artifact = 'camerafragment'
libraryDescription = 'CameraFragment'
siteUrl = 'https://github.com/florent37/CameraFragment'
gitUrl = 'https://github.com/florent37/CameraFragment.git'
libraryVersion = rootProject.ext.libraryVersion
developerId = 'florent37'
developerName = 'Florent Champigny'
developerEmail = 'champigny.florent@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
if (project.rootProject.file('local.properties').exists()) {
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
}

@ -5,7 +5,7 @@ import com.github.florent37.camerafragment.listeners.CameraFragmentResultListene
import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener;
import com.github.florent37.camerafragment.listeners.CameraFragmentVideoRecordTextListener;
/**
/*
* Created by florentchampigny on 16/01/2017.
*/

@ -27,7 +27,7 @@ import com.github.florent37.camerafragment.internal.ui.view.AspectFrameLayout;
import com.github.florent37.camerafragment.internal.utils.ImageLoader;
import com.github.florent37.camerafragment.internal.utils.Utils;
/**
/*
* Created by memfis on 7/6/16.
*/
public class PreviewActivity extends AppCompatActivity implements View.OnClickListener {

@ -7,7 +7,7 @@ import java.io.Serializable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
/*
* Created by memfis on 7/6/16.
* Updated by Florent37
*/
@ -116,7 +116,7 @@ public final class Configuration implements Serializable {
return this;
}
/***
/**
* @param videoDurationInMilliseconds - video duration in milliseconds
* @return
*/
@ -125,7 +125,7 @@ public final class Configuration implements Serializable {
return this;
}
/***
/**
* @param minimumVideoDurationInMilliseconds - minimum video duration in milliseconds, used only in video mode
* for auto quality.
* @return
@ -135,7 +135,7 @@ public final class Configuration implements Serializable {
return this;
}
/***
/**
* @param videoSizeInBytes - file size in bytes
* @return
*/

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.configuration;
/**
/*
* Created by memfis on 7/6/16.
*/
public interface ConfigurationProvider {

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.configuration;
/**
/*
* Created by florentchampigny on 12/01/2017.
*/

@ -8,7 +8,7 @@ import com.github.florent37.camerafragment.configuration.Configuration;
import com.github.florent37.camerafragment.internal.manager.CameraManager;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 7/6/16.
*/
public interface CameraController<CameraId> {

@ -23,7 +23,7 @@ import com.github.florent37.camerafragment.internal.utils.CameraHelper;
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 7/7/16.
*/

@ -25,7 +25,7 @@ import com.github.florent37.camerafragment.internal.utils.CameraHelper;
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 7/6/16.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)

@ -7,7 +7,7 @@ import com.github.florent37.camerafragment.configuration.Configuration;
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 7/6/16.
*/
public interface CameraView {

@ -13,7 +13,7 @@ import com.github.florent37.camerafragment.internal.manager.listener.CameraVideo
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 8/14/16.
*/
public interface CameraManager<CameraId, SurfaceListener> {

@ -15,7 +15,7 @@ import com.github.florent37.camerafragment.configuration.ConfigurationProvider;
import com.github.florent37.camerafragment.internal.manager.CameraManager;
import com.github.florent37.camerafragment.internal.utils.Size;
/**
/*
* Created by memfis on 8/14/16.
*/
abstract class BaseCameraManager<CameraId, SurfaceListener>

@ -32,7 +32,7 @@ import com.github.florent37.camerafragment.internal.utils.CameraHelper;
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 8/14/16.
*/
@SuppressWarnings("deprecation")

@ -50,7 +50,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
/*
* Created by memfis on 8/9/16.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.internal.manager.listener;
/**
/*
* Created by memfis on 8/14/16.
*/
public interface CameraCloseListener<CameraId> {

@ -2,7 +2,7 @@ package com.github.florent37.camerafragment.internal.manager.listener;
import com.github.florent37.camerafragment.internal.utils.Size;
/**
/*
* Created by memfis on 8/14/16.
*/
public interface CameraOpenListener<CameraId, SurfaceListener> {

@ -4,7 +4,7 @@ import com.github.florent37.camerafragment.listeners.CameraFragmentResultListene
import java.io.File;
/**
/*
* Created by memfis on 8/14/16.
*/
public interface CameraPhotoListener {

@ -5,7 +5,7 @@ import java.io.File;
import com.github.florent37.camerafragment.internal.utils.Size;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
/**
/*
* Created by memfis on 8/14/16.
*/
public interface CameraVideoListener {

@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit;
import com.github.florent37.camerafragment.internal.utils.DateTimeUtils;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -2,7 +2,7 @@ package com.github.florent37.camerafragment.internal.timer;
import com.github.florent37.camerafragment.internal.utils.DateTimeUtils;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -3,7 +3,7 @@ package com.github.florent37.camerafragment.internal.timer;
import android.os.Handler;
import android.os.Looper;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -51,7 +51,7 @@ import com.github.florent37.camerafragment.listeners.CameraFragmentVideoRecordTe
import java.io.File;
/**
/*
* Created by memfis on 12/1/16.
* Updated by Florent37
*/

@ -3,7 +3,7 @@ package com.github.florent37.camerafragment.internal.ui.model;
import com.github.florent37.camerafragment.configuration.Configuration;
import com.github.florent37.camerafragment.internal.utils.Size;
/**
/*
* Created by memfis on 12/1/16.
*/

@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit;
import com.github.florent37.camerafragment.configuration.Configuration;
/**
/*
* Created by memfis on 12/1/16.
*/

@ -4,7 +4,7 @@ import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
/**
/*
* Layout that adjusts to maintain a specific aspect ratio.
*/
public class AspectFrameLayout extends FrameLayout {

@ -6,7 +6,7 @@ import android.support.annotation.NonNull;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
/**
/*
* Created by memfis on 7/6/16.
*/
@SuppressWarnings("deprecation")
@ -29,7 +29,7 @@ public class AutoFitSurfaceView extends SurfaceView {
this.surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
/**
/*
* Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
* calculated fromList the parameters. Note that the actual sizes of parameters don't matter, that
* is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.

@ -6,7 +6,7 @@ import android.content.Context;
import android.os.Build;
import android.view.TextureView;
/**
/*
* Created by memfis on 7/6/16.
*/
@SuppressLint("ViewConstructor")
@ -23,7 +23,7 @@ public class AutoFitTextureView extends TextureView {
setSurfaceTextureListener(surfaceTextureListener);
}
/**
/*
* Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
* calculated fromList the parameters. Note that the actual sizes of parameters don't matter, that
* is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.

@ -22,7 +22,7 @@ import java.util.List;
import com.github.florent37.camerafragment.configuration.Configuration;
/**
/*
* Created by memfis on 7/6/16.
* <p/>
* Class with some common methods to work with camera.

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.internal.utils;
/**
/*
* Created by memfis on 6/27/16.
*/
public final class DateTimeUtils {

@ -18,7 +18,7 @@ import android.widget.ImageView;
import java.io.IOException;
/**
/*
* Created by memfis on 7/18/16.
*/
public final class ImageLoader {

@ -10,7 +10,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
/*
* Created by memfis on 7/6/16.
*/
public class ImageSaver implements Runnable {

@ -7,7 +7,7 @@ import android.os.Build;
import java.util.ArrayList;
import java.util.List;
/**
/*
* Created by memfis on 12/1/16.
*/

@ -9,7 +9,7 @@ import android.view.Surface;
import android.view.WindowManager;
import android.webkit.MimeTypeMap;
/**
/*
* Created by memfis on 7/18/16.
*/
public class Utils {

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.listeners;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.listeners;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -2,7 +2,7 @@ package com.github.florent37.camerafragment.listeners;
import java.io.File;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -1,6 +1,6 @@
package com.github.florent37.camerafragment.listeners;
/**
/*
* Created by florentchampigny on 13/01/2017.
*/

@ -8,7 +8,7 @@ import android.widget.ImageButton;
import com.github.florent37.camerafragment.R;
/**
/*
* Created by memfis on 8/23/16.
*/
public class CameraSettingsView extends ImageButton {

@ -13,7 +13,7 @@ import android.view.View;
import com.github.florent37.camerafragment.R;
import com.github.florent37.camerafragment.internal.utils.Utils;
/**
/*
* Created by memfis on 6/24/16.
*/
public class CameraSwitchView extends AppCompatImageButton {

@ -14,7 +14,7 @@ import android.widget.ImageButton;
import com.github.florent37.camerafragment.R;
/**
/*
* Created by memfis on 7/6/16.
*/
public class FlashSwitchView extends ImageButton {

@ -13,7 +13,7 @@ import android.widget.ImageButton;
import com.github.florent37.camerafragment.R;
import com.github.florent37.camerafragment.internal.utils.Utils;
/**
/*
* Created by memfis on 6/24/16.
*/
public class MediaActionSwitchView extends ImageButton {

@ -13,7 +13,7 @@ import android.widget.ImageButton;
import com.github.florent37.camerafragment.R;
import com.github.florent37.camerafragment.internal.utils.Utils;
/**
/*
* Created by memfis on 7/6/16.
*/
public class RecordButton extends ImageButton {

@ -0,0 +1,52 @@
apply plugin: 'com.jfrog.bintray'
version = libraryVersion
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
userOrg = orgName
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}

@ -0,0 +1,49 @@
apply plugin: 'com.jfrog.bintray'
version = libraryVersion
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
userOrg = orgName
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ['Apache-2.0']
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
//from https://github.com/workarounds/bundler/blob/master/gradle/bintray-java-v1.gradle

@ -0,0 +1,44 @@
apply plugin: 'com.github.dcendents.android-maven'
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
// Add your description here
name libraryName
description libraryDescription
url siteUrl
// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
//from https://github.com/workarounds/bundler/blob/master/gradle/install-v1.gradle
Loading…
Cancel
Save