Skip to content

Commit 6749101

Browse files
committed
Add file systems
1 parent 0bddccc commit 6749101

File tree

17 files changed

+539
-5
lines changed

17 files changed

+539
-5
lines changed

.idea/gradle.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

googledrive/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

googledrive/build.gradle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
4+
apply plugin: 'com.github.dcendents.android-maven'
5+
group = 'com.github.Omega-R'
6+
android {
7+
compileSdkVersion 28
8+
9+
10+
11+
defaultConfig {
12+
minSdkVersion 14
13+
targetSdkVersion 28
14+
versionCode 1
15+
versionName "1.0"
16+
17+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
18+
19+
}
20+
21+
buildTypes {
22+
release {
23+
minifyEnabled false
24+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25+
}
26+
}
27+
28+
}
29+
30+
dependencies {
31+
implementation project(':omegatypes')
32+
33+
implementation fileTree(dir: 'libs', include: ['*.jar'])
34+
35+
// Drive
36+
api('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
37+
exclude group: 'org.apache.httpcomponents'
38+
}
39+
api 'com.google.http-client:google-http-client-gson:1.31.0'
40+
api ("com.google.api-client:google-api-client-android:1.30.2") {
41+
exclude group: 'org.apache.httpcomponents'
42+
}
43+
44+
45+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
46+
}
47+
repositories {
48+
mavenCentral()
49+
}

googledrive/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.omega_r.libs.omegatypes.glide;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.omega_r.libs.omegatypes.glide.test", appContext.getPackageName());
25+
}
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.omega_r.libs.omegatypes.glide"/>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.omega_r.libs.omegatypes.file
2+
3+
4+
/**
5+
* Created by Anton Knyazev on 2019-10-04.
6+
*/
7+
class GoogleDriveFile(private val file: com.google.api.services.drive.model.File) : File {
8+
9+
companion object {
10+
11+
private const val MIME_TYPE_FOLDER = "application/vnd.google-apps.folder"
12+
13+
}
14+
15+
override val name: String
16+
get() = file.name
17+
18+
override val mimeType: String
19+
get() = file.mimeType
20+
21+
override val type: File.Type
22+
get() = if (file.mimeType == MIME_TYPE_FOLDER) File.Type.FOLDER else File.Type.FILE
23+
24+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<resources>
2+
</resources>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.omega_r.libs.omegatypes.glide;
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
11+
*/
12+
public class ExampleUnitTest {
13+
@Test
14+
public void addition_isCorrect() {
15+
assertEquals(4, 2 + 2);
16+
}
17+
}

0 commit comments

Comments
 (0)