Slackbot
09/15/2020, 7:42 AMSlackbot
09/15/2020, 2:16 PML.C
09/15/2020, 3:22 PMKen Maffei
09/16/2020, 6:07 AMclass FundamentalsViewModel: ViewModel() {
var fundamentalsLiveData = MutableLiveData<WrappedResult<PriceDataResponse>>()
private val repository = FundamentalsRespository()
private var job: Job? = null
fun getData(symbol: String) {
if(job == null || job?.isActive == false) {
fundamentalsLiveData.value = WrappedResult.Loading
job = viewModelScope.launch(<http://Dispatchers.IO|Dispatchers.IO>) {
try {
val response = repository.getData(symbol)
withContext(Dispatchers.Main) {
fundamentalsLiveData.value = WrappedResult.Success(response)
}
} catch(e: Exception) {
withContext(Dispatchers.Main) {
fundamentalsLiveData.value = WrappedResult.Failure(e)
}
}
}
}
}
}
And out in the field I'm getting a crash that says this:
Fatal Exception: java.lang.NullPointerException
Parameter specified as non-null is null: method kotlin.j0.d.u.p, parameter symbol
On the line that is:
fundamentalsLiveData.value = WrappedResult.Loading
How is it possible that there is ANY NPE here? It makes no sense to me. The WrappedResult is a typical Kotlin sealed class that looks like this:
sealed class WrappedResult<out T> {
data class Success<out T: Any>(val data:T) : WrappedResult<T>()
data class Failure(val error: Throwable) : WrappedResult<Nothing>()
data class CallFailure(val error: String) : WrappedResult<Nothing>()
object Loading : WrappedResult<Nothing>()
}
Any ideas would be appreciated!Mahdi Javaheri
09/16/2020, 7:37 AMKotlin 1.4.0
in my Android project (AGP 4.0.1)
when i want to build a release apk there are errors in console:
Warning: class [META-INF/versions/9/module-info.class] unexpectedly contains class [module-info]
Note: duplicate definition of program class [module-info]
Note: there were 20 duplicate class definitions.
(<http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass>)
Warning: there were 21 classes in incorrectly named files.
You should make sure all file names correspond to their class names.
The directory hierarchies must correspond to the package hierarchies.
Anyone has idea to resolve this issue?Don Phillips
09/16/2020, 4:47 PMkotlinOptions {
languageVersion = "1.4"
}
Did those of you using 1.4 have to do this? We're using AS 4.0.1, and we've got the Kotlin 1.4.10-release-Studio4.0-1 plugin installed in AS.Will Nixon
09/16/2020, 6:40 PMGrant Park
09/17/2020, 2:49 AMmsfjarvis
09/17/2020, 12:55 PMpopBackstackImmediate()
to go back invalidates the fragment and queues it for GC. We're calling registerForActivityResult
in those fragments which eventually causes this overflow if the user stays in the app for long enough because our registerForActivityResult
calls keep incrementing the counter.Mark
09/18/2020, 4:09 AMLifecycleObserver
to observe the fragment lifecycle, but what I’m struggling with is a mechanism of how best to use these callbacks to control the work.OG
09/18/2020, 6:39 AMresize_mode
and I believe the default is fit
which translates to ImageView.ScaleType.CENTER_INSIDE
There's also a fill
and zoom
but these don't seem to keep the aspect ratio intact and stretch the video.
Anyone have any idea if there is some straightforward combination of settings that I may be missing in order to achieve "center_crop" scaling and get the video to show full screen? The easy alternative is to set a black background for letter boxing and playing the video in it's actual aspect ratio, but the fullscreen is definitely preferred.Joost Klitsie
09/18/2020, 9:26 AM<MainNavGraph>
<StartFragment>
<LoginFlowGraph>
<UsernameFragment>
<PasswordFragment>
</LoginFlowGraph>
<LoggedInGraph>
<HomeFragment>
</LoggedInGraph>
</MainNavGraph>
My problem is this: when I am logged in, I want to go to the LoggedInGraph and pop everything what is on the backstack:
if (!navController.currentDestination.isPartOfGraph(R.id.loggedInNavGraph)) {
navController.popBackStack(R.id.mainNavGraph, false)
navController.navigate(R.id.loggedInNavGraph)
}
This works fine. The graph is basically emptied to the root and then the loggedInNavGraph starts.
I want to use material transitions during this, On the login flow I use Material shared transition on the X axis
enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
returnTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
On the HomeFragment I use transitions on the Z axis:
enterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true)
returnTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false)
However, popping the backstack after the login flow, shows the fragments in the backstack also with the wrong animation... Is it possible to clear the backstack without the fragments from within the backstack to show themselves during the transition?Ken Maffei
09/18/2020, 10:20 PMDavid Ng
09/19/2020, 10:55 AMEric Ampire [MOD]
09/19/2020, 3:17 PMAndarb
09/20/2020, 8:11 PMAriel Bogdziewicz
09/21/2020, 10:37 AMA: count = 1, utf16 = 1, unicode scalars = 1 -> ['A']
€: count = 1, utf16 = 1, unicode scalars = 1 -> ['€']
➜: count = 1, utf16 = 1, unicode scalars = 1 -> ['➜']
⛳: count = 1, utf16 = 1, unicode scalars = 1 -> ['⛳']
💩: count = 1, utf16 = 2, unicode scalars = 1 -> ['💩']
❤️: count = 1, utf16 = 2, unicode scalars = 2 -> ['❤', '️']
👨👩👧👦: count = 1, utf16 = 11, unicode scalars = 7 -> ['👨', '', '👩', '', '👧', '', '👦']
👩❤️💋👩: count = 1, utf16 = 11, unicode scalars = 8 -> ['👩', '', '❤', '️', '', '💋', '', '👩']
In swift it’s just text.count
and it returns number of characters like “👨👩👧👧”. I tried
@Test
public void printBreak() {
BreakIterator iterator = BreakIterator.getCharacterInstance();
String[] tests = {
"\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC67", // family icon 👨👩👧👧
"💩",
"€"
};
for (String test: tests) {
iterator.setText(test);
int index = iterator.first();
System.out.println("!!!! Start " + test);
while (index != BreakIterator.DONE) {
System.out.println(index);
index = iterator.next();
}
System.out.println("!!!! End " + test);
}
}
as article https://engineering.linecorp.com/en/blog/the-7-ways-of-counting-characters/ suggested but it also iterates over unicode scalars like
!!!! Start 👨👩👧👧
0
2
3
5
6
8
9
11
!!!! End 👨👩👧👧
Is it really so rocket science to iterate over multiple-characters in Android?Kevin Velasco
09/21/2020, 5:28 PM@UninstallModules
annotation to replace a single binding in your tests rather than having to manually write those dagger modules yourself https://github.com/JuulLabs/pommelzoha131
09/22/2020, 8:27 AMFusedLocationProviderClient
but unfortunately, lastLocation
does not provide the correct location.myanmarking
09/22/2020, 11:27 AMKayCee
09/23/2020, 4:34 AMdata class DataInputEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id") val id: Int,
@ColumnInfo(name = "weight") var weight: Float? = null,
@ColumnInfo(name = "body_fat") val bodyFat: Float? = null,
@ColumnInfo(name = "stamp") val stamp: String,
@ColumnInfo(name = "note") val note: String,
@ColumnInfo(name = "date") val date: Long,
@ColumnInfo(name = "unit") val weightUnit: Int = TypeUnitWeight.KG.value
)
Alex
09/23/2020, 6:25 AMSpikey Sanju
09/23/2020, 1:44 PMJoao Birk
09/23/2020, 2:15 PMdismiss()
findNavController().navigate(
R.id.action_bottom_sheet_b,
bundleOf(...)
)
It opens the Bottom Sheet B without any problem, but if I rotate the screen I get a crash:
java.lang.IllegalStateException
DialogFragment NUM doesn't exist in the FragmentManager
If I move the dismiss
after the navigate
, Bottom Sheet B doesnt show up. Seems they are in the same transaction and therefore bottom sheet B gets dismised as well.
Here is my navigation.xml
<dialog
android:id="@+id/bottom_sheet_a"
android:name="...BottomSheetA"
tools:layout="@layout/dialog_bottom_sheet_a">
<action
android:id="@+id/action_bottom_sheet_b"
app:destination="@id/bottom_sheet_b"/>
</dialog>
I found this on stack: https://stackoverflow.com/questions/56647476/why-dialog-does-not-have-a-navcontroller-missing
And this: https://issuetracker.google.com/issues/134089818 which seems got resolved in 2.1.0-alpha06
But not sure it's the same issue. I'm using 2.3.0.
If I use child childFragmentManager.beginTransaction().show()
to show bottom sheet A instead of findNavController().navigate()
, bottom sheet B gets displayed fine, no crash either.
Any ideas of how to fix this?ankushg
09/23/2020, 6:43 PMkotlinx.serialization
recently added the ability to derive a serializer from external classes with properties-only primary constructors: https://github.com/Kotlin/kotlinx.serialization/blob/v1.0.0-RC2/docs/serializers.md#deriving-external-serializer-for-another-kotlin-class-experimental
Are there plans to add support for this sort of feature for @Parcelize
?Christian
09/24/2020, 5:30 AMDependent features configured but no package ID was set.
I'm trying to set the project as modular as possible. Trying to access the theme from another module which is a Composable
function to my main app module.rkeazor
09/24/2020, 6:59 AMDeva Pandiyan
09/24/2020, 9:24 AMI/art: Background partial concurrent mark sweep GC freed 37518(2MB) AllocSpace objects, 7(1348KB) LOS objects, 14% free, 22MB/26MB,
D/View: [ANR Warning]onMeasure time too long, this =androidx.constraintlayout.widget.ConstraintLayout{b5b15d4 V.E...... ......ID 0,0-720,2380}time =419 ms
how to reduce my app freezingRechee Jozil
09/24/2020, 3:42 PMIvann Ruiz
09/24/2020, 8:05 PM1)
below, assume you take a picture of a document at an angle. Assuming there's some kind of edge-detection mechanism, 4 corners appear on each corner of the paper page on the pic. The final result should be a cropped image that has been transformed, namely image 2)
. Any help/direction is appreciated 🙌Ivann Ruiz
09/24/2020, 8:05 PM1)
below, assume you take a picture of a document at an angle. Assuming there's some kind of edge-detection mechanism, 4 corners appear on each corner of the paper page on the pic. The final result should be a cropped image that has been transformed, namely image 2)
. Any help/direction is appreciated 🙌Casey Brooks
09/24/2020, 8:54 PMIvann Ruiz
09/24/2020, 10:01 PMBenjamin Vallet
09/25/2020, 1:02 AM