Skip to content

Commit 2e23658

Browse files
vanshikaaroramaskaravivek
authored andcommitted
resolved rtl issue in category (commons-app#2567)
* resolved rtl issue in category * combined nested if * modified code
1 parent 0a3d8c0 commit 2e23658

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadCategoriesRenderer.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package fr.free.nrw.commons.upload;
22

3+
import android.annotation.SuppressLint;
4+
import android.content.res.Configuration;
5+
import android.os.Build;
36
import android.view.LayoutInflater;
47
import android.view.View;
58
import android.view.ViewGroup;
@@ -29,8 +32,13 @@ protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
2932
@Override
3033
protected void setUpView(View view) {
3134
ButterKnife.bind(this, view);
35+
Configuration config = getContext().getResources().getConfiguration();
36+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
37+
checkedView.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
38+
}
3239
}
3340

41+
@SuppressLint("WrongConstant")
3442
@Override
3543
protected void hookListeners(View view) {
3644
view.setOnClickListener(v -> {

0 commit comments

Comments
 (0)