1313import android .view .inputmethod .InputMethodManager ;
1414import android .widget .TextView ;
1515
16- import com .matpag .ui .clickdrawable .R ;
1716import com .matpag .clickdrawabletextview .interfaces .ClickableDrawable ;
1817import com .matpag .clickdrawabletextview .interfaces .OnDrawableClickListener ;
1918
@@ -44,9 +43,6 @@ final class CsDrawableViewManager implements ClickableDrawable {
4443 //default true
4544 private boolean enableTouchOnText = true ;
4645
47- //default true
48- private boolean enableRTL = true ;
49-
5046 private Configuration mConfig ;
5147
5248 /**
@@ -152,9 +148,6 @@ void init(Context context, AttributeSet attrs) {
152148 mBottomDrawable .setVisibility (visibility );
153149 }
154150
155- enableRTL = a .getBoolean (R .styleable .CsDrawableViewManager_csEnableRTL ,
156- true );
157-
158151 a .recycle ();
159152 }
160153
@@ -164,8 +157,8 @@ void init(Context context, AttributeSet attrs) {
164157 }
165158
166159 /**
167- * Check if the current Locale is in RTL mode and if the user has enabled the view to use it
168- * with {@link #enableRTL(boolean)}
160+ * Check if the current Locale is in RTL mode and if the user has enabled the view to support
161+ * it in the <code>AndroidManifest.xml</code> of his app
169162 *
170163 * NOTE: We should use <code>ViewCompat.getLayoutDirection(view) ==
171164 * ViewCompat.LAYOUT_DIRECTION_RTL</code> but when you use developer option : Force RTL Layout
@@ -177,7 +170,8 @@ void init(Context context, AttributeSet attrs) {
177170 * @return true if in RTL, false otherwise
178171 */
179172 private boolean isLayoutRTL (){
180- return mConfig .getLayoutDirection () == View .LAYOUT_DIRECTION_RTL && enableRTL ;
173+ return CsDrawableSettings .isRtlSupportEnabled () &&
174+ mConfig .getLayoutDirection () == View .LAYOUT_DIRECTION_RTL ;
181175 }
182176
183177 /**
@@ -206,8 +200,7 @@ private void addCompoundDrawables(){
206200
207201 /**
208202 * Add the compound drawables to the view, if the Locale of the user is in
209- * RTL mode and {@link #enableRTL} is true the drawable will be added
210- * in the proper position
203+ * RTL mode the drawables will be added in the proper position
211204 */
212205 private void addCompoundDrawablesRelative (){
213206 view .setCompoundDrawablesRelative (
@@ -369,12 +362,6 @@ public void showBottomCsDrawable(boolean visible) {
369362 }
370363 }
371364
372- @ Override
373- public void enableRTL (boolean enable ) {
374- enableRTL = enable ;
375- invalidateDrawables ();
376- }
377-
378365 @ Override
379366 public void disableFocusOnText (boolean preventReFocus , boolean closeKeyboard ) {
380367 //block refocus on others edittext
0 commit comments