Permalink
Browse files

updated forrst jar. removed method to strip carriage returns. setting…

… transformations on the descriptions/content to prevent return carriage to become a weird character
  • Loading branch information...
1 parent 663e649 commit e1bca64c5ff5349cfcc0e96376f9c9e3887eca71 @nitindhar7 committed Dec 6, 2011
View
@@ -4,6 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="lib" path="lib/java-json.jar"/>
- <classpathentry kind="lib" path="lib/forrst.jar"/>
+ <classpathentry kind="lib" path="lib/forrst-1.2.5.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
View
Binary file not shown.
View
Binary file not shown.
@@ -3,6 +3,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.text.method.HideReturnsTransformationMethod;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
@@ -48,7 +49,9 @@ public void handleMessage(Message msg) {
_codeUsername.setText(_post.getProperty("name"));
_codeDate.setText(_post.getProperty("created_at"));
_codeContent.setText(_post.getProperty("content"));
+ _codeContent.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
_codeDescription.setText(KamprUtils.cleanseText(_post.getProperty("description")));
+ _codeDescription.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
_postLikesCount.setText(_post.getProperty("like_count"));
_postViewsCount.setText(_post.getProperty("view_count"));
_postCommentsCount.setText(_post.getProperty("comment_count"));
@@ -4,6 +4,7 @@
import android.os.Handler;
import android.os.Message;
import android.text.Spannable;
+import android.text.method.HideReturnsTransformationMethod;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
@@ -52,6 +53,7 @@ public void handleMessage(Message msg) {
_linkUsername.setText(_post.getProperty("name"));
_linkDate.setText(_post.getProperty("created_at"));
_linkDescription.setText(KamprUtils.cleanseText(_post.getProperty("description")));
+ _linkDescription.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
_postLikesCount.setText(_post.getProperty("like_count"));
_postViewsCount.setText(_post.getProperty("view_count"));
_postCommentsCount.setText(_post.getProperty("comment_count"));
@@ -3,6 +3,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.text.method.HideReturnsTransformationMethod;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
@@ -46,6 +47,7 @@ public void handleMessage(Message msg) {
_questionUsername.setText(_post.getProperty("name"));
_questionDate.setText(_post.getProperty("created_at"));
_questionContent.setText(KamprUtils.cleanseText(_post.getProperty("content")));
+ _questionContent.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
_postLikesCount.setText(_post.getProperty("like_count"));
_postViewsCount.setText(_post.getProperty("view_count"));
_postCommentsCount.setText(_post.getProperty("comment_count"));
@@ -4,6 +4,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.text.method.HideReturnsTransformationMethod;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
@@ -51,6 +52,7 @@ public void handleMessage(Message msg) {
_snapUsername.setText(_post.getProperty("name"));
_snapDate.setText(_post.getProperty("created_at"));
_snapDescription.setText(KamprUtils.cleanseText(_post.getProperty("description")));
+ _snapDescription.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
_postLikesCount.setText(_post.getProperty("like_count"));
_postViewsCount.setText(_post.getProperty("view_count"));
_postCommentsCount.setText(_post.getProperty("comment_count"));
@@ -50,18 +50,12 @@ public void checkServerTrusted(X509Certificate[] chain, String authType) {}
}
}
- public static String convertCarriageReturnToNewline(String text) {
- return text.replaceAll("\\r", "");
- }
-
public static String convertHtmlToText(String text) {
return Html.fromHtml(text).toString();
}
public static String cleanseText(String text) {
- String cleansedText = convertCarriageReturnToNewline(text);
- cleansedText = convertHtmlToText(cleansedText);
- return cleansedText;
+ return convertHtmlToText(text);
}
}

0 comments on commit e1bca64

Please sign in to comment.