新增 夜间模式

This commit is contained in:
hyb1996
2018-11-10 16:41:53 +08:00
parent ad9d50ea21
commit 6e53f0761b
65 changed files with 328 additions and 113 deletions

View File

@@ -15,20 +15,20 @@
<activity
android:name=".execution.ScriptExecuteActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppTheme"/>
android:theme="@style/ScriptTheme"/>
<activity
android:name="com.stardust.autojs.core.permission.PermissionRequestActivity"
android:excludeFromRecents="true"
android:taskAffinity="com.stardust.autojs.runtime.api.image.ScreenCaptureRequestActivity"
android:theme="@style/AppTheme.Transparent"/>
android:theme="@style/ScriptTheme.Transparent"/>
<activity
android:name="com.stardust.autojs.core.image.capture.ScreenCaptureRequestActivity"
android:excludeFromRecents="true"
android:taskAffinity="com.stardust.autojs.runtime.api.image.ScreenCaptureRequestActivity"
android:theme="@style/AppTheme.Transparent"/>
android:theme="@style/ScriptTheme.Transparent"/>
</application>

View File

@@ -19,7 +19,7 @@ module.exports = function (runtime, global) {
ui.setContentView(view);
}
ui.layoutFile = layout(file){
ui.layoutFile = function(file) {
ui.layout(files.read(file));
}

View File

@@ -70,7 +70,7 @@ public class ConsoleView extends FrameLayout implements StardustConsole.LogListe
private void init() {
inflate(getContext(), R.layout.console_view, this);
mLogListRecyclerView = (RecyclerView) findViewById(R.id.log_list);
mLogListRecyclerView = findViewById(R.id.log_list);
LinearLayoutManager manager = new LinearLayoutManager(getContext());
mLogListRecyclerView.setLayoutManager(manager);
mLogListRecyclerView.setAdapter(new Adapter());
@@ -79,7 +79,7 @@ public class ConsoleView extends FrameLayout implements StardustConsole.LogListe
}
private void initSubmitButton() {
final Button submit = (Button) findViewById(R.id.submit);
final Button submit = findViewById(R.id.submit);
submit.setOnClickListener(v -> {
CharSequence input = mEditText.getText();
submitInput(input);
@@ -96,9 +96,9 @@ public class ConsoleView extends FrameLayout implements StardustConsole.LogListe
}
private void initEditText() {
mEditText = (EditText) findViewById(R.id.input);
mEditText = findViewById(R.id.input);
mEditText.setFocusableInTouchMode(true);
mInputContainer = (LinearLayout) findViewById(R.id.input_container);
mInputContainer = findViewById(R.id.input_container);
OnClickListener listener = v -> {
if (mWindow != null) {
mWindow.requestWindowFocus();

View File

@@ -18,7 +18,6 @@ import com.stardust.autojs.util.FloatingPermission;
import com.stardust.enhancedfloaty.FloatyService;
import com.stardust.util.UiHandler;
import com.stardust.util.ViewUtil;
import com.stardust.util.ViewUtils;
import java.util.concurrent.CopyOnWriteArraySet;
@@ -37,7 +36,7 @@ public class Floaty {
public Floaty(UiHandler uiHandler, UI ui, ScriptRuntime runtime) {
mUiHandler = uiHandler;
mRuntime = runtime;
mContext = new ContextThemeWrapper(mUiHandler.getContext(), R.style.AppTheme);
mContext = new ContextThemeWrapper(mUiHandler.getContext(), R.style.ScriptTheme);
mLayoutInflater = ui.getLayoutInflater();
}

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:popupTheme="@style/AppTheme.PopupOverlay">
android:theme="@style/ScriptTheme.AppBarOverlay"
app:popupTheme="@style/ScriptTheme.PopupOverlay">
</android.support.design.widget.AppBarLayout>

View File

@@ -6,19 +6,19 @@
<item name="colorButtonNormal">#cc181818</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="ScriptTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:popupTheme" tools:ignore="NewApi">@style/AppTheme.PopupOverlay</item>
<item name="android:popupTheme" tools:ignore="NewApi">@style/ScriptTheme.PopupOverlay</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="ScriptTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="ScriptTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.Transparent" parent="AppTheme">
<style name="ScriptTheme.Transparent" parent="ScriptTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>