Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit c775081

Browse files
authored
Merge pull request #75 from mhacks/removelibs
Removed libs folder
2 parents d58af4b + c297353 commit c775081

File tree

279 files changed

+6392
-4558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+6392
-4558
lines changed

apk/build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ apply plugin: 'com.android.application'
33
apply plugin: "kotlin-android"
44

55
android {
6-
compileSdkVersion 27
6+
compileSdkVersion 28
77

88

99
defaultConfig {
1010
applicationId 'org.mhacks.app'
1111
minSdkVersion 21
12-
targetSdkVersion 27
12+
targetSdkVersion 28
1313
versionCode 1
1414
versionName "1.0"
1515

16-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717

1818
}
1919

@@ -24,18 +24,17 @@ android {
2424
}
2525
}
2626

27+
dataBinding {
28+
enabled = true
29+
}
30+
2731
}
2832

2933
dependencies {
30-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
34+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
3135

3236
implementation project(':base')
3337
implementation project(':ui')
34-
// implementation fileTree(dir: 'libs', include: ['*.jar'])
35-
implementation "com.android.support:support-v4:$google_play_version"
36-
//
37-
// implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
38-
// testImplementation 'junit:junit:4.12'
39-
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
40-
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
38+
39+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
4140
}

apk/src/main/AndroidManifest.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
<application android:label="@string/app_name">
55

6-
<activity android:name="com.mhacks.app.ui.main.view.MainActivity">
6+
<uses-library
7+
android:name="org.apache.http.legacy"
8+
android:required="false" />
9+
10+
<activity android:name="com.mhacks.app.ui.main.MainActivity">
711
<intent-filter>
812
<action android:name="android.intent.action.MAIN" />
913
<category android:name="android.intent.category.LAUNCHER" />
@@ -32,6 +36,9 @@
3236
</intent-filter>
3337
</activity>
3438

39+
<activity android:name="com.mhacks.app.ui.signin.SignInActivity" />
40+
41+
3542
</application>
3643

3744
</manifest>

base/build.gradle

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//apply plugin: "com.android.application"
21
apply plugin: 'com.android.feature'
2+
33
apply plugin: "kotlin-android"
44
apply plugin: "kotlin-android-extensions"
55
apply plugin: "kotlin-kapt"
@@ -11,8 +11,8 @@ ext {
1111
}
1212

