fix: android build alignment (#733)
* fix: android build alignment * feat: make expandable image share button use navigator.share
This commit is contained in:
1 parent
e8714313b8
commit
216ccda503
3 files changed
+34
-14
No files matched your search
@@ -49,18 +49,19 @@ jobs:
|
|||||||
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||||
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
bunx cap build android --androidreleasetype=APK \
|
cd android
|
||||||
--keystorepath=app/release.keystore \
|
chmod +x gradlew
|
||||||
--keystorepass="$KEYSTORE_PASSWORD" \
|
./gradlew assembleRelease \
|
||||||
--keystorealias="$KEY_ALIAS" \
|
-Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/android/app/release.keystore \
|
||||||
--keystorealiaspass="$KEY_PASSWORD" \
|
-Pandroid.injected.signing.store.password="$KEYSTORE_PASSWORD" \
|
||||||
--signing-type="apksigner"
|
-Pandroid.injected.signing.key.alias="$KEY_ALIAS" \
|
||||||
|
-Pandroid.injected.signing.key.password="$KEY_PASSWORD"
|
||||||
|
|
||||||
- name: Upload APK Artifact
|
- name: Upload APK Artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: android-release-apk
|
name: android-release-apk
|
||||||
path: android/app/build/outputs/apk/release/app-release-signed.apk
|
path: android/app/build/outputs/apk/release/app-release.apk
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
archive: false
|
archive: false
|
||||||
|
|
||||||
@@ -69,4 +70,4 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gh release upload ${{ github.event.release.tag_name }} android/app/build/outputs/apk/release/app-release-signed.apk
|
gh release upload ${{ github.event.release.tag_name }} android/app/build/outputs/apk/release/app-release.apk
|
||||||
@@ -21,6 +21,10 @@ android {
|
|||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
debug {
|
||||||
|
applicationIdSuffix ".dex"
|
||||||
|
versionNameSuffix "-dev"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let { alt = '' }: Props = $props()
|
let { alt = '' }: Props = $props()
|
||||||
|
|
||||||
|
async function share() {
|
||||||
|
if (navigator.share != undefined && page.state.openImage != null) {
|
||||||
|
const url = page.state.openImage
|
||||||
|
const blob = await fetch(url).then((i) => i.blob())
|
||||||
|
const file = new File([blob], url.substring(url.lastIndexOf('/') + 1), {
|
||||||
|
type: blob.type,
|
||||||
|
})
|
||||||
|
navigator.share({
|
||||||
|
files: [file],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
navigator.clipboard.writeText(page.state.openImage ?? '')
|
||||||
|
toast({
|
||||||
|
content: $t('toast.copied'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if page.state.openImage || '' != ''}
|
{#if page.state.openImage || '' != ''}
|
||||||
@@ -57,16 +75,13 @@
|
|||||||
onclick={(e) => e.stopPropagation()}
|
onclick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
onclick={() => {
|
onclick={share}
|
||||||
navigator.clipboard.writeText(page.state?.openImage ?? '')
|
|
||||||
toast({ content: $t('toast.copied') })
|
|
||||||
}}
|
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
size="square-lg"
|
size="square-lg"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
aria-label={$t('post.actions.more.share')}
|
aria-label={$t('post.actions.more.share')}
|
||||||
icon={Share}
|
icon={Share}
|
||||||
></Button>
|
/>
|
||||||
<Button
|
<Button
|
||||||
onclick={() => history.back()}
|
onclick={() => history.back()}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
@@ -74,7 +89,7 @@
|
|||||||
rounding="pill"
|
rounding="pill"
|
||||||
aria-label={$t('common.back')}
|
aria-label={$t('common.back')}
|
||||||
icon={XMark}
|
icon={XMark}
|
||||||
></Button>
|
/>
|
||||||
</Material>
|
</Material>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user