mirror of
https://github.com/YTVanced/VancedManager
synced 2024-12-03 00:07:25 +00:00
update APIs
This commit is contained in:
parent
ce3977c667
commit
a0761554b2
5 changed files with 16 additions and 24 deletions
|
@ -4,6 +4,8 @@ plugins {
|
||||||
id("kotlin-parcelize")
|
id("kotlin-parcelize")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val composeVersion = "1.1.0-beta04"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = 31
|
compileSdk = 31
|
||||||
|
|
||||||
|
@ -49,7 +51,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
kotlinCompilerExtensionVersion = "1.1.0-alpha06"
|
kotlinCompilerExtensionVersion = composeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,7 +84,7 @@ dependencies {
|
||||||
|
|
||||||
// AndroidX
|
// AndroidX
|
||||||
implementation("androidx.core:core-ktx:1.7.0")
|
implementation("androidx.core:core-ktx:1.7.0")
|
||||||
implementation("androidx.appcompat:appcompat:1.3.1")
|
implementation("androidx.appcompat:appcompat:1.4.0")
|
||||||
implementation("androidx.browser:browser:1.4.0")
|
implementation("androidx.browser:browser:1.4.0")
|
||||||
implementation("androidx.preference:preference-ktx:1.1.1")
|
implementation("androidx.preference:preference-ktx:1.1.1")
|
||||||
implementation("androidx.activity:activity-compose:1.4.0")
|
implementation("androidx.activity:activity-compose:1.4.0")
|
||||||
|
@ -92,13 +94,12 @@ dependencies {
|
||||||
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion")
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion")
|
||||||
|
|
||||||
// Compose
|
// Compose
|
||||||
val composeVersion = "1.1.0-beta03"
|
|
||||||
implementation("androidx.compose.compiler:compiler:$composeVersion")
|
implementation("androidx.compose.compiler:compiler:$composeVersion")
|
||||||
implementation("androidx.compose.foundation:foundation:$composeVersion")
|
implementation("androidx.compose.foundation:foundation:$composeVersion")
|
||||||
implementation("androidx.compose.material:material-icons-core:$composeVersion")
|
implementation("androidx.compose.material:material-icons-core:$composeVersion")
|
||||||
implementation("androidx.compose.material:material-icons-extended:$composeVersion")
|
implementation("androidx.compose.material:material-icons-extended:$composeVersion")
|
||||||
implementation("androidx.compose.material:material:$composeVersion")
|
implementation("androidx.compose.material:material:$composeVersion")
|
||||||
implementation("androidx.compose.material3:material3:1.0.0-alpha01")
|
implementation("androidx.compose.material3:material3:1.0.0-alpha02")
|
||||||
implementation("androidx.compose.runtime:runtime-livedata:$composeVersion")
|
implementation("androidx.compose.runtime:runtime-livedata:$composeVersion")
|
||||||
implementation("androidx.compose.ui:ui-tooling:$composeVersion")
|
implementation("androidx.compose.ui:ui-tooling:$composeVersion")
|
||||||
implementation("androidx.compose.ui:ui-util:$composeVersion")
|
implementation("androidx.compose.ui:ui-util:$composeVersion")
|
||||||
|
|
|
@ -9,7 +9,6 @@ import androidx.compose.ui.Modifier
|
||||||
@Composable
|
@Composable
|
||||||
fun ManagerScaffold(
|
fun ManagerScaffold(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
scaffoldState: ScaffoldState = rememberScaffoldState(),
|
|
||||||
topBar: @Composable () -> Unit = {},
|
topBar: @Composable () -> Unit = {},
|
||||||
floatingActionButton: @Composable () -> Unit = {},
|
floatingActionButton: @Composable () -> Unit = {},
|
||||||
floatingActionButtonPosition: FabPosition = FabPosition.End,
|
floatingActionButtonPosition: FabPosition = FabPosition.End,
|
||||||
|
@ -22,7 +21,6 @@ fun ManagerScaffold(
|
||||||
// ) {
|
// ) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
scaffoldState = scaffoldState,
|
|
||||||
topBar = topBar,
|
topBar = topBar,
|
||||||
floatingActionButton = floatingActionButton,
|
floatingActionButton = floatingActionButton,
|
||||||
floatingActionButtonPosition = floatingActionButtonPosition,
|
floatingActionButtonPosition = floatingActionButtonPosition,
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
package com.vanced.manager.ui.widget.list
|
package com.vanced.manager.ui.widget.list
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.material3.Checkbox
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import com.vanced.manager.ui.component.color.managerTextColor
|
import com.vanced.manager.ui.component.color.managerTextColor
|
||||||
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
||||||
import com.vanced.manager.ui.component.modifier.managerClickable
|
import com.vanced.manager.ui.component.modifier.managerClickable
|
||||||
import com.vanced.manager.ui.component.text.ManagerText
|
import com.vanced.manager.ui.component.text.ManagerText
|
||||||
import com.vanced.manager.ui.widget.checkbox.ManagerAnimatedCheckbox
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CheckboxItem(
|
fun CheckboxItem(
|
||||||
|
@ -31,13 +29,12 @@ fun CheckboxItem(
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
trailing = {
|
trailing = {
|
||||||
ManagerAnimatedCheckbox(
|
Checkbox(
|
||||||
size = 24.dp,
|
checked = isChecked,
|
||||||
shape = CircleShape,
|
onCheckedChange = {
|
||||||
isChecked = isChecked
|
toggle()
|
||||||
) {
|
}
|
||||||
toggle()
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
|
@ -1,15 +1,13 @@
|
||||||
package com.vanced.manager.ui.widget.list
|
package com.vanced.manager.ui.widget.list
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.RadioButton
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import com.vanced.manager.ui.component.color.managerTextColor
|
import com.vanced.manager.ui.component.color.managerTextColor
|
||||||
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
||||||
import com.vanced.manager.ui.component.modifier.managerClickable
|
import com.vanced.manager.ui.component.modifier.managerClickable
|
||||||
import com.vanced.manager.ui.component.text.ManagerText
|
import com.vanced.manager.ui.component.text.ManagerText
|
||||||
import com.vanced.manager.ui.widget.radiobutton.ManagerAnimatedRadiobutton
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun <T> RadiobuttonItem(
|
fun <T> RadiobuttonItem(
|
||||||
|
@ -31,10 +29,8 @@ fun <T> RadiobuttonItem(
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
trailing = {
|
trailing = {
|
||||||
ManagerAnimatedRadiobutton(
|
RadioButton(
|
||||||
size = 24.dp,
|
selected = isSelected,
|
||||||
shape = CircleShape,
|
|
||||||
isSelected = isSelected,
|
|
||||||
onClick = onClick
|
onClick = onClick
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
val kotlinVersion = "1.5.31"
|
val kotlinVersion = "1.6.0"
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:7.0.3")
|
classpath("com.android.tools.build:gradle:7.0.3")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||||
|
|
Loading…
Reference in a new issue