This file contains 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
Я бы эту задачу решал через связные списки | |
https://ru.wikipedia.org/wiki/%D0%A1%D0%B2%D1%8F%D0%B7%D0%BD%D1%8B%D0%B9_%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA | |
DATA_OBJECT | |
{ | |
Field1, | |
Field2, | |
List1 | |
[ | |
ListField1 |
This file contains 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
func createWebView() -> WKWebView { | |
let configuration = WKWebViewConfiguration() | |
let contentController = WKUserContentController() | |
// Получите текущий размер текста от Dynamic Type и установите его в качестве базового размера шрифта | |
let fontSize = UIFont.preferredFont(forTextStyle: .body).pointSize | |
let lineHeight = fontSize * 1.4 | |
let script = "document.getElementsByTagName('body')[0].style.fontSize = '\(fontSize)px'; document.getElementsByTagName('body')[0].style.lineHeight = '\(lineHeight)px';" | |
let userScript = WKUserScript(source: script, injectionTime: .atDocumentEnd, forMainFrameOnly: true) | |
This file contains 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
private fun getWeekDate(): String { | |
val cal = Calendar.getInstance().apply { | |
set(Calendar.HOUR_OF_DAY, 0) | |
clear(Calendar.MINUTE) | |
clear(Calendar.SECOND) | |
clear(Calendar.MILLISECOND) | |
} | |
cal.set(Calendar.DAY_OF_WEEK, cal.firstDayOfWeek) |
This file contains 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"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="?attr/appColorSurfaceBorder"> | |
<item android:id="@android:id/background"> | |
<shape> | |
<corners android:radius="4dp" /> | |
<solid android:color="?attr/colorSurface" /> | |
<stroke | |
android:width="1dp" | |
android:color="?attr/appColorSurfaceBorder" /> |
This file contains 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
abstract class EpoxyKotlinHolder : EpoxyHolder() { | |
private lateinit var _view: View | |
override fun bindView(itemView: View) { | |
_view = itemView | |
} | |
protected fun <V : View> bind(id: Int): ReadOnlyProperty<EpoxyKotlinHolder, V> = | |
Lazy { holder: EpoxyKotlinHolder, prop -> |