fix: import file
This commit is contained in:
@@ -97,8 +97,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.stardust.autojs.core.image.ScreenCaptureRequestActivity"
|
android:name="com.stardust.autojs.core.image.ScreenCaptureRequestActivity"
|
||||||
android:taskAffinity="com.stardust.autojs.runtime.api.image.ScreenCaptureRequestActivity"
|
android:theme="@style/AppTheme.Transparent"/>
|
||||||
android:theme="@android:style/Theme.NoDisplay"/>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.error.IssueReporterActivity"
|
android:name=".ui.error.IssueReporterActivity"
|
||||||
android:theme="@style/IssueReporterTheme"/>
|
android:theme="@style/IssueReporterTheme"/>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import java.io.InputStream;
|
|||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.functions.Consumer;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import io.reactivex.subjects.PublishSubject;
|
import io.reactivex.subjects.PublishSubject;
|
||||||
|
|
||||||
@@ -118,9 +119,10 @@ public class ScriptOperations {
|
|||||||
} else {
|
} else {
|
||||||
showMessage(R.string.text_import_fail);
|
showMessage(R.string.text_import_fail);
|
||||||
}
|
}
|
||||||
mStorageFileProvider.notifyFileCreated(mCurrentDirectory, new ScriptFile(pathTo));
|
|
||||||
return pathTo;
|
return pathTo;
|
||||||
});
|
})
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.doOnNext(path -> mStorageFileProvider.notifyFileCreated(mCurrentDirectory, new ScriptFile(path)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<String> importFile(String prefix, final InputStream inputStream, final String ext) {
|
public Observable<String> importFile(String prefix, final InputStream inputStream, final String ext) {
|
||||||
@@ -305,7 +307,7 @@ public class ScriptOperations {
|
|||||||
new FileChooserDialogBuilder(mContext)
|
new FileChooserDialogBuilder(mContext)
|
||||||
.dir(Environment.getExternalStorageDirectory().getPath())
|
.dir(Environment.getExternalStorageDirectory().getPath())
|
||||||
.justScriptFile()
|
.justScriptFile()
|
||||||
.singleChoice(file -> importFile(file.getPath()))
|
.singleChoice(file -> importFile(file.getPath()).subscribe())
|
||||||
.title(R.string.text_select_file_to_import)
|
.title(R.string.text_select_file_to_import)
|
||||||
.positiveText(R.string.ok)
|
.positiveText(R.string.ok)
|
||||||
.show();
|
.show();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class FloatingActionMenu extends FrameLayout implements View.OnClickListe
|
|||||||
private View[] mFabContainers;
|
private View[] mFabContainers;
|
||||||
private boolean mExpanded = false;
|
private boolean mExpanded = false;
|
||||||
private int mInterval = 30;
|
private int mInterval = 30;
|
||||||
private int mDuration = 300;
|
private int mDuration = 250;
|
||||||
private final Interpolator mInterpolator = new FastOutSlowInInterpolator();
|
private final Interpolator mInterpolator = new FastOutSlowInInterpolator();
|
||||||
private final PublishSubject<Boolean> mState = PublishSubject.create();
|
private final PublishSubject<Boolean> mState = PublishSubject.create();
|
||||||
private OnFloatingActionButtonClickListener mOnFloatingActionButtonClickListener;
|
private OnFloatingActionButtonClickListener mOnFloatingActionButtonClickListener;
|
||||||
|
|||||||
Reference in New Issue
Block a user