Skip to content

Commit

Permalink
Merge pull request #41 from techmaved/feature/info
Browse files Browse the repository at this point in the history
add info for version and link to github
  • Loading branch information
techmaved authored Jan 8, 2024
2 parents 9b5c7d5 + f6634f2 commit 1ece22a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,7 @@ dependencies {
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
ksp("com.google.auto.service:auto-service:1.1.1")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("com.mikepenz:iconics-core:5.4.0")
implementation("com.mikepenz:iconics-compose:5.4.0")
implementation("com.mikepenz:fontawesome-typeface:5.9.0.2-kotlin@aar")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import de.techmaved.mediabrowserforspotify.components.Authentication
import de.techmaved.mediabrowserforspotify.components.Database
import de.techmaved.mediabrowserforspotify.components.Info
import de.techmaved.mediabrowserforspotify.components.MediaItems
import de.techmaved.mediabrowserforspotify.components.SpotifyDesign
import de.techmaved.mediabrowserforspotify.models.Model
Expand Down Expand Up @@ -69,6 +70,7 @@ fun Ui(activity: MainActivity?, isAuthenticated: Boolean, isSpotifyInstalled: Bo
MediaItems().TextWithButtons(mediaItemCount, isAuthenticated)
MediaItems().MirrorSection(isAuthenticated)
SpotifyDesign().LinkToSpotify(isSpotifyInstalled, activity)
Info().getInfo()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package de.techmaved.mediabrowserforspotify.components

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.mikepenz.iconics.compose.Image
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesome
import de.techmaved.mediabrowserforspotify.BuildConfig
import de.techmaved.mediabrowserforspotify.R

class Info {
@Composable
fun getInfo() {
val context = LocalContext.current
val repoUrl = stringResource(R.string.github_repository)
val intent = remember { Intent(Intent.ACTION_VIEW, Uri.parse(repoUrl)) }

Row(
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text("Version: ${BuildConfig.VERSION_NAME}")
TextButton(
onClick = {
context.startActivity(intent)
}
) {
Row(
horizontalArrangement = Arrangement.spacedBy(10.dp),
verticalAlignment = Alignment.CenterVertically
) {
Image(
asset = FontAwesome.Icon.faw_github,
colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.primary)
)
Text("source code")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Divider
import androidx.compose.material3.Text
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
Expand Down Expand Up @@ -77,6 +78,7 @@ class SpotifyDesign {
}
}
}
Divider()
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<string name="get_spotify">GET SPOTIFY FREE</string>
<string name="open_spotify">OPEN SPOTIFY</string>
<string name="github_issues_link">https://github.com/techmaved/MediaBrowser-for-Spotify/issues</string>
<string name="github_repository">https://github.com/techmaved/MediaBrowser-for-Spotify</string>
</resources>

0 comments on commit 1ece22a

Please sign in to comment.