I have used FFMpeg for video trim. loadBinary method of FFMpeg distorts the layout to LTR direction.I have instantiated its instance in a thread and also set the locale forcefully in Finish method of loadBinary method but that doesn't solves the issue. I am currently instantiating it at Application level. I am using the library 'com.writingminds:FFmpegAndroid:0.3.2'. Below is my code of instantiation
new Thread(new Runnable() {
@Override
public void run() {
FFmpeg ffmpeg = FFmpeg.getInstance(context);
try {
ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onFailure() {}
@Override
public void onSuccess() {
}
@Override
public void onFinish() {
Locale locale = Locale.getDefault();
Resources resources =context.getResources();
Configuration config = resources.getConfiguration();
config.locale = locale;
if (Build.VERSION.SDK_INT >= 17) {
config.setLayoutDirection(locale);
}
resources.updateConfiguration(config, resources.getDisplayMetrics());
}
});
} catch (FFmpegNotSupportedException e) {
}
}
}).start();