feat: Adding support for long press on server icon should bring up context menu

This commit is contained in:
Alex Yong 2025-07-17 20:43:22 +00:00
parent aa1d90dd85
commit 1658e9ff2e
7 changed files with 119 additions and 14 deletions

View File

@ -1,16 +1,16 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-community/features/deno:1": {},
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
"extra_packages": "ndk;28.1.13356709"
},
"ghcr.io/devcontainers/features/java:1": {
"version": "21",
"jdkDistro": "oracle"
},
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
"extra_packages": "ndk"
}
},
"postCreateCommand": "chmod +x gradlew && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties",
"postCreateCommand": "chmod +x gradlew && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && git submodule update --init --recursive",
"customizations": {
"vscode": {
"extensions": [

View File

@ -89,6 +89,10 @@ android {
cppFlags("")
}
}
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
}
}
buildTypes {
@ -318,7 +322,7 @@ dependencies {
}
aboutLibraries {
additionalLicenses += listOf("ofl")
additionalLicenses += listOf("ofl", "bsd", "mlkit")
includePlatform = true
strictMode = StrictMode.FAIL
allowedLicenses += listOf(
@ -329,7 +333,11 @@ aboutLibraries {
"BSD-2-Clause",
"cmark",
"EPL-1.0",
"BSD-3-Clause"
"BSD-3-Clause",
"BSD",
"MLKIT",
"BSD License",
"ML Kit Terms of Service"
)
configPath = "compliance"
}

View File

@ -0,0 +1,68 @@
{
"project_info": {
"project_number": "123456789012",
"project_id": "revolt-android-dev",
"storage_bucket": "revolt-android-dev.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:123456789012:android:abcdef1234567890",
"android_client_info": {
"package_name": "chat.revolt"
}
},
"oauth_client": [
{
"client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDummyKeyForDevelopmentOnly1234567890"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:123456789012:android:abcdef1234567891",
"android_client_info": {
"package_name": "chat.revolt.debug"
}
},
"oauth_client": [
{
"client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDummyKeyForDevelopmentOnly1234567890"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@ -332,12 +332,17 @@ fun ChannelSideDrawer(
Modifier
.padding(8.dp)
.clip(CircleShape)
.clickable {
serverInList.id?.let { srvId -> navigateToServer(srvId) }
scope.launch {
drawerState?.close()
.combinedClickable(
onClick = {
serverInList.id?.let { srvId -> navigateToServer(srvId) }
scope.launch {
drawerState?.close()
}
},
onLongClick = {
serverInList.id?.let { srvId -> onShowServerContextSheet(srvId) }
}
}) {
)) {
val icon = serverInList.icon?.id?.let { iconId ->
"$REVOLT_FILES/icons/$iconId"
}

View File

@ -0,0 +1,6 @@
{
"content": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"hash": "BSD",
"url": "https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads/main/README.chromium",
"name": "BSD License"
}

View File

@ -0,0 +1,6 @@
{
"content": "These terms govern your use of ML Kit and the features you access. By using ML Kit, you agree to these terms.\n\nML Kit enables you to build machine learning features into your mobile apps. ML Kit provides easy-to-use SDKs that bring Google's machine learning expertise to your apps in a powerful yet easy-to-use package.\n\nYour use of ML Kit is subject to the Google APIs Terms of Service and Google's Privacy Policy. You may not use ML Kit if you are a person barred from receiving the software under the laws of the United States or other countries, including the country in which you are resident or from which you use the software.\n\nML Kit APIs are provided under the terms described here. Additional terms may apply to certain ML Kit APIs as described in the documentation for those APIs.",
"hash": "MLKIT",
"url": "https://developers.google.com/ml-kit/terms",
"name": "ML Kit Terms of Service"
}

View File

@ -137,11 +137,23 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components"
You can get these values from the Sentry dashboard.
10. Build the project.
10. Copy the `google-services.json.example` file within the `app` directory to `google-services.json`.
Firebase services are integrated into the project, so we need a `google-services.json` file for the build to succeed. For development purposes, use the provided example file:
```sh
cp app/google-services.json.example app/google-services.json
```
:::note
This is a mock configuration file for development purposes only. In a production environment, you would use a real Firebase project configuration.
:::
11. Build the project.
You can build the project by clicking on the 'Run' button in Android Studio.
If asked, build the `:app` module.
11. **You're all set!** You can now start contributing to Revolt on Android.
12. **You're all set!** You can now start contributing to Revolt on Android.
</Steps>