-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only notifies for permission loss when restarting
- Loading branch information
Showing
25 changed files
with
200 additions
and
261 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
46 changes: 45 additions & 1 deletion
46
...artautoclicker/feature/smart/config/ui/common/starters/RestartMediaProjectionViewModel.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,46 @@ | ||
package com.buzbuz.smartautoclicker.feature.smart.config.ui.common.starters | ||
/* | ||
* Copyright (C) 2024 Kevin Buzeau | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.buzbuz.smartautoclicker.feature.smart.config.ui.common.starters | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
|
||
import com.buzbuz.smartautoclicker.core.base.di.Dispatcher | ||
import com.buzbuz.smartautoclicker.core.base.di.HiltCoroutineDispatchers | ||
import com.buzbuz.smartautoclicker.core.processing.domain.DetectionRepository | ||
|
||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
|
||
@HiltViewModel | ||
class RestartMediaProjectionViewModel @Inject constructor( | ||
@Dispatcher(HiltCoroutineDispatchers.IO) private val ioDispatcher: CoroutineDispatcher, | ||
private val detectionRepository: DetectionRepository, | ||
) : ViewModel() { | ||
|
||
fun restartScreenRecord(context: Context, resultCode: Int, data: Intent) { | ||
viewModelScope.launch(ioDispatcher) { | ||
detectionRepository.startScreenRecord(context, resultCode, data) | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.