Skip to content

Commit

Permalink
Remove custom theme in ConnectHelp
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwei committed Sep 6, 2024
1 parent 8caa8eb commit dfc5828
Showing 1 changed file with 64 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,79 +30,77 @@ import androidx.fragment.compose.content
import androidx.tv.material3.Button
import androidx.tv.material3.ButtonDefaults
import androidx.tv.material3.Icon
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Surface
import androidx.tv.material3.Text
import androidx.tv.material3.MaterialTheme
import org.jellyfin.androidtv.R
import org.jellyfin.androidtv.ui.composable.overscan
import org.jellyfin.androidtv.ui.shared.theme.JellyfinMaterialTheme

class ConnectHelpAlertFragment : Fragment() {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = content {
ConnectHelpAlert()
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = content {
ConnectHelpAlert()
}

@Composable
fun ConnectHelpAlert() {
val focusRequester = FocusRequester()
@Composable
fun ConnectHelpAlert() {
val focusRequester = FocusRequester()

JellyfinMaterialTheme {
Surface(
) {
Row(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.overscan(),
horizontalArrangement = Arrangement.SpaceEvenly
) {
Column(
modifier = Modifier
.width(400.dp)
.align(Alignment.CenterVertically)
) {
Text(
text = stringResource(R.string.login_help_title),
style = MaterialTheme.typography.displayMedium
)
Text(
modifier = Modifier.padding(top = 16.dp),
text = stringResource(R.string.login_help_description),
style = MaterialTheme.typography.bodyLarge
)
Button(modifier = Modifier.padding(top = 24.dp).align(Alignment.Start)
.focusRequester(focusRequester).focusable(), onClick = {
parentFragmentManager.popBackStack()
}) {
Icon(
imageVector = Icons.Default.Done,
contentDescription = null,
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text(
text = stringResource(id = R.string.btn_got_it),
style = MaterialTheme.typography.bodyLarge
)
}
}
Image(
painter = painterResource(R.drawable.qr_jellyfin_docs),
contentDescription = stringResource(R.string.app_name),
modifier = Modifier
.width(200.dp)
.align(Alignment.CenterVertically)
)
}
}
}
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
}
Surface {
Row(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.overscan(),
horizontalArrangement = Arrangement.SpaceEvenly
) {
Column(
modifier = Modifier
.width(400.dp)
.align(Alignment.CenterVertically)
) {
Text(
text = stringResource(R.string.login_help_title),
style = MaterialTheme.typography.displayMedium
)
Text(
modifier = Modifier.padding(top = 16.dp),
text = stringResource(R.string.login_help_description),
style = MaterialTheme.typography.bodyLarge
)
Button(modifier = Modifier
.padding(top = 24.dp)
.align(Alignment.Start)
.focusRequester(focusRequester).focusable(),
onClick = { parentFragmentManager.popBackStack() }
) {
Icon(
imageVector = Icons.Default.Done,
contentDescription = null,
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text(
text = stringResource(id = R.string.btn_got_it),
style = MaterialTheme.typography.bodyLarge
)
}
}
Image(
painter = painterResource(R.drawable.qr_jellyfin_docs),
contentDescription = stringResource(R.string.app_name),
modifier = Modifier
.width(200.dp)
.align(Alignment.CenterVertically)
)
}
}
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
}
}

0 comments on commit dfc5828

Please sign in to comment.