This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
250 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
sample/src/main/java/com/nononsenseapps/filepicker/sample/root/SUErrorFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.nononsenseapps.filepicker.sample.root; | ||
|
||
import android.app.Dialog; | ||
import android.content.DialogInterface; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.DialogFragment; | ||
import android.support.v4.app.FragmentManager; | ||
import android.support.v7.app.AlertDialog; | ||
|
||
/** | ||
* A dialog which tells the user that no SU binary is available | ||
*/ | ||
public class SUErrorFragment extends DialogFragment { | ||
|
||
private static final String TAG = "SUErrorFragment"; | ||
|
||
public static void showDialog(@NonNull final FragmentManager fm) { | ||
SUErrorFragment d = new SUErrorFragment(); | ||
d.show(fm, TAG); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Dialog onCreateDialog(Bundle savedInstanceState) { | ||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); | ||
builder.setMessage("No read permisson, root unavailable") | ||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { | ||
@Override | ||
public void onClick(DialogInterface dialog, int which) { | ||
dialog.dismiss(); | ||
} | ||
}); | ||
return builder.create(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
sample/src/main/java/com/nononsenseapps/filepicker/sample/root/SUPickerActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.nononsenseapps.filepicker.sample.root; | ||
|
||
import android.os.Environment; | ||
import android.support.annotation.Nullable; | ||
|
||
import com.nononsenseapps.filepicker.AbstractFilePickerActivity; | ||
import com.nononsenseapps.filepicker.AbstractFilePickerFragment; | ||
|
||
import java.io.File; | ||
|
||
public class SUPickerActivity extends AbstractFilePickerActivity<File> { | ||
|
||
public SUPickerActivity() { | ||
super(); | ||
} | ||
|
||
@Override | ||
protected AbstractFilePickerFragment<File> getFragment(@Nullable String startPath, | ||
int mode, | ||
boolean allowMultiple, | ||
boolean allowCreateDir) { | ||
AbstractFilePickerFragment<File> fragment = new SUPickerFragment(); | ||
// startPath is allowed to be null. In that case, default folder should be SD-card and | ||
// not "/" | ||
fragment.setArgs( | ||
startPath != null ? startPath : Environment.getExternalStorageDirectory().getPath(), | ||
mode, allowMultiple, allowCreateDir); | ||
return fragment; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
sample/src/main/java/com/nononsenseapps/filepicker/sample/root/SUPickerActivity2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.nononsenseapps.filepicker.sample.root; | ||
|
||
/** | ||
* Just for second theme | ||
*/ | ||
public class SUPickerActivity2 extends SUPickerActivity { | ||
} |
Oops, something went wrong.