├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_easy_cam_holder.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── fragment_camera_example.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── in │ │ │ │ └── balakrishnan │ │ │ │ └── cameramodule │ │ │ │ ├── easyCamFragmentExample │ │ │ │ ├── EasyCamHolderActivity.java │ │ │ │ └── EasyCamFragmentExample.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── in │ │ │ └── balakrishnan │ │ │ └── cameramodule │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── in │ │ └── balakrishnan │ │ └── cameramodule │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── easycam ├── consumer-rules.pro ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── ic_pause.png │ │ │ │ ├── ic_record.png │ │ │ │ ├── circle.xml │ │ │ │ ├── ic_flash_on.xml │ │ │ │ ├── ic_delete_black_24dp.xml │ │ │ │ ├── ic_close_black_24dp.xml │ │ │ │ ├── ic_flash_off.xml │ │ │ │ ├── ic_flash_auto.xml │ │ │ │ ├── ic_switch_camera.xml │ │ │ │ ├── ic_photo_camera_black_24dp.xml │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── attrs.xml │ │ │ └── layout │ │ │ │ ├── activity_camera_controller.xml │ │ │ │ ├── fragment_preview.xml │ │ │ │ ├── fragment_capture.xml │ │ │ │ ├── fragment_preview_list.xml │ │ │ │ └── fragment_camera2_basic.xml │ │ ├── java │ │ │ └── in │ │ │ │ └── balakrishnan │ │ │ │ └── easycam │ │ │ │ ├── capture │ │ │ │ ├── CameraSelection.java │ │ │ │ ├── Camera2Listener.java │ │ │ │ ├── FlashType.java │ │ │ │ ├── video │ │ │ │ │ └── CaptureFragment.java │ │ │ │ ├── AutoFitTextureView.java │ │ │ │ ├── NumberToWords.java │ │ │ │ └── CaptureFragmentBuilder.java │ │ │ │ ├── GenericFileProvider.java │ │ │ │ ├── imageBadgeView │ │ │ │ ├── listener │ │ │ │ │ └── OnBadgeCountChangeListener.java │ │ │ │ ├── util │ │ │ │ │ └── DensityUtils.java │ │ │ │ ├── constant │ │ │ │ │ └── Constants.java │ │ │ │ ├── DrawerManager.java │ │ │ │ ├── BadgeDrawer.java │ │ │ │ ├── AttributeController.java │ │ │ │ ├── model │ │ │ │ │ └── Badge.java │ │ │ │ ├── BadgePosition.java │ │ │ │ └── ImageBadgeView.java │ │ │ │ ├── CaptureData.java │ │ │ │ ├── ClassLauncher.java │ │ │ │ ├── StatusBarUtil.java │ │ │ │ ├── BitmapHelper.java │ │ │ │ ├── preview │ │ │ │ ├── PreviewRecyclerViewAdapter.java │ │ │ │ └── PreviewFragment.java │ │ │ │ ├── CameraControllerViewModel.java │ │ │ │ ├── CameraBundleBuilder.java │ │ │ │ ├── FileUtils.java │ │ │ │ ├── CameraControllerActivity.java │ │ │ │ └── CameraBundle.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── in │ │ │ └── balakrishnan │ │ │ └── easycam │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── in │ │ └── balakrishnan │ │ └── easycam │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── _config.yml ├── settings.gradle ├── changeLog ├── ChangeLog.md ├── v0_0_2.md └── v0_0_1.md ├── images ├── easy_cam_logo.png └── orientation_handling.png ├── .idea ├── dictionaries │ └── bala.xml ├── vcs.xml ├── runConfigurations.xml ├── gradle.xml ├── misc.xml ├── inspectionProfiles │ └── Project_Default.xml ├── codeStyles │ └── Project.xml └── markdown-navigator.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── CONTRIBUTING.md ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /easycam/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easycam/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':easycam' 2 | rootProject.name='CameraModule' 3 | -------------------------------------------------------------------------------- /changeLog/ChangeLog.md: -------------------------------------------------------------------------------- 1 | ### EasyCam 2 | 1. [v 0.0.2](v0_0_2.md) 3 | 2. [v 0.0.1](v0_0_1.md) 4 | 5 | -------------------------------------------------------------------------------- /images/easy_cam_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/images/easy_cam_logo.png -------------------------------------------------------------------------------- /.idea/dictionaries/bala.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CameraModule 3 | 4 | -------------------------------------------------------------------------------- /images/orientation_handling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/images/orientation_handling.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /changeLog/v0_0_2.md: -------------------------------------------------------------------------------- 1 | 2 | Release date - 27th Dec 2019 3 | 1. Split into library 4 | 2. Added to jCenter 5 | 6 | [Home](ChangeLog.md) 7 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/easycam/src/main/res/drawable/ic_pause.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/easycam/src/main/res/drawable/ic_record.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /changeLog/v0_0_1.md: -------------------------------------------------------------------------------- 1 | 2 | Release date - 26th Dec 2019 3 | 1. Base module setups 4 | 2. Camera View with basic functions 5 | 6 | [Home](ChangeLog.md) 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BalakrishnanPT/EasyCam/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/capture/CameraSelection.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.capture; 2 | 3 | /** 4 | * Created by BalaKrishnan 5 | */ 6 | public enum CameraSelection { 7 | FRONT, BACK 8 | } 9 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/GenericFileProvider.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam; 2 | 3 | 4 | import androidx.core.content.FileProvider; 5 | 6 | public class GenericFileProvider extends FileProvider { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /easycam/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 26 07:43:44 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 1. Fork the codebase and get codebase from `dev` branch 2 | 2. Make your changes and create a branch named `dev` followed by your name and feature (i.e) dev-bala-cache 3 | 3. Push your code to the branch, Make sure your code doesn't have any merge conflict with dev branch 4 | 4. Create a pull request. 5 | 6 | Hopefully within a day or two your pull request will be accepted and merged in codebase 7 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_flash_on.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/imageBadgeView/listener/OnBadgeCountChangeListener.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.imageBadgeView.listener; 2 | 3 | /** 4 | * Interface definition for a callback to be invoked when the count on a badge changed. 5 | * 6 | * @author Ivan V on 21.02.2018. 7 | * @version 1.0 8 | */ 9 | public interface OnBadgeCountChangeListener { 10 | void onCountChange(int count); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_delete_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /easycam/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CameraModule 3 | App does not have \n access to your camera. \nTo enable access, tap \n Settings and turn on \n Camera 4 | Something wrong. Please try again later 5 | 6 | 7 | Hello blank fragment 8 | 9 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_close_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /easycam/src/test/java/in/balakrishnan/easycam/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/test/java/in/balakrishnan/cameramodule/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.cameramodule; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_flash_off.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_flash_auto.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /easycam/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_switch_camera.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/capture/Camera2Listener.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.capture; 2 | 3 | import android.hardware.camera2.CameraAccessException; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * Created by wesley on 2016/03/07. 9 | */ 10 | public interface Camera2Listener { 11 | 12 | void onCameraException(CameraAccessException cae); 13 | 14 | void onNullPointerException(NullPointerException npe); 15 | 16 | void onInterruptedException(InterruptedException ie); 17 | 18 | void onIOException(IOException ioe); 19 | 20 | void onConfigurationFailed(); 21 | } -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_easy_cam_holder.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | -------------------------------------------------------------------------------- /easycam/src/main/res/layout/activity_camera_controller.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /easycam/src/main/res/drawable/ic_photo_camera_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/in/balakrishnan/cameramodule/easyCamFragmentExample/EasyCamHolderActivity.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.cameramodule.easyCamFragmentExample; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import in.balakrishnan.cameramodule.R; 8 | 9 | public class EasyCamHolderActivity extends AppCompatActivity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_easy_cam_holder); 15 | getSupportFragmentManager().beginTransaction() 16 | .replace(R.id.flExampleContainer, new EasyCamFragmentExample()) 17 | .commit(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /easycam/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /easycam/src/main/res/layout/fragment_preview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /easycam/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/imageBadgeView/util/DensityUtils.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.imageBadgeView.util; 2 | 3 | import android.content.res.Resources; 4 | import android.util.TypedValue; 5 | 6 | /** 7 | * Util methods for converting data value 8 | * 9 | * @author Ivan V on 19.02.2018. 10 | * @version 1.0 11 | */ 12 | public class DensityUtils { 13 | 14 | public static float dpToPx(float dp) { 15 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics()); 16 | } 17 | 18 | public static float pxToDp(float px) { 19 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, px, Resources.getSystem().getDisplayMetrics()); 20 | } 21 | 22 | public static float txtPxToSp(float px) { 23 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, px, Resources.getSystem().getDisplayMetrics()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /easycam/src/androidTest/java/in/balakrishnan/easycam/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("in.balakrishnan.easycam.test", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/in/balakrishnan/cameramodule/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.cameramodule; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("in.balakrishnan.cameramodule", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/CaptureData.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | /** 6 | * Created by BalaKrishnan on 2019-07-03. 7 | */ 8 | public class CaptureData { 9 | // Thumb bitmap 10 | Bitmap thumbBitmap; 11 | // Name of the File for Original image 12 | String originalFileName; 13 | 14 | public CaptureData(Bitmap thumbBitmap, String originalFileName) { 15 | this.thumbBitmap = thumbBitmap; 16 | this.originalFileName = originalFileName; 17 | } 18 | 19 | public Bitmap getThumbBitmap() { 20 | return thumbBitmap; 21 | } 22 | 23 | public void setThumbBitmap(Bitmap thumbBitmap) { 24 | this.thumbBitmap = thumbBitmap; 25 | } 26 | 27 | public String getOriginalFileName() { 28 | return originalFileName; 29 | } 30 | 31 | public void setOriginalFileName(String originalFileName) { 32 | this.originalFileName = originalFileName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/capture/FlashType.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.capture; 2 | 3 | 4 | import in.balakrishnan.easycam.R; 5 | 6 | /** 7 | * Created by BalaKrishnan 8 | */ 9 | public enum FlashType { 10 | OFF(R.drawable.ic_flash_off, 0), 11 | ON(R.drawable.ic_flash_on, 1), 12 | AUTO(R.drawable.ic_flash_auto, 2); 13 | int resourceId; 14 | int currentType; 15 | 16 | FlashType(int resourceId, int currentType) { 17 | this.resourceId = resourceId; 18 | this.currentType = currentType; 19 | } 20 | 21 | public static FlashType getInstance(int t) { 22 | switch (t) { 23 | case 1: 24 | return ON; 25 | case 2: 26 | return AUTO; 27 | default: 28 | return OFF; 29 | } 30 | } 31 | 32 | public int getCurrentType() { 33 | return currentType; 34 | } 35 | 36 | public int getResourceId() { 37 | return resourceId; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /easycam/src/main/res/layout/fragment_capture.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 15 | 16 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.2" 6 | defaultConfig { 7 | applicationId "in.balakrishnan.cameramodule" 8 | minSdkVersion 21 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'androidx.appcompat:appcompat:1.1.0' 25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 28 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 29 | 30 | implementation project(path: ':easycam') 31 | 32 | } 33 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/ClassLauncher.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | public class ClassLauncher { 9 | private final Context context; 10 | 11 | public ClassLauncher(Context context) { 12 | this.context = context; 13 | } 14 | 15 | public void launchActivity(String className) throws Exception { 16 | Intent intent = new Intent(context, getActivityClass(className)); 17 | context.startActivity(intent); 18 | } 19 | 20 | public void launchActivity(String className, Bundle bundle) throws Exception { 21 | Intent intent = new Intent(context, getActivityClass(className)); 22 | intent.putExtras(bundle); 23 | context.startActivity(intent); 24 | } 25 | 26 | private Class getActivityClass(String target) throws Exception { 27 | ClassLoader classLoader = context.getClassLoader(); 28 | 29 | @SuppressWarnings("unchecked") 30 | Class activityClass = (Class) classLoader.loadClass(target); 31 | 32 | return activityClass; 33 | } 34 | } -------------------------------------------------------------------------------- /easycam/src/main/java/in/balakrishnan/easycam/imageBadgeView/constant/Constants.java: -------------------------------------------------------------------------------- 1 | package in.balakrishnan.easycam.imageBadgeView.constant; 2 | 3 | import android.graphics.Color; 4 | import android.graphics.Typeface; 5 | 6 | /** 7 | * @author Ivan V on 22.02.2018. 8 | * @version 1.0 9 | */ 10 | public class Constants { 11 | 12 | public static final int MAX_CIRCLE_NUMBER = 9; 13 | public static final int MAX_VALUE = 99; 14 | public static final int DEFAULT_BADGE_COLOR = Color.parseColor("red"); 15 | public static final int DEFAULT_TEXT_COLOR = Color.WHITE; 16 | public static final int DEFAULT_BADGE_PADDING = 0; 17 | public static final int DEFAULT_TEXT_SIZE = 12; 18 | public static final Typeface DEFAULT_FONT = Typeface.DEFAULT; 19 | public static final int DEFAULT_FONT_STYLE = Typeface.NORMAL; 20 | public static final boolean DEFAULT_VISIBLE = false; 21 | public static final boolean DEFAULT_SHOW_COUNTER = true; 22 | public static final boolean DEFAULT_LIMIT = true; 23 | public static final boolean DEFAULT_ROUND = true; 24 | public static final boolean DEFAULT_FIXED_RADIUS = false; 25 | public static final boolean DEFAULT_BADGE_OVAL = false; 26 | public static final float NO_INIT = -1f; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_camera_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 |