android-custom-view

Android - change custom title view at run time

≯℡__Kan透↙ 提交于 2019-12-28 02:25:07
问题 I am using a custom title view in my application for each activity. In one of the activities, based on button clicks I need to change the custom title view. Now this works fine every time when I make a call to setFeatureInt. But if I try to update any items in the custom title (say change the text of a button or a text view on the title), the update does not take place. Debugging through the code shows that the text view and button instances are not null and I can also see the custom title

No resource identifier found for attribute ' ' in package 'com.app…'

不想你离开。 提交于 2019-12-28 01:46:06
问题 I've imported a project from eclipse to Android studio. It utilizes a custom view: xmlns:app="http://schemas.android.com/apk/res-auto" I get errors in the lines below from activity_ro.xml file like: "Error:(136) No resource identifier found for attribute 'pstsTabPaddingLeftRight' in package 'com.app.xxxx'" app:pstsDividerColor="#00000000" app:pstsIndicatorColor="#FF33B5E6" app:pstsTabPaddingLeftRight="14dip" app:pstsUnderlineColor="#FF33B5E6" /> I'm not sure if custom views are different for

How to inserting a custom view in XML in Android

拥有回忆 提交于 2019-12-25 18:20:01
问题 I have a class A that extends class View . I have a class B that extends class A . Now I'm trying to add class B into my xml however I'm unable to do that whereas I'm able to add class A into my xml. One more thing which I've noticed is that all other custom classes which directly extends View are visible inside my xml. I wanna know whether is there any way of adding a class which extends another class which in turn extends View into my xml? NOTE : I'm using proper xml format and complete

Forced Close after adding custom ImageView

房东的猫 提交于 2019-12-25 09:49:19
问题 I'm trying to add a custom ImageView to my main.xml , but if I start the program it closes with a forced close. XML : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > <test.testpkg.CustomImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout

Custom Listview not refreshed on fragment back

浪子不回头ぞ 提交于 2019-12-25 08:00:02
问题 I have one custom list view adapter loading contact list. When I open app, contacts are loading perfectly , but once I came back after scrolling to Preference Fragment, listview is empty. Though Data is collected by calling Inner class LoadContact but nothing in listview. There are three fragments. pls guide. Code for Fragment (tab1). If u see I added adapter initialization in oncreatview as otherwise on back tab I m getting Null point exception. m I did correct here? public class Requestor

In Custom Compound view 'TextInputLayout 'is not showing expanded hint

天涯浪子 提交于 2019-12-25 04:00:42
问题 I've created a custom compound view. It contains an imageview, a TextInputLayout, EditText . The thing is that when i set attributes from xml, it sets all values like hint, icon etc but lines are not changed and expanded hint of TextInputLayout is not showing. When i set lines like this ' textInputLayout.getEditText().setLines(lines); ' it works, but by using 'etInput.setLines(lines);' it doesn't work. Expanded hint is not working. Widget: public class InputLayoutWidget extends LinearLayout {

How to run a custom view with three-argument version constructor on pre-Honeycomb devices?

▼魔方 西西 提交于 2019-12-25 02:18:29
问题 I have a custom view that extends LinearLayout with the following contructors: public VoiceRecorderLayout(Context context) { this(context, null); } public VoiceRecorderLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public VoiceRecorderLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.context = context; loadViews(); } My application crashes only iff I run it on the devices or emulator with api lower than 11. The reason

android - hidden field in listview, using custom cursoradapter

烈酒焚心 提交于 2019-12-24 23:31:55
问题 In my app I have a listview, which when you click on an item i want a dialogfragment to appear with details in it. The listview is populated using a custom cursoradapter and each row is a view extended from a relativelayout. My thought process is that i would have some kind of id value in the custom view and when selected, the id is used in a new db query to populate the dialogfragment. However, I don't want the id on view in the row, I want it hidden. I'm thinking that i create a custom view

bitmap is not saving properly only black image

只谈情不闲聊 提交于 2019-12-24 16:09:28
问题 I am trying to save custom view as image but this is not happening it only gives black image when i open it in android device gallery. The custom view is like this public class page extends View { private static final String TAG = "DrawView"; private boolean clearflag = false; private static final float MINP = 0.25f; private static final float MAXP = 0.75f; private Context context; private Paint mPaint = new Paint(); private int[] pencolor = { Color.BLUE, Color.GREEN, Color.MAGENTA, Color

Custom view with buttons

房东的猫 提交于 2019-12-24 15:25:49
问题 I need to build the following view: Where the buttons can be regular buttons that are accessed from java code using findViewById() method. I'm not sure if i can do that using LayerList or if I need to implement a custom view from scratch? Can anyone suggest some path that I can follow to achieve this? Update Right now I have this: What I need to do for now is: - hide what is outside the circle; - only parts of the buttons that are inside the cicle should fire the onClick event. Should I use a