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

Commit

Permalink
Merge pull request #75 from mhacks/removelibs
Browse files Browse the repository at this point in the history
Removed libs folder
  • Loading branch information
jeffchang5 authored Oct 1, 2018
2 parents d58af4b + c297353 commit c775081
Show file tree
Hide file tree
Showing 279 changed files with 6,392 additions and 4,558 deletions.
21 changes: 10 additions & 11 deletions apk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ apply plugin: 'com.android.application'
apply plugin: "kotlin-android"

android {
compileSdkVersion 27
compileSdkVersion 28


defaultConfig {
applicationId 'org.mhacks.app'
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

Expand All @@ -24,18 +24,17 @@ android {
}
}

dataBinding {
enabled = true
}

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation project(':base')
implementation project(':ui')
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-v4:$google_play_version"
//
// implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
// testImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
9 changes: 8 additions & 1 deletion apk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

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

<activity android:name="com.mhacks.app.ui.main.view.MainActivity">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<activity android:name="com.mhacks.app.ui.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down Expand Up @@ -32,6 +36,9 @@
</intent-filter>
</activity>

<activity android:name="com.mhacks.app.ui.signin.SignInActivity" />


</application>

</manifest>
74 changes: 27 additions & 47 deletions base/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//apply plugin: "com.android.application"
apply plugin: 'com.android.feature'

apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-kapt"
Expand All @@ -11,8 +11,8 @@ ext {
}

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 28
buildToolsVersion '28.0.2'
baseFeature true
dexOptions {
javaMaxHeapSize "4g"
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionName "10.0.0"
resValue "string", "google_maps_api_key", google_maps_api_key
vectorDrawables.useSupportLibrary = true
Expand All @@ -62,66 +62,46 @@ android {
resValue "string", "google_maps_api_key", google_maps_api_key
}
}

dataBinding {
enabled = true
}

productFlavors {

}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlin_version"

// kapt 'androidx.databinding:databinding-compiler:3.2.0'

// Play Services
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'

// Support libraries
implementation "com.android.support:appcompat-v7:$google_play_version"
implementation "com.android.support:support-v4:$google_play_version"
implementation "com.android.support:cardview-v7:$google_play_version"
implementation "com.android.support:recyclerview-v7:$google_play_version"
implementation "com.android.support:design:$google_play_version"

// View
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.kenglxn.QRGen:android:2.2.0'
implementation 'com.github.vipulasri:timelineview:1.0.5'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.2'

implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.media:media:1.0.0'

// Networking
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'

// Persistence
implementation "android.arch.persistence.room:runtime:$room_version"
implementation "android.arch.persistence.room:rxjava2:$room_version"
implementation 'androidx.room:room-runtime:2.0.0-rc01'
implementation 'androidx.room:room-rxjava2:2.0.0-rc01'

// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'

// Debugging
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.jakewharton.timber:timber:4.6.0'

// Dagger related libraries
implementation "com.google.dagger:dagger:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
implementation 'com.jakewharton.timber:timber:4.7.0'

// Other
implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5'

implementation("com.github.hotchemi:permissionsdispatcher:3.0.1") {
exclude module: "support-v13"
}
kapt "android.arch.persistence.room:compiler:$room_version"
kapt "com.github.hotchemi:permissionsdispatcher-processor:3.0.1"
kapt 'androidx.room:room-compiler:2.0.0-rc01'

feature project(':ui')
}
Expand Down
17 changes: 2 additions & 15 deletions base/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

<uses-feature
android:glEsVersion="0x00020000"
Expand Down Expand Up @@ -79,7 +80,7 @@
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name=".ui.qrscan.view.BarcodeCaptureActivity"
android:name=".ui.qrscan.widget.BarcodeCaptureActivity"
android:label="@string/title_activity_barcode_capture"
android:theme="@style/SplashTheme" />

Expand All @@ -99,20 +100,6 @@
</intent-filter>
</service>

<!--
A service that extends FireBaseInstanceIdService to handle the creation, rotation,
and updating of registration tokens.
-->

<service
android:name=".data.network.fcm.MyFireBaseInstanceIDService"
android:exported="false"
android:permission="">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_api_key" />
Expand Down
23 changes: 23 additions & 0 deletions base/src/main/java/com/mhacks/app/data/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mhacks.app.data

