Issue I have 3 classes: GameResultList which is basically ArrayList with some helper methods in it GameResult with an abstract value gameMode GameMode public class GameResultList extends ArrayList<GameResult> { … } class GameResult( val gameMode: GameMode, val score: Int, timeSpentInSeconds:
Continue readingTag: android
Android Studio 4.2 doesn't show signing report in the Gradle bar
Issue I’m starting a new project using Firebase and I have to get an SHA1 key from my project. Recently I’ve updated Android Studio to version 4.2 and the signing report tab disappeared from the Gradle bar. Follow the image
Continue readingGet text of TextInputLayout from MaterialDesigns in Kotlin
Issue The basic code that I’ve seen in other posts don’t seem to do the trick. It doesn’t recognize the text saying Unresolved reference: text val name = binding.etName.text.toString() This is my XML where I have the etName, I have
Continue readingAttempt to invoke virtual method 'androidx.navigation.NavGraph androidx.navigation.NavDestination.getParent()' on a null object reference
Issue I have created an Android application and I have added the "Navigation Drawer Activity" from Gallery, I have removed and renamed the menu items. After starting the application when I click to any menu item in Drawer activity I
Continue readingHow can I change icons color in button?
Issue I created button with text and icon: <Button android:id=”@+id/btnLinkToProfile” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:background=”@color/white” android:text=”@string/profile” android:gravity=”left|center_vertical” android:textAllCaps=”false” android:textColor=”@color/text” android:textSize=”15dp” android:drawableLeft=”@drawable/profile”/> And I want to set icon color, how to do this in <Button/> tag or it can be set only in
Continue readingJetpack compose: position elements inside a Box
Issue I have a Box in my app with a bunch of children: Box(modifier = Modifier.fillMaxSize()) { Text("a") Text("b") } I want the text to appear aligned to the top at 20% distance from the start. How do I achieve
Continue readingFacebook ads for kotlin
Issue i am trying to show facebook ads on my android app written in kotlin but everytime i try to add code it shows errors, i searched everywhere but could not find a kotlin version adView = new AdView(this, “YOUR_PLACEMENT_ID”,
Continue readingHow to center the middle child in a Compose Row and make it responsive
Issue I’d like to build a row in Jetpack Compose, with 3 elements, where the first and last elements are "stuck" to either sides, and the middle one stays in the center. The elements are not all the same width.
Continue readingHow to change bottom navigation icons on selection
Issue How to change bottom navigation icons on selection and unselection This was my previous code bottomBar.getBar().setBackgroundColor(getResources().getColor(R.color.bottom_tabs)); bottomBar.setActiveTabColor("#FFFFFE"); Solution First you have to make drawable selectable in your drawable folder <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:drawable="@drawable/selected_icon"/> <item android:state_selected="false"
Continue readinghow to show a button on top of another element?
Issue I am very new to Kotlin and I want to create a simple activity where details of a person are shown with their picture. I want to move the edit button on top of the imageView so it looks
Continue reading