Skip to content

Commit

Permalink
Merge pull request #559 from Goooler/migrate-outdated-apis
Browse files Browse the repository at this point in the history
Migrate outdated APIs
  • Loading branch information
kizitonwose authored Jul 17, 2024
2 parents f1f8522 + 4e3b2a7 commit d06c260
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
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

0 comments on commit d06c260

Please sign in to comment.