import android.net.wifi.WifiConfiguration

object Constants {

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

const val INSTANT_APP_PATH = "/schedule"

const val FIXED_START_DATE = "2018-05-01T00:00:00" // Using ISO Local Date and Time

private const val WIFI_SSID = "MHacks11"

private const val WIFI_PASSWORD = "anyonecancode"

val WIFI_CONFIGUATION: WifiConfiguration
get() {
val wifiConfig = WifiConfiguration()

wifiConfig.SSID = String.format("\"%s\"", WIFI_SSID);
wifiConfig.preSharedKey = String.format("\"%s\"", WIFI_PASSWORD)

return wifiConfig
}

const val GOOGLE_MAPS_URL = "http://maps.google.co.in/maps?q="

const val SLACK_INVITE_URL = "https://join.slack.com/t/mhacks11/shared_invite/enQtNDQzMDI0MDY3ODQ1LTM3YTIyMmJmNjU3NGM2NDk1MzQzZjZmMmY3ZDliZmZlNTRjOGNiMTc2OWRiZjIyODBiNzk2ZGQ4YjBmMjlkZjU"

const val MHACKS_EMAIL = "[email protected]"
}
25 changes: 16 additions & 9 deletions base/src/main/java/com/mhacks/app/data/SharedPreferencesManager.kt
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
package com.mhacks.app.data

import android.content.SharedPreferences
import io.reactivex.Single

/**
* Defines the interactions with SharedPreferences within the app.
*/
class SharedPreferencesManager(private val sharedPreferences: SharedPreferences) {

fun putIsAdmin(isAdmin: Boolean)
= sharedPreferences.edit().putBoolean(IS_ADMIN_KEY, isAdmin).apply()

fun getIsAdmin() = sharedPreferences.getBoolean(IS_ADMIN_KEY, false)

fun putCameraSettings(isAutoFocusEnabled: Boolean, isFlashEnabled: Boolean) =
private fun putCameraSettings(settings: Pair<Boolean, Boolean>): Pair<Boolean, Boolean> {
sharedPreferences.edit()
.putBoolean(AUTO_FOCUS_ENABLED_KEY, isAutoFocusEnabled)
.putBoolean(FLASH_ENABLED_KEY, isFlashEnabled)
.putBoolean(AUTO_FOCUS_ENABLED_KEY, settings.first)
.putBoolean(FLASH_ENABLED_KEY, settings.second)
.apply()
return settings
}

fun getCameraSettings() =
fun putCameraSettingsRx(settings: Pair<Boolean, Boolean>) =
getRxSingle(putCameraSettings(settings))

private fun getCameraSettings() =
Pair(
sharedPreferences.getBoolean(AUTO_FOCUS_ENABLED_KEY, false),
sharedPreferences.getBoolean(FLASH_ENABLED_KEY, false))

fun getCameraSettingsRx() =
getRxSingle(getCameraSettings())

private fun <T> getRxSingle(source: T) = Single.create<T> {
it.onSuccess(source)
}!!

companion object {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.mhacks.app.data.models

import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.squareup.moshi.Json

/**
* Model about announcements.
*/
data class AnnouncementResponse(
@Json(name = "status") var status: Boolean,
@Json(name = "announcements") var announcements: List<Announcement>?
@Json(name = "announcements") var announcements: List<Announcement>
)

@Entity(tableName = "announcement")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.mhacks.app.data.models
import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey

import androidx.room.*
import com.squareup.moshi.Json

/**
* Model about the details of the event.
*/
data class ConfigurationResponse(
data class ConfigResponse(
@Json(name = "status") var status: Boolean,
@Json(name = "user") var user: User?,
@Json(name = "configuration") var configuration: Configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mhacks.app.data.models

import com.squareup.moshi.Json

/**
* Model used for creating an announcement.
*/
data class CreateAnnouncement(
@Json(name="title") var title: String,
@Json(name="body") var body: String,
@Json(name="category") var category: String,
@Json(name="isApproved") var isApproved: Boolean,
@Json(name="isSent") var isSent: Boolean,
@Json(name="push") var push: Boolean)
Loading

0 comments on commit c775081

Please sign in to comment.