Skip to content

Commit

Permalink
Merge pull request #20 from mazurio/new-drawer-and-calendar-week-view
Browse files Browse the repository at this point in the history
* 1.1.0
  • Loading branch information
mazurio committed Jan 12, 2016
2 parents 2430624 + 94cb430 commit 97169e4
Show file tree
Hide file tree
Showing 223 changed files with 7,746 additions and 1,764 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Keys
api.xml
api.properties
fabric.properties

# Built application files
Expand Down Expand Up @@ -35,4 +36,4 @@ proguard/
# Other
.DS_Store
.idea
*.iml
*.iml
98 changes: 63 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@ apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'io.fabric'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
def getApiKey(){
def Properties properties = new Properties()

properties.load(new FileInputStream(new File('api.properties')))

return properties['AMAZON_API_KEY']
}

def getFabricAPIKey() {
def Properties properties = new Properties()

properties.load(new FileInputStream(new File('api.properties')))

return properties['FABRIC_API_KEY']
}

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId 'io.mazur.fit'
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 23
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
Expand All @@ -28,57 +41,72 @@ android {
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}

productFlavors {
pro {
applicationId 'io.mazur.fit.pro'
versionCode 102
versionName "1.0.2"
applicationId 'com.bodyweight.fitness.pro'
versionCode 110
versionName "1.1.0"
}

free {
applicationId 'io.mazur.fit.free'
versionCode 102
versionName "1.0.2"
applicationId 'com.bodyweight.fitness.free'
versionCode 110
versionName "1.1.0"
}
}

buildTypes {
applicationVariants.all { variant ->
variant.buildConfigField "String", "AMAZON_API_KEY", "\"" + getApiKey() + "\""
}

debug {
ext.enableCrashlytics = false

manifestPlaceholders = [ fabric_api_key: "\"" + getFabricAPIKey() + "\""]

}

release {
manifestPlaceholders = [ fabric_api_key: "\"" + getFabricAPIKey() + "\""]
}
}
}

configurations {
all*.exclude group: 'io.reactivex', module: 'rxjava'
}

dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:design:22.2.0'

compile 'com.google.code.gson:gson:2.3.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.github.mazurio:glacier:0.0.3'
compile 'net.danlew:android.joda:2.7.1'

compile 'commons-io:commons-io:2.4'
compile 'com.jakewharton:butterknife:6.1.0'

compile 'com.netflix.rxjava:rxjava-core:0.20.7'
compile 'com.netflix.rxjava:rxjava-android:0.20.7'

compile 'frankiesardo:icepick:3.0.2'
provided 'frankiesardo:icepick-processor:3.0.2'

compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.1'
compile 'com.github.johnkil.android-robototextview:robototextview:2.3.0'

compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
compile 'com.gordonwong:material-sheet-fab:1.2'
compile 'com.github.bmarrdev:android-DecoView-charting:v0.9.4'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'io.reactivex:rxjava:1.1.0'
compile 'frankiesardo:icepick:3.1.0'
provided 'frankiesardo:icepick-processor:3.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
}
compile('com.crashlytics.sdk.android:answers:1.3.6@aar') {
transitive = true;
}
compile files('libs/amazon-mobile-associates-1.0.73.0.jar')
}
Binary file added app/libs/realm-0.84.1.jar
Binary file not shown.
17 changes: 0 additions & 17 deletions app/proguard-rules.pro

This file was deleted.

18 changes: 15 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.mazur.fit">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.bodyweight.fitness"
android:installLocation="auto">

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

<application
Expand All @@ -21,7 +23,7 @@
</activity>

<activity
android:name=".ui.AboutActivity"
android:name=".ui.BuyEquipmentActivity"
android:parentActivityName=".ui.MainActivity"
android:theme="@style/AppTheme.Activity">

Expand All @@ -30,6 +32,16 @@
android:value=".ui.MainActivity" />
</activity>

<activity
android:name=".ui.ProgressActivity"
android:parentActivityName=".ui.MainActivity"
android:theme="@style/AppTheme.Activity.Progress">

<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.MainActivity" />
</activity>

<activity
android:name=".ui.SettingsActivity"
android:parentActivityName=".ui.MainActivity"
Expand All @@ -42,6 +54,6 @@

<meta-data
android:name="io.fabric.ApiKey"
android:value="REPLACE_IT" />
android:value="${fabric_api_key}" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
package io.mazur.fit;
package com.bodyweight.fitness;

import android.app.Application;
import android.content.Context;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;

import net.danlew.android.joda.JodaTimeAndroid;

import io.mazur.glacier.Glacier;
import io.fabric.sdk.android.Fabric;

/**
* TODO: Rename drawables to use the uniqueId's.
*
* TODO: Update all gif videos to match 16:9 format.
* TODO: Update videos for Antranik new video.
*
* TODO BUG: ProgressActivity missing items sometimes.
*
* TODO: Move to Dagger 2 injection rather than using getInstance singletons.
*/
public class App extends Application {
private static Context mContext;

Expand All @@ -19,8 +31,12 @@ public void onCreate() {
Glacier.init(getApplicationContext());
JodaTimeAndroid.init(getApplicationContext());

if(!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
if (!BuildConfig.DEBUG) {
Fabric.with(
getApplicationContext(),
new Crashlytics(),
new Answers()
);
}

mContext = getApplicationContext();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.mazur.fit;
package com.bodyweight.fitness;

public class Constants {
public static final String PREFERENCE_WEIGHT_MEASUREMENT_UNITS = "PREFERENCE_WEIGHT_MEASUREMENT_UNITS";
public static final String PREFERENCE_PLAY_SOUND_WHEN_TIMER_STOPS = "PREFERENCE_PLAY_SOUND_WHEN_TIMER_STOPS";
public static final String PREFERENCE_KEEP_SCREEN_ON = "PREFERENCE_KEEP_SCREEN_ON";
public static final String PREFERENCE_TIMER_KEY = "PREFERENCE_TIMER_KEY";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.bodyweight.fitness.adapter;

import android.support.v4.view.PagerAdapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bodyweight.fitness.view.CalendarItemView;
import com.bodyweight.fitness.view.widget.ViewPager;

import com.bodyweight.fitness.R;

public class CalendarAdapter extends PagerAdapter {
public static final int DEFAULT_POSITION = 60;

@Override
public Object instantiateItem(ViewGroup viewGroup, int position) {
final ViewPager viewPager = (ViewPager) viewGroup;

CalendarItemView calendarItemView = (CalendarItemView) LayoutInflater
.from(viewGroup.getContext())
.inflate(R.layout.view_calendar_item, viewGroup, false);

calendarItemView.onCreate(position);
calendarItemView.onCreateView();

viewPager.addView(calendarItemView);

return calendarItemView;
}

/**
* Remove subscriptions made by item views to the day/page selected observables.
*/
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
CalendarItemView calendarItemView = (CalendarItemView) object;

calendarItemView.onDestroyView();

ViewPager viewPager = (ViewPager) container;
viewPager.removeView(calendarItemView);
}

@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}

@Override
public int getCount() {
return 61;
}
}
Loading

0 comments on commit 97169e4

Please sign in to comment.