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
| @Composable | |
| fun GlanceText( | |
| text: String, | |
| @FontRes font: Int, | |
| fontSize: TextUnit, | |
| modifier: GlanceModifier = GlanceModifier, | |
| color: Color = Color.Black, | |
| letterSpacing: TextUnit = 0.1.sp | |
| ) { | |
| Image( |
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
| fun Context.textAsBitmap( | |
| text: String, | |
| fontSize: TextUnit, | |
| color: Color = Color.Black, | |
| letterSpacing: Float = 0.1f, | |
| font: Int | |
| ): Bitmap { | |
| val paint = TextPaint(Paint.ANTI_ALIAS_FLAG) | |
| paint.textSize = spToPx(fontSize.value, this) | |
| paint.color = color.toArgb() |
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
| Box( | |
| modifier = GlanceModifier | |
| .fillMaxSize() | |
| .background(Color.White), | |
| contentAlignment = Alignment.Center | |
| ) { | |
| GlanceText( | |
| modifier = GlanceModifier.padding(horizontal = 20.dp), | |
| text = "Welcome to App Widget", | |
| font = R.font.good_times_rg, |
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 EventsWidget : GlanceAppWidget() { | |
| override suspend fun provideGlance(context: Context, id: GlanceId) { | |
| provideContent { | |
| Box( | |
| modifier = GlanceModifier | |
| .fillMaxSize() | |
| .background(Color.White), | |
| contentAlignment = Alignment.Center | |
| ) { |
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
| <receiver | |
| android:name=".widget.event.EventsWidgetReceiver" | |
| android:enabled="@bool/glance_appwidget_available" | |
| android:exported="true"> | |
| <intent-filter> | |
| <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | |
| </intent-filter> | |
| <meta-data | |
| android:name="android.appwidget.provider" | |
| android:resource="@xml/event_widget_info" /> |
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
| import UIKit | |
| import shared | |
| class IOSInterceptor: Interceptor { | |
| func intercept(httpRequestBuilder: Ktor_client_coreHttpRequestBuilder) { | |
| let headers = httpRequestBuilder.headers | |
| headers.set(name: "IOS", value: "HEADER") | |
| } | |
| } |
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
| fun main() { | |
| val capitalizeDec = decorateCapitalize(::capitalize) | |
| val text = capitalizeDec("HeLLo") | |
| print(text) | |
| } | |
| fun capitalize(hello: String): String { | |
| return hello.capitalize() | |
| } |
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
| fun main(args: Array<String>) { | |
| val առաջինՊայման: Բուլյան = ճիշտԷ | |
| val երկրորդՊայման: Բուլյան = սխալԷ | |
| val երրորդՊայման: Բուլյան = ճիշտԷ | |
| եթե(առաջինՊայման) { | |
| առաջինՄեթոդ() | |
| } այլապես եթե(երկրորդՊայման) { | |
| երկրորդՄեթոդ() |
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
| videoMotionLayout.addTransitionListener(object : MotionLayout.TransitionListener { | |
| override fun onTransitionChange(motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float) { | |
| val mainActivity = activity as MainActivity | |
| mainActivity.mainMotionLayout.progress = Math.abs(progress) | |
| } | |
| override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) { | |
| } | |
| }) |
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"?> | |
| <MotionScene xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto"> | |
| <Transition | |
| app:constraintSetEnd="@id/collapsed" | |
| app:constraintSetStart="@id/expanded"> | |
| <KeyFrameSet> | |
| <KeyAttribute |
NewerOlder