Search in sources :

Example 1 with UtilitiesProvider

use of com.amaze.filemanager.ui.provider.UtilitiesProvider in project AmazeFileManager by TeamAmaze.

the class AppsListFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    final MainActivity mainActivity = (MainActivity) getActivity();
    Objects.requireNonNull(mainActivity);
    UtilitiesProvider utilsProvider = mainActivity.getUtilsProvider();
    modelProvider = new AppsAdapterPreloadModel(this, false);
    ViewPreloadSizeProvider<String> sizeProvider = new ViewPreloadSizeProvider<>();
    preloader = new RecyclerViewPreloader<>(GlideApp.with(this), modelProvider, sizeProvider, GlideConstants.MAX_PRELOAD_APPSADAPTER);
    linearLayoutManager = new LinearLayoutManager(getContext());
    updateViews(mainActivity, utilsProvider);
    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    isAscending = sharedPreferences.getBoolean(PREFERENCE_APPLIST_ISASCENDING, true);
    sortby = sharedPreferences.getInt(PREFERENCE_APPLIST_SORTBY, 0);
    fastScroller = rootView.findViewById(R.id.fastscroll);
    fastScroller.setPressedHandleColor(mainActivity.getAccent());
    fastScroller.setRecyclerView(getRecyclerView(), 1);
    mainActivity.getAppbar().getAppbarLayout().addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
        fastScroller.updateHandlePosition(verticalOffset, 112);
    });
    LoaderManager.getInstance(this).initLoader(ID_LOADER_APP_LIST, null, this);
}
Also used : UtilitiesProvider(com.amaze.filemanager.ui.provider.UtilitiesProvider) MainActivity(com.amaze.filemanager.ui.activities.MainActivity) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) AppsAdapterPreloadModel(com.amaze.filemanager.adapters.glide.AppsAdapterPreloadModel) ViewPreloadSizeProvider(com.bumptech.glide.util.ViewPreloadSizeProvider)

Example 2 with UtilitiesProvider

use of com.amaze.filemanager.ui.provider.UtilitiesProvider in project AmazeFileManager by TeamAmaze.

the class AppConfig method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(// selector in srcCompat isn't supported without this
    true);
    instance = this;
    CustomSshJConfig.init();
    explorerDatabase = ExplorerDatabase.initialize(this);
    utilitiesDatabase = UtilitiesDatabase.initialize(this);
    utilsProvider = new UtilitiesProvider(this);
    utilsHandler = new UtilsHandler(this, utilitiesDatabase);
    runInBackground(Config::registerSmbURLHandler);
    // disabling file exposure method check for api n+
    StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
    StrictMode.setVmPolicy(builder.build());
}
Also used : StrictMode(android.os.StrictMode) UtilitiesProvider(com.amaze.filemanager.ui.provider.UtilitiesProvider) BuildConfig(com.amaze.filemanager.BuildConfig) Config(jcifs.Config) CustomSshJConfig(com.amaze.filemanager.filesystem.ssh.CustomSshJConfig) CoreConfigurationBuilder(org.acra.config.CoreConfigurationBuilder) UtilsHandler(com.amaze.filemanager.database.UtilsHandler)

Aggregations

UtilitiesProvider (com.amaze.filemanager.ui.provider.UtilitiesProvider)2 StrictMode (android.os.StrictMode)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 BuildConfig (com.amaze.filemanager.BuildConfig)1 AppsAdapterPreloadModel (com.amaze.filemanager.adapters.glide.AppsAdapterPreloadModel)1 UtilsHandler (com.amaze.filemanager.database.UtilsHandler)1 CustomSshJConfig (com.amaze.filemanager.filesystem.ssh.CustomSshJConfig)1 MainActivity (com.amaze.filemanager.ui.activities.MainActivity)1 ViewPreloadSizeProvider (com.bumptech.glide.util.ViewPreloadSizeProvider)1 Config (jcifs.Config)1 CoreConfigurationBuilder (org.acra.config.CoreConfigurationBuilder)1