1313
android {
14-
compileSdkVersion 27
15-
buildToolsVersion "27.0.3"
14+
compileSdkVersion 28
15+
buildToolsVersion '28.0.2'
1616
baseFeature true
1717
dexOptions {
1818
javaMaxHeapSize "4g"
@@ -41,7 +41,7 @@ android {
4141
}
4242
defaultConfig {
4343
minSdkVersion 21
44-
targetSdkVersion 27
44+
targetSdkVersion 28
4545
versionName "10.0.0"
4646
resValue "string", "google_maps_api_key", google_maps_api_key
4747
vectorDrawables.useSupportLibrary = true
@@ -62,66 +62,46 @@ android {
6262
resValue "string", "google_maps_api_key", google_maps_api_key
6363
}
6464
}
65+
66+
dataBinding {
67+
enabled = true
68+
}
69+
6570
productFlavors {
71+
6672
}
6773
}
6874

6975
dependencies {
7076
implementation fileTree(include: ['*.jar'], dir: 'libs')
71-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
77+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlin_version"
78+
79+
// kapt 'androidx.databinding:databinding-compiler:3.2.0'
7280

7381
// Play Services
74-
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
75-
implementation 'com.google.android.gms:play-services-maps:11.8.0'
76-
implementation 'com.google.android.gms:play-services-vision:11.8.0'
77-
implementation 'com.google.firebase:firebase-messaging:11.8.0'
78-
79-
// Support libraries
80-
implementation "com.android.support:appcompat-v7:$google_play_version"
81-
implementation "com.android.support:support-v4:$google_play_version"
82-
implementation "com.android.support:cardview-v7:$google_play_version"
83-
implementation "com.android.support:recyclerview-v7:$google_play_version"
84-
implementation "com.android.support:design:$google_play_version"
85-
86-
// View
87-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
88-
implementation 'com.github.kenglxn.QRGen:android:2.2.0'
89-
implementation 'com.github.vipulasri:timelineview:1.0.5'
90-
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
82+
implementation 'com.google.firebase:firebase-core:16.0.3'
83+
implementation 'com.google.firebase:firebase-messaging:17.3.2'
84+
85+
implementation 'androidx.appcompat:appcompat:1.0.0'
86+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
87+
implementation 'androidx.media:media:1.0.0'
9188

9289
// Networking
93-
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
94-
implementation 'com.squareup.retrofit2:converter-moshi:2.3.0'
95-
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
90+
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
9691

9792
// Persistence
98-
implementation "android.arch.persistence.room:runtime:$room_version"
99-
implementation "android.arch.persistence.room:rxjava2:$room_version"
93+
implementation 'androidx.room:room-runtime:2.0.0-rc01'
94+
implementation 'androidx.room:room-rxjava2:2.0.0-rc01'
10095

10196
// RxJava
102-
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
103-
implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
104-
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
97+
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
98+
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
99+
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
105100

106101
// Debugging
107-
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
108-
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
109-
implementation 'com.jakewharton.timber:timber:4.6.0'
110-
111-
// Dagger related libraries
112-
implementation "com.google.dagger:dagger:$dagger_version"
113-
implementation "com.google.dagger:dagger-android-support:$dagger_version"
114-
kapt "com.google.dagger:dagger-compiler:$dagger_version"
115-
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
102+
implementation 'com.jakewharton.timber:timber:4.7.0'
116103

117-
// Other
118-
implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5'
119-
120-
implementation("com.github.hotchemi:permissionsdispatcher:3.0.1") {
121-
exclude module: "support-v13"
122-
}
123-
kapt "android.arch.persistence.room:compiler:$room_version"
124-
kapt "com.github.hotchemi:permissionsdispatcher-processor:3.0.1"
104+
kapt 'androidx.room:room-compiler:2.0.0-rc01'
125105

126106
feature project(':ui')
127107
}

base/src/main/AndroidManifest.xml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
1717
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
1818
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
19+
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
1920

2021
<uses-feature
2122
android:glEsVersion="0x00020000"
@@ -79,7 +80,7 @@
7980
android:launchMode="singleTop"
8081
android:screenOrientation="portrait" />
8182
<activity
82-
android:name=".ui.qrscan.view.BarcodeCaptureActivity"
83+
android:name=".ui.qrscan.widget.BarcodeCaptureActivity"
8384
android:label="@string/title_activity_barcode_capture"
8485
android:theme="@style/SplashTheme" />
8586

@@ -99,20 +100,6 @@
99100
</intent-filter>
100101
</service>
101102

102-
<!--
103-
A service that extends FireBaseInstanceIdService to handle the creation, rotation,
104-
and updating of registration tokens.
105-
-->
106-
107-
<service
108-
android:name=".data.network.fcm.MyFireBaseInstanceIDService"
109-
android:exported="false"
110-
android:permission="">
111-
<intent-filter>
112-
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
113-
</intent-filter>
114-
</service>
115-
116103
<meta-data
117104
android:name="com.google.android.geo.API_KEY"
118105
android:value="@string/google_maps_api_key" />

base/src/main/java/com/mhacks/app/data/Constants.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.mhacks.app.data
22

3+
import android.net.wifi.WifiConfiguration
4+
35
object Constants {
46

57
const val STAGING_URL = "https://staging.mhacks.org/v1/"
@@ -8,4 +10,25 @@ object Constants {
810

911
const val INSTANT_APP_PATH = "/schedule"
1012

13+
const val FIXED_START_DATE = "2018-05-01T00:00:00" // Using ISO Local Date and Time
14+
15+
private const val WIFI_SSID = "MHacks11"
16+
17+
private const val WIFI_PASSWORD = "anyonecancode"
18+
19+
val WIFI_CONFIGUATION: WifiConfiguration
20+
get() {
21+
val wifiConfig = WifiConfiguration()
22+
23+
wifiConfig.SSID = String.format("\"%s\"", WIFI_SSID);
24+
wifiConfig.preSharedKey = String.format("\"%s\"", WIFI_PASSWORD)
25+
26+
return wifiConfig
27+
}
28+
29+
const val GOOGLE_MAPS_URL = "http://maps.google.co.in/maps?q="
30+
31+
const val SLACK_INVITE_URL = "https://join.slack.com/t/mhacks11/shared_invite/enQtNDQzMDI0MDY3ODQ1LTM3YTIyMmJmNjU3NGM2NDk1MzQzZjZmMmY3ZDliZmZlNTRjOGNiMTc2OWRiZjIyODBiNzk2ZGQ4YjBmMjlkZjU"
32+
33+
const val MHACKS_EMAIL = "hackathon@umich.edu"
1134
}

base/src/main/java/com/mhacks/app/data/SharedPreferencesManager.kt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
package com.mhacks.app.data
22

33
import android.content.SharedPreferences
4+
import io.reactivex.Single
45

56
/**
67
* Defines the interactions with SharedPreferences within the app.
78
*/
89
class SharedPreferencesManager(private val sharedPreferences: SharedPreferences) {
910

10-
fun putIsAdmin(isAdmin: Boolean)
11-
= sharedPreferences.edit().putBoolean(IS_ADMIN_KEY, isAdmin).apply()
12-
13-
fun getIsAdmin() = sharedPreferences.getBoolean(IS_ADMIN_KEY, false)
14-
15-
fun putCameraSettings(isAutoFocusEnabled: Boolean, isFlashEnabled: Boolean) =
11+
private fun putCameraSettings(settings: Pair<Boolean, Boolean>): Pair<Boolean, Boolean> {
1612
sharedPreferences.edit()
17-
.putBoolean(AUTO_FOCUS_ENABLED_KEY, isAutoFocusEnabled)
18-
.putBoolean(FLASH_ENABLED_KEY, isFlashEnabled)
13+
.putBoolean(AUTO_FOCUS_ENABLED_KEY, settings.first)
14+
.putBoolean(FLASH_ENABLED_KEY, settings.second)
1915
.apply()
16+
return settings
17+
}
2018

21-
fun getCameraSettings() =
19+
fun putCameraSettingsRx(settings: Pair<Boolean, Boolean>) =
20+
getRxSingle(putCameraSettings(settings))
21+
22+
private fun getCameraSettings() =
2223
Pair(
2324
sharedPreferences.getBoolean(AUTO_FOCUS_ENABLED_KEY, false),
2425
sharedPreferences.getBoolean(FLASH_ENABLED_KEY, false))
2526

27+
fun getCameraSettingsRx() =
28+
getRxSingle(getCameraSettings())
29+
30+
private fun <T> getRxSingle(source: T) = Single.create<T> {
31+
it.onSuccess(source)
32+
}!!
2633

2734
companion object {
2835

base/src/main/java/com/mhacks/app/data/models/AnnouncementResponse.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package com.mhacks.app.data.models
22

3-
import android.arch.persistence.room.Entity
4-
import android.arch.persistence.room.PrimaryKey
3+
import androidx.room.Entity
4+
import androidx.room.PrimaryKey
55
import com.squareup.moshi.Json
66

77
/**
88
* Model about announcements.
99
*/
1010
data class AnnouncementResponse(
1111
@Json(name = "status") var status: Boolean,
12-
@Json(name = "announcements") var announcements: List<Announcement>?
12+
@Json(name = "announcements") var announcements: List<Announcement>
1313
)
1414

1515
@Entity(tableName = "announcement")

base/src/main/java/com/mhacks/app/data/models/ConfigurationResponse.kt renamed to base/src/main/java/com/mhacks/app/data/models/ConfigResponse.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.mhacks.app.data.models
2-
import android.arch.persistence.room.Entity
3-
import android.arch.persistence.room.PrimaryKey
2+
3+
import androidx.room.*
44
import com.squareup.moshi.Json
55

66
/**
77
* Model about the details of the event.
88
*/
9-
data class ConfigurationResponse(
9+
data class ConfigResponse(
1010
@Json(name = "status") var status: Boolean,
1111
@Json(name = "user") var user: User?,
1212
@Json(name = "configuration") var configuration: Configuration
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.mhacks.app.data.models
2+
3+
import com.squareup.moshi.Json
4+
5+
/**
6+
* Model used for creating an announcement.
7+
*/
8+
data class CreateAnnouncement(
9+
@Json(name="title") var title: String,
10+
@Json(name="body") var body: String,
11+
@Json(name="category") var category: String,
12+
@Json(name="isApproved") var isApproved: Boolean,
13+
@Json(name="isSent") var isSent: Boolean,
14+
@Json(name="push") var push: Boolean)

0 commit comments

Comments
 (0)