Skip to content

Commit

Permalink
patch light theme bug & improve chord screen UI & add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vipe1375 committed Jul 30, 2024
1 parent ae30128 commit 0d905bf
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ local.properties
*.db
*.sqlite
Introduction Statement Cheat Sheet US Letter (1).pdf
/private
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## What's Kords ?

Kords is an app for ukulele players, which aims to help finding how to play chords and also find their names, using how they're played.

## How does it work ?

- __Find how to play a chord :__ write the chord's name into the search bar using english notation (i.e. : a `G minor` chord should be searched as `Gm`).
- __Find the name of a chord :__ use the buttons to build your chord, and let their app show its name.

## Where is it available ?

Currently available only on Android, in French and English.

## What can I do if I spot a bug, or have an idea ?

You can contact me on Discord at `vipe1375` on or X/Twitter at `@vipe1375`
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "com.vipedev.kords"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
versionCode = 2
versionName = "1.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.plus(listOf("en", "fr"))
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/com/vipedev/kords/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Email
import androidx.compose.material.icons.filled.Home
Expand Down Expand Up @@ -71,8 +72,12 @@ class MainActivity : ComponentActivity() {
val dataStore = StorePreferences(LocalContext.current)
val useSystemTheme : Boolean = dataStore.getUseSystemTheme.collectAsState(initial = true).value!!
val useDarkTheme : Boolean = dataStore.getUseDarkTheme.collectAsState(initial = true).value!!

KordsJetpackTheme (darkTheme = (useSystemTheme || (!useSystemTheme && useDarkTheme))) {
val darkTheme: Boolean = if (useSystemTheme) {
isSystemInDarkTheme()
} else {
useDarkTheme
}
KordsJetpackTheme (darkTheme = darkTheme) {
val items = listOf(
BottomNavigationItem(title = stringResource(id = R.string.chords_nav_item),
selectedIcon = Icons.Filled.Home,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun Separator(text: String) {
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 20.dp)
.padding(vertical = 15.dp)
) {
Icon(
painter = painterResource(id = R.drawable.barre3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,19 @@ class ChordsViewModel(
var textState by mutableStateOf(value = "") // value of text
private set

var searchResult by mutableStateOf(mutableListOf(Chord()))
var searchResult by mutableStateOf(mutableListOf(Chord())) // list of chords found by name
private set

var visualizedID by mutableIntStateOf(1)
var visualizedID by mutableIntStateOf(1) // id of the currently visualized chord

var showVisualizeButton by mutableStateOf(false)
var showVisualizeButton by mutableStateOf(false) // show visualized button or not when a chord is searched

fun changeCurrentChord(newChord: MutableList<String>) {
/**
* update currentChord ID to the given ID
* @param newChord
*/
searched = false
currentChord = newChord

val dbResult = chordsDao.getChordsByFingers(currentChord.joinToString("-"))
Expand All @@ -76,7 +77,7 @@ class ChordsViewModel(
searched = false
}

private fun resetChordSearched() {
fun resetChordSearched() {
chordSearched = ""
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ fun SearchByID(viewModel: ChordsViewModel) {

// SEARCH TEXT //


Text(
text = stringResource(id = R.string.find_chord_text),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.padding(8.dp)
modifier = Modifier.padding(5.dp)
)

Spacer(modifier = Modifier.height(10.dp))
Expand Down Expand Up @@ -114,7 +115,7 @@ fun SearchByID(viewModel: ChordsViewModel) {
for (i in 1 until 15) {
Box(
modifier = Modifier
.padding(vertical = 20.dp)
.padding(vertical = 15.dp)
.fillMaxWidth(),
contentAlignment = Alignment.Center,
) {
Expand All @@ -139,6 +140,8 @@ fun SearchByID(viewModel: ChordsViewModel) {
inputChordList[j] = "0"
inputChord = inputChordList.joinToString("-")
viewModel.changeCurrentChord(inputChordList)
viewModel.resetChordSearched()

},
shape = CircleShape,
modifier = Modifier
Expand All @@ -156,6 +159,7 @@ fun SearchByID(viewModel: ChordsViewModel) {
inputChordList[j] = i.toString()
inputChord = inputChordList.joinToString("-")
viewModel.changeCurrentChord(inputChordList)
viewModel.resetChordSearched()
},
shape = CircleShape,
modifier = Modifier
Expand Down
File renamed without changes
File renamed without changes

0 comments on commit 0d905bf

Please sign in to comment.