From 44da2eebaa4f00c937a043d4ed7463d6f809d0a8 Mon Sep 17 00:00:00 2001 From: Damian Mazurkiewicz Date: Fri, 22 Dec 2017 12:47:32 +0000 Subject: [PATCH] Bug Fixes (#70) --- app/build.gradle | 104 ++++++---------- .../bodyweight/fitness/MainActivityTest.kt | 58 --------- .../CacheDirectoryCreationException.java | 7 -- .../fitness/persistence/Duration.java | 20 ---- .../fitness/persistence/Glacier.java | 113 ------------------ .../persistence/file/FileObjectPersister.java | 112 ----------------- .../main/kotlin/com/bodyweight/fitness/App.kt | 2 - .../com/bodyweight/fitness/Constants.kt | 1 + .../fitness/adapter/ProgressListAdapter.kt | 1 - .../fitness/adapter/ToolbarSpinnerAdapter.kt | 2 +- .../fitness/dialog/LogWorkoutDialog.kt | 15 ++- .../com/bodyweight/fitness/model/Routine.kt | 4 +- .../fitness/repository/Repository.kt | 62 +++++----- .../fitness/stream/RoutineStream.kt | 6 +- .../fitness/ui/ProgressExerciseActivity.kt | 1 - .../bodyweight/fitness/utils/Preferences.kt | 55 +++++++-- .../progress/ProgressGeneralViewPresenter.kt | 3 +- .../view/workout/RepsLoggerViewPresenter.kt | 3 +- .../view/workout/TimerViewPresenter.kt | 3 +- app/src/main/res/layout-port/view_timer.xml | 14 +-- .../res/layout/activity_progress_card.xml | 4 +- .../res/layout/activity_progress_card_set.xml | 8 +- .../res/layout/activity_progress_exercise.xml | 8 +- .../res/layout/activity_progress_general.xml | 12 +- .../res/layout/activity_progress_header.xml | 6 +- .../main/res/layout/activity_progress_set.xml | 2 +- .../res/layout/activity_progress_title.xml | 2 +- app/src/main/res/layout/view_calendar.xml | 16 +-- .../main/res/layout/view_calendar_card.xml | 8 +- .../main/res/layout/view_calendar_page.xml | 14 +-- .../main/res/layout/view_calendar_summary.xml | 22 ++-- .../res/layout/view_dashboard_category.xml | 2 +- .../res/layout/view_dashboard_double_item.xml | 4 +- .../res/layout/view_dashboard_section.xml | 4 +- .../res/layout/view_dashboard_single_item.xml | 4 +- .../res/layout/view_dialog_log_workout.xml | 6 +- .../layout/view_dialog_log_workout_set.xml | 6 +- .../view_dialog_log_workout_timed_set.xml | 6 +- .../main/res/layout/view_dialog_progress.xml | 2 +- app/src/main/res/layout/view_home.xml | 2 +- app/src/main/res/layout/view_timer.xml | 12 +- .../molding_mobility_flexibility_routine.json | 4 +- ...arting_stretching_flexibility_routine.json | 4 +- .../fitness/HomeViewPresenterSpec.kt | 4 +- build.gradle | 40 +++---- 45 files changed, 235 insertions(+), 553 deletions(-) delete mode 100644 app/src/androidTest/kotlin/com/bodyweight/fitness/MainActivityTest.kt delete mode 100644 app/src/main/java/com/bodyweight/fitness/exception/CacheDirectoryCreationException.java delete mode 100644 app/src/main/java/com/bodyweight/fitness/persistence/Duration.java delete mode 100644 app/src/main/java/com/bodyweight/fitness/persistence/Glacier.java delete mode 100644 app/src/main/java/com/bodyweight/fitness/persistence/file/FileObjectPersister.java diff --git a/app/build.gradle b/app/build.gradle index fa19a823..ca4f35f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,26 +1,25 @@ apply plugin: 'com.android.application' - apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' - apply plugin: 'realm-android' apply plugin: 'io.fabric' android { + defaultConfig { + vectorDrawables.useSupportLibrary = true + } + flavorDimensions "default" configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' } - dexOptions { maxProcessCount 4 } - - compileSdkVersion 25 - buildToolsVersion '23.0.3' + compileSdkVersion 26 defaultConfig { applicationId 'com.bodyweight.fitness' - minSdkVersion 16 - targetSdkVersion 25 + minSdkVersion 21 + targetSdkVersion 26 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } compileOptions { @@ -43,15 +42,12 @@ android { productFlavors { pro { resValue "string", "file_provider", "com.bodyweight.fitness.pro.fileprovider" - applicationId 'com.bodyweight.fitness.pro' versionCode 141 versionName "1.4.1" } - free { resValue "string", "file_provider", "com.bodyweight.fitness.free.fileprovider" - applicationId 'com.bodyweight.fitness.free' versionCode 141 versionName "1.4.1" @@ -61,17 +57,14 @@ android { release { minifyEnabled false } - debug { minifyEnabled false ext.enableCrashlytics = false } } - sourceSets { main.java.srcDirs += 'src/main/java' main.java.srcDirs += 'src/main/kotlin' - androidTest.java.srcDirs += 'src/androidTest/kotlin' test.java.srcDirs += 'src/test/kotlin' } } @@ -85,70 +78,45 @@ configurations { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - - testCompile 'org.jetbrains.spek:spek:1.0.9' - testCompile 'org.mockito:mockito-all:2.0.2-beta' + implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile "com.android.support:support-annotations:$support_version" - androidTestCompile 'com.android.support.test:runner:0.5' - androidTestCompile 'com.android.support.test:rules:0.5' - androidTestCompile "com.android.support.test.espresso:espresso-core:2.2.2" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - compile "com.android.support:support-v4:$support_version" - compile "com.android.support:recyclerview-v7:$support_version" - compile "com.android.support:cardview-v7:$support_version" - compile "com.android.support:design:$support_version" + testImplementation 'org.jetbrains.spek:spek:1.0.9' + testImplementation 'org.mockito:mockito-all:2.0.2-beta' - compile 'com.google.code.gson:gson:2.4' + androidTestImplementation "com.android.support:support-annotations:$support_version" + androidTestImplementation 'com.android.support.test:runner:0.5' + androidTestImplementation 'com.android.support.test:rules:0.5' + androidTestImplementation "com.android.support.test.espresso:espresso-core:2.2.2" - compile 'commons-io:commons-io:2.4' - compile 'net.danlew:android.joda:2.9.3' + implementation "com.android.support:support-v4:$support_version" + implementation "com.android.support:recyclerview-v7:$support_version" + implementation "com.android.support:cardview-v7:$support_version" + implementation "com.android.support:design:$support_version" - compile 'com.netflix.rxjava:rxjava-core:0.20.7' - compile 'io.reactivex:rxandroid:1.2.1' - compile 'io.reactivex:rxjava:1.2.1' + implementation 'com.google.code.gson:gson:2.4' - compile 'com.trello:rxlifecycle:0.8.0' - compile 'com.trello:rxlifecycle-components:0.8.0' - compile 'com.trello:rxlifecycle-kotlin:0.8.0' + implementation 'commons-io:commons-io:2.4' + implementation 'net.danlew:android.joda:2.9.3' - compile 'com.robinhood.spark:spark:1.1.2' + implementation 'com.netflix.rxjava:rxjava-core:0.20.7' + implementation 'io.reactivex:rxandroid:1.2.1' + implementation 'io.reactivex:rxjava:1.2.1' - compile 'com.roughike:bottom-bar:2.0.2' - compile 'com.github.johnkil.android-robototextview:robototextview:2.5.1' - compile 'com.gordonwong:material-sheet-fab:1.2.1' - compile 'io.github.kobakei:ratethisapp:1.0.3' - compile 'com.github.paolorotolo:appintro:4.1.0' + implementation 'com.trello:rxlifecycle:0.8.0' + implementation 'com.trello:rxlifecycle-components:0.8.0' + implementation 'com.trello:rxlifecycle-kotlin:0.8.0' - compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { - transitive = true; - } + implementation 'com.robinhood.spark:spark:1.2.0' - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -} + implementation 'com.roughike:bottom-bar:2.0.2' + implementation 'com.github.johnkil.android-robototextview:robototextview:4.0.0' + implementation 'com.gordonwong:material-sheet-fab:1.2.1' + implementation 'io.github.kobakei:ratethisapp:1.0.3' + implementation 'com.github.paolorotolo:appintro:4.1.0' -buildscript { - ext.support_version = '25.1.0' - ext.kotlin_version = '1.0.4' - repositories { - mavenCentral() - maven { - url "http://repository.jetbrains.com/all" - } - maven { url 'https://maven.fabric.io/public' } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'io.fabric.tools:gradle:1.+' + implementation('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { + transitive = true } } - -repositories { - mavenCentral() - maven { - url "http://repository.jetbrains.com/all" - } - maven { url 'https://maven.fabric.io/public' } -} \ No newline at end of file diff --git a/app/src/androidTest/kotlin/com/bodyweight/fitness/MainActivityTest.kt b/app/src/androidTest/kotlin/com/bodyweight/fitness/MainActivityTest.kt deleted file mode 100644 index bdd07133..00000000 --- a/app/src/androidTest/kotlin/com/bodyweight/fitness/MainActivityTest.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.bodyweight.fitness - -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.matcher.ViewMatchers -import android.support.test.espresso.matcher.ViewMatchers.* -import android.test.ActivityInstrumentationTestCase2 - -import com.bodyweight.fitness.ui.MainActivity - -class MainActivityTest : ActivityInstrumentationTestCase2(MainActivity::class.java) { - override fun setUp() { - super.setUp() - - activity - } - - fun testExerciseSetup() { - onView(withId(R.id.title)) - .check(matches(withText("Shoulder Rolls"))) - onView(withId(R.id.description)) - .check(matches(withText("1x(5-10)"))) - - onView(withId(R.id.prev_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.INVISIBLE))); - onView(withId(R.id.next_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - - onView(withId(R.id.next_exercise_button)).perform(click()) - - onView(withId(R.id.title)) - .check(matches(withText("Scapular Shrugs"))) - onView(withId(R.id.description)) - .check(matches(withText("1x(5-10)"))) - - onView(withId(R.id.prev_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.next_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - - onView(withId(R.id.next_exercise_button)).perform(click()) - onView(withId(R.id.next_exercise_button)).perform(click()) - onView(withId(R.id.next_exercise_button)).perform(click()) - onView(withId(R.id.next_exercise_button)).perform(click()) - onView(withId(R.id.next_exercise_button)).perform(click()) - - onView(withId(R.id.title)) - .check(matches(withText("Front Leg Swings"))) - onView(withId(R.id.description)) - .check(matches(withText("1x(5-10)"))) - - onView(withId(R.id.prev_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - onView(withId(R.id.next_exercise_button)) - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bodyweight/fitness/exception/CacheDirectoryCreationException.java b/app/src/main/java/com/bodyweight/fitness/exception/CacheDirectoryCreationException.java deleted file mode 100644 index a037c737..00000000 --- a/app/src/main/java/com/bodyweight/fitness/exception/CacheDirectoryCreationException.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.bodyweight.fitness.exception; - -public class CacheDirectoryCreationException extends Exception { - public CacheDirectoryCreationException(String detailMessage) { - super(detailMessage); - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bodyweight/fitness/persistence/Duration.java b/app/src/main/java/com/bodyweight/fitness/persistence/Duration.java deleted file mode 100644 index 879be5ee..00000000 --- a/app/src/main/java/com/bodyweight/fitness/persistence/Duration.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.bodyweight.fitness.persistence; - -public interface Duration { - /** - * Always ignore cache and treat it as expired (callback is executed). - */ - long ALWAYS_EXPIRED = -1; - - /** - * We do not care how old the cache is, we just want to return it unless there is completely - * nothing there. - */ - long ALWAYS_RETURNED = 0; - - long ONE_SECOND = 1000; - long ONE_MINUTE = 60 * ONE_SECOND; - long ONE_HOUR = 60 * ONE_MINUTE; - long ONE_DAY = 24 * ONE_HOUR; - long ONE_WEEK = 7 * ONE_DAY; -} \ No newline at end of file diff --git a/app/src/main/java/com/bodyweight/fitness/persistence/Glacier.java b/app/src/main/java/com/bodyweight/fitness/persistence/Glacier.java deleted file mode 100644 index f1faf9b6..00000000 --- a/app/src/main/java/com/bodyweight/fitness/persistence/Glacier.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.bodyweight.fitness.persistence; - -import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; - -import com.bodyweight.fitness.persistence.file.FileObjectPersister; - -import java.io.File; -import java.util.HashMap; - -import rx.Observable; -import rx.subjects.PublishSubject; - -public class Glacier { - public interface Callback { - T onCacheNotFound(); - } - - private static FileObjectPersister mFileObjectPersister; - - private static HashMap hashMap = new HashMap(); - - public synchronized static void init() { - mFileObjectPersister = new FileObjectPersister(); - - try { - mFileObjectPersister.setCacheDirectory(new File("cache")); - } catch (Exception e) { - System.out.println("Exception: " + e.getMessage()); - } - } - - public synchronized static void init(@NonNull Context context) { - mFileObjectPersister = new FileObjectPersister(); - - try { - mFileObjectPersister.setCacheDirectory(context); - } catch (Exception e) { - System.out.println("Exception: " + e.getMessage()); - } - } - - public synchronized static void removeAllDataFromCache() { - mFileObjectPersister.removeAllDataFromCache(); - } - - public synchronized static Observable getObservable(String cacheKey, Class dataType) { - if(!hashMap.containsKey(cacheKey)) { - PublishSubject publishSubject = PublishSubject.create(); - - hashMap.put(cacheKey, publishSubject); - } - - return hashMap.get(cacheKey); - } - - /** - * Put object into cache with given cache key used later to retrieve it. - * - * @param cacheKey cache key in format [a-z0-9]. - * @param data data type, e.g. String.class. - */ - public synchronized static void put(@NonNull String cacheKey, @NonNull T data) { - try { - mFileObjectPersister.putDataInCache(cacheKey, data); - - if(hashMap.containsKey(cacheKey)) { - hashMap.get(cacheKey).onNext(data); - } - } catch (Exception e) { - System.out.println("Exception: " + e.getMessage()); - } - } - - @Nullable - public synchronized static T get(@NonNull String cacheKey, @NonNull Class dataType) { - return (T) mFileObjectPersister.getDataFromCache(cacheKey, dataType, Duration.ALWAYS_RETURNED); - } - - @Nullable - public synchronized static T get(@NonNull String cacheKey, @NonNull Class dataType, @NonNull long cacheDuration) { - return (T) mFileObjectPersister.getDataFromCache(cacheKey, dataType, cacheDuration); - } - - @NonNull - public synchronized static T getOrElse(@NonNull String cacheKey, @NonNull Class dataType, - @NonNull long cacheDuration, @NonNull Callback callback) { - T cacheObject = (T) mFileObjectPersister.getDataFromCache(cacheKey, dataType, cacheDuration); - - if(cacheObject == null) { - cacheObject = callback.onCacheNotFound(); - - put(cacheKey, cacheObject); - } - - return cacheObject; - } - - @NonNull - public synchronized static T getOrElse(@NonNull String cacheKey, @NonNull Class dataType, - @NonNull Callback callback) { - T cacheObject = (T) mFileObjectPersister.getDataFromCache(cacheKey, dataType, Duration.ALWAYS_RETURNED); - - if(cacheObject == null) { - cacheObject = callback.onCacheNotFound(); - - put(cacheKey, cacheObject); - } - - return cacheObject; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bodyweight/fitness/persistence/file/FileObjectPersister.java b/app/src/main/java/com/bodyweight/fitness/persistence/file/FileObjectPersister.java deleted file mode 100644 index 3153e2b4..00000000 --- a/app/src/main/java/com/bodyweight/fitness/persistence/file/FileObjectPersister.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.bodyweight.fitness.persistence.file; - -import android.content.Context; -import android.support.annotation.NonNull; - -import com.bodyweight.fitness.exception.CacheDirectoryCreationException; -import com.bodyweight.fitness.persistence.Duration; - -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -public class FileObjectPersister { - private static final String CACHE_DIRECTORY = "glacier-cache"; - - private File mCacheDirectory; - - public synchronized void setCacheDirectory(@NonNull Context context) throws CacheDirectoryCreationException { - if(mCacheDirectory == null) { - mCacheDirectory = new File(context.getCacheDir(), CACHE_DIRECTORY); - } - - if(!mCacheDirectory.exists() && !mCacheDirectory.mkdirs()) { - throw new CacheDirectoryCreationException("Cache Directory could not be created."); - } - } - - public synchronized void setCacheDirectory(@NonNull File baseCacheDirectory) throws CacheDirectoryCreationException { - if(mCacheDirectory == null) { - mCacheDirectory = new File(baseCacheDirectory, CACHE_DIRECTORY); - } - - if(!mCacheDirectory.exists() && !mCacheDirectory.mkdirs()) { - throw new CacheDirectoryCreationException("Cache Directory could not be created."); - } - } - - public File getCacheDirectory() { - return mCacheDirectory; - } - - public synchronized boolean putDataInCache(@NonNull String cacheKey, @NonNull T data) throws IOException { - if(cacheKey == null || data == null) { - return false; - } - - try { - FileOutputStream fileOutputStream = new FileOutputStream(new File(mCacheDirectory, - createFileName(cacheKey, data.getClass()))); - - ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); - - objectOutputStream.writeObject(data); - objectOutputStream.close(); - - return true; - } catch (Exception e) { - System.out.println("Exception: " + e.getMessage()); - } - - return false; - } - - public synchronized Object getDataFromCache(@NonNull String cacheKey, - @NonNull Class dataType, long duration) { - T object = null; - - try { - File file = new File(mCacheDirectory, createFileName(cacheKey, dataType)); - - if(!file.exists() || !isCacheValid(file.lastModified(), duration)) { - return null; - } - - FileInputStream fileInputStream = new FileInputStream(file); - - ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); - - object = (T) objectInputStream.readObject(); - - objectInputStream.close(); - } catch (Exception e) { - System.out.println("Exception: " + e.getMessage()); - } - - return object; - - } - - public String createFileName(@NonNull String cacheKey, @NonNull Class dataType) { - return "Class." + dataType.getName() + ".With.Key." + (cacheKey.hashCode()); - } - - public boolean isCacheValid(@NonNull long fileLastModified, @NonNull long duration) { - long timeInCache = System.currentTimeMillis() - fileLastModified; - - return (duration == Duration.ALWAYS_RETURNED || timeInCache <= duration); - } - - public synchronized void removeAllDataFromCache() { - try { - FileUtils.cleanDirectory(mCacheDirectory); - } catch (IOException e) { - System.out.println("Exception: " + e.getMessage()); - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/bodyweight/fitness/App.kt b/app/src/main/kotlin/com/bodyweight/fitness/App.kt index 00016c9d..758ef280 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/App.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/App.kt @@ -3,7 +3,6 @@ package com.bodyweight.fitness import android.app.Application import android.content.Context -import com.bodyweight.fitness.persistence.Glacier import com.bodyweight.fitness.repository.SchemaMigration import com.crashlytics.android.Crashlytics @@ -23,7 +22,6 @@ class App : Application() { override fun onCreate() { super.onCreate() - Glacier.init(applicationContext) JodaTimeAndroid.init(applicationContext) val config = RateThisApp.Config(2, 7) diff --git a/app/src/main/kotlin/com/bodyweight/fitness/Constants.kt b/app/src/main/kotlin/com/bodyweight/fitness/Constants.kt index dc77fce9..73c5df77 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/Constants.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/Constants.kt @@ -18,6 +18,7 @@ object Constants { val preferencesKeepScreenOnKey = "PREFERENCE_KEEP_SCREEN_ON" val preferencesTimerKey = "PREFERENCE_TIMER_KEY_" val preferencesNumberOfRepsKey = "PREFERENCE_NUMBER_OF_REPS_KEY_" + val preferencesExerciseIdForSection = "PREFERENCE_EXERCISE_ID_FOR_SECTION_" val preferencesIntroductionShown = "PREFERENCE_INTRODUCTION_SHOWN" val preferencesShowRestTimer = "PREFERENCE_SHOW_REST_TIMER" val preferencesRestTimerDefaultSeconds = "PREFERENCE_REST_TIMER_DEFAULT_SECONDS" diff --git a/app/src/main/kotlin/com/bodyweight/fitness/adapter/ProgressListAdapter.kt b/app/src/main/kotlin/com/bodyweight/fitness/adapter/ProgressListAdapter.kt index e718c72b..333148cb 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/adapter/ProgressListAdapter.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/adapter/ProgressListAdapter.kt @@ -129,7 +129,6 @@ class ProgressHeaderPresenter(itemView: View) : ProgressPresenter(itemView) { completionRateGraphView.scrubLineColor = Color.parseColor("#111111") completionRateGraphView.baseLineColor = Color.WHITE completionRateGraphView.isScrubEnabled = true - completionRateGraphView.animateChanges = true completionRateTabLayout.addTab(completionRateTabLayout.newTab().setText("1W")) completionRateTabLayout.addTab(completionRateTabLayout.newTab().setText("1M")) diff --git a/app/src/main/kotlin/com/bodyweight/fitness/adapter/ToolbarSpinnerAdapter.kt b/app/src/main/kotlin/com/bodyweight/fitness/adapter/ToolbarSpinnerAdapter.kt index 14cee871..c0a21b00 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/adapter/ToolbarSpinnerAdapter.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/adapter/ToolbarSpinnerAdapter.kt @@ -64,7 +64,7 @@ class ToolbarSpinnerAdapter : BaseAdapter() { view.tag = "DROPDOWN" } - val textView = view!!.findViewById(android.R.id.text1) as TextView + val textView: TextView = view!!.findViewById(android.R.id.text1) textView.text = getTitle(position) return view diff --git a/app/src/main/kotlin/com/bodyweight/fitness/dialog/LogWorkoutDialog.kt b/app/src/main/kotlin/com/bodyweight/fitness/dialog/LogWorkoutDialog.kt index 03eede00..b466ed7f 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/dialog/LogWorkoutDialog.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/dialog/LogWorkoutDialog.kt @@ -306,10 +306,9 @@ class LogWorkoutDialog : BottomSheetDialogFragment() { var set: RepositorySet? = null Repository.realm.executeTransaction { - set = Repository.realm.createObject(RepositorySet::class.java) + set = Repository.realm.createObject(RepositorySet::class.java, "Set-" + UUID.randomUUID().toString()) set?.let { - it.id = "Set-" + UUID.randomUUID().toString() it.isTimed = isTimed it.seconds = lastSet.seconds it.weight = lastSet.weight @@ -461,9 +460,9 @@ class LogWorkoutDialog : BottomSheetDialogFragment() { fun updateSet(repositorySet: RepositorySet, view: View, isTimed: Boolean = false) { if (isTimed) { - val secondsOnlyValue: TextView = view.findViewById(R.id.secondsOnlyValue) as TextView - val minutes: TextView = view.findViewById(R.id.minutesValue) as TextView - val seconds: TextView = view.findViewById(R.id.secondsValue) as TextView + val secondsOnlyValue: TextView = view.findViewById(R.id.secondsOnlyValue) + val minutes: TextView = view.findViewById(R.id.minutesValue) + val seconds: TextView = view.findViewById(R.id.secondsValue) val center: View = view.findViewById(R.id.center) if (repositorySet.seconds < 60) { @@ -493,9 +492,9 @@ class LogWorkoutDialog : BottomSheetDialogFragment() { seconds.text = repositorySet.seconds.formatSecondsPostfix() } } else { - val repsOnlyValue: TextView = view.findViewById(R.id.repsOnlyValue) as TextView - val reps: TextView = view.findViewById(R.id.repsValue) as TextView - val weight: TextView = view.findViewById(R.id.weightValue) as TextView + val repsOnlyValue: TextView = view.findViewById(R.id.repsOnlyValue) + val reps: TextView = view.findViewById(R.id.repsValue) + val weight: TextView = view.findViewById(R.id.weightValue) val center: View = view.findViewById(R.id.center) if (repositorySet.weight == 0.0) { diff --git a/app/src/main/kotlin/com/bodyweight/fitness/model/Routine.kt b/app/src/main/kotlin/com/bodyweight/fitness/model/Routine.kt index 5296cc89..dfe8e5a7 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/model/Routine.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/model/Routine.kt @@ -1,6 +1,6 @@ package com.bodyweight.fitness.model -import com.bodyweight.fitness.persistence.Glacier +import com.bodyweight.fitness.utils.Preferences import java.io.Serializable import java.util.* @@ -65,7 +65,7 @@ class Routine(JSONRoutine: JSONRoutine) : Serializable { exercises.add(exercise) if (currentSection.sectionMode === SectionMode.Levels || currentSection.sectionMode === SectionMode.Pick) { - val currentExerciseId = Glacier.get(currentSection.sectionId, String::class.java) + val currentExerciseId: String? = Preferences.getExerciseIdForSection(currentSection.sectionId) if (currentExerciseId != null) { if (exercise.exerciseId.matches(currentExerciseId.toRegex())) { diff --git a/app/src/main/kotlin/com/bodyweight/fitness/repository/Repository.kt b/app/src/main/kotlin/com/bodyweight/fitness/repository/Repository.kt index 86071919..5c59dabe 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/repository/Repository.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/repository/Repository.kt @@ -17,32 +17,37 @@ object Repository { private val realmName = "bodyweight.fitness.realm" val realm: Realm - get() = Realm.getInstance(RealmConfiguration.Builder(App.context) - .name(realmName) - .schemaVersion(2) - .migration { realm: DynamicRealm, oldVersion: Long, newVersion: Long -> - val schema = realm.schema - val routineSchema = schema.get("RepositoryRoutine") - - if (oldVersion.toInt() == 1) { - routineSchema - .addField("title", String::class.java) - .addField("subtitle", String::class.java) - .transform { obj: DynamicRealmObject -> - obj.set("title", "Bodyweight Fitness") - obj.set("subtitle", "Recommended Routine") - } + get() { + Realm.init(App.context) + + val configuration = RealmConfiguration.Builder() + .name(realmName) + .schemaVersion(2) + .migration { realm: DynamicRealm, oldVersion: Long, newVersion: Long -> + val schema = realm.schema + val routineSchema = schema.get("RepositoryRoutine") + + if (oldVersion.toInt() == 1) { + routineSchema + .addField("title", String::class.java) + .addField("subtitle", String::class.java) + .transform { obj: DynamicRealmObject -> + obj.set("title", "Bodyweight Fitness") + obj.set("subtitle", "Recommended Routine") + } + } } - } - .build()) + .build() + + return Realm.getInstance(configuration) + } fun buildRealmRoutine(routine: Routine): RepositoryRoutine { var repositoryRoutine: RepositoryRoutine? = null realm.executeTransaction { - repositoryRoutine = realm.createObject(RepositoryRoutine::class.java) + repositoryRoutine = realm.createObject(RepositoryRoutine::class.java, "Routine-" + UUID.randomUUID().toString()) repositoryRoutine?.let { - it.id = "Routine-" + UUID.randomUUID().toString() it.routineId = routine.routineId it.title = routine.title it.subtitle = routine.subtitle @@ -53,15 +58,14 @@ object Repository { var repositorySection: RepositorySection? = null for (exercise in routine.exercises) { - val repositoryExercise = realm.createObject(RepositoryExercise::class.java) - repositoryExercise.id = "Exercise-" + UUID.randomUUID().toString() + val repositoryExercise = realm.createObject(RepositoryExercise::class.java, "Exercise-" + UUID.randomUUID().toString()) repositoryExercise.exerciseId = exercise.exerciseId repositoryExercise.title = exercise.title repositoryExercise.description = exercise.description repositoryExercise.defaultSet = exercise.defaultSet - val repositorySet = realm.createObject(RepositorySet::class.java) - repositorySet.id = "Set-" + UUID.randomUUID().toString() + val repositorySetId = "Set-" + UUID.randomUUID().toString() + val repositorySet = realm.createObject(RepositorySet::class.java, repositorySetId) if (exercise.defaultSet == "weighted") { repositorySet.isTimed = false @@ -77,8 +81,7 @@ object Repository { repositoryExercise.sets.add(repositorySet) if (repositoryCategory == null || !repositoryCategory.title.equals(exercise.category!!.title, ignoreCase = true)) { - repositoryCategory = realm.createObject(RepositoryCategory::class.java) - repositoryCategory!!.id = "Category-" + UUID.randomUUID().toString() + repositoryCategory = realm.createObject(RepositoryCategory::class.java, "Category-" + UUID.randomUUID().toString()) repositoryCategory.categoryId = exercise.category!!.categoryId repositoryCategory.title = exercise.category!!.title repositoryCategory.routine = repositoryRoutine @@ -87,8 +90,7 @@ object Repository { } if (repositorySection == null || !repositorySection.title.equals(exercise.section!!.title, ignoreCase = true)) { - repositorySection = realm.createObject(RepositorySection::class.java) - repositorySection!!.id = "Section-" + UUID.randomUUID().toString() + repositorySection = realm.createObject(RepositorySection::class.java, "Section-" + UUID.randomUUID().toString()) repositorySection.sectionId = exercise.section!!.sectionId repositorySection.title = exercise.section!!.title repositorySection.mode = exercise.section!!.sectionMode.toString() @@ -96,7 +98,7 @@ object Repository { repositorySection.category = repositoryCategory it.sections.add(repositorySection) - repositoryCategory.sections.add(repositorySection) + repositoryCategory!!.sections.add(repositorySection) } repositoryExercise.routine = repositoryRoutine @@ -117,8 +119,8 @@ object Repository { } it.exercises.add(repositoryExercise) - repositoryCategory.exercises.add(repositoryExercise) - repositorySection.exercises.add(repositoryExercise) + repositoryCategory!!.exercises.add(repositoryExercise) + repositorySection!!.exercises.add(repositoryExercise) } } } diff --git a/app/src/main/kotlin/com/bodyweight/fitness/stream/RoutineStream.kt b/app/src/main/kotlin/com/bodyweight/fitness/stream/RoutineStream.kt index 14674672..d8fea7ae 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/stream/RoutineStream.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/stream/RoutineStream.kt @@ -2,7 +2,6 @@ package com.bodyweight.fitness.stream import com.bodyweight.fitness.App import com.bodyweight.fitness.model.* -import com.bodyweight.fitness.persistence.Glacier import com.bodyweight.fitness.utils.Preferences import com.google.gson.Gson @@ -101,6 +100,9 @@ object RoutineStream { exercise = chosenExercise - Glacier.put(chosenExercise.section!!.sectionId, chosenExercise.section!!.currentExercise.exerciseId) + val sectionId = chosenExercise.section!!.sectionId + val exerciseId = chosenExercise.section!!.currentExercise.exerciseId + + Preferences.setExerciseIdForSection(sectionId, exerciseId) } } diff --git a/app/src/main/kotlin/com/bodyweight/fitness/ui/ProgressExerciseActivity.kt b/app/src/main/kotlin/com/bodyweight/fitness/ui/ProgressExerciseActivity.kt index eb33169f..dc0284a2 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/ui/ProgressExerciseActivity.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/ui/ProgressExerciseActivity.kt @@ -69,7 +69,6 @@ class ProgressExerciseActivity : RxAppCompatActivity() { graph_view.baseLineColor = Color.WHITE graph_view.scrubLineColor = Color.parseColor("#111111") graph_view.isScrubEnabled = true - graph_view.animateChanges = false graph_view.setScrubListener { val data = it as? DateTimeRepositorySet diff --git a/app/src/main/kotlin/com/bodyweight/fitness/utils/Preferences.kt b/app/src/main/kotlin/com/bodyweight/fitness/utils/Preferences.kt index fae0a0ad..a4689c80 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/utils/Preferences.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/utils/Preferences.kt @@ -24,7 +24,7 @@ object Preferences { getSharedPreferences() .edit() .putBoolean(Constants.preferencesIntroductionShown, value) - .commit() + .apply() } var defaultRoutine: String @@ -37,7 +37,7 @@ object Preferences { getSharedPreferences() .edit() .putString(Constants.preferencesDefaultRoutineKey, value) - .commit() + .apply() } var showRestTimer: Boolean @@ -50,7 +50,7 @@ object Preferences { getSharedPreferences() .edit() .putBoolean(Constants.preferencesShowRestTimer, value) - .commit() + .apply() } var showRestTimerAfterWarmup: Boolean @@ -63,7 +63,7 @@ object Preferences { getSharedPreferences() .edit() .putBoolean(Constants.preferencesShowRestTimerAfterWarmup, value) - .commit() + .apply() } var showRestTimerAfterBodylineDrills: Boolean @@ -76,7 +76,7 @@ object Preferences { getSharedPreferences() .edit() .putBoolean(Constants.preferencesShowRestTimerAfterBodylineDrills, value) - .commit() + .apply() } var showRestTimerAfterFlexibilityExercises: Boolean @@ -89,7 +89,7 @@ object Preferences { getSharedPreferences() .edit() .putBoolean(Constants.preferencesShowRestTimerAfterFlexibilityExercises, value) - .commit() + .apply() } var restTimerDefaultSeconds: Int @@ -102,7 +102,7 @@ object Preferences { getSharedPreferences() .edit() .putString(Constants.preferencesRestTimerDefaultSeconds, value.toString()) - .commit() + .apply() } val weightMeasurementUnit: WeightMeasurementUnit @@ -129,19 +129,52 @@ object Preferences { } fun setTimerValue(exerciseId: String, value: Long) { - getSharedPreferences().edit().putLong(String.format("%s%s", Constants.preferencesTimerKey, exerciseId), value).commit() + getSharedPreferences().edit().putLong( + String.format("%s%s", Constants.preferencesTimerKey, exerciseId), + value + ).apply() } fun setNumberOfReps(exerciseId: String, value: Int) { - getSharedPreferences().edit().putInt(String.format("%s%s", Constants.preferencesNumberOfRepsKey, exerciseId), value).commit() + getSharedPreferences().edit().putInt( + String.format("%s%s", Constants.preferencesNumberOfRepsKey, exerciseId), + value + ).apply() } fun getTimerValueForExercise(exerciseId: String, defaultValue: Long): Long { - return getSharedPreferences().getLong(String.format("%s%s", Constants.preferencesTimerKey, exerciseId), defaultValue) + return getSharedPreferences().getLong( + String.format("%s%s", Constants.preferencesTimerKey, exerciseId), + defaultValue + ) } fun getNumberOfRepsForExercise(exerciseId: String, defaultValue: Int): Int { - return getSharedPreferences().getInt(String.format("%s%s", Constants.preferencesNumberOfRepsKey, exerciseId), defaultValue) + return getSharedPreferences().getInt( + String.format("%s%s", Constants.preferencesNumberOfRepsKey, exerciseId), + defaultValue + ) + } + + fun setExerciseIdForSection(sectionId: String, exerciseId: String) { + getSharedPreferences().edit().putString( + String.format("%s%s", Constants.preferencesExerciseIdForSection, sectionId), + exerciseId + ).apply() + } + + fun getExerciseIdForSection(sectionId: String): String? { + val emptyId = "NULL" + val exerciseId = getSharedPreferences().getString( + String.format("%s%s", Constants.preferencesExerciseIdForSection, sectionId), + emptyId + ) + + return if (exerciseId == emptyId) { + null + } else { + exerciseId + } } private fun getSharedPreferences(): SharedPreferences { diff --git a/app/src/main/kotlin/com/bodyweight/fitness/view/progress/ProgressGeneralViewPresenter.kt b/app/src/main/kotlin/com/bodyweight/fitness/view/progress/ProgressGeneralViewPresenter.kt index 83fb9d88..711561cc 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/view/progress/ProgressGeneralViewPresenter.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/view/progress/ProgressGeneralViewPresenter.kt @@ -124,7 +124,7 @@ class ProgressGeneralViewPresenter : AbstractPresenter() { workoutLengthGraphView.baseLineColor = Color.WHITE workoutLengthGraphView.scrubLineColor = Color.parseColor("#111111") workoutLengthGraphView.isScrubEnabled = true - workoutLengthGraphView.animateChanges = true +// workoutLengthGraphView.animateChanges = true workoutLengthGraphView.setScrubListener { val dateTimeWorkoutLength = it as? DateTimeWorkoutLength @@ -231,7 +231,6 @@ class ProgressGeneralViewPresenter : AbstractPresenter() { completionRateGraphView.baseLineColor = Color.WHITE completionRateGraphView.scrubLineColor = Color.parseColor("#111111") completionRateGraphView.isScrubEnabled = true - completionRateGraphView.animateChanges = true completionRateGraphView.setScrubListener { val dateTimeCompletionRate = it as? DateTimeCompletionRate diff --git a/app/src/main/kotlin/com/bodyweight/fitness/view/workout/RepsLoggerViewPresenter.kt b/app/src/main/kotlin/com/bodyweight/fitness/view/workout/RepsLoggerViewPresenter.kt index 5dd03e21..6d770518 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/view/workout/RepsLoggerViewPresenter.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/view/workout/RepsLoggerViewPresenter.kt @@ -72,9 +72,8 @@ class RepsLoggerPresenter : AbstractPresenter() { Stream.setLoggedSetReps(SetReps(numberOfSets, numberOfReps)) } else { - val repositorySet = realm.createObject(RepositorySet::class.java) + val repositorySet = realm.createObject(RepositorySet::class.java, "Set-" + UUID.randomUUID().toString()) - repositorySet.id = "Set-" + UUID.randomUUID().toString() repositorySet.isTimed = false repositorySet.seconds = 0 repositorySet.weight = 0.0 diff --git a/app/src/main/kotlin/com/bodyweight/fitness/view/workout/TimerViewPresenter.kt b/app/src/main/kotlin/com/bodyweight/fitness/view/workout/TimerViewPresenter.kt index d5af76e0..aaec9f1e 100644 --- a/app/src/main/kotlin/com/bodyweight/fitness/view/workout/TimerViewPresenter.kt +++ b/app/src/main/kotlin/com/bodyweight/fitness/view/workout/TimerViewPresenter.kt @@ -245,9 +245,8 @@ class TimerPresenter : AbstractPresenter() { firstSet.seconds = logSeconds } } else { - val repositorySet = realm.createObject(RepositorySet::class.java) + val repositorySet = realm.createObject(RepositorySet::class.java, "Set-" + UUID.randomUUID().toString()) - repositorySet.id = "Set-" + UUID.randomUUID().toString() repositorySet.isTimed = true repositorySet.seconds = logSeconds repositorySet.weight = 0.0 diff --git a/app/src/main/res/layout-port/view_timer.xml b/app/src/main/res/layout-port/view_timer.xml index 9f99f6d7..210822cb 100644 --- a/app/src/main/res/layout-port/view_timer.xml +++ b/app/src/main/res/layout-port/view_timer.xml @@ -47,7 +47,7 @@ android:gravity="center|bottom" android:textSize="16sp" android:text="5-5-X" - app:typeface="roboto_bold" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" /> diff --git a/app/src/main/res/layout/activity_progress_card.xml b/app/src/main/res/layout/activity_progress_card.xml index 7dd4a1a0..83f2ab46 100644 --- a/app/src/main/res/layout/activity_progress_card.xml +++ b/app/src/main/res/layout/activity_progress_card.xml @@ -35,7 +35,7 @@ android:text="Pullup" android:textSize="20sp" android:textColor="@color/value_text" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_progress_exercise.xml b/app/src/main/res/layout/activity_progress_exercise.xml index 57174a15..42317365 100644 --- a/app/src/main/res/layout/activity_progress_exercise.xml +++ b/app/src/main/res/layout/activity_progress_exercise.xml @@ -71,7 +71,7 @@ android:text="Tuesday, 24 May 2016" android:textSize="20sp" android:textColor="@color/label_text" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_light"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_light"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_progress_title.xml b/app/src/main/res/layout/activity_progress_title.xml index c2c35d2c..25aee6c5 100644 --- a/app/src/main/res/layout/activity_progress_title.xml +++ b/app/src/main/res/layout/activity_progress_title.xml @@ -15,5 +15,5 @@ android:textColor="@color/label_text" android:textSize="16sp" android:text="Dynamic Stretches" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_calendar.xml b/app/src/main/res/layout/view_calendar.xml index 9a365e89..6bf962db 100644 --- a/app/src/main/res/layout/view_calendar.xml +++ b/app/src/main/res/layout/view_calendar.xml @@ -38,7 +38,7 @@ android:textColor="@color/primaryDark" android:textSize="11sp" android:textAllCaps="true" - app:typeface="roboto_light" + app:robotoTypeface="roboto_light" android:text="Mon"/> @@ -133,7 +133,7 @@ android:textColor="#676767" android:textSize="14sp" android:text="When you log a workout, you'll see it here." - app:typeface="roboto_regular" /> + app:robotoTypeface="roboto_regular" /> \ No newline at end of file diff --git a/app/src/main/res/layout/view_calendar_card.xml b/app/src/main/res/layout/view_calendar_card.xml index fea67405..52ebc7ad 100644 --- a/app/src/main/res/layout/view_calendar_card.xml +++ b/app/src/main/res/layout/view_calendar_card.xml @@ -35,7 +35,7 @@ android:textSize="15sp" android:textColor="@color/label_text" android:text="Recommended Routine" - app:typeface="roboto_regular" /> + app:robotoTypeface="roboto_regular" /> + app:robotoTypeface="roboto_medium" /> + app:robotoTypeface="roboto_medium" /> + app:robotoTypeface="roboto_medium" /> \ No newline at end of file diff --git a/app/src/main/res/layout/view_calendar_page.xml b/app/src/main/res/layout/view_calendar_page.xml index 9ebc6403..597200d1 100644 --- a/app/src/main/res/layout/view_calendar_page.xml +++ b/app/src/main/res/layout/view_calendar_page.xml @@ -23,7 +23,7 @@ android:gravity="center_horizontal" android:textColor="@color/black" android:textSize="15sp" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular" /> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_calendar_summary.xml b/app/src/main/res/layout/view_calendar_summary.xml index 53cd48c8..d5743256 100644 --- a/app/src/main/res/layout/view_calendar_summary.xml +++ b/app/src/main/res/layout/view_calendar_summary.xml @@ -39,7 +39,7 @@ android:textSize="65sp" android:textColor="#F3F3F3" android:text="3" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_bold"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> @@ -155,7 +155,7 @@ android:textSize="25sp" android:textColor="#3E3E3E" android:text="5 workouts" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> diff --git a/app/src/main/res/layout/view_dashboard_category.xml b/app/src/main/res/layout/view_dashboard_category.xml index bb8bd2ad..a47a04eb 100644 --- a/app/src/main/res/layout/view_dashboard_category.xml +++ b/app/src/main/res/layout/view_dashboard_category.xml @@ -30,7 +30,7 @@ android:textSize="18dp" android:textColor="#111" android:layout_gravity="center" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_dashboard_double_item.xml b/app/src/main/res/layout/view_dashboard_double_item.xml index 6534b6cf..1a9d816e 100644 --- a/app/src/main/res/layout/view_dashboard_double_item.xml +++ b/app/src/main/res/layout/view_dashboard_double_item.xml @@ -39,7 +39,7 @@ android:layout_gravity="center" android:textSize="16dp" android:textColor="#4D4D4D" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_dashboard_section.xml b/app/src/main/res/layout/view_dashboard_section.xml index bc4f2f3a..e8d87209 100644 --- a/app/src/main/res/layout/view_dashboard_section.xml +++ b/app/src/main/res/layout/view_dashboard_section.xml @@ -30,7 +30,7 @@ android:textSize="18dp" android:textColor="#999999" android:layout_gravity="center" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_light"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_dashboard_single_item.xml b/app/src/main/res/layout/view_dashboard_single_item.xml index 03605dce..8772805b 100644 --- a/app/src/main/res/layout/view_dashboard_single_item.xml +++ b/app/src/main/res/layout/view_dashboard_single_item.xml @@ -36,7 +36,7 @@ android:layout_gravity="center" android:textSize="16dp" android:textColor="#4D4D4D" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_bold"/> \ No newline at end of file diff --git a/app/src/main/res/layout/view_dialog_log_workout.xml b/app/src/main/res/layout/view_dialog_log_workout.xml index 39884e6a..25f1059a 100644 --- a/app/src/main/res/layout/view_dialog_log_workout.xml +++ b/app/src/main/res/layout/view_dialog_log_workout.xml @@ -200,7 +200,7 @@ android:textColor="#111" android:textSize="18sp" android:text="Previous Workout" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> diff --git a/app/src/main/res/layout/view_dialog_log_workout_timed_set.xml b/app/src/main/res/layout/view_dialog_log_workout_timed_set.xml index 4a34efa2..902d10b1 100644 --- a/app/src/main/res/layout/view_dialog_log_workout_timed_set.xml +++ b/app/src/main/res/layout/view_dialog_log_workout_timed_set.xml @@ -16,7 +16,7 @@ android:textColor="@color/black" android:textSize="15dp" android:visibility="gone" - app:typeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> diff --git a/app/src/main/res/layout/view_dialog_progress.xml b/app/src/main/res/layout/view_dialog_progress.xml index e234ceef..430c1596 100644 --- a/app/src/main/res/layout/view_dialog_progress.xml +++ b/app/src/main/res/layout/view_dialog_progress.xml @@ -61,7 +61,7 @@ android:layout_alignLeft="@+id/level_progress_bar" android:layout_alignRight="@+id/level_progress_bar" android:layout_alignBottom="@+id/level_progress_bar" - app:typeface="roboto_bold"/> + app:robotoTypeface="roboto_bold"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" /> + app:robotoTypeface="roboto_bold" /> + app:robotoTypeface="roboto_light" />