diff options
44 files changed, 1155 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d6bfc95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.gradle +/local.properties +/.idea/workspace.xml +.DS_Store diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..7040dcb --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +GymLog
\ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <option name="DEFAULT_COMPILER" value="Javac" /> + <resourceExtensions /> + <wildcardResourcePatterns> + <entry name="!?*.java" /> + <entry name="!?*.form" /> + <entry name="!?*.class" /> + <entry name="!?*.groovy" /> + <entry name="!?*.scala" /> + <entry name="!?*.flex" /> + <entry name="!?*.kt" /> + <entry name="!?*.clj" /> + </wildcardResourcePatterns> + <annotationProcessing> + <profile default="true" name="Default" enabled="false"> + <processorPath useClasspath="true" /> + </profile> + </annotationProcessing> + </component> +</project> + diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ +<component name="CopyrightManager"> + <settings default=""> + <module2copyright /> + </settings> +</component>
\ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> +</project> + diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..68414fe --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="distributionType" value="DEFAULT_WRAPPED" /> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/GymLog" /> + </set> + </option> + </GradleProjectSettings> + </option> + </component> +</project> + diff --git a/.idea/libraries/appcompat_v7_19_0_1.xml b/.idea/libraries/appcompat_v7_19_0_1.xml new file mode 100644 index 0000000..caf0395 --- /dev/null +++ b/.idea/libraries/appcompat_v7_19_0_1.xml @@ -0,0 +1,10 @@ +<component name="libraryTable"> + <library name="appcompat-v7-19.0.1"> + <CLASSES> + <root url="file://$PROJECT_DIR$/GymLog/build/exploded-bundles/ComAndroidSupportAppcompatV71901.aar/res" /> + <root url="jar://$PROJECT_DIR$/GymLog/build/exploded-bundles/ComAndroidSupportAppcompatV71901.aar/classes.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> +</component>
\ No newline at end of file diff --git a/.idea/libraries/support_v13_19_0_1.xml b/.idea/libraries/support_v13_19_0_1.xml new file mode 100644 index 0000000..b427b1e --- /dev/null +++ b/.idea/libraries/support_v13_19_0_1.xml @@ -0,0 +1,11 @@ +<component name="libraryTable"> + <library name="support-v13-19.0.1"> + <CLASSES> + <root url="jar://$USER_HOME$/AppData/Local/Android/android-sdk/extras/android/m2repository/com/android/support/support-v13/19.0.1/support-v13-19.0.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="jar://$USER_HOME$/AppData/Local/Android/android-sdk/extras/android/m2repository/com/android/support/support-v13/19.0.1/support-v13-19.0.1-sources.jar!/" /> + </SOURCES> + </library> +</component>
\ No newline at end of file diff --git a/.idea/libraries/support_v4_19_0_1.xml b/.idea/libraries/support_v4_19_0_1.xml new file mode 100644 index 0000000..f26603b --- /dev/null +++ b/.idea/libraries/support_v4_19_0_1.xml @@ -0,0 +1,11 @@ +<component name="libraryTable"> + <library name="support-v4-19.0.1"> + <CLASSES> + <root url="jar://$USER_HOME$/AppData/Local/Android/android-sdk/extras/android/m2repository/com/android/support/support-v4/19.0.1/support-v4-19.0.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="jar://$USER_HOME$/AppData/Local/Android/android-sdk/extras/android/m2repository/com/android/support/support-v4/19.0.1/support-v4-19.0.1-sources.jar!/" /> + </SOURCES> + </library> +</component>
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..66ef826 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="EntryPointsManager"> + <entry_points version="2.0" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7 (2)" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> +</project> + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f7c2684 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/GymLog.iml" filepath="$PROJECT_DIR$/GymLog.iml" /> + <module fileurl="file://$PROJECT_DIR$/GymLog/GymLog-GymLog.iml" filepath="$PROJECT_DIR$/GymLog/GymLog-GymLog.iml" /> + </modules> + </component> +</project> + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ +<component name="DependencyValidationManager"> + <state> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </state> +</component>
\ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="" /> + </component> +</project> + diff --git a/GymLog.iml b/GymLog.iml new file mode 100644 index 0000000..c87302f --- /dev/null +++ b/GymLog.iml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/build/classes/main" /> + <output-test url="file://$MODULE_DIR$/build/classes/test" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <excludeFolder url="file://$MODULE_DIR$/.gradle" /> + <excludeFolder url="file://$MODULE_DIR$/build" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> + diff --git a/GymLog/.gitignore b/GymLog/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/GymLog/.gitignore @@ -0,0 +1 @@ +/build diff --git a/GymLog/GymLog-GymLog.iml b/GymLog/GymLog-GymLog.iml new file mode 100644 index 0000000..794d129 --- /dev/null +++ b/GymLog/GymLog-GymLog.iml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="GymLog" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="android-gradle" name="Android-Gradle"> + <configuration> + <option name="GRADLE_PROJECT_PATH" value=":GymLog" /> + </configuration> + </facet> + <facet type="android" name="Android"> + <configuration> + <option name="SELECTED_BUILD_VARIANT" value="debug" /> + <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> + <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" /> + <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" /> + <option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" /> + <option name="ALLOW_USER_CONFIGURATION" value="false" /> + <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> + <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> + <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> + <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> + </configuration> + </facet> + </component> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/build/classes/debug" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/r/test/debug" isTestSource="true" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test/debug" isTestSource="true" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test/debug" isTestSource="true" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/source/rs/test/debug" isTestSource="true" generated="true" /> + <sourceFolder url="file://$MODULE_DIR$/build/res/rs/test/debug" type="java-test-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" type="java-test-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" type="java-test-resource" /> + <excludeFolder url="file://$MODULE_DIR$/build/apk" /> + <excludeFolder url="file://$MODULE_DIR$/build/assets" /> + <excludeFolder url="file://$MODULE_DIR$/build/bundles" /> + <excludeFolder url="file://$MODULE_DIR$/build/classes" /> + <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" /> + <excludeFolder url="file://$MODULE_DIR$/build/incremental" /> + <excludeFolder url="file://$MODULE_DIR$/build/libs" /> + <excludeFolder url="file://$MODULE_DIR$/build/manifests" /> + <excludeFolder url="file://$MODULE_DIR$/build/res" /> + <excludeFolder url="file://$MODULE_DIR$/build/symbols" /> + <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> + </content> + <orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" exported="" name="support-v13-19.0.1" level="project" /> + <orderEntry type="library" exported="" name="appcompat-v7-19.0.1" level="project" /> + <orderEntry type="library" exported="" name="support-v4-19.0.1" level="project" /> + </component> +</module> + diff --git a/GymLog/build.gradle b/GymLog/build.gradle new file mode 100644 index 0000000..68421ae --- /dev/null +++ b/GymLog/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'android' + +android { + compileSdkVersion 19 + buildToolsVersion "19.0.3" + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 19 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + runProguard false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} + +dependencies { + compile 'com.android.support:support-v13:+' + compile 'com.android.support:appcompat-v7:+' + compile 'com.android.support:support-v4:+' + compile fileTree(dir: 'libs', include: ['*.jar']) +} diff --git a/GymLog/proguard-rules.txt b/GymLog/proguard-rules.txt new file mode 100644 index 0000000..378660c --- /dev/null +++ b/GymLog/proguard-rules.txt @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in C:/Users/Mike/AppData/Local/Android/android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#}
\ No newline at end of file diff --git a/GymLog/src/main/AndroidManifest.xml b/GymLog/src/main/AndroidManifest.xml new file mode 100644 index 0000000..417ce01 --- /dev/null +++ b/GymLog/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.mikemiller.gymlog" > + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > + <activity + android:name="com.mikemiller.gymlog.MainActivity" + android:label="@string/app_name" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> diff --git a/GymLog/src/main/ic_launcher-web.png b/GymLog/src/main/ic_launcher-web.png Binary files differnew file mode 100644 index 0000000..f974377 --- /dev/null +++ b/GymLog/src/main/ic_launcher-web.png diff --git a/GymLog/src/main/java/com/mikemiller/gymlog/Activity.java b/GymLog/src/main/java/com/mikemiller/gymlog/Activity.java new file mode 100644 index 0000000..bce8419 --- /dev/null +++ b/GymLog/src/main/java/com/mikemiller/gymlog/Activity.java @@ -0,0 +1,46 @@ +package com.mikemiller.gymlog; + +import java.io.Serializable; + +/** + * Created by Mike on 3/29/14. COPYRIGHT OLIO. + */ +public class Activity implements Serializable { + private String mName; + private int mSets; + private int mRepsLow; + private int mRepsHigh; + private int mWeightDecrement_percent; + private int mRepIncrement; + + public Activity (String name, int sets, int repsLow, int repsHigh, int weightDecrement_percent, int repIncrement) { + mName = name; + mSets = sets; + mRepsLow = repsLow; + mRepsHigh = repsHigh; + mWeightDecrement_percent = weightDecrement_percent; + mRepIncrement = repIncrement; + } + + public String getName() { return mName; } + public int getSets() { return mSets; } + public int getRepsLow() { return mRepsLow; } + public int getRepsHigh() { return mRepsHigh; } + public int getWeightForSet(int set, int setOneWeight) { + double val = (int)(setOneWeight - (set - 1) * setOneWeight * (mWeightDecrement_percent / 100.0)); + return (int) (5*(Math.round(val/5))); // Round to the nearest 5 lbs + } + public int getRepIncrement() { return mRepIncrement; } + + public String getSummary(int setOneWeight, int currentReps) { + String summary = ""; + String reps = getRepsLow() + (getRepsLow() == getRepsHigh() ? "" : " - " + getRepsHigh()); + summary += reps + " reps ("+ currentReps + ")\n\n"; + for (int i = 1; i <= getSets(); i++) { + summary += i + ": " + getWeightForSet(i, setOneWeight); + if (i > 1 && getRepIncrement() > 0) summary += " (+" + getRepIncrement() + " rep)"; + if (i < getSets()) summary += "\n"; + } + return summary; + } +} diff --git a/GymLog/src/main/java/com/mikemiller/gymlog/ActivityFragment.java b/GymLog/src/main/java/com/mikemiller/gymlog/ActivityFragment.java new file mode 100644 index 0000000..a4986ea --- /dev/null +++ b/GymLog/src/main/java/com/mikemiller/gymlog/ActivityFragment.java @@ -0,0 +1,179 @@ +package com.mikemiller.gymlog; + +import android.app.Fragment; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.GestureDetector; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +public class ActivityFragment extends Fragment { + + private Activity mActivity; + private int mWeight = 0; + private int mReps = 0; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_activity, container, false); + + TextView name = (TextView) view.findViewById(R.id.name); + mActivity = (Activity) getArguments().getSerializable("activity"); + name.setText(mActivity.getName()); + + Button summary = (Button) view.findViewById(R.id.summary); + if (savedInstanceState!= null && savedInstanceState.containsKey("count")) { + mWeight = savedInstanceState.getInt("count"); + } + + summary.setText(Integer.toString(mWeight)); + summary.setOnTouchListener(new View.OnTouchListener() { + GestureDetector doubleTapDetector = new GestureDetector(new DoubleTapDetector(getActivity())); + GestureDetector flingDetector = new GestureDetector(getActivity(), new GestureDetector.OnGestureListener() { + @Override + public boolean onDown(MotionEvent e) { + return false; + } + + @Override + public void onShowPress(MotionEvent e) { + + } + + @Override + public boolean onSingleTapUp(MotionEvent e) { + return false; + } + + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + return false; + } + + @Override + public void onLongPress(MotionEvent e) { + decrementWeight(); + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + final float minFlingVelocity = 300; + if (velocityY > minFlingVelocity && Math.abs(velocityX) < minFlingVelocity) { + decrementReps(); + } else if (velocityY < -minFlingVelocity && Math.abs(velocityX) < minFlingVelocity ) { + incrementReps(); + } + return true; + } + }); + + @Override + public boolean onTouch(View v, MotionEvent event) { + if (flingDetector.onTouchEvent(event)) { + return true; + } + if (doubleTapDetector.onTouchEvent(event)) { + // A double tap occurred. + incrementWeight(); + return true; + } + return false; + } + }); + + + /* + count.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + incrementWeight(); + } + });*/ + + return view; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + outState.putInt("weight", mWeight); + } + + @Override + public void onViewStateRestored(Bundle savedInstanceState) { + super.onViewStateRestored(savedInstanceState); + + if (savedInstanceState!= null && savedInstanceState.containsKey("weight")) { + setWeight(savedInstanceState.getInt("weight")); + } + } + + private void setWeight(int weight) { + mWeight = weight; + Button summaryButton = (Button) getView().findViewById(R.id.summary); + summaryButton.setText(getSummary()); + } + private void setReps(int reps) { + mReps = reps; + Button summaryButton = (Button) getView().findViewById(R.id.summary); + summaryButton.setText(getSummary()); + } + + private String getSummary() { + return mActivity.getSummary(mWeight, mReps); + } + + public void incrementWeight() { + setWeight(mWeight + 5); + } + public void decrementWeight() { + setWeight(mWeight - 5); + } + public void incrementReps() { + setReps(mReps + 1); + } + public void decrementReps() { + setReps(mReps - 1); + } + + public static ActivityFragment newInstance(Activity activity) { + + ActivityFragment f = new ActivityFragment(); + Bundle b = new Bundle(); + b.putSerializable("activity", activity); + f.setArguments(b); + + return f; + } + + @Override + public void onStop() { + super.onStop(); + saveData(); + } + + private void saveData() { + SharedPreferences.Editor outState = getActivity().getSharedPreferences(getSharedpreferencesName(), Context.MODE_APPEND).edit(); + outState.putInt("weight", mWeight); + outState.putInt("reps", mReps); + outState.commit(); + } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + SharedPreferences activity_data = getActivity().getSharedPreferences(getSharedpreferencesName(), Context.MODE_APPEND); + setWeight(activity_data.getInt("weight", 0)); + setReps(activity_data.getInt("reps", 0)); + } + + private String getSharedpreferencesName() { + return "activity_data_" + mActivity.getName(); + } +}
\ No newline at end of file diff --git a/GymLog/src/main/java/com/mikemiller/gymlog/DoubleTapDetector.java b/GymLog/src/main/java/com/mikemiller/gymlog/DoubleTapDetector.java new file mode 100644 index 0000000..4b42bc4 --- /dev/null +++ b/GymLog/src/main/java/com/mikemiller/gymlog/DoubleTapDetector.java @@ -0,0 +1,30 @@ +package com.mikemiller.gymlog; + +import android.content.Context; +import android.view.GestureDetector; +import android.view.MotionEvent; + +/** + * Created by Mike on 3/29/14. COPYRIGHT OLIO. + */ +public class DoubleTapDetector extends GestureDetector.SimpleOnGestureListener { + public Context context; + public String phno; + + public DoubleTapDetector(Context con) + { + this.context=con; + } + @Override + public boolean onDown(MotionEvent e) { + return false; + } + @Override + public boolean onDoubleTap(MotionEvent e) { + return true; + } + @Override + public boolean onSingleTapUp(MotionEvent e) { + return false; + } +}
\ No newline at end of file diff --git a/GymLog/src/main/java/com/mikemiller/gymlog/MainActivity.java b/GymLog/src/main/java/com/mikemiller/gymlog/MainActivity.java new file mode 100644 index 0000000..e7c8f60 --- /dev/null +++ b/GymLog/src/main/java/com/mikemiller/gymlog/MainActivity.java @@ -0,0 +1,92 @@ +package com.mikemiller.gymlog; + +import android.app.Fragment; +import android.app.FragmentManager; +import android.os.Bundle; +import android.support.v4.app.FragmentActivity; +import android.support.v13.app.FragmentPagerAdapter; +import android.support.v4.view.ViewPager; + +import java.util.Arrays; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; + +public class MainActivity extends FragmentActivity { + + SimpleCounterFragment mEpisodeFragment; + + // 1 = Sunday + final Map<Integer[], Activity[]> mDaysOfWeekToActivity = new HashMap<Integer[], Activity[]>(){{ + put(new Integer[]{2, 3}, new Activity[]{ + new Activity("Barbell Deadlifts", 3, 4, 6, 10, 1), + new Activity("Assisted Chin-ups", 3, 4, 6, 10, 1), + new Activity("Pendlay Rows", 2, 4, 6, 10, 1) }); + put(new Integer[]{4, 5}, new Activity[]{ + new Activity("Flat Dumbell Bench Press", 3, 6, 10, 10, 1), + new Activity("Incline Dumbell Bench Press", 2, 8, 12, 10, 1), + new Activity("Barbell Curls", 3, 0, 8, 0, 0)}); + put(new Integer[]{6, 7, 1}, new Activity[]{ + new Activity("Barbell Squats", 2, 6, 8, 10, 1), + new Activity("Widowmaker Squats", 1, 20, 20, 0, 0), + new Activity("Stiff Legged Deadlifts", 2, 15, 20, 10, 1), + new Activity("Tricep Pushdown", 3, 0, 8, 0, 0), + new Activity("Weighted Ab Cable Crunches", 1, 10, 20, 0, 0)}); + }}; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + ViewPager pager = (ViewPager) findViewById(R.id.viewPager); + pager.setAdapter(new MyPagerAdapter(getFragmentManager())); + + mEpisodeFragment = SimpleCounterFragment.newInstance("Whose Line"); + } + + // 1 = Sunday + private int getDayOfWeek() { + Calendar calendar = Calendar.getInstance(); + return calendar.get(Calendar.DAY_OF_WEEK); + } + + private Activity[] getActivitiesForDayOfWeek(int dayOfWeek) { + for(Integer[] key : mDaysOfWeekToActivity.keySet()) { + if (Arrays.asList(key).contains(dayOfWeek)) { + return mDaysOfWeekToActivity.get(key); + } + } + return new Activity[]{}; + } + + private Activity[] getActivitiesForTody() { + return getActivitiesForDayOfWeek(getDayOfWeek()); + } + + + private class MyPagerAdapter extends FragmentPagerAdapter { + + public MyPagerAdapter(FragmentManager fm) { + super(fm); + } + + @Override + public Fragment getItem(int pos) { + Activity[] activities = getActivitiesForTody(); + + if (pos == 0) { + return mEpisodeFragment; + } + + if (pos > activities.length) pos = activities.length; + + return ActivityFragment.newInstance(activities[pos - 1]); + } + + @Override + public int getCount() { + return getActivitiesForTody().length + 1; + } + } +}
\ No newline at end of file diff --git a/GymLog/src/main/java/com/mikemiller/gymlog/SimpleCounterFragment.java b/GymLog/src/main/java/com/mikemiller/gymlog/SimpleCounterFragment.java new file mode 100644 index 0000000..a6870d0 --- /dev/null +++ b/GymLog/src/main/java/com/mikemiller/gymlog/SimpleCounterFragment.java @@ -0,0 +1,123 @@ +package com.mikemiller.gymlog; + +import android.app.Fragment; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.GestureDetector; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +public class SimpleCounterFragment extends Fragment { + + private String mShow = ""; + private int mCount = 0; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_simple_counter, container, false); + + TextView show = (TextView) view.findViewById(R.id.show); + mShow = getArguments().getString("show"); + show.setText(mShow); + + Button count = (Button) view.findViewById(R.id.count); + if (savedInstanceState!= null && savedInstanceState.containsKey("count")) { + mCount = savedInstanceState.getInt("count"); + } + + count.setText(Integer.toString(mCount)); + + count.setOnTouchListener(new View.OnTouchListener() { + GestureDetector doubleTapDetector = new GestureDetector(new DoubleTapDetector(getActivity())); + + @Override + public boolean onTouch(View v, MotionEvent event) { + if (doubleTapDetector.onTouchEvent(event)) { + // A double tap occurred. + increment(); + return true; + } + return false; + } + }); + + count.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + decrement(); + return true; + } + }); + + return view; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + outState.putInt("count", mCount); + } + + @Override + public void onViewStateRestored(Bundle savedInstanceState) { + super.onViewStateRestored(savedInstanceState); + + if (savedInstanceState!= null && savedInstanceState.containsKey("count")) { + setCount(savedInstanceState.getInt("count")); + } + } + + private void setCount(int count) { + mCount = count; + Button countButton = (Button) getView().findViewById(R.id.count); + countButton.setText(Integer.toString(mCount)); + + } + + public void increment() { + setCount(mCount + 1); + } + public void decrement() { + setCount(mCount - 1); + } + + public static SimpleCounterFragment newInstance(String show) { + + SimpleCounterFragment f = new SimpleCounterFragment(); + Bundle b = new Bundle(); + b.putString("show", show); + f.setArguments(b); + + return f; + } + + @Override + public void onStop() { + super.onStop(); + saveData(); + } + + private void saveData() { + + SharedPreferences.Editor outState = getActivity().getSharedPreferences(getSharedpreferencesName(), Context.MODE_APPEND).edit(); + outState.putInt("count", mCount); + outState.commit(); + } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + SharedPreferences counter_data = getActivity().getSharedPreferences(getSharedpreferencesName(), Context.MODE_APPEND); + setCount(counter_data.getInt("count", 0)); + } + + private String getSharedpreferencesName() { + return "counter_data_" + mShow; + } +}
\ No newline at end of file diff --git a/GymLog/src/main/res/drawable-hdpi/ic_launcher.png b/GymLog/src/main/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..7776dab --- /dev/null +++ b/GymLog/src/main/res/drawable-hdpi/ic_launcher.png diff --git a/GymLog/src/main/res/drawable-mdpi/ic_launcher.png b/GymLog/src/main/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..688a96b --- /dev/null +++ b/GymLog/src/main/res/drawable-mdpi/ic_launcher.png diff --git a/GymLog/src/main/res/drawable-xhdpi/ic_launcher.png b/GymLog/src/main/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..cb6451d --- /dev/null +++ b/GymLog/src/main/res/drawable-xhdpi/ic_launcher.png diff --git a/GymLog/src/main/res/drawable-xxhdpi/ic_launcher.png b/GymLog/src/main/res/drawable-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..cb0b645 --- /dev/null +++ b/GymLog/src/main/res/drawable-xxhdpi/ic_launcher.png diff --git a/GymLog/src/main/res/layout/activity_main.xml b/GymLog/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..e5bad81 --- /dev/null +++ b/GymLog/src/main/res/layout/activity_main.xml @@ -0,0 +1,8 @@ +<android.support.v4.view.ViewPager + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/viewPager" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@android:color/black" + />
\ No newline at end of file diff --git a/GymLog/src/main/res/layout/fragment_activity.xml b/GymLog/src/main/res/layout/fragment_activity.xml new file mode 100644 index 0000000..5ae1af5 --- /dev/null +++ b/GymLog/src/main/res/layout/fragment_activity.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> + +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center_horizontal" + android:background="@android:color/black" > + + <Button + android:id="@+id/summary" + android:layout_above="@+id/name" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerHorizontal="false" + android:gravity="center_vertical" + android:textSize="40dp" + android:text="0" + android:textColor="@android:color/holo_blue_dark" + android:background="@android:color/black" /> + <TextView + android:id="@+id/name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:gravity="center_horizontal" + android:textSize="30dp" + android:text="Activity Name" + android:textColor="@android:color/holo_blue_dark" /> +</RelativeLayout>
\ No newline at end of file diff --git a/GymLog/src/main/res/layout/fragment_simple_counter.xml b/GymLog/src/main/res/layout/fragment_simple_counter.xml new file mode 100644 index 0000000..327677a --- /dev/null +++ b/GymLog/src/main/res/layout/fragment_simple_counter.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> + +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center_horizontal" + android:background="@android:color/black" > + + + <Button + android:id="@+id/count" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:textSize="166dp" + android:text="0" + android:textColor="@android:color/holo_blue_dark" + android:background="@android:color/black" /> + <View + android:layout_width="match_parent" + android:layout_height="10dp"/> + <TextView + android:id="@+id/show" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:gravity="center_horizontal" + android:textSize="26dp" + android:text="Show Name" + android:textColor="@android:color/holo_blue_dark" /> +</RelativeLayout>
\ No newline at end of file diff --git a/GymLog/src/main/res/menu/main.xml b/GymLog/src/main/res/menu/main.xml new file mode 100644 index 0000000..e6ab32e --- /dev/null +++ b/GymLog/src/main/res/menu/main.xml @@ -0,0 +1,10 @@ +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + tools:context="com.mikemiller.gymlog.MainActivity" > + + <item android:id="@+id/action_settings" + android:title="@string/action_settings" + android:orderInCategory="100" + app:showAsAction="never" /> +</menu> diff --git a/GymLog/src/main/res/values-w820dp/dimens.xml b/GymLog/src/main/res/values-w820dp/dimens.xml new file mode 100644 index 0000000..63fc816 --- /dev/null +++ b/GymLog/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,6 @@ +<resources> + <!-- Example customization of dimensions originally defined in res/values/dimens.xml + (such as screen margins) for screens with more than 820dp of available width. This + would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> + <dimen name="activity_horizontal_margin">64dp</dimen> +</resources> diff --git a/GymLog/src/main/res/values/dimens.xml b/GymLog/src/main/res/values/dimens.xml new file mode 100644 index 0000000..a0171a7 --- /dev/null +++ b/GymLog/src/main/res/values/dimens.xml @@ -0,0 +1,6 @@ +<resources> + <!-- Default screen margins, per the Android Design guidelines. --> + <dimen name="activity_horizontal_margin">16dp</dimen> + <dimen name="activity_vertical_margin">16dp</dimen> + + </resources> diff --git a/GymLog/src/main/res/values/strings.xml b/GymLog/src/main/res/values/strings.xml new file mode 100644 index 0000000..530eeb9 --- /dev/null +++ b/GymLog/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="app_name">GymLog</string> + <string name="hello_world">Hello world!</string> + <string name="action_settings">Settings</string> + <string name="hello_blank_fragment">Hello blank fragment</string> + +</resources> diff --git a/GymLog/src/main/res/values/styles.xml b/GymLog/src/main/res/values/styles.xml new file mode 100644 index 0000000..766ab99 --- /dev/null +++ b/GymLog/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ +<resources> + + <!-- Base application theme. --> + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> + <!-- Customize your theme here. --> + </style> + +</resources> diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..6b42096 --- /dev/null +++ b/build.gradle @@ -0,0 +1,16 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:0.8.+' + } +} + +allprojects { + repositories { + mavenCentral() + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..5d08ba7 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Settings specified in this file will override any Gradle settings +# configured through the IDE. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true
\ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 0000000..8c0fb64 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5de946b --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..9a9749d --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':GymLog' |