Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated libraries but still not working #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

subprojects {
ext {
artifactVersion = '2.7.0'
}
}

buildscript {
ext {
versions = [
kotlin : '1.3.50',
kotlin : '1.8.0',
code : 1,
name : '1.0.0',
sdk : [
Expand All @@ -20,35 +14,48 @@ buildscript {
buildTools: '28.0.3',
appcompat : '1.1.0',
annotation : '1.1.0',
exifinterface : '1.0.0'
exifinterface : '1.3.6'
],
rx : [
rxJava1: '1.3.8',
rxJava2: '2.2.12'
rxJava2: '2.2.19'
],
test : [
junit : '4.12',
mockito: '2.23.0'
junit : '4.13.2',
mockito: '4.4.0'
]
]
}
repositories {
google()
jcenter()
mavenCentral()
//jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.android.tools.build:gradle:7.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"

//classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
//classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
}
}

plugins {
//id 'com.jfrog.bintray' version '1.8.4'
id 'maven-publish'
}

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
subprojects {
ext {
artifactVersion = '2.7.0'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
//jcenter()
}
}

Expand Down
10 changes: 5 additions & 5 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.jfrog.bintray'
//apply plugin: 'com.github.dcendents.android-maven'

ext {
bintrayOrganisation = 'fotoapparat'
bintrayRepo = 'fotoapparat'

publishedGroupId = 'io.fotoapparat'

siteUrl = 'https://github.com/RedApparat/Fotoapparat'
gitUrl = 'https://github.com/RedApparat/Fotoapparat.git'
siteUrl = 'https://github.com/Devenom1/Fotoapparat'
gitUrl = 'https://github.com/Devenom1/Fotoapparat.git'

developerId = 'fotoapparat'
developerName = 'Fotoapparat'
developerEmail = 'dmitry.zaicew@gmail.com'
developerEmail = 'braganza.denver@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
Expand Down
20 changes: 10 additions & 10 deletions fotoapparat-adapters/rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'

group = 'io.fotoapparat'

android {
buildToolsVersion versions.android.buildTools
compileSdkVersion versions.sdk.target
//buildToolsVersion versions.android.buildTools
compileSdkVersion 33

defaultConfig {
minSdkVersion versions.sdk.minimum
targetSdkVersion versions.sdk.target
minSdkVersion 14
targetSdkVersion 33
}

archivesBaseName = 'adapter-rxjava'
Expand All @@ -22,10 +22,10 @@ android {

dependencies {
compileOnly project(':fotoapparat')
compileOnly "io.reactivex:rxjava:${versions.rx.rxJava1}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
testImplementation "io.reactivex:rxjava:${versions.rx.rxJava1}"
testImplementation "junit:junit:${versions.test.junit}"
compileOnly "io.reactivex:rxjava:1.3.8"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
testImplementation "io.reactivex:rxjava:1.3.8"
testImplementation "junit:junit:4.13.2"
}

ext {
Expand All @@ -38,4 +38,4 @@ ext {
libraryDescription = 'RxJava1 adapter for Fotoapparat.'
}

apply from: '../../deploy.gradle'
//apply from: '../../deploy.gradle'
20 changes: 10 additions & 10 deletions fotoapparat-adapters/rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'

group = 'io.fotoapparat'

android {
buildToolsVersion versions.android.buildTools
compileSdkVersion versions.sdk.target
//buildToolsVersion versions.android.buildTools
compileSdkVersion 33

defaultConfig {
minSdkVersion versions.sdk.minimum
targetSdkVersion versions.sdk.target
minSdkVersion 14
targetSdkVersion 33
}

archivesBaseName = 'adapter-rxjava2'
Expand All @@ -22,10 +22,10 @@ android {

dependencies {
compileOnly project(':fotoapparat')
compileOnly "io.reactivex.rxjava2:rxjava:${versions.rx.rxJava2}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
testImplementation "io.reactivex.rxjava2:rxjava:${versions.rx.rxJava2}"
testImplementation "junit:junit:${versions.test.junit}"
compileOnly "io.reactivex.rxjava2:rxjava:2.2.19"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
testImplementation "io.reactivex.rxjava2:rxjava:2.2.19"
testImplementation "junit:junit:4.13.2"
}

ext {
Expand All @@ -38,4 +38,4 @@ ext {
libraryDescription = 'RxJava2 adapter for Fotoapparat.'
}

apply from: '../../deploy.gradle'
//apply from: '../../deploy.gradle'
26 changes: 13 additions & 13 deletions fotoapparat/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'

group = 'io.fotoapparat'

android {
buildToolsVersion versions.android.buildTools
compileSdkVersion versions.sdk.target
//buildToolsVersion versions.android.buildTools
compileSdkVersion 33

defaultConfig {
minSdkVersion versions.sdk.minimum
targetSdkVersion versions.sdk.target
minSdkVersion 14
targetSdkVersion 33
}

buildTypes {
Expand All @@ -29,13 +29,13 @@ android {
}

dependencies {
implementation "androidx.annotation:annotation:${versions.android.annotation}"
implementation "androidx.exifinterface:exifinterface:${versions.android.exifinterface}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
testImplementation "junit:junit:${versions.test.junit}"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:${versions.kotlin}"
testImplementation "org.mockito:mockito-core:${versions.test.mockito}"
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.exifinterface:exifinterface:1.3.6"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
testImplementation "junit:junit:4.13.2"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:1.8.10"
testImplementation "org.mockito:mockito-core:4.4.0"
}

ext {
Expand All @@ -48,4 +48,4 @@ ext {
libraryDescription = 'Camera library for Android with a more user-friendly API.'
}

apply from: '../deploy.gradle'
//apply from: '../deploy.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.fotoapparat.coroutines

import kotlinx.coroutines.*
import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.ChannelResult
import kotlinx.coroutines.channels.ConflatedBroadcastChannel

/**
Expand All @@ -21,9 +22,14 @@ internal class AwaitBroadcastChannel<T>(
return channel.value
}

override fun offer(element: T): Boolean {
/*override fun offer(element: T): Boolean {
deferred.complete(true)
return channel.offer(element)
return channel.try(element)
}*/

override fun trySend(element: T): ChannelResult<Unit> {
deferred.complete(true)
return channel.trySend(element)
}

override suspend fun send(element: T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import io.fotoapparat.hardware.orientation.Orientation.Vertical.ReversePortrait
*/
internal open class Display(context: Context) {

private val display = context.getDisplay()
private val display = context.getDisplay1()

/**
* Returns the orientation of the screen.
*/
open fun getOrientation(): Orientation = when (display.rotation) {
open fun getOrientation(): Orientation = when (display?.rotation) {
Surface.ROTATION_0 -> Portrait
Surface.ROTATION_90 -> Landscape
Surface.ROTATION_180 -> ReversePortrait
Expand All @@ -29,4 +29,4 @@ internal open class Display(context: Context) {

}

private fun Context.getDisplay() = (getSystemService(Context.WINDOW_SERVICE) as WindowManager).defaultDisplay
private fun Context.getDisplay1() = (getSystemService(Context.WINDOW_SERVICE) as WindowManager).defaultDisplay
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
19 changes: 12 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
//apply plugin: 'kotlin-android-extensions'

android {
buildToolsVersion versions.android.buildTools
compileSdkVersion versions.sdk.target
//buildToolsVersion versions.android.buildTools
compileSdkVersion 33

defaultConfig {
applicationId "io.fotoapparat.sample"
minSdkVersion versions.sdk.minimum
targetSdkVersion versions.sdk.target
minSdkVersion 14
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,10 +21,14 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
dataBinding true
}
}

dependencies {
implementation project(':fotoapparat')
implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
implementation "androidx.appcompat:appcompat:${versions.android.appcompat}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
implementation "androidx.appcompat:appcompat:1.6.1"
}
3 changes: 2 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<!--Set android:name to ".ActivityJava" for java example-->
<activity
android:name=".MainActivity"
android:screenOrientation="fullSensor">
android:screenOrientation="fullSensor"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Loading