Skip to content

Commit

Permalink
Fix missing text on inline image thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Mar 1, 2019
1 parent a4bd6dd commit fce2464
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ android {
testBuildType 'debugTest'

defaultConfig {
versionCode 218
versionCode 219
versionName "4.15"
minSdkVersion 17
targetSdkVersion 28
Expand Down
7 changes: 7 additions & 0 deletions irccloud-android.iml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<sourceFolder url="file://$MODULE_DIR$/tests/src" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
<excludeFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources" />
<excludeFolder url="file://$MODULE_DIR$/build/generated/source/r" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
Expand All @@ -88,18 +89,24 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/data_binding_dependency_artifacts" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/data_binding_layout_info_type_merge" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/external_libs_dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/feature_data_binding_base_feature_info" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_app_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_aapt_derived_proguard_rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_main_dex_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/linked_res_for_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/metadata_feature_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/module_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-files" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
Expand Down
33 changes: 17 additions & 16 deletions src/com/irccloud/android/data/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,23 @@ public Event(Event e) {
public String toString() {
return "{" +
"cid: " + cid +
" bid: " + bid +
" eid: " + eid +
" type: " + type +
" timestamp: " + timestamp +
" from: " + from +
" hostmask: " + hostmask +
" msg: " + msg +
" html: " + html +
" group_eid: " + group_eid +
" group_msg: " + group_msg +
" pending: " + pending +
" self: " + self +
" header: " + header +
" avatar: " + avatar +
" avatar_url: " + avatar_url +
" getAvatarURL: " + getAvatarURL(72) +
", bid: " + bid +
", eid: " + eid +
", type: " + type +
", timestamp: " + timestamp +
", from: " + from +
", hostmask: " + hostmask +
", msg: " + msg +
", html: " + html +
", formatted: " + formatted +
", group_eid: " + group_eid +
", group_msg: " + group_msg +
", pending: " + pending +
", self: " + self +
", header: " + header +
", avatar: " + avatar +
", avatar_url: " + avatar_url +
", getAvatarURL: " + getAvatarURL(72) +
"}";
}

Expand Down
14 changes: 10 additions & 4 deletions src/com/irccloud/android/fragment/MessageViewFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,8 @@ public synchronized void addItem(long eid, Event e) {
if (e.group_msg != null && e.html == null)
e.html = e.group_msg;

/*if(e.html != null) {
e.html = ColorFormatter.irc_to_html(e.html);
e.formatted = ColorFormatter.html_to_spanned(e.html, e.linkify, server);
}*/
e.ready_for_display = true;
format(e);

if (e.day < 1) {
e.day = calendar.get(Calendar.DAY_OF_YEAR);
Expand Down Expand Up @@ -592,6 +590,8 @@ public void insertAbove(long eid, Event e) {
}
for (int i = 0; i < data.size(); i++) {
if(data.get(i).eid == eid) {
e.ready_for_display = true;
format(e);
data.add(i, e);
break;
}
Expand All @@ -607,12 +607,16 @@ public void insertBelow(long eid, Event e) {
e.day = calendar.get(Calendar.DAY_OF_YEAR);
}
if(data.size() == 0 || data.get(data.size() - 1).eid == eid) {
e.ready_for_display = true;
format(e);
data.add(e);
return;
}

for (int i = 0; i < data.size(); i++) {
if(data.get(i).eid == eid) {
e.ready_for_display = true;
format(e);
data.add(i+1, e);
break;
}
Expand Down Expand Up @@ -2458,6 +2462,8 @@ private synchronized void insertEntity(final MessageAdapter adapter, Event paren
}
if(e.msg != null)
e.html = e.msg = TextUtils.htmlEncode(e.msg);
e.ready_for_display = true;
adapter.format(e);
adapter.insertBelow(parent.eid, e);
if(!backlog) {
runOnUiThread(new Runnable() {
Expand Down

0 comments on commit fce2464

Please sign in to comment.