This file contains hidden or 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
1. With your Android Studio open, click on the ‘File’ menu. | |
2. Then select ‘Settings’. | |
3. In the ‘Editor’ tab, navigate to ‘File Types’. | |
4. Within this menu, click on the ‘Ignored Files and Folders’ window. | |
5. Add this sources. | |
*DaggerComponent.java | |
*DaggetModule.java | |
*Hilt*.java |
This file contains hidden or 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
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.platform.LocalDensity | |
import androidx.compose.ui.unit.TextUnit | |
import androidx.compose.ui.unit.sp | |
val TextUnit.nonScaledSp | |
@Composable | |
get() = (this.value / LocalDensity.current.fontScale).sp | |
// Example: |
This file contains hidden or 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
fun Context.getActivity(): ComponentActivity? = when (this) { | |
is ComponentActivity -> this | |
is ContextWrapper -> baseContext.getActivity() | |
else -> null | |
} |