Skip to content
Open
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: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android:
components:
- platform-tools
- tools
- android-25
- build-tools-25.0.0
- android-27
- build-tools-27.0.3
- extra-android-m2repository
- extra-android-support
- sys-img-armeabi-v7a-android-18
Expand Down
25 changes: 13 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion

defaultConfig {
applicationId "com.michaelcarrano.seven_min_workout"
minSdkVersion 16
targetSdkVersion 25
versionCode 2
versionName "2.0"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 3
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

buildConfigField("String", "YOUTUBE_API_KEY", "\"${youtube_api_key}\"")
Expand All @@ -23,18 +24,18 @@ android {
}

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

compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
implementation "com.android.support:appcompat-v7:$supportLib"
implementation "com.android.support:design:$supportLib"

compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true;
}

// Testing Dependencies
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);

// Set the ActionBar title and up button
// getActionBar().setTitle(getString(R.string.app_label));
// getActionBar().setDisplayHomeAsUpEnabled(true);

// Set the text
TextView textView = (TextView) findViewById(R.id.about_text);
textView.append(getString(R.string.about_part1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Created by michaelcarrano on 10/1/16.
*/

public class BaseActivity extends AppCompatActivity {
public abstract class BaseActivity extends AppCompatActivity {

protected Toolbar toolbar;

Expand Down Expand Up @@ -59,12 +59,12 @@ public final CoordinatorLayout getCoordinatorLayout() {

@NonNull
public FloatingActionButton addFab() {
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
FloatingActionButton fab = findViewById(R.id.fab);

if (fab == null) {
getLayoutInflater().inflate(R.layout.fab, getCoordinatorLayout());

fab = (FloatingActionButton) findViewById(R.id.fab);
fab = findViewById(R.id.fab);
}

setShowFab(true);
Expand All @@ -74,7 +74,7 @@ public FloatingActionButton addFab() {

@Nullable
public FloatingActionButton setShowFab(boolean show) {
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
FloatingActionButton fab = findViewById(R.id.fab);

if (fab == null || fab.getVisibility() == View.VISIBLE && show || fab.getVisibility() == View.GONE && !show) {
return fab;
Expand All @@ -84,7 +84,6 @@ public FloatingActionButton setShowFab(boolean show) {

CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
if (show) {
// params.setBehavior(new FloatingActionButtonBehavior(this));
fab.setVisibility(View.VISIBLE);
} else {
params.setBehavior(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater
.inflate(R.layout.fragment_workout_countdown, container, false);
mCircularProgressBar = (CircularProgressBar) rootView
.findViewById(R.id.workout_countdown_time);
// rootView.setBackgroundColor(Color.parseColor(mWorkout.light));
mCircularProgressBar = rootView.findViewById(R.id.workout_countdown_time);

// Start off with 10 second rest, then alternate
if (!workoutInProgress) {
Expand All @@ -93,21 +91,19 @@ private void rest(final View rootView) {
public void onTick(long millisUntilFinished) {
REMAINING_TIME = (int) (millisUntilFinished / 1000);

TextView name = (TextView) rootView.findViewById(R.id.workout_countdown_name);
TextView name = rootView.findViewById(R.id.workout_countdown_name);
if (!workoutInProgress) {
name.setText(R.string.get_ready);
} else {
name.setText(R.string.rest);
}

TextView id = (TextView) rootView.findViewById(R.id.workout_countdown_id);
TextView id = rootView.findViewById(R.id.workout_countdown_id);
id.setText(mWorkout.id);

id.setBackgroundColor(mWorkout.dark);
name.setBackgroundColor(mWorkout.light);

// TextView time = (TextView) rootView.findViewById(R.id.workout_countdown_time);
// time.setText("" + millisUntilFinished / 1000);
mCircularProgressBar.setMax(REST_TIME / 1000);
mCircularProgressBar.setProgress(REMAINING_TIME);

Expand All @@ -128,14 +124,12 @@ private void exercise(final View rootView) {
public void onTick(long millisUntilFinished) {
REMAINING_TIME = (int) (millisUntilFinished / 1000);

TextView ready = (TextView) rootView.findViewById(R.id.workout_countdown_name);
TextView ready = rootView.findViewById(R.id.workout_countdown_name);
ready.setText(mWorkout.name);

TextView id = (TextView) rootView.findViewById(R.id.workout_countdown_id);
TextView id = rootView.findViewById(R.id.workout_countdown_id);
id.setText(mWorkout.id);

// TextView time = (TextView) rootView.findViewById(R.id.workout_countdown_time);
// time.setText("" + millisUntilFinished / 1000);
mCircularProgressBar.setMax(EXERCISE_TIME / 1000);
mCircularProgressBar.setProgress(REMAINING_TIME);

Expand All @@ -145,7 +139,6 @@ public void onTick(long millisUntilFinished) {
public void onFinish() {
if (++mWorkoutPos < WorkoutContent.WORKOUTS.size()) {
mWorkout = WorkoutContent.WORKOUTS.get(mWorkoutPos);
// rootView.setBackgroundColor(Color.parseColor(mWorkout.light));
rest(rootView);
} else {
finish(rootView);
Expand All @@ -158,12 +151,12 @@ public void onFinish() {
private void finish(View rootView) {
mCountDownTimer.cancel();
// hide the current views
LinearLayout info = (LinearLayout) rootView.findViewById(R.id.workout_countdown_info);
LinearLayout info = rootView.findViewById(R.id.workout_countdown_info);
info.setVisibility(View.GONE);
mCircularProgressBar.setVisibility(View.GONE);

// display "finished"
TextView textView = (TextView) rootView.findViewById(R.id.workout_countdown_finished);
TextView textView = rootView.findViewById(R.id.workout_countdown_finished);
textView.setVisibility(View.VISIBLE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

// Show the workout content as text in a TextView.
if (mWorkout != null) {
TextView content = (TextView) rootView.findViewById(R.id.workout_detail);
TextView content = rootView.findViewById(R.id.workout_detail);
content.setText(mWorkout.content);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.michaelcarrano.seven_min_workout;

import com.michaelcarrano.seven_min_workout.adapter.WorkoutListAdapter;

import android.app.Activity;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.ListFragment;
import android.view.View;
import android.widget.ListView;

import com.michaelcarrano.seven_min_workout.adapter.WorkoutListAdapter;

/**
* A list fragment representing a list of Workouts. This fragment also supports tablet devices by
* allowing list items to be given an 'activated' state upon selection. This helps indicate which
Expand Down Expand Up @@ -68,9 +68,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
getListView().setDividerHeight(0);

// Restore ListView position
// Log.i("7min", "onViewCreated");
if (mListViewScrollPos != null) {
// Log.i("7min", "Restore scroll position");
getListView().onRestoreInstanceState(mListViewScrollPos);
}
}
Expand Down Expand Up @@ -111,7 +109,6 @@ public void onSaveInstanceState(Bundle outState) {
// Serialize and persist the activated item position.
outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
}
// Log.i("7min", "onSaveInstanceState");
mListViewScrollPos = getListView().onSaveInstanceState();
}

Expand Down Expand Up @@ -146,6 +143,6 @@ public interface Callbacks {
/**
* Callback for when an item has been selected.
*/
public void onItemSelected(int position);
void onItemSelected(int position);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
convertView = mLayoutInflater.inflate(R.layout.adapter_workout_row, parent, false);

holder = new ViewHolder();
holder.id = (TextView) convertView.findViewById(R.id.workout_id);
holder.name = (TextView) convertView.findViewById(R.id.workout_name);
holder.id = convertView.findViewById(R.id.workout_id);
holder.name = convertView.findViewById(R.id.workout_name);

convertView.setTag(holder);
} else {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
<string name="push_ups_video">Eh00_rniF8E</string>
<string name="abdominal_crunches_video">SHWgBc4Ahc8</string>
<string name="step_ups_onto_a_chair_video">u-QwO-Bbaro</string>
<string name="squats_video">p3g4wAsu0R4</string>
<string name="squats_video">aPYCiuiB4PA</string>
<string name="triceps_dips_on_a_chair_video">nx9gVDCnT84</string>
<string name="planks_video">pSHjTRCQxIw</string>
<string name="high_knees_running_in_place_video">kMFv3Alg-Gc</string>
<string name="lunges_video">m_RYVmpWDq4</string>
<string name="lunges_video">Z2n58m2i4jg</string>
<string name="push_ups_and_rotations_video">uGqZONsnZa8</string>
<string name="side_planks_video">NXr4Fw8q60o</string>

Expand Down
25 changes: 15 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
google()
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'io.fabric.tools:gradle:1.+'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
google()
maven { url "https://jitpack.io" }
maven { url "https://maven.fabric.io/public" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
targetSdkVersion = 27
compileSdkVersion = 27

supportLib = "27.1.1"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Apr 24 20:37:50 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
46 changes: 25 additions & 21 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading