电子说
本项目是基于开源项目Markwon进行适用harmonyos的移植和开发的。
移植版本:v4.6.2
)~~项目已完成移植,完成度50%,差异如下
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
。build.gradle
文件中添加mavenCentral()
:// Top-level build file where you can add configuration options common to all sub-projects/modules. ... buildscript { repositories { ... mavenCentral() } ... } allprojects { repositories { ... mavenCentral() } }
build.gradle
文件中添加``... dependencies { ... implementation 'com.gitee.ts_ohos:markwon:1.0.1' }
更多用法参考本项目的 demo ,原项目Java Doc与OHOS的文档。
主要用法如下:
< u >< i >H< sup >T< sub >M< /sub >< /sup >< b >< s >L< /s >< /b >< /i >< /u >
*HTML*
< ScrollView android:id="@+id/scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="?android:attr/actionBarSize" > < TextView android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="16dip" android:lineSpacingExtra="2dip" android:textSize="16sp" tools:text="yonman" / > < /ScrollView >
// username, repo, branch, lastPathSegment String RE_FILE = "^"+TextUtils.getHttps()+"github.com/([w-.]+?)/([w-.]+?)/(?:blob|raw)/([w-.]+?)/(.+)$"; private static final String RE_REPOSITORY = "^"+TextUtils.getHttps()+"github.com/([w-.]+?)/([w-.]+?)/*$"; public static Pair< String, String > parseRepository(String url) { Pattern pattern = Pattern.compile(RE_REPOSITORY); Matcher matcher = pattern.matcher(url); if (matcher.matches()) { String user = matcher.group(1); String repository = matcher.group(2); if (TextUtils.isEmpty(user) || TextUtils.isEmpty(user)) { return new Pair< >(null, null); } else { return new Pair< >(user, repository); } } else { return new Pair< String, String >(null, null); } }
private static final String SAMPLE_PREFIX = "io.noties.markwon.app."; @NonNull public static List< Sample > readSamples(@NonNull Context context) { RawFileEntry rawFileEntry = context.getResourceManager().getRawFileEntry("resources/rawfile/samples.json"); try (InputStream inputStream = rawFileEntry.openRawFile()) { return readSamples(inputStream); } catch (IOException e) { throw new RuntimeException(e); } }
gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md
参考前往。或+mau123789学习,是v喔
1. 主界面展示
2. 点击item中plugin标签,显示选择结果
*注 : demo中的图片是点击不同标签,进行筛选显示结果
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
审核编辑 黄宇
全部0条评论
快来发表一下你的评论吧 !