android-custom-view

Populate list of custom view using ListFragment

孤人 提交于 2020-01-09 03:20:09
问题 I am trying to show elements in a list view using Fragments. I created my custom view as follow graphical representation of list_row.xml list_row.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dip" > <!-- ListRow Left sied Thumbnail image --> <LinearLayout

GetChildView gets not called

六眼飞鱼酱① 提交于 2020-01-06 12:39:48
问题 I have searched similar threads but they didn't help me and they were light different or they still are unanswered, so I'll describe my trouble. I have an ExpandableListView with a custom ExpandableListAdapter and I can show my Groups but not my Children . GetChildView don't get called anyway. I would thank you for your Help. EDIT: If I log this section ... client = (ExpandableListView)row.findViewById(R.id.field_expandable_list); client.setFocusable(false); client_adapter = new ClientAdapter

GetChildView gets not called

…衆ロ難τιáo~ 提交于 2020-01-06 12:39:30
问题 I have searched similar threads but they didn't help me and they were light different or they still are unanswered, so I'll describe my trouble. I have an ExpandableListView with a custom ExpandableListAdapter and I can show my Groups but not my Children . GetChildView don't get called anyway. I would thank you for your Help. EDIT: If I log this section ... client = (ExpandableListView)row.findViewById(R.id.field_expandable_list); client.setFocusable(false); client_adapter = new ClientAdapter

Android: get parent layout width in custom view to set child width

可紊 提交于 2020-01-06 07:20:49
问题 I have made class called ProgressButton that extended RelativeLayout .Now in main xml i added this class: <com.tazik.progressbutton.ProgressButton android:id="@+id/pb_button" android:layout_width="200dp" android:layout_height="wrap_content"/> As you can see i added android:layout_width="200dp" , now in ProgressButton class i want to get this size to create a button with this size: public class ProgressButton extends RelativeLayout { private AppCompatButton button; public ProgressButton

Custom component not rendering properly anymore

China☆狼群 提交于 2020-01-06 07:06:18
问题 I'm new to creating custom components on android and it was a fun, annoying, and very educational experience. I was able to make my quite complex custom component and I'm very happy with it. But after I moved it to a directory and out of it, it doesn't display anything anymore. My project consist of a lot of fragments and my custom component is used on one of them. So when I moved all those fragments in a directory, AS told me that someone can't find something on my custom component class. So

Custom editText on android

醉酒当歌 提交于 2020-01-05 12:09:45
问题 I'm newbie with android layout, so i need some help. I want create a custom editText, something like this: I'm want to fix that with the best possible way. Someone? Thanks. 回答1: If you want the blue line on the left, you can just set the background on the EditText, such as, <EditText android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:background="@drawable/custom_edittext" android:layout_weight="1" /> Then create another file in your

How to create a custom view in android

南笙酒味 提交于 2020-01-05 10:29:52
问题 I want to learn, how to create custom view . I have gone through multiple tutorial and didn't get what i want(I mean concept). What i have learned I am sharing my concept,if i am wrong please correct me. If you want to make a minor change to the standard view then inherit itself(e.g extends seekbar) and customize it. But if you want to make difficult or multifunction view, We should inherit View Class When we inherit a View. Two methods are neccessary onDraw(Canvas canvas) // it call each

Remove Action bar Icon with custom view and show home up button

霸气de小男生 提交于 2020-01-04 14:36:34
问题 I am able to add custom view in actionbar . My application is supporting from version 2.3 so I had used ActionbarActivity . Now my query is to remove app icon from the actionbar and only to have home up icon i.e back image. I had tried lots of option that I found while searching. But its not working with custom view. edit ActionBar actionBar = getSupportActionBar(); LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL

onMeasure() called with EXACTLY and spec size 0

ぃ、小莉子 提交于 2020-01-03 20:02:57
问题 While debugging a custom view overriden onMeasure() method I see that there are several calls to this method. I am only dealing with the height of the view, leaving the width spec always unchanged. At some point I get a call with the (height) MeasureSpec getMode() == EXACTLY and getSize() == 0. This does not make sense and contradicts the Android documentation : MeasureSpecs are used to push requirements down the tree from parent to child. A MeasureSpec can be in one of three modes:

How to display multiple number of TextViews inside each row in ListView?

落花浮王杯 提交于 2020-01-03 13:01:47
问题 I am creating a Help page in which I have a set of questions and answers. These questions and answers have different styles. Here is the xml file, which describes the layout of a question & answer set : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center"> <TextView android:text="@string/Help_first