com.eveningoutpost.dexdrip.utils.SdcardImportExport Java Examples

The following examples show how to use com.eveningoutpost.dexdrip.utils.SdcardImportExport. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NumberWallPreview.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
public void folderImageButtonClick() {
    if (Pref.getString(PREF_numberwall_background, null) == null) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
            if (SdcardImportExport.checkPermissions(activity, true, ASK_FILE_PERMISSION)) {
                final Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
                intent.addCategory(Intent.CATEGORY_OPENABLE);
                intent.setType("image/*");
                startActivityForResult(intent, LOAD_IMAGE_RESULTS);
            } else {
                if (JoH.ratelimit("need-file-permission",10)) {
                    //JoH.static_toast_short("Need file permission");
                }
            }
        }
    } else {
        binding.getSprefs().put(PREF_numberwall_background, null);
        refreshBitmap();
    }
}
 
Example #2
Source File: NumberWallPreview.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
public void folderImageButtonClick() {
    if (Pref.getString(PREF_numberwall_background, null) == null) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
            if (SdcardImportExport.checkPermissions(activity, true, ASK_FILE_PERMISSION)) {
                final Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
                intent.addCategory(Intent.CATEGORY_OPENABLE);
                intent.setType("image/*");
                startActivityForResult(intent, LOAD_IMAGE_RESULTS);
            } else {
                if (JoH.ratelimit("need-file-permission",10)) {
                    //JoH.static_toast_short("Need file permission");
                }
            }
        }
    } else {
        binding.getSprefs().put(PREF_numberwall_background, null);
        refreshBitmap();
    }
}
 
Example #3
Source File: Home.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onRequestPermissionsResult(int requestCode,
                                       @NonNull String[] permissions,
                                       @NonNull int[] grantResults) {
    // automatically restore settings backup if we just approved a request coming from that
    if (requestCode == SdcardImportExport.TRIGGER_RESTORE_PERMISSIONS_REQUEST_STORAGE
            && permissions.length > 0 && grantResults.length > 0
            && permissions[0].equals(WRITE_EXTERNAL_STORAGE) && grantResults[0] == 0) {
        SdcardImportExport.restoreSettingsNow(this);
    }
}
 
Example #4
Source File: Home.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onRequestPermissionsResult(int requestCode,
                                       @NonNull String[] permissions,
                                       @NonNull int[] grantResults) {
    // automatically restore settings backup if we just approved a request coming from that
    if (requestCode == SdcardImportExport.TRIGGER_RESTORE_PERMISSIONS_REQUEST_STORAGE
            && permissions.length > 0 && grantResults.length > 0
            && permissions[0].equals(WRITE_EXTERNAL_STORAGE) && grantResults[0] == 0) {
        SdcardImportExport.restoreSettingsNow(this);
    }
}
 
Example #5
Source File: Home.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
public void settingsSDcardExport(MenuItem myitem) {
    startActivity(new Intent(getApplicationContext(), SdcardImportExport.class));
}
 
Example #6
Source File: Home.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
public void settingsSDcardExport(MenuItem myitem) {
    startActivity(new Intent(getApplicationContext(), SdcardImportExport.class));
}
 
Example #7
Source File: Home.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
public void settingsSDcardExport(MenuItem myitem) {
    startActivity(new Intent(getApplicationContext(), SdcardImportExport.class));
}