Skip to content

Commit 9021507

Browse files
Diolordmitry-zaitsev
authored andcommittedNov 8, 2018
Auto upload on tags (#317)
* Deploy on tags * Bump version to 2.6.1
1 parent 4a23a70 commit 9021507

File tree

5 files changed

+40
-35
lines changed

5 files changed

+40
-35
lines changed
 

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
build
77
/captures
88
.externalNativeBuild
9+
.project
10+
.settings
911

‎.travis.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ jdk: oraclejdk8
33

44
android:
55
components:
6-
- tools
7-
- platform-tools
8-
- tools
9-
- build-tools-28.0.3
10-
- android-28
11-
- extra-android-m2repository
6+
- tools
7+
- platform-tools
8+
- tools
9+
- build-tools-28.0.3
10+
- android-28
11+
- extra-android-m2repository
1212

1313
before_install:
14-
- yes | sdkmanager "platforms;android-28"
14+
- yes | sdkmanager "platforms;android-28"
1515

1616
script:
1717
- ./gradlew build test
18+
19+
deploy:
20+
provider: script
21+
script: ./gradlew bintrayUpload
22+
on:
23+
tags: true

‎README.md

+22-25
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
![Build status](https://travis-ci.org/RedApparat/Fotoapparat.svg?branch=master)
44

5-
65
![ ](sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png)
76

87
Camera API in Android is hard. Having 2 different API for new and old Camera does not make things any easier. But fret not, that is your lucky day! After several years of working with Camera, we came up with Fotoapparat.
98

109
What it provides:
10+
1111
- Camera API which does not allow you to shoot yourself in the foot.
1212
- Simple yet powerful parameters customization.
1313
- Standalone custom `CameraView` which can be integrated into any `Activity`.
1414
- Fixes and workarounds for device-specific problems.
1515
- Both Kotlin and Java friendly configurations.
16-
- Last, but not least, non 0% test coverage.
17-
16+
- Last, but not least, non 0% test coverage.
1817

1918
Taking picture becomes as simple as:
2019

@@ -23,9 +22,9 @@ val fotoapparat = Fotoapparat(
2322
context = this,
2423
view = cameraView
2524
)
26-
25+
2726
fotoapparat.start()
28-
27+
2928
fotoapparat
3029
.takePicture()
3130
.saveToFile(someFile)
@@ -48,7 +47,7 @@ Add `CameraView` to your layout
4847

4948
Configure `Fotoapparat` instance.
5049

51-
```kotlin
50+
```kotlin
5251
Fotoapparat(
5352
context = this,
5453
view = cameraView, // view which will draw the camera preview
@@ -61,12 +60,12 @@ Fotoapparat(
6160
),
6261
cameraErrorCallback = { error -> } // (optional) log fatal errors
6362
)
64-
```
63+
```
64+
6565
Check the [wiki for the `configuration` options e.g. change iso](https://github.com/Fotoapparat/Fotoapparat/wiki/Configuration-Kotlin)
6666

6767
Are you using Java only? See our [wiki for the java-friendly configuration](https://github.com/Fotoapparat/Fotoapparat/wiki/Configuration-Java).
6868

69-
7069
### Step Three
7170

7271
Call `start()` and `stop()`. No rocket science here.
@@ -76,7 +75,7 @@ override fun onStart() {
7675
super.onStart()
7776
fotoapparat.start()
7877
}
79-
78+
8079
override fun onStop() {
8180
super.onStop()
8281
fotoapparat.stop()
@@ -89,30 +88,30 @@ Finally, we are ready to take a picture. You have various options.
8988

9089
```kotlin
9190
val photoResult = fotoapparat.takePicture()
92-
91+
9392
// Asynchronously saves photo to file
9493
photoResult.saveToFile(someFile)
95-
94+
9695
// Asynchronously converts photo to bitmap and returns the result on the main thread
9796
photoResult
9897
.toBitmap()
9998
.whenAvailable { bitmapPhoto ->
10099
val imageView = (ImageView) findViewById(R.id.result)
101-
100+
102101
imageView.setImageBitmap(bitmapPhoto.bitmap)
103102
imageView.setRotation(-bitmapPhoto.rotationDegrees)
104103
}
105-
104+
106105
// Of course, you can also get a photo in a blocking way. Do not do it on the main thread though.
107106
val result = photoResult.toBitmap().await()
108-
109-
// Convert asynchronous events to RxJava 1.x/2.x types.
110-
// See /fotoapparat-adapters/ module
107+
108+
// Convert asynchronous events to RxJava 1.x/2.x types.
109+
// See /fotoapparat-adapters/ module
111110
photoResult
112111
.toBitmap()
113112
.toSingle()
114-
.subscribe { bitmapPhoto ->
115-
113+
.subscribe { bitmapPhoto ->
114+
116115
}
117116
```
118117

@@ -125,23 +124,23 @@ fotoapparat.updateConfiguration(
125124
UpdateConfiguration(
126125
flashMode = if (isChecked) torch() else off()
127126
// ...
128-
// all the parameters available in CameraConfiguration
127+
// all the parameters available in CameraConfiguration
129128
)
130129
)
131130
```
132131

133-
Or alternatively, you may provide updates on an existing full configuration.
132+
Or alternatively, you may provide updates on an existing full configuration.
134133

135134
```kotlin
136135
val configuration = CameraConfiguration(
137136
// A full configuration
138137
// ...
139138
)
140-
139+
141140
fotoapparat.updateConfiguration(
142141
configuration.copy(
143142
flashMode = if (isChecked) torch() else off()
144-
// all the parameters available in CameraConfiguration
143+
// all the parameters available in CameraConfiguration
145144
)
146145
)
147146
```
@@ -162,7 +161,7 @@ fotoapparat.switchTo(
162161
Add dependency to your `build.gradle`
163162

164163
```groovy
165-
implementation 'io.fotoapparat:fotoapparat:2.6.0'
164+
implementation 'io.fotoapparat:fotoapparat:2.6.1'
166165
```
167166

168167
Camera permission will be automatically added to your `AndroidManifest.xml`. Do not forget to request this permission on Marshmallow and higher.
@@ -171,14 +170,12 @@ Camera permission will be automatically added to your `AndroidManifest.xml`. Do
171170

172171
Optionally, you can check out our other library which adds face detection capabilities - [FaceDetector](https://github.com/Fotoapparat/FaceDetector).
173172

174-
175173
## Credits
176174

177175
We want to say thanks to [Mark Murphy](https://github.com/commonsguy) for the awesome job he did with [CWAC-Camera](https://github.com/commonsguy/cwac-camera). We were using his library for a couple of years and now we feel that Fotoapparat is a next step in the right direction.
178176

179177
We also want to say many thanks to [Leander Lenzing](http://leanderlenzing.com/) for the amazing icon. Don't forget to follow his work in [dribbble](https://dribbble.com/leanderlenzing).
180178

181-
182179
## License
183180

184181
```

‎build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
subprojects {
44
ext {
5-
artifactVersion = '2.6.0'
5+
artifactVersion = '2.6.1'
66
}
77
}
88

‎deploy.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ artifacts {
7777
}
7878

7979
bintray {
80-
user = project.properties["bintray.user"]
81-
key = project.properties["bintray.apikey"]
80+
user = project.properties["bintray.user"] ?: System.getenv('BINTRAY_USER')
81+
key = project.properties["bintray.apikey"] ?: System.getenv('BINTRAY_API_KEY')
8282

8383
configurations = ['archives']
8484
pkg {

0 commit comments

Comments
 (0)
Please sign in to comment.