initial module restructuring
This commit is contained in:
parent
2dfaa354d7
commit
deec8934d8
|
@ -5,12 +5,11 @@ import androidx.activity.ComponentActivity
|
|||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.activity.viewModels
|
||||
import androidx.compose.material3.Text
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.ui.VideoPlayerUI
|
||||
import net.newpipe.newplayer.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.internal.ui.VideoPlayerUI
|
||||
import net.newpipe.newplayer.internal.ui.theme.VideoPlayerTheme
|
||||
|
||||
@AndroidEntryPoint
|
||||
class VideoPlayerActivity : ComponentActivity() {
|
||||
|
|
|
@ -34,10 +34,10 @@ import androidx.core.view.updateLayoutParams
|
|||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.ui.VideoPlayerUI
|
||||
import net.newpipe.newplayer.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.internal.ui.VideoPlayerUI
|
||||
import net.newpipe.newplayer.internal.ui.theme.VideoPlayerTheme
|
||||
|
||||
@AndroidEntryPoint
|
||||
class VideoPlayerFragment() : Fragment() {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer
|
||||
package net.newpipe.newplayer.internal
|
||||
|
||||
import android.app.Application
|
||||
import androidx.media3.common.Player
|
||||
|
@ -26,8 +26,6 @@ import androidx.media3.exoplayer.ExoPlayer
|
|||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ViewModelComponent
|
||||
import dagger.hilt.android.scopes.ViewModelScoped
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.model
|
||||
package net.newpipe.newplayer.internal.model
|
||||
|
||||
import android.app.Application
|
||||
import android.os.Build
|
||||
|
@ -40,7 +40,7 @@ import kotlinx.coroutines.flow.StateFlow
|
|||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import net.newpipe.newplayer.utils.VideoSize
|
||||
import net.newpipe.newplayer.internal.utils.VideoSize
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
val VIDEOPLAYER_UI_STATE = "video_player_ui_state"
|
|
@ -19,9 +19,8 @@
|
|||
*/
|
||||
|
||||
|
||||
package net.newpipe.newplayer.ui
|
||||
package net.newpipe.newplayer.internal.ui
|
||||
|
||||
import android.content.pm.ActivityInfo
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
|
@ -80,9 +79,8 @@ import androidx.compose.ui.unit.DpOffset
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import net.newpipe.newplayer.R
|
||||
import net.newpipe.newplayer.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.ui.theme.video_player_onSurface
|
||||
import net.newpipe.newplayer.utils.LockScreenOrientation
|
||||
import net.newpipe.newplayer.internal.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.internal.ui.theme.video_player_onSurface
|
||||
|
||||
@Composable
|
||||
fun VideoPlayerControllerUI(
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.ui
|
||||
package net.newpipe.newplayer.internal.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
|
@ -27,7 +27,6 @@ import androidx.activity.compose.BackHandler
|
|||
import androidx.activity.compose.ManagedActivityResultLauncher
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.IntentSenderRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material3.Surface
|
||||
|
@ -47,14 +46,13 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.VIEW_MODEL_STORE_OWNER_KEY
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import net.newpipe.newplayer.VideoPlayerActivity
|
||||
import net.newpipe.newplayer.model.VIDEOPLAYER_UI_STATE
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.utils.findActivity
|
||||
import net.newpipe.newplayer.internal.model.VIDEOPLAYER_UI_STATE
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModel
|
||||
import net.newpipe.newplayer.internal.model.VideoPlayerViewModelImpl
|
||||
import net.newpipe.newplayer.internal.ui.theme.VideoPlayerTheme
|
||||
import net.newpipe.newplayer.internal.utils.findActivity
|
||||
|
||||
@Composable
|
||||
fun VideoPlayerUI(
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.ui.theme
|
||||
package net.newpipe.newplayer.internal.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
|
@ -18,13 +18,12 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.ui.theme
|
||||
package net.newpipe.newplayer.internal.ui.theme
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
private val VideoPlayerColorScheme = darkColorScheme(
|
||||
primary = video_player_primary,
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.ui.theme
|
||||
package net.newpipe.newplayer.internal.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
|
@ -1,4 +1,4 @@
|
|||
package net.newpipe.newplayer.utils
|
||||
package net.newpipe.newplayer.internal.utils
|
||||
|
||||
data class VideoSize(
|
||||
val width: Int,
|
|
@ -18,7 +18,7 @@
|
|||
* along with NewPlayer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package net.newpipe.newplayer.utils
|
||||
package net.newpipe.newplayer.internal.utils
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
Loading…
Reference in New Issue