Skip to content

Commit

Permalink
show/hide test code
Browse files Browse the repository at this point in the history
  • Loading branch information
kimnahee1529 committed Oct 6, 2023
1 parent 2b35caf commit 71a757f
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 3 deletions.
3 changes: 3 additions & 0 deletions 18.Show,Hide/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions 18.Show,Hide/.idea/18.Show,Hide.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 18.Show,Hide/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 18.Show,Hide/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 18.Show,Hide/Default/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions 18.Show,Hide/Default/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion 18.Show,Hide/Default/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -18,6 +20,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.devinsight.adefault.ui.theme.DefaultTheme

Expand All @@ -26,7 +29,7 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setContent {
DefaultTheme {
MyShowHideEx1()
MyShowHideEx2()
}
}
}
Expand Down Expand Up @@ -71,11 +74,38 @@ fun MyShowHideEx1(){
}
}

@Composable
fun MyShowHideEx2(){

var switchState by remember { mutableStateOf(false) }

Column(
modifier = Modifier.padding(20.dp)
) {
Switch(
checked = switchState,
onCheckedChange = { checked ->
switchState = checked
}
)
Text(
text = if(switchState) "ON" else "OFF",
fontSize = 30.sp
)

if(switchState){
Button(onClick = {}) {
Text(text = "얍얍")
}
}
}
}


@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
DefaultTheme {
MyShowHideEx1()
MyShowHideEx2()
}
}

0 comments on commit 71a757f

Please sign in to comment.