android-xml

RecyclerView adapter showing wrong images

僤鯓⒐⒋嵵緔 提交于 2020-11-30 09:17:34
问题 I have a RecyclerView adapter that looks like this: public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private static Context context; private List<Message> mDataset; public RecyclerAdapter(Context context, List<Message> myDataset) { this.context = context; this.mDataset = myDataset; } public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener, View.OnClickListener { public TextView title; public LinearLayout

RecyclerView adapter showing wrong images

ぃ、小莉子 提交于 2020-11-30 09:16:10
问题 I have a RecyclerView adapter that looks like this: public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private static Context context; private List<Message> mDataset; public RecyclerAdapter(Context context, List<Message> myDataset) { this.context = context; this.mDataset = myDataset; } public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener, View.OnClickListener { public TextView title; public LinearLayout

RecyclerView adapter showing wrong images

给你一囗甜甜゛ 提交于 2020-11-30 09:15:04
问题 I have a RecyclerView adapter that looks like this: public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private static Context context; private List<Message> mDataset; public RecyclerAdapter(Context context, List<Message> myDataset) { this.context = context; this.mDataset = myDataset; } public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener, View.OnClickListener { public TextView title; public LinearLayout

Android AppCompatEditText,AppCompatTextView, setText without ID

纵然是瞬间 提交于 2020-11-29 03:57:23
问题 I have simple Login page with some textview and edittex and i set static text to textview and hint to edittext from string.xml working fine. But Now i am receiving that strings(which i set form stirng.xml as i explained above) form webservices and i have to set webservice string. Issue is i didn't set any id to that login screen elements(edittext and textview). Update I have AppCompatTextView like below in my XML <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent"

Android AppCompatEditText,AppCompatTextView, setText without ID

本小妞迷上赌 提交于 2020-11-29 03:54:05
问题 I have simple Login page with some textview and edittex and i set static text to textview and hint to edittext from string.xml working fine. But Now i am receiving that strings(which i set form stirng.xml as i explained above) form webservices and i have to set webservice string. Issue is i didn't set any id to that login screen elements(edittext and textview). Update I have AppCompatTextView like below in my XML <androidx.appcompat.widget.AppCompatTextView android:layout_width="match_parent"

AndroidX Preference Screen shifted off center [duplicate]

為{幸葍}努か 提交于 2020-07-18 07:21:28
问题 This question already has answers here : Android: How to remove margin/padding in Preference Screen (17 answers) Closed 12 months ago . I have a preference screen in my app and it is shifted off center and the header text or data doesn't start from the left shown in the image below. I am initializing the settings fragment. I have not applied any visual changes or added any special attributes. There is no padding or margin in the parent activity. I also have a recycler view which is displayed

What is android:layout_marginStart

家住魔仙堡 提交于 2020-07-17 09:49:22
问题 I would like to add some space between the left display border and an ImageView. Android SDK made me aware of "android:layout_marginStart". Consider adding android:layout_marginStart="10dp" to better support right-to-left layouts Why should I use android:layout_marginStart="10dp" instead of android:layout_marginLeft="10dp" ? I have never done so and never encountered any problems with so-called "right-to-left layouts". 回答1: start and end are the same as left and right for left-to-right (LTR)

How can I make make a border for a clicked imagebutton in Android?

旧城冷巷雨未停 提交于 2020-06-25 18:09:24
问题 I am using Imagebuttons to show some icons in my android project. <ImageButton android:id="@+id/button_one" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:padding="20dp" android:contentDescription="@string/button_one" android:background="@android:color/transparent" android:src="@drawable/button_one" /> I would like, when the button is in pressed state, there to be a white border with