Search in sources :

Example 1 with CursorLoader

use of androidx.loader.content.CursorLoader in project fdroidclient by f-droid.

the class ManageReposActivity method onCreateLoader.

@NonNull
@Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
    Uri uri = RepoProvider.allExceptSwapUri();
    final String[] projection = { RepoTable.Cols._ID, RepoTable.Cols.NAME, RepoTable.Cols.SIGNING_CERT, RepoTable.Cols.FINGERPRINT, RepoTable.Cols.IN_USE };
    return new CursorLoader(this, uri, projection, null, null, null);
}
Also used : CursorLoader(androidx.loader.content.CursorLoader) Uri(android.net.Uri) NonNull(androidx.annotation.NonNull)

Example 2 with CursorLoader

use of androidx.loader.content.CursorLoader in project fdroidclient by f-droid.

the class UtilsTest method testGetAntifeatureSQLFilter.

@Test
public void testGetAntifeatureSQLFilter() {
    CursorLoader cursorLoader = new CursorLoader(context, AppProvider.getLatestTabUri(), Schema.AppMetadataTable.Cols.ALL, Utils.getAntifeatureSQLFilter(context), null, null);
    cursor = cursorLoader.loadInBackground();
    assertNotNull(cursor);
}
Also used : CursorLoader(androidx.loader.content.CursorLoader) Test(org.junit.Test)

Example 3 with CursorLoader

use of androidx.loader.content.CursorLoader in project collect by opendatakit.

the class CursorLoaderFactory method createCompletedUndeletedInstancesCursorLoader.

public CursorLoader createCompletedUndeletedInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
    CursorLoader cursorLoader;
    if (charSequence.length() == 0) {
        cursorLoader = createCompletedUndeletedInstancesCursorLoader(sortOrder);
    } else {
        String selection = DatabaseInstanceColumns.DELETED_DATE + " IS NULL and (" + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=?) and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
        String[] selectionArgs = { Instance.STATUS_COMPLETE, Instance.STATUS_SUBMISSION_FAILED, Instance.STATUS_SUBMITTED, "%" + charSequence + "%" };
        cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
    }
    return cursorLoader;
}
Also used : CursorLoader(androidx.loader.content.CursorLoader)

Example 4 with CursorLoader

use of androidx.loader.content.CursorLoader in project collect by opendatakit.

the class CursorLoaderFactory method createFinalizedInstancesCursorLoader.

public CursorLoader createFinalizedInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
    CursorLoader cursorLoader;
    if (charSequence.length() == 0) {
        cursorLoader = createFinalizedInstancesCursorLoader(sortOrder);
    } else {
        String selection = "(" + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=?) and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
        String[] selectionArgs = { Instance.STATUS_COMPLETE, Instance.STATUS_SUBMISSION_FAILED, "%" + charSequence + "%" };
        cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
    }
    return cursorLoader;
}
Also used : CursorLoader(androidx.loader.content.CursorLoader)

Example 5 with CursorLoader

use of androidx.loader.content.CursorLoader in project collect by opendatakit.

the class CursorLoaderFactory method createSentInstancesCursorLoader.

public CursorLoader createSentInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
    CursorLoader cursorLoader;
    if (charSequence.length() == 0) {
        cursorLoader = createSentInstancesCursorLoader(sortOrder);
    } else {
        String selection = DatabaseInstanceColumns.STATUS + " =? and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
        String[] selectionArgs = { Instance.STATUS_SUBMITTED, "%" + charSequence + "%" };
        cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
    }
    return cursorLoader;
}
Also used : CursorLoader(androidx.loader.content.CursorLoader)

Aggregations

CursorLoader (androidx.loader.content.CursorLoader)12 Uri (android.net.Uri)4 Cursor (android.database.Cursor)2 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)2 NonNull (androidx.annotation.NonNull)2 CloudEntry (com.amaze.filemanager.database.models.explorer.CloudEntry)1 CloudPluginException (com.amaze.filemanager.file_operations.exceptions.CloudPluginException)1 Test (org.junit.Test)1