Skip to content

Releases: Knightwood/ComposePreference

1.2.8

Choose a tag to compare

@Knightwood Knightwood released this 19 Feb 02:36

增加datastore委托工具。

这是一个示例:

//1. 需要有一个协程作用域
val scope = CoroutineScope(Dispatchers.IO)
//2. 你可以将属性委托给datastore,变量名就是key的名称
var username by dataStore.getting(11, scope)

//3. 对数据读写就可以存储到datastore
MaterialTheme {
    //可以在compose中观察数据变化
    val va = dataStore.asDataFlow<Int>("username").collectAsState(initial = 11)
    Column {
        Button(onClick = {
            val randoms = Random.nextInt(0, 11)
            //赋值就会将数据写入datastore
            username = randoms
            //访问变量就可以得到刚刚写入的数据
            println(username)
        }) {
            Text("Random")
        }
        Text("value:${va.value}")
    }
}

1.2.7

Choose a tag to compare

@Knightwood Knightwood released this 24 Dec 03:08

重写ui界面

1.2.6

Choose a tag to compare

@Knightwood Knightwood released this 18 Nov 06:56
1

1.2.5

Choose a tag to compare

@Knightwood Knightwood released this 06 Jun 10:09

修复switch有的设备上用不了
修改参数

1.2.4

Choose a tag to compare

@Knightwood Knightwood released this 31 May 10:01

1,增加默认存储,使ui可以用在任何地方,不必包裹在preferenceScope中
2,新增“主题系统”,使ui的间距,文本样式可以自定义。并新增修饰符参数
3,gradle修改到8.5
4,存储行为优化,去除textfield中的异步行为

1.2.3

Choose a tag to compare

@Knightwood Knightwood released this 24 Feb 12:51
6e0eeaf

修改data-core为jar包,精简依赖

1.2.2

Choose a tag to compare

@Knightwood Knightwood released this 24 Feb 12:50

添加委托工具
修复slider无法滑动
修改依赖
其他优化

1.2.1

Choose a tag to compare

@Knightwood Knightwood released this 21 Feb 11:42

完善文档
增加文本编辑框类型preference
修改样式

分离模块

Choose a tag to compare

@Knightwood Knightwood released this 20 Feb 05:05

将mmkv,datastore,oreference与界面模块分离,可单独引入

1.1

1.1

Choose a tag to compare

@Knightwood Knightwood released this 15 Feb 09:19
b037d41
Update README.md