Issue I read here about converting dp units to pixel units. But I cant understand the 0.5f. Where does this number come from and what is the use of it? // The gesture threshold expressed in dp private static final
Continue readingTag: android-layout
Why does my XML element not have rounded corners?
Issue I am trying to create a rectangle with rounded corners to be the background of two elements in my XML. I have created a TextView for this background called prod1_bg and set its cornerRadius to 10dp. Why don’t the
Continue readingIs 12px text size in Figma equal to 12sp text size in Android XML layout?
Issue In my figma android maket i have a text with 12px text size, which text size should i set for my textview in android app? 12sp or other? Solution No, the text size in Figma and Android XML layouts
Continue readingMenu won't show up in search bar
Issue I’m currently facing a problem with a search bar in my app. The search bar is part of an inflated layout from a menu. Within this menu, there’s an icon called ‘log_out_button’ that should appear in the search bar
Continue readingScrollView Layout does not fill the whole screen
Issue I got an Activity with two Fragments (one list one normal). And the normal Fragment inflates a Scrollview containing a LineaLayout (vertical) and this layout contains TextViews. The ScrollView and layout_width and layout_height are match_parent, so I think the
Continue readingHow to constrain a rotated View/Button to the left side of ConstraintLayout on Android?
Issue Edit: it is possible to just to use translateX (see comments and accepted answer). I don’t know how I missed that. On Android, I want to rotate a simple button 90 degrees and have it stick against the left
Continue readingHow to programmatically add views and constraints to a ConstraintLayout?
Issue I’m having a problem to programmatically add views to a ConstraintLayout, and set up all the constraints required for the layout to work. What I have at the moment doesn’t work: ConstraintLayout layout = (ConstraintLayout) findViewById(R.id.mainConstraint); ConstraintSet set =
Continue readingAdding constraints programmatically
Issue What is the translation to java code of the following XML instructions used in a layout definition with a constraint layout? app:layout_constraintBottom_toBottomOf=”@+id/Button1″ app:layout_constraintTop_toTopOf=”@+id/Button1″ app:layout_constraintLeft_toLeftOf=”@+id/Button2″ app:layout_constraintRight_toRightOf=”Button2″ Solution Here is an example of adding constraints programatically, ConstraintLayout mConstraintLayout = (ConstraintLayout)fndViewById(R.id.mainConstraint); ConstraintSet
Continue readingAsking for advice of how to appraoch an application
Issue As part of a university project, I have to build an Android app that will contain informations about diseases, the diseases will be listed in a list (alphabetic order), when clicked on a disease you’ll be directed to another
Continue readingAndroid Layout Render Issue
Issue I have a RecyclerView list and recently a "Render problem" appeared in the layout, activity_main.xml: java.lang.NoSuchFieldError: ACTION_SCROLL_IN_DIRECTION at androidx.core.view.accessibility.AccessibilityNodeInfoCompat$Api34Impl.getActionScrollInDirection(AccessibilityNodeInfoCompat.java:5592) [the rest of the stack error is shown below] An online google forum for Android bugs suggested that issue might
Continue reading