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

Dev #1

Merged
merged 25 commits into from
Feb 12, 2017
Merged
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
4 changes: 4 additions & 0 deletions outlay/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
.DS_Store
/build
/captures
/app/src/debug/google-services.json
/app/src/release/google-services.json
/app/src/staging/google-services.json
/release.properties
67 changes: 48 additions & 19 deletions outlay/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ buildscript {
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.android.databinding'

def cfg = rootProject.ext.configuration
def libs = rootProject.ext.libraries
Expand All @@ -26,15 +24,42 @@ android {
buildToolsVersion cfg.buildToolsVersion

defaultConfig {
applicationId cfg.package
minSdkVersion cfg.minSdk
targetSdkVersion cfg.targetSdk
versionCode cfg.version_code
versionName cfg.version_name
applicationId cfg.package
minSdkVersion cfg.minSdk
targetSdkVersion cfg.targetSdk
versionCode cfg.version_code
versionName cfg.version_name
}

def propsFile = rootProject.file('release.properties')
def props = new Properties()
if (propsFile.exists()) {
props.load(new FileInputStream(propsFile))
}

signingConfigs {
release {
if (propsFile.exists()) {
storeFile file(props['RELEASE_STORE_FILE'])
storePassword props['RELEASE_STORE_PASSWORD']
keyAlias props['RELEASE_KEY_ALIAS']
keyPassword props['RELEASE_KEY_PASSWORD']
}
}
}

buildTypes {
debug {
buildConfigField "boolean", "USE_ANALYTICS", "false"
}
staging {
buildConfigField "boolean", "USE_ANALYTICS", "false"
}
release {
buildConfigField "boolean", "USE_ANALYTICS", "true"

signingConfig signingConfigs.release

minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand All @@ -46,6 +71,7 @@ android {
}

packagingOptions {
//<div>Icons made by <a href="http://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
Expand All @@ -62,11 +88,10 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':domain')

//Google
apt "com.google.dagger:dagger-compiler:${libs.dagger}"
compile "com.google.dagger:dagger-compiler:${libs.dagger}"
provided "javax.annotation:jsr250-api:1.0"

//Support
compile "com.android.support:support-v13:${libs.supportVersion}"
Expand All @@ -79,23 +104,27 @@ dependencies {
compile "io.reactivex:rxjava:${libs.rxjava}"
compile "io.reactivex:rxandroid:${libs.rxandroid}"

//greenRobot
compile "de.greenrobot:greendao:${libs.greenDao}"

//UI
compile('com.mikepenz:materialdrawer:4.6.4@aar') {
compile('com.mikepenz:materialdrawer:5.8.1@aar') {
transitive = true
}
compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar'
compile 'com.mikepenz:material-design-iconic-typeface:+@aar'

compile 'com.jakewharton:butterknife:7.0.1'

compile "com.github.johnkil.print:print:1.3.1"
compile(group: 'uz.shift', name: 'colorpicker', version: '0.5', ext: 'aar')
compile 'com.github.PhilJay:MPAndroidChart:v2.2.0'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.2.0'

compile 'joda-time:joda-time:2.9.2'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'com.hannesdorfmann.mosby:mvp:2.0.1'

compile "com.google.firebase:firebase-core:${libs.firebase}"
compile "com.google.firebase:firebase-auth:${libs.firebase}"
compile "com.google.firebase:firebase-database:${libs.firebase}"
releaseCompile "com.google.firebase:firebase-crash:${libs.firebase}"
stagingCompile "com.google.firebase:firebase-crash:${libs.firebase}"
}

apply plugin: 'com.google.gms.google-services'
30 changes: 19 additions & 11 deletions outlay/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.outlay">
package="app.outlay">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
android:name=".App"
android:name="app.outlay.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Material.Custom">
<activity
android:name=".view.activity.MainActivity"
android:name="app.outlay.view.activity.MainActivity"
android:screenOrientation="portrait"></activity>

<activity
android:name="app.outlay.view.activity.SingleFragmentActivity"
android:screenOrientation="portrait" />

<activity
android:name="app.outlay.view.activity.SyncGuestActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Material.Translucent" />

<activity
android:name="app.outlay.view.activity.LoginActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".view.activity.SingleFragmentActivity"
android:screenOrientation="portrait" />

<meta-data
android:name="io.fabric.ApiKey"
android:value="0" />
</application>

</manifest>
57 changes: 57 additions & 0 deletions outlay/app/src/main/java/app/outlay/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package app.outlay;

import android.app.Application;

import com.google.firebase.database.FirebaseDatabase;
import app.outlay.core.logger.LoggerFactory;
import app.outlay.di.component.AppComponent;
import app.outlay.di.component.DaggerAppComponent;
import app.outlay.di.component.UserComponent;
import app.outlay.di.module.AppModule;
import app.outlay.di.module.FirebaseModule;
import app.outlay.di.module.UserModule;
import app.outlay.domain.model.User;
import app.outlay.impl.AndroidLogger;

/**
* Created by Bogdan Melnychuk on 1/15/16.
*/
public class App extends Application {
private AppComponent appComponent;
private UserComponent userComponent;

@Override
public void onCreate() {
super.onCreate();
initializeInjector();
LoggerFactory.registerLogger(new AndroidLogger());

FirebaseDatabase.getInstance().setPersistenceEnabled(true);
}

public UserComponent createUserComponent(User user) {
if (userComponent == null) {
userComponent = appComponent.plus(new UserModule(user));
}
return userComponent;
}

public void releaseUserComponent() {
userComponent = null;
}

private void initializeInjector() {
appComponent = DaggerAppComponent.builder()
.appModule(new AppModule(this))
.firebaseModule(new FirebaseModule())
.build();
}

public AppComponent getAppComponent() {
return appComponent;
}

public UserComponent getUserComponent() {
return userComponent;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.outlay;
package app.outlay;

/**
* Created by Bogdan Melnychuk on 1/30/16.
Expand Down
56 changes: 56 additions & 0 deletions outlay/app/src/main/java/app/outlay/analytics/Analytics.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package app.outlay.analytics;

import app.outlay.domain.model.Category;
import app.outlay.domain.model.Expense;

import java.util.Date;

/**
* Created by bmelnychuk on 2/11/17.
*/

public interface Analytics {
void trackGuestSignIn();

void trackEmailSignIn();

void trackSignUp();

void trackSingOut();

void trackLinkAccount();

void trackExpenseCreated(Expense e);

void trackExpenseDeleted(Expense e);

void trackExpenseUpdated(Expense e);

void trackCategoryCreated(Category c);

void trackCategoryDeleted(Category c);

void trackCategoryUpdated(Category c);

void trackCategoryDragEvent();

void trackViewDailyExpenses();

void trackViewWeeklyExpenses();

void trackViewMonthlyExpenses();

void trackExpensesViewDateChange(Date from, Date to);

void trackViewExpensesList();

void trackViewCategoriesList();

void trackFeedbackClick();

void trackMainScreenDateChange(Date todayDate, Date changeTo);

void trackAnalysisView();

void trackAnalysisPerformed(Date from, Date to);
}
32 changes: 32 additions & 0 deletions outlay/app/src/main/java/app/outlay/di/component/AppComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package app.outlay.di.component;

import android.content.Context;

import app.outlay.analytics.Analytics;
import app.outlay.di.module.AppModule;
import app.outlay.di.module.FirebaseModule;
import app.outlay.di.module.UserModule;
import app.outlay.view.activity.base.ParentActivity;
import app.outlay.view.activity.LoginActivity;
import app.outlay.view.fragment.LoginFragment;
import app.outlay.view.fragment.SyncGuestFragment;

import javax.inject.Singleton;

import dagger.Component;

/**
* Created by Bogdan Melnychuk on 12/17/15.
*/
@Singleton
@Component(modules = {AppModule.class, FirebaseModule.class})
public interface AppComponent {
UserComponent plus(UserModule userModule);
Context getApplication();
Analytics analytics();

void inject(LoginActivity loginActivity);
void inject(ParentActivity staticContentActivity);
void inject(LoginFragment loginFragment);
void inject(SyncGuestFragment syncGuestFragment);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package app.outlay.di.component;

import app.outlay.di.module.UserModule;
import app.outlay.di.scope.UserScope;
import app.outlay.view.activity.MainActivity;
import app.outlay.view.fragment.AnalysisFragment;
import app.outlay.view.fragment.CategoriesFragment;
import app.outlay.view.fragment.CategoryDetailsFragment;
import app.outlay.view.fragment.ExpensesDetailsFragment;
import app.outlay.view.fragment.ExpensesListFragment;
import app.outlay.view.fragment.MainFragment;
import app.outlay.view.fragment.ReportFragment;

import dagger.Subcomponent;

/**
* Created by bmelnychuk on 10/27/16.
*/

@UserScope
@Subcomponent(modules = {UserModule.class})
public interface UserComponent {
void inject(CategoriesFragment fragment);

void inject(CategoryDetailsFragment fragment);

void inject(ReportFragment fragment);

void inject(ExpensesListFragment fragment);

void inject(ExpensesDetailsFragment fragment);

void inject(MainActivity mainActivity);

void inject(MainFragment mainFragment2);

void inject(AnalysisFragment analysisFragment);
}
Loading