Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate outdated APIs #559

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -189,7 +188,6 @@ private fun MonthHeader(daysOfWeek: List<DayOfWeek>) {
}
}

@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun MonthFooter(selectionCount: Int) {
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun ListPage(click: (Page) -> Unit) {
.fillMaxSize()
.background(Color.White),
) {
items(Page.values().drop(1)) { item ->
items(Page.entries.drop(1)) { item ->
Column(
modifier = Modifier
.fillParentMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.LocalLifecycleOwner
import com.kizitonwose.calendar.compose.CalendarLayoutInfo
import com.kizitonwose.calendar.compose.CalendarState
import com.kizitonwose.calendar.compose.weekcalendar.WeekCalendarState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CalendarViewActivity : AppCompatActivity() {

override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
android.R.id.home -> onBackPressed().let { true }
android.R.id.home -> onBackPressedDispatcher.onBackPressed().let { true }
else -> super.onOptionsItemSelected(item)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.kizitonwose.calendar.view.internal

import android.content.Context
import android.os.Build
import android.util.Log
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -75,13 +74,8 @@ internal fun <Day, Container : ViewContainer> setupItemRoot(
root.layoutParams = MarginLayoutParams(width, height).apply {
bottomMargin = itemMargins.bottom
topMargin = itemMargins.top
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
marginStart = itemMargins.start
marginEnd = itemMargins.end
} else {
leftMargin = itemMargins.start
rightMargin = itemMargins.end
}
marginStart = itemMargins.start
marginEnd = itemMargins.end
}
}

Expand Down