当前位置: 首页 > news >正文

西樵做网站wordpress修改文章默认排序

西樵做网站,wordpress修改文章默认排序,西安云众网站建设,厦门外贸网站最近在项目开发的过程中需要用到 Jetpack Compose#xff0c;之前没有接触过Compose#xff0c;所以项目一直没有用到Compose。通过查看官网发现Compose上手比较快#xff0c;但是准备比较复杂的布局要转换成Compose 不是一件容易的事情。那有没有可能只是对成熟的项目中的x…最近在项目开发的过程中需要用到 Jetpack Compose之前没有接触过Compose所以项目一直没有用到Compose。通过查看官网发现Compose上手比较快但是准备比较复杂的布局要转换成Compose 不是一件容易的事情。那有没有可能只是对成熟的项目中的xml 布局中的某一部分进行改造让其能够在xml 布局中也能使用Compose通过查阅网上相关资料发现并非难事。于是就动手开始改造了。 一、添加kotlin Jetpack Compose 必须使用kotlin 语言进行开发在现有的项目中如果是使用的Java开发需要首先添加kotlin环境然后将相关的代码转换成kotlin.由于我的项目中已经有kotlin环境无需再适配kotlin环境只需将相关部分的Java 代码通过AndroidStudio的代码转换工具转换成kotlin 即可。如果不熟悉现有项目转换成kotlin 环境的可以在网上查阅相关资料. 二、在应用中使用 Jetpack 库 所有 Jetpack 组件都可在 Google Maven 代码库中找到。 打开 settings.gradle 文件将 google() 代码库添加到 dependencyResolutionManagement { repositories {...}} 块中如下所示 dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()jcenter()} } 在项目的根目录下build.gradle 添加kotlin  plugins {id com.android.application version 7.3.1 apply falseid com.android.library version 7.3.1 apply falseid org.jetbrains.kotlin.android version 1.7.20 apply false } 在模块的 build.gradle 文件中添加 Jetpack 依赖 android {//....buildFeatures {compose true}composeOptions {kotlinCompilerExtensionVersion 1.3.2} }然后您可以在模块的 build.gradle 文件中添加 Jetpack 组件例如 LiveData 和 ViewModel 等架构组件如下所示 def composeBom platform(androidx.compose:compose-bom:2024.03.00)implementation composeBomandroidTestImplementation composeBom// Choose one of the following:// Material Design 3implementation androidx.compose.material3:material3// or Material Design 2implementation androidx.compose.material:material// or skip Material Design and build directly on top of foundational componentsimplementation androidx.compose.foundation:foundation// or only import the main APIs for the underlying toolkit systems,// such as input and measurement/layoutimplementation androidx.compose.ui:ui// Android Studio Preview supportimplementation androidx.compose.ui:ui-tooling-previewdebugImplementation androidx.compose.ui:ui-tooling// UI TestsandroidTestImplementation androidx.compose.ui:ui-test-junit4debugImplementation androidx.compose.ui:ui-test-manifest// Optional - Included automatically by material, only add when you need// the icons but not the material library (e.g. when using Material3 or a// custom design system based on Foundation)implementation androidx.compose.material:material-icons-core// Optional - Add full set of material iconsimplementation androidx.compose.material:material-icons-extended// Optional - Add window size utilsimplementation androidx.compose.material3:material3-window-size-class// Optional - Integration with activitiesimplementation androidx.activity:activity-compose:1.8.2// Optional - Integration with ViewModelsimplementation androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1// Optional - Integration with LiveDataimplementation androidx.compose.runtime:runtime-livedata// Optional - Integration with RxJavaimplementation androidx.compose.runtime:runtime-rxjava2 三、 在xml 使用compose  在xml布局找到需要替换的元素例如需要将TextView 替换成ComposeView //AppCompatTextView 为改造前的布局!--androidx.appcompat.widget.AppCompatTextViewandroid:idid/tv_messageandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:textSize16spandroid:layout_marginTop8dpapp:layout_constraintBottom_toBottomOfparent /-- //替换后的布局androidx.compose.ui.platform.ComposeViewandroid:idid/compose_viewandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:layout_marginTop8dpapp:layout_constraintTop_toBottomOfparent / 在Kotlin 代码中修改如下 var composeView: ComposeView var textString:String // ... 插入其他代码 composeView findViewById(R.id.compose_view) composeView.setContent {MarkdownText(markdown textString,style TextStyle(fontSize 16.sp)) }
http://www.tj-hxxt.cn/news/130985.html

相关文章:

  • 做调查的网站有哪些免费设计app软件
  • 漯河做网站优化响应式布局优缺点
  • 松江专业做网站寺庙建设网站的意义
  • 免费建设外贸网站做翻译小说网站赚钱吗
  • 全国高速公路施工建设有没有网站网络seo
  • 自己做免费网站的流程wordpress交友
  • 西部数码创建子网站温州seo排名
  • 知道网站是wp程序做的如何仿站网站建设平台怎么样
  • 网站后期维护是做什么网络营销模式下品牌推广途径
  • 鑫菲互动网站建设公司河南省住房城乡和建设厅网站
  • 京东商城网站风格创个网站怎么弄
  • 二元期货交易网站开发建设信用卡积分兑换商城网站
  • 算命网站怎么做微信公众号网页版登录入口
  • 做网站不挣钱茶叶市场网站建设方案
  • 手机网站运营成都网站制作培训多少钱
  • 网站的策划做推广电子商务网站建站
  • 网站做下载wordwordpress 设置footer
  • 月嫂的个人简历网站模板平面设计学徒
  • 重庆哪里有做网络推广网站配置优化
  • 济南高新区 网站建设公司做任务转比特币的网站
  • 平顶山网站建设费用工作总结开头
  • 企业网站报价方案下载建设银行 公户 该网站使用过期的
  • 如何在百度做网站推广wordpress禁止某ip
  • 如何建设一个文件分享网站seo静态页源码
  • 网站建设情况说明网页设计的网网页设计的网站
  • 南京装饰公司网站建设流量精灵
  • 网站开发标准建设网站的软件
  • 企业官网网站建设报价安装discuz x 3.1 网站虚拟主机的要求
  • 小程序网站建设y021长沙网站建设费用
  • 满城区城乡建设局网站百度竞价推广代运营话术