Skip to content

Commit

Permalink
Restructures app to be distributed as a library.
Browse files Browse the repository at this point in the history
To make this as easy to reuse as possible, this change restructures the app to be distributed as an AAR, with only theming and config information needing to come from the actual final app.

Still to be done:

* Move some final parts into config or firebase (conference image in nav drawer, etc.)
* Setup deploy information for Maven Central.
* Add documentation to readme about parts that need setup (build.gradle, themes, etc.)
  • Loading branch information
rharter committed Apr 23, 2017
1 parent 4726c02 commit 5079c39
Show file tree
Hide file tree
Showing 120 changed files with 448 additions and 333 deletions.
37 changes: 6 additions & 31 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

def event_id = "chicagoroboto-2017"
def event_name = "Chicago Roboto"
def app_name = "Roboto"

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.chicagoroboto"
minSdkVersion 15
targetSdkVersion 25
versionCode 9
versionName "1.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

buildConfigField "String", "EVENT_ID", "\"$event_id\""
resValue "string", "app_name", "$app_name"
resValue "string", "event_name", "$event_name"
}
if (hasProperty('CHICAGO_ROBOTO_STORE_FILE')) {
signingConfigs {
release {
storeFile file(CHICAGO_ROBOTO_STORE_FILE)
storePassword CHICAGO_ROBOTO_STORE_PASSWORD
keyAlias CHICAGO_ROBOTO_KEY_ALIAS
keyPassword CHICAGO_ROBOTO_KEY_PASSWORD
}
}
}
buildTypes {
release {
if (hasProperty('CHICAGO_ROBOTO_STORE_FILE')) {
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
// Sample values
resValue "string", "event_id", "\"Unknown\""
resValue "string", "app_name", "Conference"
resValue "string", "event_name", "My Conference"
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -78,6 +55,4 @@ dependencies {

testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.3.1'
}

apply plugin: 'com.google.gms.google-services'
}
7 changes: 2 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chicagoroboto">
package="com.conferences">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name=".DevconApp">
android:name=".ConferenceApplication">

<activity android:name=".features.main.MainActivity">
<intent-filter>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.chicagoroboto
package com.conferences

import android.app.Application
import com.chicagoroboto.data.DataModule
import com.chicagoroboto.injection.AppComponent
import com.chicagoroboto.injection.AppModule
import com.chicagoroboto.injection.DaggerAppComponent
import com.conferences.data.DataModule
import com.conferences.injection.AppComponent
import com.conferences.injection.AppModule
import com.conferences.injection.DaggerAppComponent

class DevconApp() : Application() {
class ConferenceApplication() : Application() {

lateinit var component: AppComponent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.chicagoroboto.data
package com.conferences.data

import android.content.Context
import com.chicagoroboto.model.Library
import com.conferences.model.Library

class AndroidLibraryProvider(private val context: Context) : LibraryProvider {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.data
package com.conferences.data

import android.app.Application
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.data
package com.conferences.data

import javax.inject.Qualifier

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chicagoroboto.data
package com.conferences.data

import com.chicagoroboto.model.Feedback
import com.conferences.model.Feedback
import com.google.firebase.database.*

class FirebaseFeedbackProvider(private val db: DatabaseReference,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.data
package com.conferences.data

import com.google.firebase.database.*
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chicagoroboto.data
package com.conferences.data

import com.chicagoroboto.model.Session
import com.conferences.model.Session
import com.google.firebase.database.*
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chicagoroboto.data
package com.conferences.data

import com.chicagoroboto.model.Speaker
import com.conferences.model.Speaker
import com.google.firebase.database.*
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chicagoroboto.data
package com.conferences.data

import com.chicagoroboto.model.Venue
import com.conferences.model.Venue
import com.google.firebase.database.*

class FirebaseVenueProvider(val database: DatabaseReference) : VenueProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.data
package com.conferences.data

import android.content.SharedPreferences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.chicagoroboto.data
package com.conferences.data

import android.app.AlarmManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.support.v7.app.NotificationCompat
import com.chicagoroboto.R
import com.chicagoroboto.features.sessiondetail.SessionDetailActivity
import com.chicagoroboto.model.Session
import com.chicagoroboto.notifications.NotificationPublisher
import com.chicagoroboto.utils.DrawableUtils
import com.chicagoroboto.utils.asBitmap
import com.conferences.R
import com.conferences.features.sessiondetail.SessionDetailActivity
import com.conferences.model.Session
import com.conferences.notifications.NotificationPublisher
import com.conferences.utils.DrawableUtils
import com.conferences.utils.asBitmap

class LocalNotificationProvider(private val context: Context) : NotificationProvider {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.data
package com.conferences.data

import android.app.Application
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.chicagoroboto.ext
package com.conferences.ext

import android.content.Context
import com.chicagoroboto.injection.AppComponent
import com.conferences.injection.AppComponent

val SERVICE_COMPONENT = "component"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.ext
package com.conferences.ext

import android.app.Activity
import android.content.ContextWrapper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.chicagoroboto.features.info
package com.conferences.features.info

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.chicagoroboto.R
import com.chicagoroboto.model.Library
import com.conferences.R
import com.conferences.model.Library
import kotlinx.android.synthetic.main.view_info_library.view.*

class InfoAdapter(val libraryListener: (library: Library) -> Unit) : RecyclerView.Adapter<InfoAdapter.ViewHolder>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.features.info
package com.conferences.features.info

import dagger.Subcomponent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.chicagoroboto.features.info
package com.conferences.features.info

import android.content.Context
import com.chicagoroboto.data.AndroidLibraryProvider
import com.chicagoroboto.data.LibraryProvider
import com.chicagoroboto.navigator.AndroidWebNavigator
import com.chicagoroboto.navigator.WebNavigator
import com.conferences.data.AndroidLibraryProvider
import com.conferences.data.LibraryProvider
import com.conferences.navigator.AndroidWebNavigator
import com.conferences.navigator.WebNavigator
import dagger.Module
import dagger.Provides

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.chicagoroboto.features.info
package com.conferences.features.info

import android.content.Context
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.util.AttributeSet
import com.chicagoroboto.ext.getAppComponent
import com.chicagoroboto.model.Library
import com.conferences.ext.getAppComponent
import com.conferences.model.Library
import javax.inject.Inject

class InfoView(context: Context, attrs: AttributeSet? = null) : RecyclerView(context, attrs), InfoMvp.View {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.features.location
package com.conferences.features.location

import dagger.Subcomponent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chicagoroboto.features.location
package com.conferences.features.location

import com.chicagoroboto.data.VenueProvider
import com.conferences.data.VenueProvider
import dagger.Module
import dagger.Provides

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.chicagoroboto.features.location
package com.conferences.features.location

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import com.chicagoroboto.R
import com.chicagoroboto.ext.getComponent
import com.chicagoroboto.features.main.MainComponent
import com.chicagoroboto.model.Venue
import com.conferences.R
import com.conferences.ext.getComponent
import com.conferences.features.main.MainComponent
import com.conferences.model.Venue
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MarkerOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chicagoroboto.features.main
package com.conferences.features.main

import android.content.Intent
import android.os.Bundle
Expand All @@ -7,21 +7,18 @@ import android.support.v4.view.GravityCompat
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import android.view.View
import com.chicagoroboto.R
import com.chicagoroboto.ext.getAppComponent
import com.chicagoroboto.features.info.InfoView
import com.chicagoroboto.features.location.LocationView
import com.chicagoroboto.features.sessiondetail.SessionDetailActivity
import com.chicagoroboto.features.sessions.SessionDateView
import com.chicagoroboto.features.sessions.SessionNavigator
import com.chicagoroboto.features.speakerdetail.SpeakerDetailActivity
import com.chicagoroboto.features.speakerdetail.SpeakerNavigator
import com.chicagoroboto.features.speakerlist.SpeakerListView
import com.chicagoroboto.model.Session
import kotlinx.android.synthetic.main.activity_main.content
import kotlinx.android.synthetic.main.activity_main.drawer_layout
import kotlinx.android.synthetic.main.activity_main.nav_view
import kotlinx.android.synthetic.main.activity_main.toolbar
import com.conferences.R
import com.conferences.ext.getAppComponent
import com.conferences.features.info.InfoView
import com.conferences.features.location.LocationView
import com.conferences.features.sessiondetail.SessionDetailActivity
import com.conferences.features.sessions.SessionDateView
import com.conferences.features.sessions.SessionNavigator
import com.conferences.features.speakerdetail.SpeakerDetailActivity
import com.conferences.features.speakerdetail.SpeakerNavigator
import com.conferences.features.speakerlist.SpeakerListView
import com.conferences.model.Session
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(), SessionNavigator, SpeakerNavigator, NavigationView.OnNavigationItemSelectedListener {
lateinit var component: MainComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.chicagoroboto.features.main
package com.conferences.features.main

import com.chicagoroboto.features.location.LocationComponent
import com.chicagoroboto.features.sessions.SessionListComponent
import com.chicagoroboto.features.speakerlist.SpeakerListComponent
import com.conferences.features.location.LocationComponent
import com.conferences.features.sessions.SessionListComponent
import com.conferences.features.speakerlist.SpeakerListComponent
import dagger.Subcomponent

@Subcomponent(modules = arrayOf(MainModule::class))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.chicagoroboto.features.main
package com.conferences.features.main

import com.chicagoroboto.features.sessions.SessionNavigator
import com.chicagoroboto.features.speakerdetail.SpeakerNavigator
import com.conferences.features.sessions.SessionNavigator
import com.conferences.features.speakerdetail.SpeakerNavigator
import dagger.Module
import dagger.Provides

Expand Down
Loading

1 comment on commit 5079c39

@rharter
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIP for #11

Please sign in to comment.