-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated versions in gradle for 34 API support
- Loading branch information
1 parent
089ca38
commit 3b797b4
Showing
4 changed files
with
59 additions
and
88 deletions.
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
53 changes: 7 additions & 46 deletions
53
app/src/main/java/com/mdoc/termsandconditiondemo/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 |
---|---|---|
@@ -1,65 +1,26 @@ | ||
package com.mdoc.termsandconditiondemo | ||
|
||
import android.graphics.Color | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.mdoc.termsandconditiondemo.ui.theme.TermsAndConditionDemoTheme | ||
import com.mdoc.tnc_compose.TermsText | ||
|
||
|
||
class MainActivity : ComponentActivity() { | ||
private val termsArray = | ||
arrayListOf("I agree to the ", "Terms and Conditions", " & ", "Privacy Policies") | ||
arrayListOf("I agree to the", "Terms and Conditions", "&", "Privacy Policies") | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
|
||
setContent { | ||
TermsAndConditionDemoTheme { | ||
// A surface container using the 'background' color from the theme | ||
Surface( | ||
modifier = Modifier.fillMaxSize(), | ||
color = MaterialTheme.colorScheme.background | ||
) { | ||
TermsText( | ||
24F, | ||
Color.BLACK, | ||
Color.BLUE, | ||
termsArray, | ||
"https://stackoverflow.com/", | ||
"https://google.com/", | ||
LocalContext.current | ||
) | ||
} | ||
TermsText( | ||
stringArray = termsArray, | ||
termsURL = "https://www.stackoverflow.com", | ||
policyURL = "https://www.google.com" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun TermsPreview() { | ||
val termsArray = | ||
arrayListOf("I agree to the ", "Terms and Conditions", " & ", "Privacy Policies") | ||
|
||
TermsAndConditionDemoTheme { | ||
TermsText( | ||
24F, | ||
Color.BLACK, | ||
Color.BLUE, | ||
termsArray, | ||
"https://stackoverflow.com/", | ||
"https://google.com/", | ||
LocalContext.current | ||
) | ||
} | ||
} | ||
} |
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