Search in sources :

Example 1 with LanguageUtils

use of org.kiwix.kiwixmobile.utils.LanguageUtils in project kiwix-android by kiwix.

the class KiwixMobileActivity method handleLocaleCheck.

// Reset the Locale and change the font of all TextViews and its subclasses, if necessary
private void handleLocaleCheck() {
    LanguageUtils.handleLocaleChange(this, sharedPreferenceUtil);
    new LanguageUtils(this).changeFont(getLayoutInflater(), sharedPreferenceUtil);
}
Also used : LanguageUtils(org.kiwix.kiwixmobile.utils.LanguageUtils)

Example 2 with LanguageUtils

use of org.kiwix.kiwixmobile.utils.LanguageUtils in project kiwix-android by kiwix.

the class ZimFileSelectFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    KiwixApplication.getApplicationComponent().inject(this);
    zimManageActivity = (ZimManageActivity) super.getActivity();
    presenter.attachView(this);
    // Replace LinearLayout by the type of the root element of the layout you're trying to load
    llLayout = (RelativeLayout) inflater.inflate(R.layout.zim_list, container, false);
    new LanguageUtils(super.getActivity()).changeFont(super.getActivity().getLayoutInflater(), sharedPreferenceUtil);
    mFileMessage = llLayout.findViewById(R.id.file_management_no_files);
    mZimFileList = llLayout.findViewById(R.id.zimfilelist);
    mFiles = new ArrayList<>();
    // SwipeRefreshLayout for the list view
    swipeRefreshLayout = llLayout.findViewById(R.id.zim_swiperefresh);
    swipeRefreshLayout.setOnRefreshListener(this::refreshFragment);
    // A boolean to distinguish between a user refresh and a normal loading
    mHasRefresh = false;
    mRescanAdapter = new RescanDataAdapter(zimManageActivity, 0, mFiles);
    // Allow temporary use of ZimContentProvider to query books
    ZimContentProvider.canIterate = true;
    presenter.loadLocalZimFileFromDb(zimManageActivity);
    bookDao = new BookDao(KiwixDatabase.getInstance(zimManageActivity));
    // We must return the loaded Layout
    return llLayout;
}
Also used : LanguageUtils(org.kiwix.kiwixmobile.utils.LanguageUtils) BookDao(org.kiwix.kiwixmobile.database.BookDao)

Aggregations

LanguageUtils (org.kiwix.kiwixmobile.utils.LanguageUtils)2 BookDao (org.kiwix.kiwixmobile.database.BookDao)1