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