Compare commits
8 Commits
b8a40afe3a
...
v0.5.132
| Author | SHA1 | Date | |
|---|---|---|---|
| 25cfbe9bdc | |||
| c9340ab2ab | |||
| cdb2471445 | |||
| a5ebcd4d80 | |||
| 374e8838e8 | |||
| 47b2638b2b | |||
| b8e08d1a97 | |||
| fd341cb22a |
@@ -39,8 +39,8 @@ android {
|
|||||||
applicationId 'ru.forbion.f7cloud.mobile'
|
applicationId 'ru.forbion.f7cloud.mobile'
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 36
|
targetSdk 36
|
||||||
versionCode 136
|
versionCode 140
|
||||||
versionName '0.5.128'
|
versionName '0.5.132'
|
||||||
missingDimensionStrategy 'default', 'f7'
|
missingDimensionStrategy 'default', 'f7'
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,31 @@ class F7MobileApp : F7cloudTalkApplication(), ImageLoaderFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun newImageLoader(): ImageLoader {
|
override fun newImageLoader(): ImageLoader {
|
||||||
|
// OkHttp с Basic-auth для хоста сервера: серверные картинки (иконки внешних сайтов
|
||||||
|
// /apps/external/img, превью и т.п.) требуют логина — без заголовка coil ловит 401.
|
||||||
|
val authedClient = okhttp3.OkHttpClient.Builder()
|
||||||
|
.addInterceptor { chain ->
|
||||||
|
val request = chain.request()
|
||||||
|
val session = runCatching { AuthStore(this).load() }.getOrNull()
|
||||||
|
val serverHost = session?.serverUrl?.let {
|
||||||
|
runCatching { android.net.Uri.parse(it).host }.getOrNull()
|
||||||
|
}
|
||||||
|
val patched = if (session != null && serverHost != null && request.url.host == serverHost) {
|
||||||
|
request.newBuilder()
|
||||||
|
.header(
|
||||||
|
"Authorization",
|
||||||
|
okhttp3.Credentials.basic(session.username, session.appPassword),
|
||||||
|
)
|
||||||
|
.header("OCS-APIRequest", "true")
|
||||||
|
.build()
|
||||||
|
} else {
|
||||||
|
request
|
||||||
|
}
|
||||||
|
chain.proceed(patched)
|
||||||
|
}
|
||||||
|
.build()
|
||||||
return ImageLoader.Builder(this)
|
return ImageLoader.Builder(this)
|
||||||
|
.okHttpClient(authedClient)
|
||||||
.components { add(SvgDecoder.Factory()) }
|
.components { add(SvgDecoder.Factory()) }
|
||||||
.crossfade(false)
|
.crossfade(false)
|
||||||
.memoryCache {
|
.memoryCache {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ object AppMenuRepository {
|
|||||||
}
|
}
|
||||||
AppMenuExternalSite(
|
AppMenuExternalSite(
|
||||||
name = name,
|
name = name,
|
||||||
iconUrl = icon ?: defaultExternalIcon(session.serverUrl, name),
|
iconUrl = resolveExternalIcon(session.serverUrl, icon, name),
|
||||||
openUrl = openUrl,
|
openUrl = openUrl,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -56,12 +56,18 @@ object AppMenuRepository {
|
|||||||
}.getOrDefault(emptyList())
|
}.getOrDefault(emptyList())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun defaultExternalIcon(serverUrl: String, name: String): String {
|
/**
|
||||||
|
* Иконка внешнего сайта. API external отдаёт `icon` как ИМЯ ФАЙЛА (напр. «bitrix24.png»),
|
||||||
|
* а не URL — сайт грузит его с `/apps/external/img/{icon}` (см. layout.user.php). Раньше
|
||||||
|
* имя файла бралось как есть → битая ссылка → глобус-заглушка у Bitrix/1C.
|
||||||
|
*/
|
||||||
|
private fun resolveExternalIcon(serverUrl: String, icon: String?, name: String): String {
|
||||||
val base = serverUrl.trimEnd('/')
|
val base = serverUrl.trimEnd('/')
|
||||||
return when {
|
return when {
|
||||||
name.contains("bitrix", ignoreCase = true) -> "$base/themes/forbion/images/header/bitrix-glass.svg"
|
icon.isNullOrBlank() -> "$base/index.php/apps/external/img/external.svg"
|
||||||
name.contains("1c", ignoreCase = true) -> "$base/themes/forbion/images/header/1c-glass.svg"
|
icon.startsWith("http") -> icon
|
||||||
else -> "$base/index.php/apps/external/img/external.svg"
|
icon.startsWith("/") -> "$base$icon"
|
||||||
|
else -> "$base/index.php/apps/external/img/$icon"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,16 @@ private data class AppMenuEntry(
|
|||||||
|
|
||||||
// Состав меню — по дизайну выдвижного меню (Почта/Конференции/Задачи/Поддержка — только
|
// Состав меню — по дизайну выдвижного меню (Почта/Конференции/Задачи/Поддержка — только
|
||||||
// в нижней панели; Уведомления/Настройки добавлены как нативные пункты, см. appMenuItems).
|
// в нижней панели; Уведомления/Настройки добавлены как нативные пункты, см. appMenuItems).
|
||||||
// iconPath — базовое имя плоской menu-иконки (assets/menu/menu-<name>.svg)
|
// iconPath — базовое имя плоской menu-иконки (assets/menu/menu-<name>.svg).
|
||||||
|
// Состав/порядок 1:1 со шторкой сайта: Файлы·Календарь·Контакты·Карточки·Заметки·Поддержка
|
||||||
|
// (Почта/Задачи/Конференции не тут — они в нижней панели).
|
||||||
private val coreAppMenuEntries = listOf(
|
private val coreAppMenuEntries = listOf(
|
||||||
AppMenuEntry(AppTab.Files, "Файлы", "files"),
|
AppMenuEntry(AppTab.Files, "Файлы", "files"),
|
||||||
AppMenuEntry(AppTab.Calendar, "Календарь", "calendar"),
|
AppMenuEntry(AppTab.Calendar, "Календарь", "calendar"),
|
||||||
AppMenuEntry(AppTab.Contacts, "Контакты", "contacts"),
|
AppMenuEntry(AppTab.Contacts, "Контакты", "contacts"),
|
||||||
AppMenuEntry(AppTab.Deck, "Карточки", "cards"),
|
AppMenuEntry(AppTab.Deck, "Карточки", "cards"),
|
||||||
AppMenuEntry(null, "Заметки", "notes", webPath = "/apps/notes/"),
|
AppMenuEntry(null, "Заметки", "notes", webPath = "/apps/notes/"),
|
||||||
|
AppMenuEntry(AppTab.Support, "Поддержка", "support"),
|
||||||
)
|
)
|
||||||
|
|
||||||
data class AppMenuExternalSite(
|
data class AppMenuExternalSite(
|
||||||
@@ -74,8 +77,14 @@ fun appMenuItems(
|
|||||||
externalUrl = site.openUrl,
|
externalUrl = site.openUrl,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// Нативные пункты — плоские menu-иконки темы, действия по label в AppScaffold
|
// Нативные пункты — плоские menu-иконки темы, действия по label в AppScaffold.
|
||||||
|
// Порядок как на сайте: после внешних сайтов — Личный кабинет, затем Уведомления, Настройки.
|
||||||
val native = listOf(
|
val native = listOf(
|
||||||
|
F7AppMenuItem(
|
||||||
|
label = "Личный кабинет",
|
||||||
|
iconUrl = menuIcon("lk"),
|
||||||
|
selected = false,
|
||||||
|
),
|
||||||
F7AppMenuItem(
|
F7AppMenuItem(
|
||||||
label = "Уведомления",
|
label = "Уведомления",
|
||||||
iconUrl = menuIcon("notifications"),
|
iconUrl = menuIcon("notifications"),
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ fun AppScaffold(
|
|||||||
var filesUploadRequest by remember { mutableIntStateOf(0) }
|
var filesUploadRequest by remember { mutableIntStateOf(0) }
|
||||||
var contactsCreateRequest by remember { mutableIntStateOf(0) }
|
var contactsCreateRequest by remember { mutableIntStateOf(0) }
|
||||||
var tasksCreateRequest by remember { mutableIntStateOf(0) }
|
var tasksCreateRequest by remember { mutableIntStateOf(0) }
|
||||||
|
var tasksShowListsRequest by remember { mutableIntStateOf(0) }
|
||||||
var supportCreateRequest by remember { mutableIntStateOf(0) }
|
var supportCreateRequest by remember { mutableIntStateOf(0) }
|
||||||
var calendarSettingsRequest by remember { mutableIntStateOf(0) }
|
var calendarSettingsRequest by remember { mutableIntStateOf(0) }
|
||||||
var talkChatsRequest by remember { mutableIntStateOf(0) }
|
var talkChatsRequest by remember { mutableIntStateOf(0) }
|
||||||
@@ -458,7 +459,10 @@ fun AppScaffold(
|
|||||||
AppTab.Mail -> mailSidebarOpen = !mailSidebarOpen
|
AppTab.Mail -> mailSidebarOpen = !mailSidebarOpen
|
||||||
AppTab.Calendar -> calendarSidebarOpen = !calendarSidebarOpen
|
AppTab.Calendar -> calendarSidebarOpen = !calendarSidebarOpen
|
||||||
AppTab.Files -> filesSidebarOpen = !filesSidebarOpen
|
AppTab.Files -> filesSidebarOpen = !filesSidebarOpen
|
||||||
// Разделы без сайдбара (Карточки/Конференции/Контакты/Задачи/
|
// Задачи: стрелка открывает панель списков (закрывает
|
||||||
|
// открытый список) — как сайдбар в Почте/Файлах.
|
||||||
|
AppTab.Tasks -> tasksShowListsRequest++
|
||||||
|
// Разделы без сайдбара (Карточки/Конференции/Контакты/
|
||||||
// Поддержка): стрелка = «назад» к предыдущему разделу.
|
// Поддержка): стрелка = «назад» к предыдущему разделу.
|
||||||
else -> popTabHistory()?.let { activeTab = it }
|
else -> popTabHistory()?.let { activeTab = it }
|
||||||
}
|
}
|
||||||
@@ -469,10 +473,10 @@ fun AppScaffold(
|
|||||||
activeTab = AppTab.Mail
|
activeTab = AppTab.Mail
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCardsClick = {
|
onTasksClick = {
|
||||||
if (activeTab != AppTab.Deck) {
|
if (activeTab != AppTab.Tasks) {
|
||||||
pushTabHistory(activeTab)
|
pushTabHistory(activeTab)
|
||||||
activeTab = AppTab.Deck
|
activeTab = AppTab.Tasks
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onConferencesClick = {
|
onConferencesClick = {
|
||||||
@@ -566,6 +570,7 @@ fun AppScaffold(
|
|||||||
modifier = contentModifier,
|
modifier = contentModifier,
|
||||||
createRequest = tasksCreateRequest,
|
createRequest = tasksCreateRequest,
|
||||||
openListSlug = pendingTasksListSlug,
|
openListSlug = pendingTasksListSlug,
|
||||||
|
showListsRequest = tasksShowListsRequest,
|
||||||
onOpenListConsumed = { pendingTasksListSlug = null },
|
onOpenListConsumed = { pendingTasksListSlug = null },
|
||||||
onUnauthorized = forceLogout,
|
onUnauthorized = forceLogout,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_205_498)">
|
||||||
|
<path d="M35 17.5C35 22.3965 32.9889 26.823 29.748 29.999C29.7278 30.0189 29.7072 30.0387 29.6866 30.0585C29.4207 30.3164 29.1468 30.5662 28.8645 30.8073C28.3084 31.2838 27.7217 31.7251 27.1083 32.1287C24.3503 33.9441 21.0484 35 17.5 35C13.9516 35 10.6497 33.9441 7.89171 32.1287C7.27832 31.7251 6.69162 31.2838 6.13545 30.8073C5.85317 30.5662 5.57928 30.3164 5.3134 30.0585C5.2928 30.0387 5.2722 30.0189 5.25198 29.999C2.01145 26.823 0 22.3965 0 17.5C0 7.83487 7.83487 0 17.5 0C27.1651 0 35 7.83487 35 17.5Z" fill="#e5efe8"/>
|
||||||
|
<path d="M15.3301 22.9482L15.1152 22.8213C14.4793 22.4435 13.9364 22.0278 13.4297 21.6855L13.4287 21.6846C12.6398 21.1521 12.1076 20.3166 11.9502 19.375L11.6738 17.7227L11.6123 17.3574H11.2422C10.6187 17.3573 10.1152 16.854 10.1152 16.2305C10.1153 15.7671 10.3933 15.37 10.792 15.1973L11.1914 15.0244L11.0205 14.624C10.5503 13.5216 10.2046 12.3526 9.99707 11.1533V11.1523C9.86377 10.3836 9.80431 9.64622 10.002 8.99707C10.2015 8.34043 10.6884 7.89652 11.1309 7.88086L11.1982 7.88672L11.457 7.9043L11.5967 7.68555C11.9829 7.08239 12.5985 6.66833 13.2754 6.42285H13.2764C13.9611 6.17432 14.6919 6.08725 15.4746 5.99707C15.7786 5.96223 16.0789 5.92659 16.3799 5.89648L16.3789 5.89551C17.769 5.76175 19.2371 5.73653 20.5977 6.11523C21.9531 6.4928 23.2258 7.32891 23.8887 8.625C24.4185 9.65968 24.5371 10.937 24.3965 12.1826C24.3036 13.0075 24.1053 13.8182 23.8662 14.6348L23.75 15.0303L24.1377 15.1699C24.5724 15.3256 24.8827 15.741 24.8828 16.2305C24.8828 16.8541 24.38 17.3574 23.7559 17.3574H23.3857L23.3242 17.7227L23.0479 19.375C22.8904 20.3168 22.3584 21.1522 21.5693 21.6846C21.0607 22.0276 20.5195 22.4431 19.8828 22.8213L19.6689 22.9482V24.3721L19.9746 24.4688L25.1543 26.1045C27.0535 26.7041 28.5119 28.1435 29.1777 29.9355C29.1138 29.9956 29.0512 30.0571 28.9863 30.1162L28.5791 30.4756C28.0371 30.9399 27.4652 31.3702 26.8672 31.7637C24.1785 33.5335 20.9593 34.5635 17.499 34.5635C14.0388 34.5635 10.8205 33.5334 8.13184 31.7637H8.13086C7.53293 31.3702 6.96095 30.9399 6.41895 30.4756L6.01172 30.1162C5.94669 30.057 5.88345 29.9958 5.81934 29.9355C6.48477 28.1431 7.94475 26.7039 9.84375 26.1045L15.0234 24.4688L15.3301 24.3721V22.9482Z" fill="#F5F5F5" stroke="black" stroke-width="0.875"/>
|
||||||
|
<path d="M18.1351 24.5H16.7466C16.6261 24.5 16.5416 24.619 16.5814 24.7328L16.9294 25.7282C16.954 25.7984 17.0202 25.8454 17.0946 25.8454H17.7871C17.8615 25.8454 17.9277 25.7984 17.9523 25.7282L18.3003 24.7328C18.3401 24.619 18.2557 24.5 18.1351 24.5Z" fill="#70B62B"/>
|
||||||
|
<path d="M15.7661 32.1765L16.9463 25.8847C16.9619 25.8019 17.0341 25.7419 17.1183 25.7419H17.7667C17.8518 25.7419 17.9246 25.8032 17.9391 25.8871L19.0289 32.1808C19.0379 32.2323 19.0233 32.285 18.9893 32.3247L17.5726 33.9747C17.504 34.0545 17.3811 34.0563 17.3103 33.9784L15.8086 32.3265C15.7717 32.2859 15.7559 32.2304 15.7661 32.1765Z" fill="#70B62B"/>
|
||||||
|
<path d="M23.0874 17.1475C22.6802 17.1566 22.677 17.1565 22.6763 17.2303C22.6751 17.3617 22.5101 17.8603 22.3794 18.1348C22.193 18.5242 21.9528 18.8458 21.6003 19.1728C21.1508 19.5918 20.7029 19.8346 20.1019 19.9893C19.8544 20.0543 19.7678 20.0567 17.9148 20.0492L16.4625 20.0454C16.1964 20.0447 15.9796 20.2589 15.9771 20.525C15.9747 20.7901 16.1885 21.0065 16.4535 21.0072L17.954 21.0114C20.1116 21.0185 20.0763 21.0214 20.6873 20.8219C21.7131 20.4883 22.6568 19.6763 23.1759 18.6776C23.3586 18.3331 23.5398 17.8089 23.6007 17.4664C23.6243 17.3416 23.6479 17.2168 23.6546 17.1848C23.6614 17.1432 23.6455 17.1302 23.5813 17.136C23.5332 17.1388 23.3119 17.1464 23.0874 17.1475Z" fill="black"/>
|
||||||
|
<rect x="22.451" y="12.5238" width="3.2" height="5.2" rx="0.6" transform="rotate(0.530608 22.451 12.5238)" fill="#F5F5F5" stroke="black" stroke-width="0.8"/>
|
||||||
|
<rect x="9.45097" y="12.4037" width="3.2" height="5.2" rx="0.6" transform="rotate(0.530608 9.45097 12.4037)" fill="#F5F5F5" stroke="black" stroke-width="0.8"/>
|
||||||
|
<path d="M15.293 20.4473C15.293 19.895 15.7407 19.4473 16.293 19.4473H17.293C17.8453 19.4473 18.293 19.895 18.293 20.4473C18.293 20.9996 17.8453 21.4473 17.293 21.4473H16.293C15.7407 21.4473 15.293 20.9996 15.293 20.4473Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_205_498">
|
||||||
|
<rect width="35" height="35" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,40 @@
|
|||||||
|
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_4199_10908)">
|
||||||
|
<g filter="url(#filter0_di_4199_10908)">
|
||||||
|
<circle cx="17.5" cy="17.5" r="17.5" fill="#FDFDFD"/>
|
||||||
|
<circle cx="17.5" cy="17.5" r="17" stroke="url(#paint0_linear_4199_10908)" stroke-opacity="0.2"/>
|
||||||
|
</g>
|
||||||
|
<path d="M15.3301 22.9482L15.1152 22.8213C14.4793 22.4435 13.9364 22.0278 13.4297 21.6855L13.4287 21.6846C12.6398 21.1521 12.1076 20.3166 11.9502 19.375L11.6738 17.7227L11.6123 17.3574H11.2422C10.6187 17.3573 10.1152 16.854 10.1152 16.2305C10.1153 15.7671 10.3933 15.37 10.792 15.1973L11.1914 15.0244L11.0205 14.624C10.5503 13.5216 10.2046 12.3526 9.99707 11.1533V11.1523C9.86377 10.3836 9.80431 9.64622 10.002 8.99707C10.2015 8.34043 10.6884 7.89652 11.1309 7.88086L11.1982 7.88672L11.457 7.9043L11.5967 7.68555C11.9829 7.08239 12.5985 6.66833 13.2754 6.42285H13.2764C13.9611 6.17432 14.6919 6.08725 15.4746 5.99707C15.7786 5.96223 16.0789 5.92659 16.3799 5.89648L16.3789 5.89551C17.769 5.76175 19.2371 5.73653 20.5977 6.11523C21.9531 6.4928 23.2258 7.32891 23.8887 8.625C24.4185 9.65968 24.5371 10.937 24.3965 12.1826C24.3036 13.0075 24.1053 13.8182 23.8662 14.6348L23.75 15.0303L24.1377 15.1699C24.5724 15.3256 24.8827 15.741 24.8828 16.2305C24.8828 16.8541 24.38 17.3574 23.7559 17.3574H23.3857L23.3242 17.7227L23.0479 19.375C22.8904 20.3168 22.3584 21.1522 21.5693 21.6846C21.0607 22.0276 20.5195 22.4431 19.8828 22.8213L19.6689 22.9482V24.3721L19.9746 24.4688L25.1543 26.1045C27.0535 26.7041 28.5119 28.1435 29.1777 29.9355C29.1138 29.9956 29.0512 30.0571 28.9863 30.1162L28.5791 30.4756C28.0371 30.9399 27.4652 31.3702 26.8672 31.7637C24.1785 33.5335 20.9593 34.5635 17.499 34.5635C14.0388 34.5635 10.8205 33.5334 8.13184 31.7637H8.13086C7.53293 31.3702 6.96095 30.9399 6.41895 30.4756L6.01172 30.1162C5.94669 30.057 5.88345 29.9958 5.81934 29.9355C6.48477 28.1431 7.94475 26.7039 9.84375 26.1045L15.0234 24.4688L15.3301 24.3721V22.9482Z" fill="#F5F5F5" stroke="black" stroke-width="0.875"/>
|
||||||
|
<path d="M18.1351 24.5H16.7466C16.6261 24.5 16.5416 24.619 16.5814 24.7328L16.9294 25.7282C16.954 25.7984 17.0202 25.8454 17.0946 25.8454H17.7871C17.8615 25.8454 17.9277 25.7984 17.9523 25.7282L18.3003 24.7328C18.3401 24.619 18.2557 24.5 18.1351 24.5Z" fill="#70B62B"/>
|
||||||
|
<path d="M15.7661 32.1768L16.9463 25.8849C16.9619 25.8022 17.0341 25.7422 17.1183 25.7422H17.7667C17.8518 25.7422 17.9246 25.8034 17.9391 25.8873L19.0289 32.1811C19.0379 32.2325 19.0233 32.2853 18.9893 32.3249L17.5726 33.975C17.504 34.0548 17.3811 34.0565 17.3103 33.9787L15.8086 32.3268C15.7717 32.2862 15.7559 32.2307 15.7661 32.1768Z" fill="#70B62B"/>
|
||||||
|
<path d="M23.0874 17.1475C22.6802 17.1566 22.677 17.1565 22.6763 17.2303C22.6751 17.3617 22.5101 17.8603 22.3794 18.1348C22.193 18.5242 21.9528 18.8458 21.6003 19.1728C21.1508 19.5918 20.7029 19.8346 20.1019 19.9893C19.8544 20.0543 19.7678 20.0567 17.9148 20.0492L16.4625 20.0454C16.1964 20.0447 15.9796 20.2589 15.9771 20.525C15.9747 20.7901 16.1885 21.0065 16.4535 21.0072L17.954 21.0114C20.1116 21.0185 20.0763 21.0214 20.6873 20.8219C21.7131 20.4883 22.6568 19.6763 23.1759 18.6776C23.3586 18.3331 23.5398 17.8089 23.6007 17.4664C23.6243 17.3416 23.6479 17.2168 23.6546 17.1848C23.6614 17.1432 23.6455 17.1302 23.5813 17.136C23.5332 17.1388 23.3119 17.1464 23.0874 17.1475Z" fill="black"/>
|
||||||
|
<rect x="22.451" y="12.5248" width="3.2" height="5.2" rx="0.6" transform="rotate(0.530608 22.451 12.5248)" fill="#F5F5F5" stroke="black" stroke-width="0.8"/>
|
||||||
|
<rect x="9.45097" y="12.4037" width="3.2" height="5.2" rx="0.6" transform="rotate(0.530608 9.45097 12.4037)" fill="#F5F5F5" stroke="black" stroke-width="0.8"/>
|
||||||
|
<path d="M15.293 20.4473C15.293 19.895 15.7407 19.4473 16.293 19.4473H17.293C17.8453 19.4473 18.293 19.895 18.293 20.4473C18.293 20.9996 17.8453 21.4473 17.293 21.4473H16.293C15.7407 21.4473 15.293 20.9996 15.293 20.4473Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<filter id="filter0_di_4199_10908" x="-2" y="-1" width="39" height="39" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||||
|
<feOffset dy="1"/>
|
||||||
|
<feGaussianBlur stdDeviation="1"/>
|
||||||
|
<feComposite in2="hardAlpha" operator="out"/>
|
||||||
|
<feColorMatrix type="matrix" values="0 0 0 0 0.901961 0 0 0 0 0.901961 0 0 0 0 0.901961 0 0 0 1 0"/>
|
||||||
|
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4199_10908"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4199_10908" result="shape"/>
|
||||||
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||||
|
<feOffset dy="-0.25"/>
|
||||||
|
<feGaussianBlur stdDeviation="1.5"/>
|
||||||
|
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
||||||
|
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"/>
|
||||||
|
<feBlend mode="normal" in2="shape" result="effect2_innerShadow_4199_10908"/>
|
||||||
|
</filter>
|
||||||
|
<linearGradient id="paint0_linear_4199_10908" x1="1.09375" y1="1.59091" x2="35" y2="1.59091" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#C0FF7B"/>
|
||||||
|
<stop offset="0.65625" stop-color="#70B62B"/>
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="clip0_4199_10908">
|
||||||
|
<rect width="35" height="35" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.2 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M6 7.5H19.5341" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M6 12.5H19.5" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M6 17.5H19.5" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 432 B |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M21.0755 4.16406L3.39658 4.16406C2.71318 4.16406 2.15918 4.71777 2.15918 5.4008L2.15918 19.0967C2.15918 19.7797 2.71318 20.3335 3.39658 20.3335H21.0755C21.7589 20.3335 22.3129 19.7797 22.3129 19.0967V5.4008C22.3129 4.71777 21.7589 4.16406 21.0755 4.16406Z" stroke="#808080" stroke-width="1.15" stroke-miterlimit="10"/>
|
||||||
|
<path d="M9.10286 12.375L2.60676 18.15C1.74915 18.9153 2.28822 20.3357 3.43986 20.3357H21.033C22.1846 20.3357 22.7237 18.9153 21.8661 18.15L15.37 12.375" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M12.6101 14.5783L21.8661 6.34978C22.7237 5.58447 22.1846 4.16406 21.033 4.16406L3.43986 4.16406C2.28822 4.16406 1.74915 5.58447 2.60676 6.34978L11.8628 14.5783C12.0772 14.7681 12.4018 14.7681 12.6101 14.5783Z" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 976 B |
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_mobile_spreed)">
|
||||||
|
<path d="M11.1875 19.743V18.7995C11.1875 18.3126 11.5822 17.918 12.069 17.918H13.3336C13.8204 17.918 14.2151 18.3126 14.2151 18.7995V19.743C14.2151 20.2298 13.8204 20.6245 13.3336 20.6245H12.069C11.5822 20.6245 11.1875 20.2298 11.1875 19.743Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15"/>
|
||||||
|
<path d="M7.09047 15.9141C8.56573 17.3894 10.4773 18.1623 12.4098 18.2329C14.5365 18.3106 16.6884 17.5376 18.3119 15.9141C21.4106 12.8154 21.4106 7.7915 18.3119 4.69274C15.2131 1.59398 10.1892 1.59398 7.09047 4.69274C3.99171 7.7915 3.99171 12.8154 7.09047 15.9141Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M10.1764 12.8321C10.8403 13.496 11.7005 13.8438 12.5701 13.8755C13.527 13.9105 14.4954 13.5627 15.2259 12.8321C16.6203 11.4377 16.6203 9.17699 15.2259 7.78258C13.8315 6.38816 11.5708 6.38816 10.1764 7.78258C8.782 9.17699 8.782 11.4377 10.1764 12.8321Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M12.1779 5.30035C12.3155 5.43795 12.4938 5.51003 12.674 5.51662C12.8723 5.52386 13.073 5.45177 13.2245 5.30035C13.5135 5.01134 13.5135 4.54278 13.2245 4.25376C12.9355 3.96475 12.4669 3.96475 12.1779 4.25376C11.8889 4.54278 11.8889 5.01134 12.1779 5.30035Z" fill="#808080"/>
|
||||||
|
<path d="M7.47754 22.1609V21.2174C7.47754 20.7306 7.8722 20.3359 8.35905 20.3359H17.0433C17.5302 20.3359 17.9248 20.7306 17.9248 21.2174V22.1609C17.9248 22.6478 17.5302 23.0425 17.0433 23.0425H8.35905C7.87221 23.0425 7.47754 22.6478 7.47754 22.1609Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_mobile_spreed">
|
||||||
|
<rect width="22.0417" height="23" fill="white" transform="translate(1.47949 1)"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M3 20.0191V4.98038C3 3.88665 3.88665 3 4.98038 3H20.0196C21.1133 3 22 3.88665 22 4.98038V20.0191C22 21.1131 21.1131 22 20.0191 22H4.98087C3.88687 22 3 21.1131 3 20.0191Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15"/>
|
||||||
|
<path d="M3 8.48077V4.98087C3 3.88687 3.88687 3 4.98087 3H20.0191C21.1131 3 22 3.88687 22 4.98087V8.48077H3Z" fill="#FBFBFB" stroke="#808080" stroke-width="1.15"/>
|
||||||
|
<mask id="path-3-inside-1_mobile_tasks" fill="white">
|
||||||
|
<rect x="5" y="10.6211" width="9.20801" height="4" rx="0.730769"/>
|
||||||
|
</mask>
|
||||||
|
<rect x="5" y="10.6211" width="9.20801" height="4" rx="0.730769" stroke="#808080" stroke-width="2.3" mask="url(#path-3-inside-1_mobile_tasks)"/>
|
||||||
|
<mask id="path-4-inside-2_mobile_tasks" fill="white">
|
||||||
|
<rect x="7" y="15.6211" width="13" height="4" rx="0.730769"/>
|
||||||
|
</mask>
|
||||||
|
<rect x="7" y="15.6211" width="13" height="4" rx="0.730769" stroke="#808080" stroke-width="2.3" mask="url(#path-4-inside-2_mobile_tasks)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M14.9847 20L7.43923 13.1999C7.01817 12.8204 7.01861 12.1598 7.44019 11.7809L14.9847 5" stroke="#808080" stroke-width="1.73077" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 264 B |
@@ -4,7 +4,7 @@ enum class F7BottomBarSlot {
|
|||||||
Chats,
|
Chats,
|
||||||
NavBack,
|
NavBack,
|
||||||
SectionMail,
|
SectionMail,
|
||||||
SectionCards,
|
SectionTasks,
|
||||||
SectionConferences,
|
SectionConferences,
|
||||||
Menu,
|
Menu,
|
||||||
}
|
}
|
||||||
@@ -15,10 +15,8 @@ data class F7BottomBarConfig(
|
|||||||
val buttonCount: Int get() = slots.size
|
val buttonCount: Int get() = slots.size
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// Единая навигационная панель по дизайну «Новое меню»:
|
// Нижняя панель 1:1 с мобильным сайтом forbion (layout.user.php):
|
||||||
// слева «назад», затем ярлыки-разделы Почта · Карточки · Конференции,
|
// «назад», затем ярлыки-разделы Почта · Задачи · Конференции, справа — меню.
|
||||||
// справа — выдвижное меню. Кнопки «чаты» (по просьбе владельца убрана),
|
|
||||||
// профиль/уведомления/настройки/создать в панели нет (меню и шапки экранов).
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
fun forContext(
|
fun forContext(
|
||||||
tabKey: String,
|
tabKey: String,
|
||||||
@@ -27,7 +25,7 @@ data class F7BottomBarConfig(
|
|||||||
listOf(
|
listOf(
|
||||||
F7BottomBarSlot.NavBack,
|
F7BottomBarSlot.NavBack,
|
||||||
F7BottomBarSlot.SectionMail,
|
F7BottomBarSlot.SectionMail,
|
||||||
F7BottomBarSlot.SectionCards,
|
F7BottomBarSlot.SectionTasks,
|
||||||
F7BottomBarSlot.SectionConferences,
|
F7BottomBarSlot.SectionConferences,
|
||||||
F7BottomBarSlot.Menu,
|
F7BottomBarSlot.Menu,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -30,19 +30,24 @@ data class F7BottomBarActions(
|
|||||||
val onChatsClick: () -> Unit = {},
|
val onChatsClick: () -> Unit = {},
|
||||||
val onNavBackClick: () -> Unit = {},
|
val onNavBackClick: () -> Unit = {},
|
||||||
val onMailClick: () -> Unit = {},
|
val onMailClick: () -> Unit = {},
|
||||||
val onCardsClick: () -> Unit = {},
|
val onTasksClick: () -> Unit = {},
|
||||||
val onConferencesClick: () -> Unit = {},
|
val onConferencesClick: () -> Unit = {},
|
||||||
val onMenuClick: () -> Unit = {},
|
val onMenuClick: () -> Unit = {},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Иконки нижней панели — ЛОКАЛЬНЫЕ mobile-*-icon из живой темы (assets/menu/), 1:1 с сайтом.
|
||||||
|
private fun barIcon(name: String): String = "file:///android_asset/menu/$name"
|
||||||
|
|
||||||
// Живой forbion (_header.css .header__mobile-bottom): пилюля 328×61, паддинг 3,
|
// Живой forbion (_header.css .header__mobile-bottom): пилюля 328×61, паддинг 3,
|
||||||
// фон #F5F5F5; кнопки 55, фон #FBFBFB, рамка #E6E6E6; активная кнопка-раздел и открытый
|
// фон #F5F5F5; кнопки 55, фон #FBFBFB, рамка #E6E6E6; активная кнопка-раздел и открытый
|
||||||
// бургер — полупрозрачный зелёный градиент 104°.
|
// бургер — полупрозрачный зелёный градиент 104°.
|
||||||
private val BottomBarWidth = 328.dp
|
private val BottomBarWidth = 328.dp
|
||||||
private val BottomBarHeight = 61.dp
|
private val BottomBarHeight = 61.dp
|
||||||
private val BottomBarButtonSize = 55.dp
|
private val BottomBarButtonSize = 55.dp
|
||||||
private val BottomBarIconSize = 34.dp
|
// Живой сайт: app-link/бургер img = 25px; стрелка «назад» мельче.
|
||||||
private val BottomBarSectionIconSize = 46.dp
|
private val BottomBarIconSize = 25.dp
|
||||||
|
private val BottomBarSectionIconSize = 25.dp
|
||||||
|
private val BottomBarBackIconSize = 18.dp
|
||||||
private val BottomBarOuterPadding = 3.dp
|
private val BottomBarOuterPadding = 3.dp
|
||||||
private val BottomBarButtonShape = RoundedCornerShape(100.dp)
|
private val BottomBarButtonShape = RoundedCornerShape(100.dp)
|
||||||
private val BottomBarButtonBg = Color(0xFFFBFBFB)
|
private val BottomBarButtonBg = Color(0xFFFBFBFB)
|
||||||
@@ -94,38 +99,35 @@ fun F7MobileBottomBar(
|
|||||||
onClick = actions.onChatsClick,
|
onClick = actions.onChatsClick,
|
||||||
)
|
)
|
||||||
F7BottomBarSlot.NavBack -> F7BottomBarIconSlot(
|
F7BottomBarSlot.NavBack -> F7BottomBarIconSlot(
|
||||||
iconUrl = "$base/themes/forbion/images/header/sidebar-chevron-left.svg",
|
iconUrl = barIcon("sidebar-chevron-left.svg"),
|
||||||
contentDescription = "Папки",
|
contentDescription = "Назад",
|
||||||
|
iconSize = BottomBarBackIconSize,
|
||||||
iconRotation = if (navBackHighlighted) 180f else 0f,
|
iconRotation = if (navBackHighlighted) 180f else 0f,
|
||||||
onClick = actions.onNavBackClick,
|
onClick = actions.onNavBackClick,
|
||||||
)
|
)
|
||||||
F7BottomBarSlot.SectionMail -> F7BottomBarIconSlot(
|
F7BottomBarSlot.SectionMail -> F7BottomBarIconSlot(
|
||||||
iconUrl = "$base/themes/forbion/images/header/mail-header-icon.svg",
|
iconUrl = barIcon("mobile-mail-icon.svg"),
|
||||||
contentDescription = "Почта",
|
contentDescription = "Почта",
|
||||||
iconSize = BottomBarSectionIconSize,
|
iconSize = BottomBarSectionIconSize,
|
||||||
active = activeTabKey.equals("mail", ignoreCase = true),
|
active = activeTabKey.equals("mail", ignoreCase = true),
|
||||||
onClick = actions.onMailClick,
|
onClick = actions.onMailClick,
|
||||||
)
|
)
|
||||||
F7BottomBarSlot.SectionCards -> F7BottomBarIconSlot(
|
F7BottomBarSlot.SectionTasks -> F7BottomBarIconSlot(
|
||||||
iconUrl = "$base/themes/forbion/images/header/deck-header-icon.svg",
|
iconUrl = barIcon("mobile-tasks-icon.svg"),
|
||||||
contentDescription = "Карточки",
|
contentDescription = "Задачи",
|
||||||
iconSize = BottomBarSectionIconSize,
|
iconSize = BottomBarSectionIconSize,
|
||||||
active = activeTabKey.equals("deck", ignoreCase = true),
|
active = activeTabKey.equals("tasks", ignoreCase = true),
|
||||||
onClick = actions.onCardsClick,
|
onClick = actions.onTasksClick,
|
||||||
)
|
)
|
||||||
F7BottomBarSlot.SectionConferences -> F7BottomBarIconSlot(
|
F7BottomBarSlot.SectionConferences -> F7BottomBarIconSlot(
|
||||||
iconUrl = "$base/themes/forbion/images/header/spreed-header-icon.svg",
|
iconUrl = barIcon("mobile-spreed-icon.svg"),
|
||||||
contentDescription = "Конференции",
|
contentDescription = "Конференции",
|
||||||
iconSize = BottomBarSectionIconSize,
|
iconSize = BottomBarSectionIconSize,
|
||||||
active = activeTabKey.equals("talk", ignoreCase = true),
|
active = activeTabKey.equals("talk", ignoreCase = true),
|
||||||
onClick = actions.onConferencesClick,
|
onClick = actions.onConferencesClick,
|
||||||
)
|
)
|
||||||
F7BottomBarSlot.Menu -> F7BottomBarIconSlot(
|
F7BottomBarSlot.Menu -> F7BottomBarIconSlot(
|
||||||
iconUrl = if (menuOpen) {
|
iconUrl = barIcon("mobile-burger-icon.svg"),
|
||||||
"$base/themes/forbion/images/header/menu-burger-green.svg"
|
|
||||||
} else {
|
|
||||||
"$base/themes/forbion/images/header/menu-burger-gray.svg"
|
|
||||||
},
|
|
||||||
contentDescription = "Меню",
|
contentDescription = "Меню",
|
||||||
active = menuOpen,
|
active = menuOpen,
|
||||||
showBadge = showNotificationBadge,
|
showBadge = showNotificationBadge,
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ data class DavTask(
|
|||||||
val description: String,
|
val description: String,
|
||||||
val calendarName: String,
|
val calendarName: String,
|
||||||
val calendarHref: String,
|
val calendarHref: String,
|
||||||
|
/** UID родительской задачи (RELATED-TO;RELTYPE=PARENT) — для подзадач; пусто у корневых. */
|
||||||
|
val parentUid: String = "",
|
||||||
) {
|
) {
|
||||||
val isCompleted: Boolean
|
val isCompleted: Boolean
|
||||||
get() = status.equals("COMPLETED", ignoreCase = true) || percentComplete >= 100
|
get() = status.equals("COMPLETED", ignoreCase = true) || percentComplete >= 100
|
||||||
@@ -87,6 +89,11 @@ object CalDavClient {
|
|||||||
private val icsDue = Pattern.compile("DUE[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsDue = Pattern.compile("DUE[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
private val icsStatus = Pattern.compile("STATUS:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsStatus = Pattern.compile("STATUS:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
private val icsUid = Pattern.compile("UID:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsUid = Pattern.compile("UID:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
|
// RELATED-TO с необязательным RELTYPE=PARENT (или без параметров) → UID родителя.
|
||||||
|
private val icsRelatedTo = Pattern.compile(
|
||||||
|
"RELATED-TO(?:;[^:\\r\\n]*)?:([^\\r\\n]+)",
|
||||||
|
Pattern.CASE_INSENSITIVE,
|
||||||
|
)
|
||||||
private val icsDtStamp = Pattern.compile("DTSTAMP[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsDtStamp = Pattern.compile("DTSTAMP[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
private val icsLastModified = Pattern.compile("LAST-MODIFIED[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsLastModified = Pattern.compile("LAST-MODIFIED[^:]*:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
private val icsPriority = Pattern.compile("PRIORITY:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
private val icsPriority = Pattern.compile("PRIORITY:([^\\r\\n]+)", Pattern.CASE_INSENSITIVE)
|
||||||
@@ -634,6 +641,7 @@ object CalDavClient {
|
|||||||
dueDate: LocalDate? = null,
|
dueDate: LocalDate? = null,
|
||||||
priority: Int = 0,
|
priority: Int = 0,
|
||||||
description: String = "",
|
description: String = "",
|
||||||
|
parentUid: String = "",
|
||||||
): DavTask {
|
): DavTask {
|
||||||
val uid = "${UUID.randomUUID()}@f7cloud.mobile"
|
val uid = "${UUID.randomUUID()}@f7cloud.mobile"
|
||||||
val ics = buildVTodoIcs(
|
val ics = buildVTodoIcs(
|
||||||
@@ -644,6 +652,7 @@ object CalDavClient {
|
|||||||
priority = priority,
|
priority = priority,
|
||||||
percentComplete = 0,
|
percentComplete = 0,
|
||||||
description = description,
|
description = description,
|
||||||
|
parentUid = parentUid,
|
||||||
)
|
)
|
||||||
val url = calendar.href.trimEnd('/') + "/$uid.ics"
|
val url = calendar.href.trimEnd('/') + "/$uid.ics"
|
||||||
val req = Request.Builder()
|
val req = Request.Builder()
|
||||||
@@ -670,6 +679,7 @@ object CalDavClient {
|
|||||||
description = description,
|
description = description,
|
||||||
calendarName = calendar.displayName,
|
calendarName = calendar.displayName,
|
||||||
calendarHref = calendar.href,
|
calendarHref = calendar.href,
|
||||||
|
parentUid = parentUid,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,6 +701,7 @@ object CalDavClient {
|
|||||||
priority = priority,
|
priority = priority,
|
||||||
percentComplete = percentComplete,
|
percentComplete = percentComplete,
|
||||||
description = description,
|
description = description,
|
||||||
|
parentUid = task.parentUid, // не терять связь с родителем при правке подзадачи
|
||||||
)
|
)
|
||||||
val req = Request.Builder()
|
val req = Request.Builder()
|
||||||
.url(task.href)
|
.url(task.href)
|
||||||
@@ -938,6 +949,7 @@ object CalDavClient {
|
|||||||
description = extractIcs(icsDescription, ics),
|
description = extractIcs(icsDescription, ics),
|
||||||
calendarName = calendarName,
|
calendarName = calendarName,
|
||||||
calendarHref = calendarHref,
|
calendarHref = calendarHref,
|
||||||
|
parentUid = extractIcs(icsRelatedTo, ics).trim(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -949,6 +961,7 @@ object CalDavClient {
|
|||||||
priority: Int,
|
priority: Int,
|
||||||
percentComplete: Int,
|
percentComplete: Int,
|
||||||
description: String,
|
description: String,
|
||||||
|
parentUid: String = "",
|
||||||
): String {
|
): String {
|
||||||
val now = Instant.now()
|
val now = Instant.now()
|
||||||
return buildString {
|
return buildString {
|
||||||
@@ -976,6 +989,9 @@ object CalDavClient {
|
|||||||
if (description.isNotBlank()) {
|
if (description.isNotBlank()) {
|
||||||
appendLine("DESCRIPTION:${escapeIcsText(description)}")
|
appendLine("DESCRIPTION:${escapeIcsText(description)}")
|
||||||
}
|
}
|
||||||
|
if (parentUid.isNotBlank()) {
|
||||||
|
appendLine("RELATED-TO;RELTYPE=PARENT:${escapeIcsText(parentUid)}")
|
||||||
|
}
|
||||||
appendLine("END:VTODO")
|
appendLine("END:VTODO")
|
||||||
appendLine("END:VCALENDAR")
|
appendLine("END:VCALENDAR")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,9 +50,17 @@ class DeckRepository {
|
|||||||
|
|
||||||
suspend fun loadBoardDetail(session: AuthSession, boardId: Int): DeckBoardDetail {
|
suspend fun loadBoardDetail(session: AuthSession, boardId: Int): DeckBoardDetail {
|
||||||
val c = client(session)
|
val c = client(session)
|
||||||
val board = getJson(c, "${apiBase(session)}/boards/$boardId") as JSONObject
|
// Доска-объект (метки/права) — НЕ критична: если запрос упадёт, доску всё равно
|
||||||
val labels = parseLabels(board.optJSONArray("labels"))
|
// открываем со стеками (раньше был баг — сбой board#read рушил всю загрузку).
|
||||||
val canEdit = board.optJSONObject("permissions")?.optBoolean("PERMISSION_EDIT", true) ?: true
|
var boardTitle = ""
|
||||||
|
var labels = emptyList<DeckLabel>()
|
||||||
|
var canEdit = true
|
||||||
|
runCatching { getJson(c, "${apiBase(session)}/boards/$boardId") as JSONObject }
|
||||||
|
.onSuccess { board ->
|
||||||
|
boardTitle = board.optString("title")
|
||||||
|
labels = parseLabels(board.optJSONArray("labels"))
|
||||||
|
canEdit = board.optJSONObject("permissions")?.optBoolean("PERMISSION_EDIT", true) ?: true
|
||||||
|
}
|
||||||
val stacksJson = getJson(c, "${apiBase(session)}/boards/$boardId/stacks") as? JSONArray ?: JSONArray()
|
val stacksJson = getJson(c, "${apiBase(session)}/boards/$boardId/stacks") as? JSONArray ?: JSONArray()
|
||||||
val stacks = mutableListOf<DeckStack>()
|
val stacks = mutableListOf<DeckStack>()
|
||||||
for (i in 0 until stacksJson.length()) {
|
for (i in 0 until stacksJson.length()) {
|
||||||
@@ -74,7 +82,7 @@ class DeckRepository {
|
|||||||
}
|
}
|
||||||
return DeckBoardDetail(
|
return DeckBoardDetail(
|
||||||
boardId = boardId,
|
boardId = boardId,
|
||||||
title = board.optString("title"),
|
title = boardTitle,
|
||||||
canEdit = canEdit,
|
canEdit = canEdit,
|
||||||
labels = labels,
|
labels = labels,
|
||||||
stacks = stacks.sortedBy { it.order },
|
stacks = stacks.sortedBy { it.order },
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import androidx.compose.animation.animateContentSize
|
|||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -345,7 +346,10 @@ fun TasksRow(
|
|||||||
onToggleComplete: () -> Unit,
|
onToggleComplete: () -> Unit,
|
||||||
onOpen: () -> Unit,
|
onOpen: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
onAddSubtask: (() -> Unit)? = null,
|
||||||
|
onDelete: (() -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
|
var menuOpen by remember { mutableStateOf(false) }
|
||||||
val hasMeta = showMeta && (task.listName.isNotBlank() || task.percentComplete in 1..99 || task.due.isNotBlank())
|
val hasMeta = showMeta && (task.listName.isNotBlank() || task.percentComplete in 1..99 || task.due.isNotBlank())
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
@@ -401,6 +405,43 @@ fun TasksRow(
|
|||||||
color = task.dueDateColor(),
|
color = task.dueDateColor(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// Меню «⋯»: вложенная задача / удалить (как в веб-версии)
|
||||||
|
if (onAddSubtask != null || onDelete != null) {
|
||||||
|
Box {
|
||||||
|
Text(
|
||||||
|
"⋯",
|
||||||
|
fontSize = 20.sp,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = F7Colors.TextSecondary,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(24.dp)
|
||||||
|
.clickable(
|
||||||
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
|
indication = null,
|
||||||
|
onClick = { menuOpen = true },
|
||||||
|
),
|
||||||
|
textAlign = androidx.compose.ui.text.style.TextAlign.Center,
|
||||||
|
)
|
||||||
|
androidx.compose.material3.DropdownMenu(
|
||||||
|
expanded = menuOpen,
|
||||||
|
onDismissRequest = { menuOpen = false },
|
||||||
|
containerColor = androidx.compose.ui.graphics.Color.White,
|
||||||
|
) {
|
||||||
|
onAddSubtask?.let { add ->
|
||||||
|
androidx.compose.material3.DropdownMenuItem(
|
||||||
|
text = { Text("Добавить вложенную задачу", color = F7Colors.TextPrimary) },
|
||||||
|
onClick = { menuOpen = false; add() },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onDelete?.let { del ->
|
||||||
|
androidx.compose.material3.DropdownMenuItem(
|
||||||
|
text = { Text("Удалить задачу", color = F7Colors.Error) },
|
||||||
|
onClick = { menuOpen = false; del() },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasMeta) {
|
if (hasMeta) {
|
||||||
@@ -1064,3 +1105,42 @@ private fun SmartListSettingRow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Диалог создания вложенной задачи (подзадачи) — по кнопке «Добавить вложенную задачу». */
|
||||||
|
@Composable
|
||||||
|
fun TaskSubtaskDialog(
|
||||||
|
parentTitle: String,
|
||||||
|
onConfirm: (String) -> Unit,
|
||||||
|
onDismiss: () -> Unit,
|
||||||
|
) {
|
||||||
|
var text by remember { mutableStateOf("") }
|
||||||
|
Dialog(onDismissRequest = onDismiss) {
|
||||||
|
Surface(shape = RoundedCornerShape(16.dp), color = Color.White) {
|
||||||
|
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||||
|
Text(
|
||||||
|
"Вложенная задача",
|
||||||
|
style = MaterialTheme.typography.titleMedium.copy(fontSize = 18.sp),
|
||||||
|
fontWeight = FontWeight.SemiBold,
|
||||||
|
color = F7Colors.TextPrimary,
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
"к «$parentTitle»",
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = F7Colors.TextSecondary,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
)
|
||||||
|
F7OutlinedField(value = text, onValueChange = { text = it }, label = "Название")
|
||||||
|
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
|
F7SecondaryButton("Отмена", onClick = onDismiss, modifier = Modifier.weight(1f))
|
||||||
|
F7PrimaryButton(
|
||||||
|
text = "Создать",
|
||||||
|
onClick = { onConfirm(text.trim()) },
|
||||||
|
enabled = text.isNotBlank(),
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ data class TaskItem(
|
|||||||
val description: String,
|
val description: String,
|
||||||
val listHref: String,
|
val listHref: String,
|
||||||
val listName: String,
|
val listName: String,
|
||||||
|
val parentUid: String = "",
|
||||||
) {
|
) {
|
||||||
val isCompleted: Boolean
|
val isCompleted: Boolean
|
||||||
get() = status.equals("COMPLETED", ignoreCase = true) || percentComplete >= 100
|
get() = status.equals("COMPLETED", ignoreCase = true) || percentComplete >= 100
|
||||||
@@ -46,6 +47,7 @@ data class TaskItem(
|
|||||||
description = description,
|
description = description,
|
||||||
calendarName = listName,
|
calendarName = listName,
|
||||||
calendarHref = listHref,
|
calendarHref = listHref,
|
||||||
|
parentUid = parentUid,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,6 +82,7 @@ class TasksRepository {
|
|||||||
dueDate: LocalDate? = null,
|
dueDate: LocalDate? = null,
|
||||||
priority: Int = 0,
|
priority: Int = 0,
|
||||||
description: String = "",
|
description: String = "",
|
||||||
|
parentUid: String = "",
|
||||||
): TaskItem {
|
): TaskItem {
|
||||||
val client = authedClient(session)
|
val client = authedClient(session)
|
||||||
val calendar = calendarForHref(session, listHref)
|
val calendar = calendarForHref(session, listHref)
|
||||||
@@ -90,6 +93,7 @@ class TasksRepository {
|
|||||||
dueDate = dueDate,
|
dueDate = dueDate,
|
||||||
priority = priority,
|
priority = priority,
|
||||||
description = description,
|
description = description,
|
||||||
|
parentUid = parentUid,
|
||||||
).toTaskItem()
|
).toTaskItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +161,7 @@ class TasksRepository {
|
|||||||
description = description,
|
description = description,
|
||||||
listHref = calendarHref,
|
listHref = calendarHref,
|
||||||
listName = calendarName,
|
listName = calendarName,
|
||||||
|
parentUid = parentUid,
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun calendarSlug(href: String): String {
|
private fun calendarSlug(href: String): String {
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import androidx.compose.runtime.Composable
|
|||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
@@ -31,11 +34,19 @@ fun TasksScreen(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
createRequest: Int = 0,
|
createRequest: Int = 0,
|
||||||
openListSlug: String? = null,
|
openListSlug: String? = null,
|
||||||
|
showListsRequest: Int = 0,
|
||||||
onOpenListConsumed: () -> Unit = {},
|
onOpenListConsumed: () -> Unit = {},
|
||||||
onUnauthorized: () -> Unit = {},
|
onUnauthorized: () -> Unit = {},
|
||||||
) {
|
) {
|
||||||
val vm: TasksViewModel = viewModel()
|
val vm: TasksViewModel = viewModel()
|
||||||
val state by vm.state.collectAsState()
|
val state by vm.state.collectAsState()
|
||||||
|
// Родитель для создаваемой подзадачи (открывает диалог ввода названия).
|
||||||
|
var subtaskParent by remember { mutableStateOf<TaskItem?>(null) }
|
||||||
|
|
||||||
|
// Стрелка «назад» нижней панели на Задачах → показать панель списков (закрыть открытый список).
|
||||||
|
LaunchedEffect(showListsRequest) {
|
||||||
|
if (showListsRequest > 0) vm.closeList()
|
||||||
|
}
|
||||||
|
|
||||||
LaunchedEffect(session.serverUrl, session.username, session.davUserId) {
|
LaunchedEffect(session.serverUrl, session.username, session.davUserId) {
|
||||||
vm.load(session)
|
vm.load(session)
|
||||||
@@ -103,6 +114,8 @@ fun TasksScreen(
|
|||||||
onReload = { vm.refreshTasks(session) },
|
onReload = { vm.refreshTasks(session) },
|
||||||
onToggleCompletedExpanded = vm::toggleCompletedExpanded,
|
onToggleCompletedExpanded = vm::toggleCompletedExpanded,
|
||||||
onDeleteCompleted = { vm.deleteCompletedTasks(session) },
|
onDeleteCompleted = { vm.deleteCompletedTasks(session) },
|
||||||
|
onAddSubtask = { subtaskParent = it },
|
||||||
|
onDeleteTask = { vm.deleteTask(session, it) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,6 +156,18 @@ fun TasksScreen(
|
|||||||
onDismiss = vm::closeSettings,
|
onDismiss = vm::closeSettings,
|
||||||
onSwipeBack = vm::closeSettings,
|
onSwipeBack = vm::closeSettings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Диалог «Добавить вложенную задачу»
|
||||||
|
subtaskParent?.let { parent ->
|
||||||
|
TaskSubtaskDialog(
|
||||||
|
parentTitle = parent.summary,
|
||||||
|
onConfirm = { title ->
|
||||||
|
vm.createSubtask(session, parent, title)
|
||||||
|
subtaskParent = null
|
||||||
|
},
|
||||||
|
onDismiss = { subtaskParent = null },
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@@ -162,7 +187,15 @@ private fun TasksMainContent(
|
|||||||
onReload: () -> Unit,
|
onReload: () -> Unit,
|
||||||
onToggleCompletedExpanded: () -> Unit,
|
onToggleCompletedExpanded: () -> Unit,
|
||||||
onDeleteCompleted: () -> Unit,
|
onDeleteCompleted: () -> Unit,
|
||||||
|
onAddSubtask: (TaskItem) -> Unit,
|
||||||
|
onDeleteTask: (TaskItem) -> Unit,
|
||||||
) {
|
) {
|
||||||
|
// Подзадачи (RELATED-TO) — рисуем под родителем с отступом; из верхнего уровня исключаем.
|
||||||
|
val childrenByParent = remember(state.visibleActiveGroups) {
|
||||||
|
state.visibleActiveGroups.flatMap { it.tasks }
|
||||||
|
.filter { it.parentUid.isNotBlank() }
|
||||||
|
.groupBy { it.parentUid }
|
||||||
|
}
|
||||||
Column(modifier = Modifier.fillMaxSize()) {
|
Column(modifier = Modifier.fillMaxSize()) {
|
||||||
TasksToolbar(
|
TasksToolbar(
|
||||||
serverUrl = session.serverUrl,
|
serverUrl = session.serverUrl,
|
||||||
@@ -212,13 +245,27 @@ private fun TasksMainContent(
|
|||||||
modifier = Modifier.padding(bottom = 4.dp),
|
modifier = Modifier.padding(bottom = 4.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
items(group.tasks, key = { it.uid }) { task ->
|
items(group.tasks.filter { it.parentUid.isBlank() }, key = { it.uid }) { task ->
|
||||||
|
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||||
TasksRow(
|
TasksRow(
|
||||||
task = task,
|
task = task,
|
||||||
serverUrl = session.serverUrl,
|
serverUrl = session.serverUrl,
|
||||||
onToggleComplete = { onToggleComplete(task) },
|
onToggleComplete = { onToggleComplete(task) },
|
||||||
onOpen = { onOpenTask(task) },
|
onOpen = { onOpenTask(task) },
|
||||||
|
onAddSubtask = { onAddSubtask(task) },
|
||||||
|
onDelete = { onDeleteTask(task) },
|
||||||
)
|
)
|
||||||
|
childrenByParent[task.uid].orEmpty().forEach { sub ->
|
||||||
|
TasksRow(
|
||||||
|
task = sub,
|
||||||
|
serverUrl = session.serverUrl,
|
||||||
|
onToggleComplete = { onToggleComplete(sub) },
|
||||||
|
onOpen = { onOpenTask(sub) },
|
||||||
|
onDelete = { onDeleteTask(sub) },
|
||||||
|
modifier = Modifier.padding(start = 24.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ class TasksViewModel(
|
|||||||
summary: String,
|
summary: String,
|
||||||
dueInput: String,
|
dueInput: String,
|
||||||
priority: Int,
|
priority: Int,
|
||||||
|
parentUid: String = "",
|
||||||
) {
|
) {
|
||||||
val listHref = _state.value.selectedListHref ?: return
|
val listHref = _state.value.selectedListHref ?: return
|
||||||
if (summary.isBlank()) {
|
if (summary.isBlank()) {
|
||||||
@@ -218,6 +219,7 @@ class TasksViewModel(
|
|||||||
summary = summary.trim(),
|
summary = summary.trim(),
|
||||||
dueDate = dueDate,
|
dueDate = dueDate,
|
||||||
priority = priority,
|
priority = priority,
|
||||||
|
parentUid = parentUid,
|
||||||
)
|
)
|
||||||
}.onSuccess {
|
}.onSuccess {
|
||||||
_state.update {
|
_state.update {
|
||||||
@@ -301,6 +303,30 @@ class TasksViewModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Удаление конкретной задачи из списка (per-task меню «⋯»), не только открытой детали. */
|
||||||
|
fun deleteTask(session: AuthSession, task: TaskItem) {
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
_state.update { it.copy(saving = true, error = null) }
|
||||||
|
runCatching { repository.deleteTask(session, task) }
|
||||||
|
.onSuccess {
|
||||||
|
_state.update {
|
||||||
|
it.copy(saving = false, detailTask = it.detailTask?.takeIf { d -> d.uid != task.uid })
|
||||||
|
}
|
||||||
|
_state.value.selectedListHref?.let { loadTasks(session, it) }
|
||||||
|
}
|
||||||
|
.onFailure { t ->
|
||||||
|
_state.update {
|
||||||
|
it.copy(saving = false, error = t.message ?: "Не удалось удалить", unauthorized = t is UnauthorizedException)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Создать подзадачу к [parent] с заголовком [summary]. */
|
||||||
|
fun createSubtask(session: AuthSession, parent: TaskItem, summary: String) {
|
||||||
|
createTask(session, summary, "", 0, parentUid = parent.uid)
|
||||||
|
}
|
||||||
|
|
||||||
fun deleteDetail(session: AuthSession) {
|
fun deleteDetail(session: AuthSession) {
|
||||||
val task = _state.value.detailTask ?: return
|
val task = _state.value.detailTask ?: return
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
|||||||