Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug修复,截图优化 #822

Merged
merged 8 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: set up kotlin
uses: fwilhe2/setup-kotlin@main
with:
version: 1.6.20
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Build with Gradle
run: |
chmod 777 ./gradlew
./gradlew :inrt:assemble
./gradlew :app:assembleRelease
- uses: actions/upload-artifact@v3
with:
name: apks
name: apks(no signing)
path: app/build/outputs/apk/v6/release/*
6 changes: 4 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

Expand All @@ -41,8 +43,8 @@ jobs:
alias: ${{ secrets.AALIAS }}
keyStorePassword: ${{ secrets.AKEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.AKEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: rename apk
run: |
cd build/app/signed
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -440,7 +447,7 @@
android:theme="@style/EditorTheme" />
<activity android:name="org.autojs.autojs.ui.settings.AboutActivity_" />
<activity
android:name="org.autojs.autojs.ui.settings.SettingsActivity_"
android:name="org.autojs.autojs.ui.settings.SettingsActivity"
android:theme="@style/AppTheme.Settings" />
<activity android:name="org.autojs.autojs.ui.error.ErrorReportActivity" />
<activity
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/autojs/autojs/autojs/AutoJs.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.autojs.autojs.ui.floating.layoutinspector.LayoutBoundsFloatyWindow;
import org.autojs.autojs.ui.floating.layoutinspector.LayoutHierarchyFloatyWindow;
import org.autojs.autojs.ui.log.LogActivityKt;
import org.autojs.autojs.ui.settings.SettingsActivity_;
import org.autojs.autojs.ui.settings.SettingsActivity;


/**
Expand Down Expand Up @@ -181,7 +181,7 @@ protected AccessibilityConfig createAccessibilityConfig() {
@Override
protected ScriptRuntime createRuntime() {
ScriptRuntime runtime = super.createRuntime();
runtime.putProperty("class.settings", SettingsActivity_.class);
runtime.putProperty("class.settings", SettingsActivity.class);
runtime.putProperty("class.console", LogActivityKt.class);
runtime.putProperty("broadcast.inspect_layout_bounds", LayoutBoundsFloatyWindow.class.getName());
runtime.putProperty("broadcast.inspect_layout_hierarchy", LayoutHierarchyFloatyWindow.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager;

import com.stardust.app.GlobalAppContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.stardust.util.IntentUtil
import org.autojs.autojs.ui.log.LogActivityKt
import org.autojs.autojs.ui.main.web.DocumentSource
import org.autojs.autojs.ui.main.web.DocumentSourceSelectDialog
import org.autojs.autojs.ui.main.web.EditorAppManager.Companion.loadHomeDocument
import org.autojs.autoxjs.R

//主界面日志按钮
Expand Down Expand Up @@ -57,7 +57,7 @@ fun DocumentPageMenuButton(getWebView: () -> WebView) {
onDismissRequest = { expanded = false }) {
DropdownMenuItem(onClick = {
dismissMenu()
getWebView().loadUrl(DocumentSource.DOC_V1.uri)
loadHomeDocument(getWebView())
}) {
Icon(Icons.Default.Home, contentDescription = null)
Text(text = "回到主页")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import org.autojs.autojs.ui.compose.widget.MyAlertDialog1
import org.autojs.autojs.ui.compose.widget.MyIcon
import org.autojs.autojs.ui.compose.widget.MySwitch
import org.autojs.autojs.ui.floating.FloatyWindowManger
import org.autojs.autojs.ui.settings.SettingsActivity_
import org.autojs.autojs.ui.settings.SettingsActivity
import org.autojs.autoxjs.R
import org.joda.time.DateTimeZone
import org.joda.time.Instant
Expand Down Expand Up @@ -272,7 +272,7 @@ private fun BottomButtons() {
context.startActivity(
Intent(
context,
SettingsActivity_::class.java
SettingsActivity::class.java
)
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ class EditorAppManager : Fragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
val saveStatus = getSaveStatus(requireContext())
val name = saveStatus.getString(DocumentSourceKEY, DocumentSource.DOC_V1_LOCAL.name)
return swipeRefreshWebView.apply {
switchDocument(
webView, try {
DocumentSource.valueOf(name!!)
} catch (e: Exception) {
DocumentSource.DOC_V1_LOCAL
}
)
loadHomeDocument(this.webView)
fillMaxSize()
}
}
Expand All @@ -51,6 +43,18 @@ class EditorAppManager : Fragment() {
return saveStatus!!
}

fun loadHomeDocument(webView: WebView) {
val saveStatus = getSaveStatus(webView.context)
val name = saveStatus.getString(DocumentSourceKEY, DocumentSource.DOC_V1_LOCAL.name)
switchDocument(
webView, try {
DocumentSource.valueOf(name!!)
} catch (e: Exception) {
DocumentSource.DOC_V1_LOCAL
}
)
}

fun switchDocument(webView: WebView, documentSource: DocumentSource) {
if (documentSource.isLocal) {
webView.webViewClient = WebViewClient(webView.context, documentSource.uri)
Expand Down
164 changes: 0 additions & 164 deletions app/src/main/java/org/autojs/autojs/ui/settings/SettingsActivity.java

This file was deleted.

Loading
Loading