Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloNetrebchuk committed Oct 17, 2023
2 parents 8cc9f2e + e23a91c commit 73bb5c8
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.lazy.LazyColumn
Expand Down Expand Up @@ -322,9 +323,13 @@ fun SequentialItem(
}

@Composable
fun VideoTitle(text: String) {
fun VideoTitle(
text: String,
modifier: Modifier = Modifier,
) {
Text(
text = text,
modifier = modifier,
color = MaterialTheme.appColors.textPrimary,
style = MaterialTheme.appTypography.titleLarge,
maxLines = 1,
Expand Down Expand Up @@ -353,6 +358,7 @@ fun NavigationUnitsButtons(
.fillMaxWidth()
} else {
Modifier
.statusBarsPadding()
.padding(end = 32.dp)
.padding(top = 2.dp)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.res.Configuration
import android.os.Bundle
import android.os.SystemClock
import android.view.View
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -66,9 +67,6 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta
super.onViewCreated(view, savedInstanceState)

val insetHolder = requireActivity() as InsetHolder
val statusBarParams = binding.statusBarInset.layoutParams as ConstraintLayout.LayoutParams
statusBarParams.topMargin = insetHolder.topInset
binding.statusBarInset.layoutParams = statusBarParams
val containerParams = binding.viewPager.layoutParams as ConstraintLayout.LayoutParams
containerParams.bottomMargin = insetHolder.bottomInset
binding.viewPager.layoutParams = containerParams
Expand All @@ -93,7 +91,10 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta
OpenEdXTheme {
val block by viewModel.currentBlock.observeAsState()
if (block?.type == BlockType.VIDEO) {
VideoTitle(text = block?.displayName ?: "")
VideoTitle(
text = block?.displayName ?: "",
modifier = Modifier.statusBarsPadding()
)
}
}
}
Expand Down Expand Up @@ -160,7 +161,7 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta

binding.btnBack.setContent {
OpenEdXTheme {
BackBtn {
BackBtn(modifier = Modifier.statusBarsPadding()) {
requireActivity().supportFragmentManager.popBackStack()
}
}
Expand Down
17 changes: 4 additions & 13 deletions course/src/main/res/layout-land/fragment_course_unit_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@
android:layout_height="match_parent"
android:background="@color/background">

<View
android:id="@+id/statusBarInset"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/btnBack"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="48dp"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/statusBarInset" />
app:layout_constraintTop_toTopOf="parent" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/cv_video_title"
Expand All @@ -38,7 +29,7 @@
android:layout_height="wrap_content"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/statusBarInset" />
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
android:layout_height="match_parent"
android:background="@color/background">

<View
android:id="@+id/statusBarInset"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<FrameLayout
android:id="@+id/frameBack"
android:layout_width="wrap_content"
Expand All @@ -22,12 +14,12 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/statusBarInset">
app:layout_constraintTop_toTopOf="parent">

<androidx.compose.ui.platform.ComposeView
android:id="@+id/btnBack"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp" />

Expand Down
16 changes: 3 additions & 13 deletions course/src/main/res/layout/fragment_course_unit_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,12 @@
android:layout_height="match_parent"
android:background="@color/background">

<View
android:id="@+id/statusBarInset"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/btnBack"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/statusBarInset" />
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ private fun AnothersProfileScreen(
Spacer(modifier = Modifier.height(36.dp))

ProfileInfoSection(uiState.account)

Spacer(modifier = Modifier.height(36.dp))
}
}
}
Expand Down

0 comments on commit 73bb5c8

Please sign in to comment.