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

Google Drive Integration #931

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
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
22 changes: 21 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,22 @@ android {
premium {
buildConfigField "boolean", "IS_DROPBOX_ENABLED", "true"

buildConfigField "boolean", "IS_GOOGLE_DRIVE_ENABLED", "true"

buildConfigField "String", "VERSION_NAME_SUFFIX", '""'

dimension "store"
}

fdroid {
/*
* Disable Dropbox.
* Disable Dropbox and Google Drive.
* Properties file which contains the required API key is not included with the code.
*/
buildConfigField "boolean", "IS_DROPBOX_ENABLED", "false"

buildConfigField "boolean", "IS_GOOGLE_DRIVE_ENABLED", "false"

buildConfigField "String", "VERSION_NAME_SUFFIX", '" (fdroid)"'

dimension "store"
Expand Down Expand Up @@ -165,6 +169,22 @@ dependencies {

implementation "com.dropbox.core:dropbox-core-sdk:$versions.dropbox_core_sdk"

// Google Drive
// implementation 'com.google.api-client:google-api-client:1.23.0'
// implementation 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
// implementation 'com.google.apis:google-api-services-drive:v3-rev110-1.23.0'

// implementation 'com.google.android.gms:play-services:17.0.0'
implementation 'com.google.android.gms:play-services-drive:17.0.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.api-client:google-api-client-android:1.26.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
exclude group: 'org.apache.httpcomponents'
}

implementation "com.googlecode.juniversalchardet:juniversalchardet:$versions.juniversalchardet"

implementation "com.evernote:android-job:$versions.evernote_android_job"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
android:windowSoftInputMode="stateAlwaysHidden">
</activity>

<activity
android:name=".android.ui.repo.googledrive.GoogleDriveRepoActivity"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>

<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/orgzly/android/di/AppComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.orgzly.android.ui.refile.RefileFragment
import com.orgzly.android.ui.repo.BrowserActivity
import com.orgzly.android.ui.repo.directory.DirectoryRepoActivity
import com.orgzly.android.ui.repo.dropbox.DropboxRepoActivity
import com.orgzly.android.ui.repo.googledrive.GoogleDriveRepoActivity
import com.orgzly.android.ui.repo.git.GitRepoActivity
import com.orgzly.android.ui.repo.webdav.WebdavRepoActivity
import com.orgzly.android.ui.repos.ReposActivity
Expand Down Expand Up @@ -51,6 +52,7 @@ interface AppComponent {
fun inject(arg: MainActivity)
fun inject(arg: ReposActivity)
fun inject(arg: DropboxRepoActivity)
fun inject(arg: GoogleDriveRepoActivity)
fun inject(arg: DirectoryRepoActivity)
fun inject(arg: WebdavRepoActivity)
fun inject(arg: GitRepoActivity)
Expand Down Expand Up @@ -83,4 +85,4 @@ interface AppComponent {
fun inject(arg: ListWidgetProvider)
fun inject(arg: NewNoteBroadcastReceiver)
fun inject(arg: TimeChangeBroadcastReceiver)
}
}
Loading