This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ir.baha.km_lib | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.activity.enableEdgeToEdge | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.material3.Scaffold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation(libs.ir.baha) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
km = "1.0.2" | |
ir-baha = { group = "ir.baha", name = "shared-android", version.ref = "km" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pluginManagement { | |
repositories { | |
google { | |
content { | |
includeGroupByRegex("com\\.android.*") | |
includeGroupByRegex("com\\.google.*") | |
includeGroupByRegex("androidx.*") | |
} | |
} | |
mavenCentral() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
alias(libs.plugins.kotlinMultiplatform) | |
alias(libs.plugins.androidLibrary) | |
id("maven-publish") | |
} | |
group = "ir.baha" | |
version = "1.0.2" | |
kotlin { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishing { | |
repositories { | |
maven { | |
name = "GitHubPackages" | |
url = uri("https://maven.pkg.github.com/alibahaaa/km") | |
credentials { | |
username = "github_user_name" | |
password = "github_token" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishLibraryVariants("release", "debug") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id("maven-publish") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "# km" >> README.md | |
git init | |
git add . | |
git commit -m "first commit" | |
git branch -M main | |
git remote add origin https://github.com/alibahaaa/km.git | |
git push -u origin main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MusicPlayerFacade { | |
private val player = MediaPlayer() | |
private val playlist = Playlist() | |
fun play(song: Song) { | |
playlist.clear() | |
playlist.addSong(song) | |
player.reset() | |
player.setDataSource(song.filePath) | |
player.prepare() |
NewerOlder