Added text parsing to post content

This commit is contained in:
Pierre HUBERT 2018-09-03 13:35:40 +02:00
parent 8ab6fb7cfd
commit 0f60453c97
3 changed files with 12 additions and 16 deletions

View File

@ -23,6 +23,7 @@ import org.communiquons.android.comunic.client.data.models.UserInfo;
import org.communiquons.android.comunic.client.data.utils.TimeUtils; import org.communiquons.android.comunic.client.data.utils.TimeUtils;
import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener; import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener;
import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.ui.utils.UiUtils;
import org.communiquons.android.comunic.client.ui.views.ContentTextView;
import org.communiquons.android.comunic.client.ui.views.CountDownView; import org.communiquons.android.comunic.client.ui.views.CountDownView;
import org.communiquons.android.comunic.client.ui.views.EditCommentContentView; import org.communiquons.android.comunic.client.ui.views.EditCommentContentView;
import org.communiquons.android.comunic.client.ui.views.EnlargeableWebImageView; import org.communiquons.android.comunic.client.ui.views.EnlargeableWebImageView;
@ -175,7 +176,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
private ImageView mPostVisibility; private ImageView mPostVisibility;
private ImageView mPostActions; private ImageView mPostActions;
private FrameLayout mAdditionnalViews; private FrameLayout mAdditionnalViews;
private TextView mPostContent; private ContentTextView mPostContent;
private LikeButtonView mLikeButton; private LikeButtonView mLikeButton;
private LinearLayout mCommentsList; private LinearLayout mCommentsList;
private LinearLayout mCreateCommentForm; private LinearLayout mCreateCommentForm;
@ -208,7 +209,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
/** /**
* @return Additional views container * @return Additional views container
*/ */
FrameLayout getAdditionnalViewsLayout(){ FrameLayout getAdditionalViewsLayout(){
return mAdditionnalViews; return mAdditionnalViews;
} }
@ -306,7 +307,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
//Set post content //Set post content
mPostContent.setText(UiUtils.prepareStringTextView(post.getContent())); mPostContent.setParsedText(UiUtils.prepareStringTextView(post.getContent()));
//Post likes //Post likes
@ -401,7 +402,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
super(itemView); super(itemView);
mPostImage = new EnlargeableWebImageView(getContext()); mPostImage = new EnlargeableWebImageView(getContext());
getAdditionnalViewsLayout().addView(mPostImage, getAdditionalViewsLayout().addView(mPostImage,
new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
UiUtils.GetPixel(getContext(), 200))); UiUtils.GetPixel(getContext(), 200)));
} }
@ -425,7 +426,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
super(itemView); super(itemView);
mPDFLinkButton = new PDFLinkButtonView(getContext(), null, R.style.PostPDFButton); mPDFLinkButton = new PDFLinkButtonView(getContext(), null, R.style.PostPDFButton);
getAdditionnalViewsLayout().addView(mPDFLinkButton); getAdditionalViewsLayout().addView(mPDFLinkButton);
} }
@Override @Override
@ -447,7 +448,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
super(itemView); super(itemView);
mWebLinkView = new WebLinkView(getContext()); mWebLinkView = new WebLinkView(getContext());
getAdditionnalViewsLayout().addView(mWebLinkView, getAdditionalViewsLayout().addView(mWebLinkView,
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT ViewGroup.LayoutParams.WRAP_CONTENT
)); ));
@ -472,7 +473,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
super(itemView); super(itemView);
mMovieView = new MovieView(getContext(), null, R.style.PostMovie); mMovieView = new MovieView(getContext(), null, R.style.PostMovie);
getAdditionnalViewsLayout().addView(mMovieView, new FrameLayout.LayoutParams( getAdditionalViewsLayout().addView(mMovieView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT,
UiUtils.GetPixel(getContext(), 200) UiUtils.GetPixel(getContext(), 200)
)); ));
@ -497,7 +498,7 @@ public class PostsAdapter extends BaseRecyclerViewAdapter {
super(itemView); super(itemView);
mCountDownView = new CountDownView(getContext(), null); mCountDownView = new CountDownView(getContext(), null);
getAdditionnalViewsLayout().addView(mCountDownView, new FrameLayout.LayoutParams( getAdditionalViewsLayout().addView(mCountDownView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT,
UiUtils.GetPixel(getContext(), 30))); UiUtils.GetPixel(getContext(), 30)));
} }

View File

@ -188,21 +188,16 @@ public abstract class AbstractPostsListFragment extends Fragment
//Create likes helper //Create likes helper
mLikesHelper = new LikesHelper(getActivity()); mLikesHelper = new LikesHelper(getActivity());
}
@Override
public void onResume() {
super.onResume();
if(mPostsList == null) { if(mPostsList == null) {
setProgressBarVisibility(true); setProgressBarVisibility(true);
setNoPostsNoticeVisibility(false); setNoPostsNoticeVisibility(false);
onLoadPosts(); onLoadPosts();
} }
else{ else {
setPostsList(getPostsList()); setPostsList(getPostsList());
show_posts(); show_posts();
} }
} }
/** /**

View File

@ -102,7 +102,7 @@
tools:layout_height="10dp" /> tools:layout_height="10dp" />
<!-- Post content --> <!-- Post content -->
<TextView <org.communiquons.android.comunic.client.ui.views.ContentTextView
android:id="@+id/post_content" android:id="@+id/post_content"
style="@style/PostContent" style="@style/PostContent"
android:layout_width="match_parent" android:layout_width="match_parent"