This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:shape="rectangle"> | |
| <solid android:color="@color/white" /> | |
| <corners android:topLeftRadius="25dp" android:topRightRadius="25dp" /> | |
| </shape> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@+id/curvedContainer" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:background="@drawable/button_selector" | |
| android:orientation="horizontal"> | |
| </LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.aqua30.testingproject.curved_background | |
| import android.os.Bundle | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import android.view.WindowManager | |
| import androidx.appcompat.app.AppCompatActivity | |
| import com.aqua30.testingproject.R | |
| import com.aqua30.testingproject.databinding.BottomCurvedBinding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CurvedContainer @JvmOverloads constructor( | |
| context: Context, | |
| attrs: AttributeSet? = null, | |
| defStyleAttr: Int = 0 | |
| ): LinearLayout(context, attrs, defStyleAttr) { | |
| /* paint object for coloring the canvas */ | |
| private val mPaint = Paint() | |
| /* path that will be drawn to achieve the shape */ | |
| private val path = Path() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { | |
| super.onSizeChanged(w, h, oldw, oldh) | |
| /* curve from P1 to P2 */ | |
| leftArc.set( | |
| 0f, | |
| 0f, | |
| xAxisOffset, | |
| yAxisOffset | |
| ) | |
| path.addArc(leftArc, 180f, 90f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override fun onDraw(canvas: Canvas?) { | |
| super.onDraw(canvas) | |
| canvas?.drawPath(path, mPaint) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style name="TransparentBackgroundDialog" parent="Theme.Design.Light.BottomSheetDialog"> | |
| <item name="android:colorBackground">@android:color/transparent</item> | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setStyle(STYLE_NORMAL, R.style.TransparentBackgroundDialog) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencyResolutionManagement { | |
| repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | |
| repositories { | |
| google() | |
| mavenCentral() | |
| } | |
| versionCatalogs { | |
| libs { | |
| version('compose','1.4.0') | |
| version('composeui','1.1.1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AnimatedContent( | |
| targetState = timerContent, | |
| transitionSpec = { | |
| if(targetState == TimerContent.SELECTION) { | |
| slideInVertically { height -> height } + fadeIn() with | |
| slideOutVertically { height -> -height } + fadeOut() | |
| } else { | |
| slideInVertically { height -> -height } + fadeIn() with | |
| slideOutVertically { height -> height } + fadeOut() | |
| } |