Skip to content

Commit

Permalink
Merge pull request #23 from nwagu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
nwagu authored Jun 21, 2021
2 parents 99abeb4 + 3ed62a2 commit 882eb6a
Show file tree
Hide file tree
Showing 35 changed files with 877 additions and 474 deletions.
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "com.nwagu.android.chessboy"
minSdk = 21
targetSdk = 30
versionCode = 14
versionName = "3.4.0"
versionCode = 15
versionName = "3.5.0"
}
buildTypes {
getByName("release") {
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:theme="@style/AppTheme">

<activity
android:name="com.nwagu.android.chessboy.screens.MainActivity">
android:name="com.nwagu.android.chessboy.screens.main.view.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ import com.karumi.dexter.listener.PermissionDeniedResponse
import com.karumi.dexter.listener.PermissionGrantedResponse
import com.karumi.dexter.listener.PermissionRequest
import com.karumi.dexter.listener.single.PermissionListener
import com.nwagu.android.chessboy.screens.MainActivity
import com.nwagu.android.chessboy.screens.main.view.MainActivity
import com.nwagu.android.chessboy.constants.RequestCodes
import com.nwagu.android.chessboy.receiver.DeviceFoundReceiver
import com.nwagu.android.chessboy.vm.ScanState
import timber.log.Timber


class BluetoothController(
private val context: Activity
) {

val viewModel by lazy { (context as MainActivity).newbluetoothGameViewModel }
val viewModel by lazy { (context as MainActivity).newBluetoothGameViewModel }

val bluetoothAdapter = BluetoothAdapter.getDefaultAdapter()
val receiver: DeviceFoundReceiver by lazy { DeviceFoundReceiver(viewModel) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ sealed class BluetoothMessage {

abstract val value: String

class SyncRequest(val position: String): BluetoothMessage() {
class SyncRequest(val fen: String): BluetoothMessage() {
override val value: String
get() {
return "SYNC-$position"
return "SYNC-$fen"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.LocalContext
import com.nwagu.android.chessboy.dialogs.DialogStateViewModel.Companion.KEY_DIALOG_VISIBLE
import com.nwagu.android.chessboy.screens.Dialog
import com.nwagu.android.chessboy.screens.main.view.MainActivity
import com.nwagu.android.chessboy.screens.model.Dialog
import com.nwagu.android.chessboy.widgets.AlertDialogWrapper
import com.nwagu.android.chessboy.widgets.SelectPromotionPieceDialog
import com.nwagu.chess.enums.ChessPieceType
Expand All @@ -21,7 +22,7 @@ fun DialogHost(

val dialogStates by dialogController.getStates().collectAsState(hashMapOf())

val context = LocalContext.current
val context = LocalContext.current as MainActivity

fun getVisibility(key: String): Boolean {
return dialogStates[key]?.getBoolean(KEY_DIALOG_VISIBLE) ?: false
Expand Down

This file was deleted.

Loading

0 comments on commit 882eb6a

Please sign in to comment.