Skip to content

Commit

Permalink
Fix internal file browser crash and update version to 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rparkins999 committed May 27, 2018
1 parent 1911aa3 commit 4c895ad
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
minSdkVersion 21
targetSdkVersion 22
versionCode 6
versionName "2.0"
versionName "2.1"
}
buildTypes {
release {
Expand All @@ -42,6 +42,6 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:23.2.1'
api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.android.support:support-v4:23.2.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static final void setDefaultDir(Context context, String dir) {

public static final String getDefaultDir(Context context) {
return context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
.getString(PREF_DEFAULTDIRECTORY, "/");
.getString(PREF_DEFAULTDIRECTORY, null);
}

private static final String PREF_LOGGING = "logging";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import android.app.Fragment;
import android.os.Bundle;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -61,8 +62,12 @@ public void onDirectoryOrFileClick(File file) {

TextView textViewFile = (TextView) v.findViewById(R.id.textViewFile);
fileList.setTextViewFile(textViewFile);

fileList.init(new File (mOwner.getDefaultDir()));
String s = mOwner.getDefaultDir();
if (s != null) {
fileList.init(new File (s));
} else {
fileList.init(Environment.getExternalStorageDirectory());
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ public void setRowView(int rowViewResourceId) {
* @param path root directory
*/
public void init(File path) {
if(path != null) {
adapter.setPath(path);
} else {
adapter.setPath(Environment.getExternalStorageDirectory());
}
adapter.setPath(path);

if(!adapter.hasExtentions()) {
setDefaultFileExtentions();
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ buildscript {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

Expand Down

0 comments on commit 4c895ad

Please sign in to comment.