diff --git a/README.md b/README.md index 8ed68cf..99afe1d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build Status](https://travis-ci.org/paug/openfeedback-android-sdk.svg?branch=master)](https://travis-ci.org/paug/openfeedback-android-sdk) [ ![Download](https://api.bintray.com/packages/openfeedback/Android/feedback-android-sdk-ui/images/download.svg) ](https://bintray.com/openfeedback/Android/feedback-android-sdk-ui/_latestVersion) +[![BuildStatus](https://github.com/paug/openfeedback-android-sdk/actions/workflows/ci.yaml/badge.svg)](https://github.com/paug/openfeedback-android-sdk/actions/workflows/ci.yaml/badge.svg) + # Open-Feedback Android SDK An Android client for Open-Feeedback https://github.com/HugoGresse/open-feedback: @@ -31,8 +32,7 @@ val openfeedbackFirebaseConfig = OpenFeedbackFirebaseConfig( OpenFeedback( config = (application as MyApp).openfeedbackFirebaseConfig, projectId = "", - sessionId = "", - language = "" + sessionId = "" ) ``` @@ -64,7 +64,3 @@ dependencies { implementation("io.openfeedback:feedback-android-sdk-viewmodel:$openfeedbackVersion") } ``` - -## Limitations and TODO - -The SDK is still very young and misses some features, most notably comments. Feedbacks welcome. diff --git a/sample-app/src/main/java/io/openfeedback/android/sample/MainActivity.kt b/sample-app/src/main/java/io/openfeedback/android/sample/MainActivity.kt index cd2a93e..dd46ced 100644 --- a/sample-app/src/main/java/io/openfeedback/android/sample/MainActivity.kt +++ b/sample-app/src/main/java/io/openfeedback/android/sample/MainActivity.kt @@ -10,7 +10,8 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.material.Scaffold +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.material3.Scaffold import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -21,7 +22,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import io.openfeedback.android.viewmodels.OpenFeedbackFirebaseConfig import io.openfeedback.android.m2.OpenFeedback import io.openfeedback.android.sample.theme.DesignSystem import io.openfeedback.android.sample.theme.OpenFeedbackTheme @@ -30,43 +30,47 @@ class MainActivity : AppCompatActivity() { @SuppressLint("UnusedMaterialScaffoldPaddingParameter") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val projectId = "mMHR63ARZQpPidFQISyc" + val projectId = "vpVXg1DSiq3i1jFZdtuQ" + val sessionId = "p5wMp8XHyaQo0ePbzdwW" val openFeedbackFirebaseConfig = (application as MainApplication).openFeedbackFirebaseConfig setContent { - var designSystem by rememberSaveable { mutableStateOf(DesignSystem.M2) } + var designSystem by rememberSaveable { mutableStateOf(DesignSystem.M3) } val isDark = isSystemInDarkTheme() var isLight by rememberSaveable(isDark) { mutableStateOf(isDark.not()) } OpenFeedbackTheme( designSystem = designSystem, isLight = isLight ) { - Column { - ThemeSwitcher( - designSystem = designSystem, - isLight = isLight, - onDesignSystemChanged = { designSystem = it }, - onLightDarkChanged = { isLight = it } - ) - when (designSystem) { - DesignSystem.M2 -> Scaffold { - OpenFeedback( - config = openFeedbackFirebaseConfig, - projectId = projectId, - sessionId = "173222", - modifier = Modifier - .padding(it) - .padding(horizontal = 8.dp, vertical = 4.dp) + Scaffold { + LazyColumn(contentPadding = it) { + item { + ThemeSwitcher( + designSystem = designSystem, + isLight = isLight, + onDesignSystemChanged = { designSystem = it }, + onLightDarkChanged = { isLight = it } ) } - DesignSystem.M3 -> androidx.compose.material3.Scaffold { - io.openfeedback.android.m3.OpenFeedback( - config = openFeedbackFirebaseConfig, - projectId = projectId, - sessionId = "173222", - modifier = Modifier - .padding(it) - .padding(horizontal = 8.dp, vertical = 4.dp) - ) + item { + when (designSystem) { + DesignSystem.M2 -> + OpenFeedback( + config = openFeedbackFirebaseConfig, + projectId = projectId, + sessionId = sessionId, + modifier = Modifier + .padding(horizontal = 8.dp, vertical = 4.dp) + ) + + DesignSystem.M3 -> + io.openfeedback.android.m3.OpenFeedback( + config = openFeedbackFirebaseConfig, + projectId = projectId, + sessionId = sessionId, + modifier = Modifier + .padding(horizontal = 8.dp, vertical = 4.dp) + ) + } } } } diff --git a/sample-app/src/main/java/io/openfeedback/android/sample/MainApplication.kt b/sample-app/src/main/java/io/openfeedback/android/sample/MainApplication.kt index bc4e0ee..00540a6 100644 --- a/sample-app/src/main/java/io/openfeedback/android/sample/MainApplication.kt +++ b/sample-app/src/main/java/io/openfeedback/android/sample/MainApplication.kt @@ -10,10 +10,10 @@ class MainApplication: Application() { super.onCreate() openFeedbackFirebaseConfig = OpenFeedbackFirebaseConfig( context = this, - projectId = "openfeedback-b7ab9", - applicationId = "1:765209934800:android:a6bb09f3deabc2277297d5", - apiKey = "AIzaSyC_cfbh8xKwF8UPxCeasGcsHyK4s5yZFeA", - databaseUrl = "https://openfeedback-b7ab9.firebaseio.com" + projectId = "open-feedback-42", + applicationId = "1:635903227116:android:ffbe1750162d4b01b1e1c9", + apiKey = "AIzaSyDVVFO767y1cfp38D_rveqPm0XEaWrzFiA", + databaseUrl = "https://open-feedback-42.firebaseio.com" ) } }