amar_1995
07/12/2020, 7:45 AMnglauber
07/12/2020, 3:12 PMval shape = RoundedCornerShape(8.dp)
Column(modifier = Modifier.fillMaxSize()) {
Text(
text = "Text 1",
modifier = Modifier.fillMaxWidth()
.padding(16.dp)
.drawShadow(2.dp, shape)
.drawBorder(2.dp, MaterialTheme.colors.secondary, shape)
.drawBackground(MaterialTheme.colors.primary, shape)
.padding(16.dp)
)
}
Socheat KHAUV
07/12/2020, 3:18 PMV Badalyan
07/13/2020, 12:02 AMorg.jetbrains.kotlin.kotlin-compiler-embeddable-1.3.70-dev-withExperimentalGoogleExtensions-20200424
with kottlin 1.4-M2
and M3
version" ???
• clean 1.4-M2
from get brains don't compile
Caused by: java.lang.IllegalArgumentException: Call resolver must be non-null at androidx.compose.plugins.kotlin.ComposeCallResolutionInterceptorExtension.interceptCandidates(ComposeCallResolutionInterceptorExtension.kt:189)
• setting kotlinCompilerVersion = "1.3.70-dev-withExperimentalGoogleExtensions-20200424" don't work because i use IR and Progressive mode
cause error becouse i use IR and progressiveMode
Class 'com.cisystems.ssmp.arm_vmb2.controlles.workerUtils.CardsUpdateWorkerUtils' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
doubov
07/13/2020, 12:05 AM@Composable
fun Greeting(name: String) {
val state = state { TextFieldValue("Hello $name") }
Row(modifier = Modifier.fillMaxWidth() + Modifier.wrapContentHeight()) {
Box(modifier = Modifier.width(32.dp) + Modifier.fillMaxHeight(), backgroundColor = Color.Yellow)
Column(modifier = Modifier.weight(1f)) {
TextField(
modifier = Modifier.fillMaxWidth() + Modifier.wrapContentHeight(),
value = state.value,
onValueChange = {
state.value = it
}
)
Text(
text = "TextField text: ${state.value.text}",
modifier = Modifier.padding(vertical = 8.dp) + Modifier.fillMaxWidth() + Modifier.wrapContentHeight()
)
Text(text = "Finish", modifier = Modifier.fillMaxWidth() + Modifier.wrapContentHeight())
}
Box(modifier = Modifier.width(32.dp), backgroundColor = Color.Yellow)
}
}
Produces in my opinion, unexpected layout:Madhava
07/13/2020, 12:46 AMfun onImeActionPerformed(action: ImeAction, keyboard: SoftwareKeyboardController?): Unit {
Log.v("conditions", "ime pressed $action $keyboard")
}
OutlinedTextField(
value = searchState.value,
onValueChange = { it: String ->
Log.v("conditions", "search bar $it")
searchState.value = it
},
activeColor = primaryColor,
inactiveColor = primaryColor,
label = { Text("Search") },
onFocusChange = { it: Boolean ->
Log.v("conditions", "focus changed $it")
},
imeAction = ImeAction.Search,
keyboardType = KeyboardType.Ascii,
onImeActionPerformed = { action, kb -> onImeActionPerformed(action, kb) },
modifier = Modifier.fillMaxWidth()
)
This does not:
fun onImeActionPerformed(action: ImeAction, keyboard: SoftwareKeyboardController?): Unit {
Log.v("conditions", "ime pressed $action $keyboard")
}
OutlinedTextField(
value = searchState.value,
onValueChange = { it: String ->
Log.v("conditions", "search bar $it")
searchState.value = it
},
activeColor = primaryColor,
inactiveColor = primaryColor,
label = { Text("Search") },
onFocusChange = { it: Boolean ->
Log.v("conditions", "focus changed $it")
},
imeAction = ImeAction.Done,
keyboardType = KeyboardType.Ascii,
onImeActionPerformed = onImeActionPerformed,
modifier = Modifier.fillMaxWidth()
)
Error:
None of the following functions can be called with the arguments supplied:
public fun OutlinedTextField(value: TextFieldValue, onValueChange: (TextFieldValue) -> Unit, label: () -> Unit, modifier: Modifier = ..., textStyle: TextStyle = ..., placeholder: (() -> Unit)? = ..., leadingIcon: (() -> Unit)? = ..., trailingIcon: (() -> Unit)? = ..., isErrorValue: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardType: KeyboardType = ..., imeAction: ImeAction = ..., onImeActionPerformed: (ImeAction, SoftwareKeyboardController?) -> Unit = ..., onFocusChange: (Boolean) -> Unit = ..., onTextInputStarted: (SoftwareKeyboardController) -> Unit = ..., activeColor: Color = ..., inactiveColor: Color = ..., errorColor: Color = ...): Unit defined in androidx.ui.material
public fun OutlinedTextField(value: String, onValueChange: (String) -> Unit, label: () -> Unit, modifier: Modifier = ..., textStyle: TextStyle = ..., placeholder: (() -> Unit)? = ..., leadingIcon: (() -> Unit)? = ..., trailingIcon: (() -> Unit)? = ..., isErrorValue: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardType: KeyboardType = ..., imeAction: ImeAction = ..., onImeActionPerformed: (ImeAction, SoftwareKeyboardController?) -> Unit = ..., onFocusChange: (Boolean) -> Unit = ..., onTextInputStarted: (SoftwareKeyboardController) -> Unit = ..., activeColor: Color = ..., inactiveColor: Color = ..., errorColor: Color = ...): Unit defined in androidx.ui.material
Madhava
07/13/2020, 2:41 AMAlejandro Rios
07/13/2020, 11:58 AMLinearProgressIndicator
?, by animate i mean to fill the progress to certain value, thanks!bohregard
07/13/2020, 1:04 PMJoshua McWilliams
07/13/2020, 2:25 PMExecution failed for task ‘:app:kaptDebugKotlin’.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)Any ideas how to get Dagger to place nice with Compose? Fragment Code:
class HomeFragment : Fragment() {
@Inject
lateinit var viewModelFactory: ViewModelFactory
private val vm: HomeViewModel by viewModels { viewModelFactory }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val fragmentView = inflater.inflate(R.layout.compose_container, container, false)
(fragmentView as ViewGroup).setContent {
LetsComposeTheme {
HomeTabContent()
}
}
return fragmentView
}
}
@Composable
fun HomeTabContent() {
VerticalScroller {
drawSectionCard(createSections())
}
}
Julius Marozas
07/13/2020, 4:56 PMLinearProgressIndicator
below an app bar. Can I hide the progress indicator without affecting the content below it? I am looking for something like View.INVISIBLE
(and not View.GONE
).Halil Ozercan
07/13/2020, 9:11 PMadd
in fragment transactions).Alejandro Rios
07/13/2020, 10:29 PMScaffold
which has a bodyContent
with a Box
and a list inside and it scrolls ok, then, i added a bottomBar
but now i cant see the bottom of the list, do you know if there's a way to avoid this? ThanksMadhava
07/14/2020, 1:06 AMMadhava
07/14/2020, 3:00 AMAndroidView(
modifier = Modifier.fillMaxWidth().fillMaxHeight(),
view = MapComponent(ctx, options)
)
// the getMapAsync never runs
private fun MapComponent(ctx: Context, options: GoogleMapOptions) = MapView(ctx, options).apply {
val result = ctx.checkCallingPermission(Manifest.permission.ACCESS_FINE_LOCATION)
Log.i("MapView", "got permission check value: $result")
val builder = LatLngBounds.Builder()
val cameraUpdate = CameraUpdateFactory.newLatLngBounds(builder.build(), 0)
getMapAsync {
Log.i("MapView", "Does this run?")
it.uiSettings.isMyLocationButtonEnabled = true
it.isMyLocationEnabled = true
it.mapType = MAP_TYPE_NORMAL
}
}
// if i try it this way, I don't see how to get a view from a fragment
private fun MapComponent(ctx: Context, options: GoogleMapOptions) = SupportMapFragment.newInstance(options).getMapAsync {
}
Socheat KHAUV
07/14/2020, 7:38 AMJulius Marozas
07/14/2020, 10:11 AMCanvas
. I see that the DrawScope.drawPath
function accepts Path
as a parameter. However, I also found a quite convenient path builder function PathData
which returns List<PathNode>
. Can I somehow pass that list of path nodes to DrawScope.drawPath
, i.e., construct a Path
from List<PathNode>
?Socheat KHAUV
07/14/2020, 10:29 AMGriffin.Park
07/14/2020, 1:22 PMjava.lang.IllegalArgumentException: Unhandled intrinsic in ExpressionCodegen: FUN IR_EXTERNAL_DECLARATION_STUB name:<get-primaryVideoView> visibility:public modality:FINAL <> ($receiver:android.app.Activity) returnType:com.twilio.video.VideoView?
I haven't called the .xml file that this function is located, but this appears to be a separate activity from my main that's causing the error. Do I need to somehow refactor this into my main activity?Alejandro Rios
07/14/2020, 2:28 PM@Composable
items, if i want to launch a Toast
, how can i get the context
in order to show the Toast
?Julius Marozas
07/14/2020, 3:59 PMrxjava2
package the subscribeAsState
function calls asState
and it uses the onPreCommit
hook. Why would the onCommit
hook not work there? I don't really understand the use case of onPreCommit
.Brett Best
07/14/2020, 4:02 PMnglauber
07/14/2020, 5:59 PM/**
* My Component
*
* @sample com.example.tempcompose.SimplePreview
*/
@Composable
fun MyComposable() { ... }
@Preview
@Composable
fun SimplePreview() {
MyComposable()
}
When I hit Cmd+Space I can see the sample code, but not the preview…Halil Ozercan
07/14/2020, 10:41 PMIconButton
and Icon
. I'm developing a VideoPlayer fully written in Compose and wanted to add on-screen play/pause button. These icons need to be differentiable on video, so that I chose to use white for icon colors and draw shadow around them. Code looks something like this
IconButton(
onClick = {
mediaPlayer.toggle()
playButtonUiState = mediaPlayer.isPlaying
}
) {
Icon(
asset = if (playButtonUiState) Icons.Filled.Pause else Icons.Filled.PlayArrow,
modifier = Modifier.drawShadow(elevation = 2.dp)
)
}
Without shadow, everything seems like to work. State changes and icon is updated when clicked on the button. However, when I add shadow as in the example, icon stops changing. Functionality works but icon gets fixed to Pause
. Is there something wrong with my code or is this might be a bug?pajatopmr
07/15/2020, 4:39 AMLoboda Deni
07/15/2020, 8:56 AMTimo Drick
07/15/2020, 11:34 AMcb
07/15/2020, 12:02 PMCrossfade
and allowing you to pass in a `TransitionDefinition`: https://gist.github.com/chrisbanes/c4d199a34366a4e13594f5f98d6e8620Julius Marozas
07/15/2020, 1:34 PMhenrikhorbovyi
07/15/2020, 3:53 PM@GenerateView
annotation still available? 🤔henrikhorbovyi
07/15/2020, 3:53 PM@GenerateView
annotation still available? 🤔Vinay Gaba
07/15/2020, 4:08 PMhenrikhorbovyi
07/15/2020, 4:18 PMromainguy
07/15/2020, 4:27 PMLeland Richardson [G]
07/15/2020, 4:48 PMhenrikhorbovyi
07/15/2020, 5:27 PMPatrick Yin
08/18/2020, 12:30 AM@GenerateView
is available?Adam Powell
08/18/2020, 12:46 AMAbstractComposeView
exposes a single @Composable abstract fun Content()
, or ComposeView
has a setContent(content: @Composable () -> Unit)
method@GenerateView
, when we get the opportunity to add it, will likely just generate a subclass of AbstractComposeView
and add xml inflation in the constructor and mutableStateOf
-backed propertiesPatrick Yin
08/18/2020, 6:30 PMComposeView
is a good solution. didn’t find it out from doc and source code before you point it out. It works well. thanks @Adam Powell