Category : android-layout

I would like to have a scrollable TextView / TextView inside a ScrollView. I’ve already tried it myself and looked up multiple pages, however my issue always is that the text "text" TextView which says "some text" always exceeds the space between the two other Views despite getting into "ScrollMode" Here’s my XML code: <?xml ..

Read more

i am making a music player and it was working fine , but after some adjustment it started giving error in logcat : java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.musicplayer/com.example.musicplayer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()’ on a null object reference the main_activity.java file is : package com.example.musicplayer; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; ..

Read more

This is what I’m trying to achieve: Basically I want my TextView to autosize only relative tho the fixed height of the TextView container and NOT to the length of the text. Is this achievable in XML only (no Kotlin)? Current implementation: <androidx.appcompat.widget.AppCompatTextView style="@style/TextSFontMd" android:layout_width="0dp" android:layout_height="@dimen/_16sdp" android:ellipsize="end" android:lines="1" android:text="@{text}" app:autoSizeStepGranularity="@dimen/_1ssp" app:autoSizeTextType="uniform" tools:maxLength="10" tools:text="@string/placeholder_lorem_ipsum_short" /> Source: ..

Read more

I am developing an android app to support posting articles by user and have an edittext for the same and below is my layout. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="vertical"> <TextView android:id="@+id/article_title_text_view" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Write Article" /> <com.google.android.material.textfield.TextInputLayout android:id="@+id/article_text_field" android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.material.textfield.TextInputEditText android:layout_width="match_parent" android:layout_height="match_parent" /> </com.google.android.material.textfield.TextInputLayout> </LinearLayout> The problem is the on clicking on edittext ..

Read more