Skip to content

Commit

Permalink
compatible with Ladybug android studio now
Browse files Browse the repository at this point in the history
  • Loading branch information
myofficework000 committed Oct 22, 2024
1 parent 5ba81d3 commit 4de5418
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 136 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {

defaultConfig {
applicationId "com.example.jetpack_compose_all_in_one"
minSdk 26
minSdk 29
targetSdk 34
versionCode 1
versionName "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ComposeUITestForListScreenTest{
@get:Rule
val composeRule = createComposeRule()


@Test
fun testList() {
val stateList = mutableStateListOf<String>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTextClearance
import androidx.compose.ui.test.performTextInput
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.*
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class RegistrationKtTest{
class RegistrationKtTest {

@get:Rule
val composeTestRule = createComposeRule()

@Before
fun setup() {
composeTestRule.setContent {
RegistrationForm{

RegistrationForm {
}
}
}

@Test
fun verifyAllViewExits(){
fun verifyAllViewExits() {
composeTestRule.apply {
onNodeWithTag("Register").assertExists()
onNodeWithText("Username").assertExists()
Expand All @@ -44,7 +44,7 @@ class RegistrationKtTest{
}

@Test
fun verifyEmailValidationWithValidEmail(){
fun verifyEmailValidationWithValidEmail() {
val validEmail = "[email protected]"

composeTestRule.onNodeWithText("Email").apply {
Expand All @@ -57,7 +57,7 @@ class RegistrationKtTest{
}

@Test
fun verifyEmailValidationWithInvalidEmail(){
fun verifyEmailValidationWithInvalidEmail() {
val invalidEmail = "invalidEmail"
val errorMsg = "Input proper email id"

Expand All @@ -71,7 +71,7 @@ class RegistrationKtTest{
}

@Test
fun verifyConfirmPasswordValidationWithValidPassword(){
fun verifyConfirmPasswordValidationWithValidPassword() {
val validConfirmPassword = ""
val errorMsg = ""

Expand All @@ -85,7 +85,7 @@ class RegistrationKtTest{
}

@Test
fun verifyConfirmPasswordValidationWithInvalidPassword(){
fun verifyConfirmPasswordValidationWithInvalidPassword() {
val validConfirmPassword = "password"
val errorMsg = "Password is not matched"

Expand All @@ -99,7 +99,7 @@ class RegistrationKtTest{
}

@Test
fun verifyButtonClick(){
fun verifyButtonClick() {
val userName = "user"
val email = "[email protected]"
val mobile = "123-456-789"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ fun CounterDisplay() {
text = counterText,
style = TextStyle(
fontSize = 36.sp,
color = Color.White
color = Color.Blue
)
)

OutlinedTextField(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -64,12 +65,14 @@ fun CounterDisplay() {
Text("Input")
},
textStyle = TextStyle(
color = Color.White,
color = Color.Blue,
fontSize = 18.sp,
textAlign = TextAlign.Start,
),
)

Spacer(modifier = Modifier.height(16.dp))

Button(
onClick = {
counterText = processInput(editedText)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.jetpack_compose_all_in_one.R
import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.remote.NetworkResult
import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.viewmodel.ChatGPTViewModel
Expand All @@ -41,7 +43,12 @@ import com.example.jetpack_compose_all_in_one.ui.theme.dp_5
import com.example.jetpack_compose_all_in_one.ui.views.chat.textBackgroundColor
import com.example.openai_app.model.remote.responsemodel.ChatResponse

//Luan
@Preview
@Composable
private fun ChatUIPrev() {
ChatUI(chatGPTViewModel = viewModel())
}

@Composable
fun ChatUI(chatGPTViewModel: ChatGPTViewModel) {
val result by chatGPTViewModel.result.observeAsState()
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ buildscript {
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.45'
classpath 'com.google.gms:google-services:4.3.15'
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
classpath 'com.android.tools.build:gradle:8.1.0'
classpath 'com.android.tools.build:gradle:8.7.1'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.1' apply false
id 'com.android.library' version '8.1.1' apply false
id 'com.android.application' version '8.7.1' apply false
id 'com.android.library' version '8.7.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'com.apollographql.apollo3' version '3.2.1' apply false
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
8 changes: 5 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Tue Apr 11 20:11:17 IST 2023
#Tue Oct 22 01:05:09 IST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 4de5418

Please sign in to comment.