-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update podfile source to china * update podfile source to china * gitee sync test * [Android] gitee sync >> use china repos. * fix sync shell * [Android]revert to use common repo url. * update sync script. * update sync script. * update sync script. * Add download agora SDK when executing pod install and modify dependencies * gitee sync modify source url * modify podfile file script * modify podfile file script * update download ijk and swiftlint * update ijk download script * iOS Adapt to RTC 4.3.1 version * [windows] Adapt to 4.3.1 sdk and ajust examples. * mac Adapt to RTC 4.3.1 version * [windows]enable use_audio4 * [Android]Adapt to 4.3.1 sdk * [Android][Audio]Adapt to 4.3.1 sdk * Change way of using salt (#374) * Change way of using salt * Add macOS support * [Windows]perfect screen parameter adjusting. * [windows]change way of using salt. * [Android]Renew beauty api and etc. * add package_script * [windows]fix case switch crash. * [windows]fix release compile problem. * [windows]change slider notify to NW_RELEASEDCAPTURE. * [windows]show startCameraCapture error. * [Android]Fix fragment back bug. * [windows]fix original video bug (NMS-20350). * fix pip bug * fix crash bug * fix volume bug * fix stutter bug * [Android]Update beauty api and fix bug(NMS-20393) * [Android]Fix beauty effect bug. * [Android]Update gradle config. * [Android]Update gradle config. * [Android]Add pip mode demo. * [windows]update ci. * [windows]update ci. * [windows]update ci. * [windows]update ci 2. * [windows]update ci 3. * [Android][Compose]init project. * [Android][Compose]adjust project construction, add setting and etc. * [Android][Compose]add join channel auido,join channel video by token, and perfect codes. * [Android][Compose]add rtmpstreaming case and fix bugs. * [Android][Compose]add cases. * [Android][Compose]add cases. * [Android][Compose]add cases. * [Android][Compose]add cases. * [Android][Compose]add cert config and token. --------- Co-authored-by: zhaoyongqiang <[email protected]> Co-authored-by: sync2gitee <[email protected]> Co-authored-by: Sihán Zhū <[email protected]>
- Loading branch information
1 parent
b7ac81b
commit 0fada86
Showing
91 changed files
with
14,163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import java.util.Properties | ||
|
||
plugins { | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
} | ||
|
||
android { | ||
namespace = "io.agora.api.example.compose" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "io.agora.api.example.compose" | ||
minSdk = 24 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
|
||
val properties = Properties() | ||
properties.load(rootProject.file("local.properties").inputStream()) | ||
val AGORA_APP_ID = properties.getProperty("AGORA_APP_ID", "") | ||
if(AGORA_APP_ID == ""){ | ||
throw GradleException("请在项目根目录下local.properties文件里正确配置:AGORA_APP_ID=<您的声网AppId>") | ||
} | ||
val AGORA_APP_CERT = properties.getProperty("AGORA_APP_CERT", "") | ||
buildConfigField("String", "AGORA_APP_ID", "\"$AGORA_APP_ID\"") | ||
buildConfigField("String", "AGORA_APP_CERT", "\"$AGORA_APP_CERT\"") | ||
} | ||
|
||
buildFeatures { | ||
buildConfig = true | ||
} | ||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.1" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.lifecycle.runtime.ktx) | ||
implementation(libs.androidx.activity.compose) | ||
implementation(platform(libs.androidx.compose.bom)) | ||
implementation(libs.androidx.ui) | ||
implementation(libs.androidx.ui.graphics) | ||
implementation(libs.androidx.ui.tooling.preview) | ||
implementation(libs.androidx.material3) | ||
implementation(libs.androidx.navigation.compose) | ||
implementation(libs.androidx.datastore) | ||
implementation(libs.androidx.datastore.preferences) | ||
implementation(libs.agora.full.sdk) | ||
implementation(libs.agora.full.screen.sharing) | ||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
androidTestImplementation(libs.androidx.ui.test.junit4) | ||
debugImplementation(libs.androidx.ui.tooling) | ||
debugImplementation(libs.androidx.ui.test.manifest) | ||
implementation(libs.androidx.material.icons.extended) | ||
implementation(libs.okhttp) | ||
implementation(libs.logging.interceptor) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
22 changes: 22 additions & 0 deletions
22
...-Compose/app/src/androidTest/java/io/agora/api/example/compose/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.agora.api.example.compose | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("io.agora.api.example.compose", appContext.packageName) | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Android/APIExample-Compose/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.APIExampleCompose" | ||
tools:targetApi="31"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true" | ||
android:label="@string/app_name" | ||
android:theme="@style/Theme.APIExampleCompose"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
Android/APIExample-Compose/app/src/main/java/io/agora/api/example/compose/APIExampleApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.agora.api.example.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import io.agora.api.example.compose.ui.theme.APIExampleComposeTheme | ||
|
||
@Composable | ||
fun APIExampleApp(){ | ||
APIExampleComposeTheme { | ||
NavGraph() | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Android/APIExample-Compose/app/src/main/java/io/agora/api/example/compose/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.agora.api.example.compose | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.core.view.WindowCompat | ||
|
||
class MainActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
setContent { | ||
APIExampleApp() | ||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
Android/APIExample-Compose/app/src/main/java/io/agora/api/example/compose/NavGraph.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package io.agora.api.example.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.compose.rememberNavController | ||
import androidx.navigation.navArgument | ||
import io.agora.api.example.compose.model.Component | ||
import io.agora.api.example.compose.model.Components | ||
import io.agora.api.example.compose.model.Example | ||
import io.agora.api.example.compose.ui.example.Example | ||
import io.agora.api.example.compose.ui.home.Home | ||
import io.agora.api.example.compose.ui.settings.Settings | ||
|
||
@Composable | ||
fun NavGraph() { | ||
val navController = rememberNavController() | ||
NavHost( | ||
navController = navController, | ||
startDestination = HomeRoute | ||
) { | ||
composable(HomeRoute) { | ||
Home( | ||
components = Components, | ||
onExampleClick = { example, component -> navController.navigate(example.route(component)) }, | ||
onSettingClick = { navController.navigate(SettingsRoute) } | ||
) | ||
} | ||
composable(SettingsRoute) { | ||
Settings { | ||
navController.popBackStack() | ||
} | ||
} | ||
composable( | ||
route = "$ExampleRoute/" + | ||
"{$ComponentIdArgName}/" + | ||
"{$ExampleIndexArgName}", | ||
arguments = listOf( | ||
navArgument(ComponentIdArgName) { type = NavType.IntType }, | ||
navArgument(ExampleIndexArgName) { type = NavType.IntType } | ||
) | ||
) { navBackStackEntry -> | ||
val arguments = requireNotNull(navBackStackEntry.arguments) { "No arguments" } | ||
val componentId = arguments.getInt(ComponentIdArgName) | ||
val exampleIndex = arguments.getInt(ExampleIndexArgName) | ||
val component = Components.first { component -> component.id == componentId } | ||
val example = component.examples[exampleIndex] | ||
Example( | ||
example = example, | ||
onBackClick = { navController.popBackStack() }, | ||
) | ||
} | ||
} | ||
|
||
} | ||
|
||
private fun Example.route(component: Component) = | ||
"$ExampleRoute/${component.id}/${component.examples.indexOf(this)}" | ||
|
||
private const val HomeRoute = "home" | ||
private const val SettingsRoute = "settings" | ||
private const val ExampleRoute = "example" | ||
private const val ComponentIdArgName = "componentId" | ||
private const val ExampleIndexArgName = "exampleIndex" |
48 changes: 48 additions & 0 deletions
48
...Example-Compose/app/src/main/java/io/agora/api/example/compose/data/SettingPreferences.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.agora.api.example.compose.data | ||
|
||
import io.agora.rtc2.RtcEngineConfig.AreaCode | ||
import io.agora.rtc2.video.VideoEncoderConfiguration | ||
import io.agora.rtc2.video.VideoEncoderConfiguration.FRAME_RATE | ||
import io.agora.rtc2.video.VideoEncoderConfiguration.ORIENTATION_MODE | ||
import io.agora.rtc2.video.VideoEncoderConfiguration.VideoDimensions | ||
|
||
object SettingPreferences { | ||
|
||
private var videoDimensions : VideoDimensions? = null | ||
private var videoFrameRate : FRAME_RATE? = null | ||
private var orientationMode: ORIENTATION_MODE? = null | ||
private var area = AreaCode.AREA_CODE_GLOB | ||
|
||
fun setVideoDimensions(dimensions: VideoDimensions?) { | ||
videoDimensions = dimensions | ||
} | ||
|
||
fun getVideoDimensions(): VideoDimensions{ | ||
return videoDimensions ?: VideoEncoderConfiguration.VD_960x540 | ||
} | ||
|
||
fun setVideoFrameRate(frameRate: FRAME_RATE?) { | ||
videoFrameRate = frameRate | ||
} | ||
|
||
fun getVideoFrameRate(): FRAME_RATE{ | ||
return videoFrameRate ?: FRAME_RATE.FRAME_RATE_FPS_15 | ||
} | ||
|
||
fun setOrientationMode(mode: ORIENTATION_MODE?) { | ||
orientationMode = mode | ||
} | ||
|
||
fun getOrientationMode(): ORIENTATION_MODE { | ||
return orientationMode ?: ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE | ||
} | ||
|
||
fun setArea(area: Int) { | ||
this.area = area | ||
} | ||
|
||
fun getArea(): Int { | ||
return area | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...oid/APIExample-Compose/app/src/main/java/io/agora/api/example/compose/model/Components.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.agora.api.example.compose.model | ||
|
||
data class Component( | ||
val id: Int, | ||
val name: String, | ||
val examples: List<Example> | ||
) | ||
|
||
val basicComponent = Component( | ||
0, | ||
"Basic", | ||
examples = BasicExampleList | ||
) | ||
|
||
val advanceComponent = Component( | ||
1, | ||
"Advance", | ||
examples = AdvanceExampleList | ||
) | ||
|
||
val Components = listOf( | ||
basicComponent, | ||
advanceComponent | ||
) |
Oops, something went wrong.