导航:首页 > 源码编译 > android文本编辑器源码

android文本编辑器源码

发布时间:2022-08-30 11:44:02

① 如何实现一个 android 端的富文本编辑器

利用XML进行文本内容和格式描述,图片音频资源通过uri引入,XML解析就自己添加咯。

② 如何实现一个 Android 端的富文本编辑器

  1. WebView + javaScript;

  2. EditText + Span;

  3. scrollview + view;

  1. 效果图:

其他

在scrollview实现一些view的添加和删除,以及组件间的拼接,就可以实现一个很简单的可定制的富文本编辑器。

③ 如何实现一个 Android 端的富文本编辑器

RichEditor for Android 是 Android的一个超酷的所见即所得的富文本编辑器控件。
它支持的功能有:Bold、Italic、Subscript、Superscript、Strikethrough、Underline、Justify Left、Justify Center、Justify Right、Heading 1、Heading 2、Heading 3、Heading 4、Heading 5、Heading 6、Undo、Redo、Indent、Outdent、Insert Image、Insert Link、Text Color、Text Background Color、Milestone、Blockquote
RichEditor 是一个继承自 WebView 的自定义 view,枚举类型 Type 定了它所支持的排版格式。
编辑器的核心功能由 js 实现,RichEditor 封装了 js 的功能,为上层提供了 java 接口

④ 如何实现一个 Android 端的富文本编辑器

参考如下知乎的内容:

在 Android 上实现富文本编辑器的思路大致分为三种:
使用多种 Layout 布局,每一种布局对应一种 HTML 格式,比如图片,比如顺序列表等。具体的实现例子可以参考这个链接。 Medium 和 Evernote 的富文本编辑就是采用这种方式实现的。总体来说比较复杂。
WebView + JavaScript 实现。现在 Web 端有很多成熟的 JavaScript 富文本编辑库,比如 Squire ,你只需要做好 WebView 和 JavaScript 的交互就可以了(多写回调函数)。理论上虽然是这么说,但是在实现过程你需要解决 WebView 的兼容性问题( Android 4.4 及其以上版本和 4.4 以下版本的 WebView 内核不一样),以及其他一些不可预见的问题(比如我就遇到无法粘贴文字的问题)。
EditText + Span 。 Android 的 TextView 原生支持诸如粗体、删除线、引用等 Span ,要实现简单的富文本编辑需求,可操作性还是比较大的。综合再三,我选择了这种方式来实现自己的需求。

⑤ android文本编辑器,那位那位高人有源码 给发一份

你已经好高了………………

坐等更高的

网上找了个JAVA的,看看有用没

public class FileUtils
{
public static final int S_IRWXU = 00700;
public static final int S_IRUSR = 00400;
public static final int S_IWUSR = 00200;
public static final int S_IXUSR = 00100;

public static final int S_IRWXG = 00070;
public static final int S_IRGRP = 00040;
public static final int S_IWGRP = 00020;
public static final int S_IXGRP = 00010;

public static final int S_IRWXO = 00007;
public static final int S_IROTH = 00004;
public static final int S_IWOTH = 00002;
public static final int S_IXOTH = 00001;

public static final class FileStatus {
public int dev;
public int ino;
public int mode;
public int nlink;
public int uid;
public int gid;
public int rdev;
public long size;
public int blksize;
public long blocks;
public long atime;
public long mtime;
public long ctime;
}

public static native boolean getFileStatus(String path, FileStatus status);

private static final Pattern SAFE_FILENAME_PATTERN = Pattern.compile("[\\w%+,./=_-]+");

public static boolean File(File srcFile, File destFile) {
boolean result = false;
try {
InputStream in = new FileInputStream(srcFile);
try {
result = ToFile(in, destFile);
} finally {
in.close();
}
} catch (IOException e) {
result = false;
}
return result;
}

public static boolean ToFile(InputStream inputStream, File destFile) {
try {
if (destFile.exists()) {
destFile.delete();
}
OutputStream out = new FileOutputStream(destFile);
try {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) >= 0) {
out.write(buffer, 0, bytesRead);
}
} finally {
out.close();
}
return true;
} catch (IOException e) {
return false;
}
}

