-
Notifications
You must be signed in to change notification settings - Fork 104
Justified Text Across Whole App #423
base: develop
Are you sure you want to change the base?
Conversation
@sandarumk please review. |
android:label="@string/user_settings_activity" | ||
android:parentActivityName=".MainActivity" | ||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" | ||
android:configChanges="orientation|screenSize"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove configChanges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologise if I misunderstood something but I think the config changes are there. I just reformatted the code of "AndroidManifest" since it was not aligned properly.
* Created by ashu on 5/2/17. | ||
*/ | ||
|
||
public class FormattedSafetyPlanBasicsContentFragment extends DialogFragment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to create a formatted fragment. Is there any dependency for not changing the original fragment?
|
||
public DocumentView addDocumentView(CharSequence article, int type, boolean rtl) { | ||
final DocumentView documentView = new DocumentView(mContext, type); | ||
documentView.getDocumentLayoutParams().setTextColor(mContext.getResources().getColor(R.color.primary_text_default_material_dark)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use JustificationUtil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for telling me about it will correct this by tomorrow.
|
||
public DocumentView addDocumentView(CharSequence article, int type, boolean rtl) { | ||
final DocumentView documentView = new DocumentView(getActivity(), type); | ||
documentView.getDocumentLayoutParams().setTextColor(getResources().getColor(R.color.primary_text_default_material_dark)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use JustificationUtil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will correct it by tomorrow.
true, new RelativeSizeSpan(1f), new JustifiedSpan()); | ||
DocumentView reporting_step1 = util.addDocumentView(Html.toHtml(articleBuilder1), | ||
DocumentView.FORMATTED_TEXT, false, getActivity()); | ||
reporting_step1.getDocumentLayoutParams().setTextAlignment(TextAlignment.JUSTIFIED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many code duplicates here. Move the common part to a single method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reason as StepsFragment.java
View rootView = inflater.inflate(R.layout.fragment_reporting_steps, container, false); | ||
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(R.string.after_assault); | ||
|
||
ArticleBuilder articleBuilder1 = new ArticleBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove code duplicates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologise for that but I was forced to do that since in this library it is required to create new instance of every-time we are justifying a new block of text in the same screen.
@@ -0,0 +1,33 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible update the original one instead of creating new one
@chamika the library has a slight problem since it been made over scroll view. It treats both the formatted(bold/hyperlinked etx) and plain text in the same. i.e. when we try to justify the formatted text it is justified but its formatting goes away. So after numerous trail and errors and contacting with its maintainer I found out that in order to make the formatted text justified I had to do it programmatically using article builder instead of the conventional method i.e. using XML. Reason for creating new layouts instead of creating new ones? Why not change the library? AND thank you for reviewing it! |
4df5db6
to
c27f169
Compare
fc487cf
to
8ccd4b8
Compare
@sandarumk @chamika changes done.
Please review. |
@sandarumk is this PR approved? if not what other changes do I have to do please tell. |
@top-gun007 can you have a look at Codecy errors and fix them as well? |
will fix them @sandarumk |
PR for issue #337.
Summary
Used bluejamesbond/TextJustify-Android(https://github.com/bluejamesbond/TextJustify-Android) in order to justify text across whole app.
Changes:
Issue Video link(youtube):
Safety Tools(https://youtu.be/KA5AWdLj9Jo)
Get Help Now(https://youtu.be/iHdZwxbO7lg)
Sexual Assault Awareness(https://youtu.be/zkLop-Tw9P8)
Policies(https://youtu.be/D1Q3D3sv9Gw)
Support Services(https://youtu.be/Vix-rxlAPaY)