move LOG from tab TASK to action menu
This commit is contained in:
@@ -9,8 +9,8 @@ android {
|
|||||||
applicationId "com.stardust.scriptdroid"
|
applicationId "com.stardust.scriptdroid"
|
||||||
minSdkVersion 17
|
minSdkVersion 17
|
||||||
targetSdkVersion 23
|
targetSdkVersion 23
|
||||||
versionCode 217
|
versionCode 218
|
||||||
versionName "3.0.0 Alpha17"
|
versionName "3.0.0 Alpha18"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
ndk {
|
ndk {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.stardust.scriptdroid">
|
package="com.stardust.scriptdroid">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
<!-- Ad SDK Permissions -->
|
<!-- Ad SDK Permissions -->
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
@@ -24,15 +24,14 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
tools:replace="android:label, android:icon, android:allowBackup">
|
tools:replace="android:label, android:icon, android:allowBackup">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.splash.SplashActivity_"
|
android:name=".ui.splash.SplashActivity_"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:label="@string/_app_name"
|
android:label="@string/_app_name"
|
||||||
android:theme="@style/AppTheme.Splash">
|
android:theme="@style/AppTheme.Splash">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
@@ -42,16 +41,14 @@
|
|||||||
android:label="@string/_app_name"
|
android:label="@string/_app_name"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/AppTheme.FullScreen">
|
android:theme="@style/AppTheme.FullScreen">
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".external.shortcut.ShortcutActivity"
|
android:name=".external.shortcut.ShortcutActivity"
|
||||||
android:taskAffinity="com.stardust.scriptdroid.external.shortcut.ShortcutActivity"
|
android:taskAffinity="com.stardust.scriptdroid.external.shortcut.ShortcutActivity"
|
||||||
android:theme="@android:style/Theme.NoDisplay">
|
android:theme="@android:style/Theme.NoDisplay">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
@@ -69,7 +66,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.edit.EditActivity_"
|
android:name=".ui.edit.EditActivity_"
|
||||||
android:multiprocess="true">
|
android:multiprocess="true">
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ui.settings.AboutActivity_"/>
|
<activity android:name=".ui.settings.AboutActivity_"/>
|
||||||
<activity
|
<activity
|
||||||
@@ -86,6 +82,7 @@
|
|||||||
android:windowSoftInputMode="adjustResize"/>
|
android:windowSoftInputMode="adjustResize"/>
|
||||||
<activity android:name=".ui.user.WebActivity_"/>
|
<activity android:name=".ui.user.WebActivity_"/>
|
||||||
<activity android:name=".ui.build.BuildActivity_"/>
|
<activity android:name=".ui.build.BuildActivity_"/>
|
||||||
|
<activity android:name=".ui.log.LogActivity_"/>
|
||||||
<activity android:name=".ui.doc.DocumentationActivity_"/>
|
<activity android:name=".ui.doc.DocumentationActivity_"/>
|
||||||
<activity android:name=".ui.shortcut.ShortcutIconSelectActivity_"/>
|
<activity android:name=".ui.shortcut.ShortcutIconSelectActivity_"/>
|
||||||
<activity
|
<activity
|
||||||
@@ -100,31 +97,28 @@
|
|||||||
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:taskAffinity="com.stardust.autojs.runtime.api.image.ScreenCaptureRequestActivity"
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
|
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.error.IssueReporterActivity"
|
android:name=".ui.error.IssueReporterActivity"
|
||||||
android:theme="@style/IssueReporterTheme"/>
|
android:theme="@style/IssueReporterTheme"/>
|
||||||
|
|
||||||
|
<service android:name=".external.ScriptExecutionIntentService"/>
|
||||||
<service android:name="com.stardust.scriptdroid.external.ScriptExecutionIntentService"/>
|
|
||||||
|
|
||||||
<activity android:name=".external.tasker.TaskPrefEditActivity_"/>
|
<activity android:name=".external.tasker.TaskPrefEditActivity_"/>
|
||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name="com.stardust.scriptdroid.external.tasker.PluginActivity"
|
android:name=".external.tasker.PluginActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:icon="@drawable/ic_android_eat_js"
|
android:icon="@drawable/ic_android_eat_js"
|
||||||
android:label="@string/_app_name"
|
android:label="@string/_app_name"
|
||||||
android:targetActivity="com.stardust.scriptdroid.external.tasker.TaskPrefEditActivity_"
|
android:targetActivity=".external.tasker.TaskPrefEditActivity_"
|
||||||
tools:ignore="ExportedActivity">
|
tools:ignore="ExportedActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING"/>
|
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.stardust.scriptdroid.external.tasker.FireSettingReceiver"
|
android:name=".external.tasker.FireSettingReceiver"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":background"
|
android:process=":background"
|
||||||
tools:ignore="ExportedReceiver">
|
tools:ignore="ExportedReceiver">
|
||||||
@@ -135,12 +129,10 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".external.open.EditIntentActivity"
|
android:name=".external.open.EditIntentActivity"
|
||||||
android:icon="@drawable/autojs_logo"
|
android:icon="@drawable/autojs_logo"
|
||||||
android:label="@string/text_edit_script">
|
android:label="@string/text_edit_script">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<action android:name="android.intent.action.EDIT"/>
|
<action android:name="android.intent.action.EDIT"/>
|
||||||
@@ -153,9 +145,7 @@
|
|||||||
<data android:mimeType="application/x-javascript"/>
|
<data android:mimeType="application/x-javascript"/>
|
||||||
<data android:mimeType="text/plain"/>
|
<data android:mimeType="text/plain"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".external.open.RunIntentActivity"
|
android:name=".external.open.RunIntentActivity"
|
||||||
android:icon="@drawable/autojs_logo"
|
android:icon="@drawable/autojs_logo"
|
||||||
@@ -174,16 +164,12 @@
|
|||||||
<data android:mimeType="application/x-javascript"/>
|
<data android:mimeType="application/x-javascript"/>
|
||||||
<data android:mimeType="text/plain"/>
|
<data android:mimeType="text/plain"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".external.open.ImportIntentActivity"
|
android:name=".external.open.ImportIntentActivity"
|
||||||
android:icon="@drawable/autojs_logo"
|
android:icon="@drawable/autojs_logo"
|
||||||
android:label="@string/text_import_script"
|
android:label="@string/text_import_script"
|
||||||
android:theme="@style/AppTheme.Transparent">
|
android:theme="@style/AppTheme.Transparent">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<action android:name="android.intent.action.EDIT"/>
|
<action android:name="android.intent.action.EDIT"/>
|
||||||
@@ -191,7 +177,6 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
|
|
||||||
|
|
||||||
<data android:scheme="file"/>
|
<data android:scheme="file"/>
|
||||||
<data android:scheme="content"/>
|
<data android:scheme="content"/>
|
||||||
<data android:mimeType="application/x-javascript"/>
|
<data android:mimeType="application/x-javascript"/>
|
||||||
@@ -200,18 +185,17 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.stardust.scriptdroid.accessibility.AccessibilityService"
|
android:name=".accessibility.AccessibilityService"
|
||||||
android:label="@string/_app_name"
|
android:label="@string/_app_name"
|
||||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.accessibilityservice.AccessibilityService"/>
|
<action android:name="android.accessibilityservice.AccessibilityService"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.accessibilityservice"
|
android:name="android.accessibilityservice"
|
||||||
android:resource="@xml/accessibility_service_config"/>
|
android:resource="@xml/accessibility_service_config"/>
|
||||||
|
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.stardust.notification.NotificationListenerService"
|
android:name="com.stardust.notification.NotificationListenerService"
|
||||||
android:label="@string/_app_name"
|
android:label="@string/_app_name"
|
||||||
@@ -225,6 +209,7 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
android:resource="@xml/script_widget_config"/>
|
android:resource="@xml/script_widget_config"/>
|
||||||
@@ -234,10 +219,10 @@
|
|||||||
<service
|
<service
|
||||||
android:name="com.qq.e.comm.DownloadService"
|
android:name="com.qq.e.comm.DownloadService"
|
||||||
android:exported="false"/>
|
android:exported="false"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.qq.e.ads.ADActivity"
|
android:name="com.qq.e.ads.ADActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -11,6 +11,7 @@ import com.stardust.scriptdroid.R;
|
|||||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||||
import com.stardust.scriptdroid.ui.build.BuildActivity;
|
import com.stardust.scriptdroid.ui.build.BuildActivity;
|
||||||
import com.stardust.scriptdroid.ui.build.BuildActivity_;
|
import com.stardust.scriptdroid.ui.build.BuildActivity_;
|
||||||
|
import com.stardust.scriptdroid.ui.log.LogActivity_;
|
||||||
import com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder;
|
import com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder;
|
||||||
import com.stardust.util.ClipboardUtil;
|
import com.stardust.util.ClipboardUtil;
|
||||||
|
|
||||||
@@ -258,7 +259,7 @@ public class EditorMenu {
|
|||||||
|
|
||||||
|
|
||||||
private void showLog() {
|
private void showLog() {
|
||||||
AutoJs.getInstance().getScriptEngineService().getGlobalConsole().show();
|
LogActivity_.intent(mContext).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showConsole() {
|
private void showConsole() {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.stardust.scriptdroid.ui.log;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.stardust.autojs.core.console.ConsoleView;
|
||||||
|
import com.stardust.autojs.core.console.StardustConsole;
|
||||||
|
import com.stardust.scriptdroid.R;
|
||||||
|
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||||
|
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||||
|
|
||||||
|
import org.androidannotations.annotations.AfterViews;
|
||||||
|
import org.androidannotations.annotations.Click;
|
||||||
|
import org.androidannotations.annotations.EActivity;
|
||||||
|
import org.androidannotations.annotations.ViewById;
|
||||||
|
|
||||||
|
@EActivity(R.layout.activity_log)
|
||||||
|
public class LogActivity extends BaseActivity {
|
||||||
|
|
||||||
|
@ViewById(R.id.console)
|
||||||
|
ConsoleView mConsoleView;
|
||||||
|
|
||||||
|
private StardustConsole mStardustConsole;
|
||||||
|
|
||||||
|
@AfterViews
|
||||||
|
void setupViews() {
|
||||||
|
setToolbarAsBack(getString(R.string.text_log));
|
||||||
|
mStardustConsole = (StardustConsole) AutoJs.getInstance().getGlobalConsole();
|
||||||
|
mConsoleView.setConsole(mStardustConsole);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Click(R.id.fab)
|
||||||
|
void clearConsole() {
|
||||||
|
mStardustConsole.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import com.stardust.scriptdroid.ui.floating.FloatyWindowManger;
|
|||||||
import com.stardust.scriptdroid.io.StorageFileProvider;
|
import com.stardust.scriptdroid.io.StorageFileProvider;
|
||||||
import com.stardust.scriptdroid.ui.main.community.CommunityFragment_;
|
import com.stardust.scriptdroid.ui.main.community.CommunityFragment_;
|
||||||
import com.stardust.scriptdroid.ui.main.sample.SampleListFragment;
|
import com.stardust.scriptdroid.ui.main.sample.SampleListFragment;
|
||||||
|
import com.stardust.scriptdroid.ui.log.LogActivity_;
|
||||||
import com.stardust.scriptdroid.ui.main.sample.SampleListFragment_;
|
import com.stardust.scriptdroid.ui.main.sample.SampleListFragment_;
|
||||||
import com.stardust.scriptdroid.ui.main.scripts.MyScriptListFragment_;
|
import com.stardust.scriptdroid.ui.main.scripts.MyScriptListFragment_;
|
||||||
import com.stardust.scriptdroid.ui.main.task.TaskManagerFragment_;
|
import com.stardust.scriptdroid.ui.main.task.TaskManagerFragment_;
|
||||||
@@ -259,6 +260,15 @@ public class MainActivity extends BaseActivity implements OnActivityResultDelega
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if(item.getItemId() == R.id.action_log){
|
||||||
|
LogActivity_.intent(this).start();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
private void setUpSearchMenuItem(MenuItem searchMenuItem) {
|
private void setUpSearchMenuItem(MenuItem searchMenuItem) {
|
||||||
mSearchViewItem = new SearchViewItem(this, searchMenuItem);
|
mSearchViewItem = new SearchViewItem(this, searchMenuItem);
|
||||||
mSearchViewItem.setQueryCallback(this::submitQuery);
|
mSearchViewItem.setQueryCallback(this::submitQuery);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.androidannotations.annotations.ViewById;
|
|||||||
* Created by Stardust on 2017/3/24.
|
* Created by Stardust on 2017/3/24.
|
||||||
*/
|
*/
|
||||||
@EFragment(R.layout.fragment_task_manager)
|
@EFragment(R.layout.fragment_task_manager)
|
||||||
public class TaskManagerFragment extends ViewPagerFragment implements PopupMenu.OnMenuItemClickListener {
|
public class TaskManagerFragment extends ViewPagerFragment {
|
||||||
|
|
||||||
@ViewById(R.id.task_list)
|
@ViewById(R.id.task_list)
|
||||||
TaskListRecyclerView mTaskListRecyclerView;
|
TaskListRecyclerView mTaskListRecyclerView;
|
||||||
@@ -35,36 +35,17 @@ public class TaskManagerFragment extends ViewPagerFragment implements PopupMenu.
|
|||||||
@ViewById(R.id.swipe_refresh_layout)
|
@ViewById(R.id.swipe_refresh_layout)
|
||||||
SwipeRefreshLayout mSwipeRefreshLayout;
|
SwipeRefreshLayout mSwipeRefreshLayout;
|
||||||
|
|
||||||
@ViewById(R.id.task_manager_view)
|
|
||||||
View mTaskManagerView;
|
|
||||||
|
|
||||||
@ViewById(R.id.spinner)
|
|
||||||
View mSpinner;
|
|
||||||
|
|
||||||
@ViewById(R.id.spinner_current_item)
|
|
||||||
TextView mSpinnerCurrentItem;
|
|
||||||
|
|
||||||
@ViewById(R.id.console)
|
|
||||||
ConsoleView mConsoleView;
|
|
||||||
|
|
||||||
private StardustConsole mStardustConsole;
|
|
||||||
|
|
||||||
public TaskManagerFragment() {
|
public TaskManagerFragment() {
|
||||||
super(45);
|
super(45);
|
||||||
setArguments(new Bundle());
|
setArguments(new Bundle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@AfterViews
|
@AfterViews
|
||||||
void setUpViews() {
|
void setUpViews() {
|
||||||
init();
|
init();
|
||||||
final boolean noRunningScript = mTaskListRecyclerView.getAdapter().getItemCount() == 0;
|
final boolean noRunningScript = mTaskListRecyclerView.getAdapter().getItemCount() == 0;
|
||||||
mNoRunningScriptNotice.setVisibility(noRunningScript ? View.VISIBLE : View.GONE);
|
mNoRunningScriptNotice.setVisibility(noRunningScript ? View.VISIBLE : View.GONE);
|
||||||
mStardustConsole = (StardustConsole) AutoJs.getInstance().getGlobalConsole();
|
|
||||||
mConsoleView.setConsole(mStardustConsole);
|
|
||||||
if (getArguments().getBoolean("console_shown", false)) {
|
|
||||||
showLog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
@@ -90,51 +71,9 @@ public class TaskManagerFragment extends ViewPagerFragment implements PopupMenu.
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Click(R.id.spinner)
|
|
||||||
void showPopupMenu() {
|
|
||||||
PopupMenu popupMenu = new PopupMenu(getContext(), mSpinner);
|
|
||||||
popupMenu.inflate(R.menu.menu_manager);
|
|
||||||
popupMenu.show();
|
|
||||||
popupMenu.setOnMenuItemClickListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == R.id.task_manage) {
|
|
||||||
showTaskManager();
|
|
||||||
} else {
|
|
||||||
showLog();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showLog() {
|
|
||||||
mTaskManagerView.setVisibility(View.GONE);
|
|
||||||
mConsoleView.setVisibility(View.VISIBLE);
|
|
||||||
mSpinnerCurrentItem.setText(R.string.text_log);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showTaskManager() {
|
|
||||||
mConsoleView.setVisibility(View.GONE);
|
|
||||||
mTaskManagerView.setVisibility(View.VISIBLE);
|
|
||||||
mSpinnerCurrentItem.setText(R.string.text_task_manage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFabClick(FloatingActionButton fab) {
|
protected void onFabClick(FloatingActionButton fab) {
|
||||||
if (mConsoleView.getVisibility() == View.VISIBLE) {
|
AutoJs.getInstance().getScriptEngineService().stopAll();
|
||||||
mStardustConsole.clear();
|
|
||||||
} else {
|
|
||||||
AutoJs.getInstance().getScriptEngineService().stopAll();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
getArguments().putBoolean("console_shown", mConsoleView.getVisibility() == View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-hdpi/ic_clear_white_48dp.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_clear_white_48dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 347 B |
BIN
app/src/main/res/drawable-mdpi/ic_clear_white_48dp.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_clear_white_48dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-xhdpi/ic_ali_log.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_ali_log.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_clear_white_48dp.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_clear_white_48dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 436 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_clear_white_48dp.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_clear_white_48dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 524 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_clear_white_48dp.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_clear_white_48dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 702 B |
43
app/src/main/res/layout/activity_log.xml
Normal file
43
app/src/main/res/layout/activity_log.xml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="4dp">
|
||||||
|
|
||||||
|
<com.stardust.autojs.core.console.ConsoleView
|
||||||
|
android:id="@+id/console"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@drawable/ic_clear_white_48dp"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,80 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/spinner"
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/swipe_refresh_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.stardust.scriptdroid.ui.main.task.TaskListRecyclerView
|
||||||
|
android:id="@+id/task_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notice_no_running_script"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackground"
|
android:layout_gravity="center"
|
||||||
android:clickable="true"
|
android:gravity="center"
|
||||||
android:padding="8dp">
|
android:text="@string/notice_no_running_script"
|
||||||
|
android:textColor="#adadad"
|
||||||
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<TextView
|
</FrameLayout>
|
||||||
android:id="@+id/spinner_current_item"
|
|
||||||
android:layout_width="70dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:text="@string/text_task_manage"
|
|
||||||
android:textColor="#484C4F"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="16dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:src="@drawable/ic_arrow_drop_down_black_36dp"
|
|
||||||
android:tint="#484C4F"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@android:color/white">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/task_manager_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/swipe_refresh_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.stardust.scriptdroid.ui.main.task.TaskListRecyclerView
|
|
||||||
android:id="@+id/task_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/notice_no_running_script"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/notice_no_running_script"
|
|
||||||
android:textColor="#adadad"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<com.stardust.autojs.core.console.ConsoleView
|
|
||||||
android:id="@+id/console"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -2,6 +2,12 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_log"
|
||||||
|
android:icon="@drawable/ic_ali_log"
|
||||||
|
android:title="@string/text_log"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search"
|
android:id="@+id/action_search"
|
||||||
android:icon="@drawable/ic_search_white_36dp"
|
android:icon="@drawable/ic_search_white_36dp"
|
||||||
|
|||||||
@@ -6,4 +6,5 @@
|
|||||||
<dimen name="level_beam_view_padding_right">-4dp</dimen>
|
<dimen name="level_beam_view_padding_right">-4dp</dimen>
|
||||||
<dimen name="script_and_folder_list_divider_left_margin">0dp</dimen>
|
<dimen name="script_and_folder_list_divider_left_margin">0dp</dimen>
|
||||||
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
|
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
|
||||||
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -308,4 +308,5 @@
|
|||||||
<item>js</item>
|
<item>js</item>
|
||||||
<item>binary</item>
|
<item>binary</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string name="title_activity_log">LogActivity</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user