public static boolean isFilenameSafe(File file) {
return SAFE_FILENAME_PATTERN.matcher(file.getPath()).matches();
}

public static String readTextFile(File file, int max, String ellipsis) throws IOException {
InputStream input = new FileInputStream(file);
try {
long size = file.length();
if (max > 0 || (size > 0 && max == 0)) {

if (size > 0 && (max == 0 || size < max)) max = (int) size;
byte[] data = new byte[max + 1];
int length = input.read(data);
if (length <= 0) return "";
if (length <= max) return new String(data, 0, length);
if (ellipsis == null) return new String(data, 0, max);
return new String(data, 0, max) + ellipsis;
} else if (max < 0) { // "tail" mode: keep the last N
int len;
boolean rolled = false;
byte[] last = null, data = null;
do {
if (last != null) rolled = true;
byte[] tmp = last; last = data; data = tmp;
if (data == null) data = new byte[-max];
len = input.read(data);
} while (len == data.length);

if (last == null && len <= 0) return "";
if (last == null) return new String(data, 0, len);
if (len > 0) {
rolled = true;
System.array(last, len, last, 0, last.length - len);
System.array(data, 0, last, last.length - len, len);
}
if (ellipsis == null || !rolled) return new String(last);
return ellipsis + new String(last);
} else {
ByteArrayOutputStream contents = new ByteArrayOutputStream();
int len;
byte[] data = new byte[1024];
do {
len = input.read(data);
if (len > 0) contents.write(data, 0, len);
} while (len == data.length);
return contents.toString();
}
} finally {
input.close();
}
}
}

⑥ 如何实现一个 Android 端的富文本编辑器

jota文本编辑器和jota ,基本全汉化的,小巧精悍,我用它们写txt和html很方便。jota 我有破解版的,能同时打开多个文件。尤其是这两款是我见过的安卓上唯一带强悍的正则表达式替换功能的文本编辑器。用此功能可以过滤html标识符,实现html转txt。要的话上传附件给你。计数器在文件→属性里面。

⑦ 用android开发一个简单的文本编辑器,我想提供给用户设置字体大小和阅读模式,应该怎么做

索爱ST17i是安卓2.3的系统所以不能直接修改系统字体。但可以自己修改。首先确定你的手机已经ROOT了,才可以修改。然后安装RE管理器,再进入SYSTEM找到BUILD.PROP,长按,出现选择菜单,选择用文本编辑器打开,更改ro.sf.lcd_density等号后面的数字,240为目前常规大小字体,167为该ROM原始默认,200则是修改版数值,167-240间可任意选择一个数字,然后按menu(最中间实体键)选择保存并退出,重启手机即可。还有更简单的方法,下载一款名叫“LCDDensityChanger”的应用就可以直接修改了。下载地址这里发不了,用短消息发给你了。

阅读全文

与android文本编辑器源码相关的资料

热点内容
怎么找一个软件里面的源码 浏览:772
python设定安装源 浏览:831
boss直聘程序员面试方式 浏览:484
cc服务器怎么处理 浏览:455
福万通app哪里查到期 浏览:344
苹果换手机如何还原app 浏览:560
云服务器测试技巧 浏览:546
网盘里面的文件如何解压 浏览:463
linux查看应用的端口 浏览:97
拉伸训练pdf 浏览:92
如何拨号到中央服务器 浏览:648
中国天才少年程序员 浏览:352
编程思想pdf 浏览:282
加密欧美航线 浏览:48
svn怎么看服务器的地址 浏览:187
骑马与砍杀1命令部队用盾牌 浏览:595
光缆pdf 浏览:350
加密流量实时监测 浏览:628
360压缩和好压哪个好 浏览:61
python判断变量是否为list 浏览:906