android-layout

CardView and RecyclerView divider behaviour

北城以北 提交于 2020-02-24 17:02:50
问题 I am trying to use RecyclerView with CardView as an single item of the list. I want to implement horizontal list, with LayoutManager it is really easy. So I started to implement it. It seems that everything works, but not as I expected here is the result using CardView as an list item. Looks pretty good, but I haven't set any paddings, dividers and rounded corners. Here is my XML for card view item. <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http

Listview with a MPAndroidChart(or whatever) below

心已入冬 提交于 2020-02-24 11:31:33
问题 Edit: I changed the title because isn't about MPAndroidChart, the same issue would happen with another view below the ListView. I am trying to set a layout for an activity in my android app. This activity consist on 2 elements, a ListView and a MPAndroidChart. What I would like to achieve is to place the ListView at top, taking the height that it needs ( wrap_content ) and below it the chart with a fixed height. I'm newbie on android, so the first thing I made was make a RelativeLayout with

RecycleView layout manager list items are taking the whole screen

泪湿孤枕 提交于 2020-02-24 05:26:25
问题 So i just made this simple fragment that contains a RecycleView. The recycle view has a custom made relative layout with two TextViews and a CheckBox. The problem is that a single list item takes up the whole AVD seceen's space and the listener I set for the list item is not working. here is a screenshot of the AVD screen (I am using android studio) And when scrolled The XML layout code <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res

Set the height of imageview according to screen from the layout

大憨熊 提交于 2020-02-24 04:59:13
问题 I am making the layout and using the layout_weight and weight_sum. I am making the orientation of linear layout to horizontal so i am able to set the width of imageview 1/3 of the screen. But I dont know how to set the height of imageview to 1/3 of the screen. Please help me to set the imageview height to 1/3 of the screen from the layout xml. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

InflateException when using chrisjenx CalligraphyLayoutInflater , android.view.InflateException

醉酒当歌 提交于 2020-02-23 10:15:56
问题 Hi So in our project we are using calligraphy library , it works with no issues but now in one of the activity i added it keeps crashing with the following stacktrace: 01-23 02:25:32.178 3654-3654/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example, PID: 3654 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activities.MultipleActivity}: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components

EmojiTextView renders Emoji semi-transparent

↘锁芯ラ 提交于 2020-02-23 09:13:11
问题 I'm implementing the new EmojiCompat into my app. Now I run into the following issue and don't know how to fix it: The code below is rendered by the EmojiCompat, but the Emoji is rendered semi-transparent: <android.support.text.emoji.widget.EmojiTextView android:textAlignment="center" android:text="😍" android:textSize="100dp" android:layout_gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" /> Screenshot of the rendered XML file on my device: The layout

EmojiTextView renders Emoji semi-transparent

不问归期 提交于 2020-02-23 09:12:58
问题 I'm implementing the new EmojiCompat into my app. Now I run into the following issue and don't know how to fix it: The code below is rendered by the EmojiCompat, but the Emoji is rendered semi-transparent: <android.support.text.emoji.widget.EmojiTextView android:textAlignment="center" android:text="😍" android:textSize="100dp" android:layout_gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" /> Screenshot of the rendered XML file on my device: The layout

Multi line Edit Text and first letter capitalization of Edit Text

旧时模样 提交于 2020-02-21 10:05:11
问题 Hello I am trying to make EditText to multi line and first letter should be type as in capital which I am doing using android:inputType="textCapSentences" but after setting to input type to textCapSentences it set first letter in capital but EditText is single line only. Can you please help me to make EditText to multiline plus first letter should be type in capital Here it is current EditText <EditText android:id="@+id/commentsEditText" android:layout_width="match_parent" android:layout

CardView with different corner radius

混江龙づ霸主 提交于 2020-02-20 08:07:03
问题 I have the following CardView and I want to set different radius for each corner in the card. Is it possible to change them by XML or programmaticaly? Thanks in advance. <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:layout_marginLeft="16dp" android:layout_marginTop="5dp" android

add Layout programmatically inside another one

纵饮孤独 提交于 2020-02-19 10:08:49
问题 I have an xml file (option_element.xml) that contains a ImageView and a TextView <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="-18dp" > <ImageView android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:src="@drawable/option_button" />