1
1
package com.mecofarid.trending
2
2
3
3
import android.os.Bundle
4
- import androidx.activity.ComponentActivity
5
- import androidx.activity.compose.setContent
6
- import androidx.compose.foundation.isSystemInDarkTheme
7
- import androidx.compose.foundation.layout.fillMaxSize
8
- import androidx.compose.foundation.shape.RoundedCornerShape
4
+ import androidx.appcompat.app.AppCompatActivity
9
5
import androidx.compose.material.*
10
- import androidx.compose.runtime.Composable
11
- import androidx.compose.ui.Modifier
12
- import androidx.compose.ui.graphics.Color
13
- import androidx.compose.ui.text.TextStyle
14
- import androidx.compose.ui.text.font.FontFamily
15
- import androidx.compose.ui.text.font.FontWeight
16
- import androidx.compose.ui.tooling.preview.Preview
17
- import androidx.compose.ui.unit.dp
18
- import androidx.compose.ui.unit.sp
6
+ import androidx.databinding.DataBindingUtil
7
+ import com.mecofarid.trending.android.R
8
+ import com.mecofarid.trending.common.ui.ext.replaceFragment
9
+ import com.mecofarid.trending.ui.trending.view.TrendingFragment
19
10
20
- @Composable
21
- fun MyApplicationTheme (
22
- darkTheme : Boolean = isSystemInDarkTheme(),
23
- content : @Composable () -> Unit
24
- ) {
25
- val colors = if (darkTheme) {
26
- darkColors(
27
- primary = Color (0xFFBB86FC ),
28
- primaryVariant = Color (0xFF3700B3 ),
29
- secondary = Color (0xFF03DAC5 )
30
- )
31
- } else {
32
- lightColors(
33
- primary = Color (0xFF6200EE ),
34
- primaryVariant = Color (0xFF3700B3 ),
35
- secondary = Color (0xFF03DAC5 )
36
- )
37
- }
38
- val typography = Typography (
39
- body1 = TextStyle (
40
- fontFamily = FontFamily .Default ,
41
- fontWeight = FontWeight .Normal ,
42
- fontSize = 16 .sp
43
- )
44
- )
45
- val shapes = Shapes (
46
- small = RoundedCornerShape (4 .dp),
47
- medium = RoundedCornerShape (4 .dp),
48
- large = RoundedCornerShape (0 .dp)
49
- )
50
-
51
- MaterialTheme (
52
- colors = colors,
53
- typography = typography,
54
- shapes = shapes,
55
- content = content
56
- )
57
- }
58
-
59
- class MainActivity : ComponentActivity () {
60
- override fun onCreate (savedInstanceState : Bundle ? ) {
61
- super .onCreate(savedInstanceState)
62
- setContent {
63
- MyApplicationTheme {
64
- Surface (
65
- modifier = Modifier .fillMaxSize(),
66
- color = MaterialTheme .colors.background
67
- ) {
68
- Greeting (" Heyye" )
69
- }
70
- }
71
- }
72
- }
73
- }
74
-
75
- @Composable
76
- fun Greeting (text : String ) {
77
- Text (text = text)
78
- }
79
-
80
- @Preview
81
- @Composable
82
- fun DefaultPreview () {
83
- MyApplicationTheme {
84
- Greeting (" Hello, Android!" )
85
- }
86
- }
11
+ class MainActivity : AppCompatActivity () {
12
+ // private val binding: ActivityMainBinding by lazy { DataBindingUtil.setContentView(this, R.layout.activity_main) }
13
+ // override fun onCreate(savedInstanceState: Bundle?) {
14
+ // super.onCreate(savedInstanceState)
15
+ // addTrendingScreen()
16
+ // }
17
+ //
18
+ // private fun addTrendingScreen(){
19
+ // replaceFragment(TrendingFragment(), binding.coninerid)
20
+ // }
21
+ }
0 commit comments