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
139 changes: 57 additions & 82 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,99 +1,74 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.devtools.ksp'
}

android {
signingConfigs {
config {
}
}
compileSdkVersion 33
buildToolsVersion '28.0.3'
namespace 'com.aricneto.twistytimer'
compileSdk 34

defaultConfig {
applicationId "com.aricneto.twistytimer"
minSdkVersion 16
targetSdkVersion 33
versionCode 60
versionName "4.7.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
resValue "string", "app_name", "Twisty Timer"
resValue "string", "file_provider_authority", "com.aricneto.twistytimer.fileprovider"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
resValue "string", "app_name", "Twisty Timer (Debug)"
resValue "string", "file_provider_authority", "com.aricneto.twistytimer.debug.fileprovider"
}
}
productFlavors {
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.github.thewca:tnoodle:v0.12.0'
implementation 'com.opencsv:opencsv:3.7'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.appcompat:appcompat-resources:1.1.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-rc01'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation "androidx.annotation:annotation:1.1.0"
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
implementation 'com.takisoft.fix:preference-v7:26.0.1.0'
implementation 'com.android.support:multidex:1.0.3'
// Butterknife ("apt" dependency is defined in root "build.gradle" script).
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
// Observable scrollview
implementation 'com.github.ksoichiro:android-observablescrollview:1.5.2'
// Dialogs
implementation('com.github.afollestad.material-dialogs:core:0.9.6.0@aar') {
transitive = true
kotlinOptions {
jvmTarget = '17'
}
implementation('com.github.afollestad.material-dialogs:commons:0.9.6.0@aar') {
transitive = true
}
// Material Drawer
implementation "com.mikepenz:materialdrawer:6.1.2"
// Progress
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
// Joda-time
implementation 'net.danlew:android.joda:2.9.4.1'
// Android SVG
implementation 'com.caverock:androidsvg:1.2.1'
// MPAndroidChart
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
// RippleBackground
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
// LicensesDialog
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.0'
// Inapp Billing
implementation 'com.anjlab.android.iab.v3:library:2.0.3'
// Material color picker
implementation 'com.pavelsikun:vintage-chroma:1.5'

testImplementation 'junit:junit:4.12'
}

repositories {
jcenter()
maven { url 'http://maven.google.com' }
maven { url 'https://jitpack.io' }
}
dependencies {
// Core Android dependencies
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'

// Material Design 3
implementation 'com.google.android.material:material:1.10.0'

// Architecture Components
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'

// Room Database
def room_version = "2.6.0"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
ksp "androidx.room:room-compiler:$room_version"

// Charts
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'

// Testing
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
13 changes: 13 additions & 0 deletions app/src/main/java/com/aricneto/twistytimer/data/model/Session.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.aricneto.twistytimer.data.model

import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "sessions")
data class Session(
@PrimaryKey(autoGenerate = true)
val id: Long = 0,
val name: String,
val eventType: EventType,
val createdAt: Long = System.currentTimeMillis()
)
36 changes: 36 additions & 0 deletions app/src/main/java/com/aricneto/twistytimer/data/model/Solve.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.aricneto.twistytimer.data.model

import androidx.room.Entity
import androidx.room.PrimaryKey
import java.util.Date

@Entity(tableName = "solves")
data class Solve(
@PrimaryKey(autoGenerate = true)
val id: Long = 0,
val time: Long, // Time in milliseconds
val date: Date,
val scramble: String,
val eventType: EventType,
val penalty: Penalty = Penalty.NONE,
val comment: String? = null,
val sessionId: Long,
val isDnf: Boolean = false,
val isPlusTwo: Boolean = false
)

enum class Penalty {
NONE,
PLUS_TWO,
DNF
}

enum class EventType {
CUBE_3X3,
CUBE_2X2,
CUBE_4X4,
CUBE_5X5,
ONE_HANDED,
BLINDFOLDED,
MEGAMINX
}