skip to Main Content

Android Studio – Image View doesn't match parent's rounded cornered background

<FrameLayout android:id="@+id/flTodayTraining" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/fl_today_training_bg_margin_bottom" android:layout_marginTop="@dimen/fl_today_training_bg_margin_top" android:layout_marginHorizontal="@dimen/fl_today_training_bg_margin_horizontal" android:background="@drawable/today_training_bg" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/tvDaysTrained" > <androidx.appcompat.widget.LinearLayoutCompat android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:layout_width="match_parent" android:layout_height="@dimen/iv_today_training_detail_height" android:src="@drawable/male_upper_body" android:scaleType="fitXY" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/upper_body" android:textSize="@dimen/tv_today_training_detail_text_size" android:textColor="@color/black" android:paddingVertical="@dimen/tv_today_training_detail_padding_vertical" android:gravity="center" /> </androidx.appcompat.widget.LinearLayoutCompat> </FrameLayout> That's the cornered background of the…

VIEW QUESTION

Android Studio – Android studio custom icon state_focused not working

custom_email_icon.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/ic_email_focused"/> <item android:state_focused="false" android:drawable="@drawable/ic_email"/> </selector> activity_main.xml <EditText android:id="@+id/emailText" android:layout_width="301dp" android:layout_height="48dp" android:layout_marginTop="100dp" android:ems="10" android:background="@drawable/custom_input" android:drawableStart="@drawable/custom_email_icon" android:drawablePadding="12dp" android:paddingStart="12dp" android:paddingEnd="12dp" android:hint="Email Address" android:inputType="textPersonName" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> Icon color change not working when I clicked…

VIEW QUESTION

Android Studio – ImageView.setBackgroundResource

Attempt to invoke virtual method 'void android.widget.ImageView.setBackgroundResource(int)' on a null object reference at com.Adapter.MessageAdapter.onBindViewHolder(MessageAdapter.java:240) at com.Adapter.MessageAdapter.onBindViewHolder(MessageAdapter.java:37) at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7093) at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7172) at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6037) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6304) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6143) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6139) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next public class ViewHolder extends RecyclerView.ViewHolder { public ImageView read_chat; }…

VIEW QUESTION

Android Studio – Shared srcDirs between test and androidTest, unresolved references after upgrade to Android Studio Chipmunk (IntelliJ 2021.2.1)

I just upgraded from Bumblebee to Chipmunk, and I am having multiple dependency-resolution issues in my instrumented androidTests. These are what my source sets look like: sourceSets { test.java.srcDirs += 'src/testShared/kotlin' test.resources.srcDirs += 'src/testShared/resources' androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) androidTest.java.srcDirs += 'src/testShared/kotlin'…

VIEW QUESTION
Back To Top
Search