android-custom-view

Default Style Resource pre API Level 21

佐手、 提交于 2019-12-12 04:23:37
问题 I am looking to create a custom ViewGroup to be used in a library; which contains a few ImageButton objects. I would like to be able to apply a style each ImageButton ; but I cannot figure out how to apply a style programmatically other than by applying a attribute resource to the defStyleAttr parameter; like so: mImageButton = new ImageButton( getContext(), // context null, // attrs R.attr.customImageButtonStyle); // defStyleAttr The issue with this is that the only way to change the style

Create CardView with dynamic custom list inside

馋奶兔 提交于 2019-12-12 04:06:52
问题 I create a RecyclerView with CardViews in my app. Now I want to add inside each CardView a new List of custom Views, with a custom layout (see example Image). When the add button is pressed, there should be insert a new row of this layout inside the card. How do I realize that? In the internet I readed, that a ListView inside the CardView is not possible, because a ListView is scrollable, and there should not be two scrollable Views on the activity (thats what I found..) the red marked row is

Adding components dynamically to RecyclerView

為{幸葍}努か 提交于 2019-12-12 03:36:24
问题 I'm displaying daily events. The number of events/day is variable. Each item in the RecView is a Day which should contain as many views as the number of events. Here is one item's layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/llDay"> <TextView android:layout_width="wrap_content" android:layout_height=

Use View.isInEditMode() in your custom views with CordovaWebView

余生颓废 提交于 2019-12-12 02:57:30
问题 I am developing application with CordovaWebView and i have added the below code in web_view.xml file. <org.apache.cordova.CordovaWebView android:id="@+id/cordovaWebView" android:layout_width="fill_parent" android:layout_height="fill_parent" /> I have implemented methods from CordovaInterface. Now my design page showing the following error message. Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse Could anyone please tell me that how to resolve it? 回答1:

Custom view hierarchy child not added

北慕城南 提交于 2019-12-12 02:52:32
问题 I have a hierarchy of custom views that looks like this: Activity(RelativeLayout) -> ParentLayout(FrameLayout) -> ChildLayout(LinearLayout) The activity and parent layout are added and displayed just fine, but the child is not. I have looked at the hierarchy viewer in the device monitor to confirm it is not being added to the view hierarchy. Really all I'm trying to do here is create a view hierarchy so I can play around with handling touch events at various places in the view. Here is

Custom LinearLayout, child is not viewing

随声附和 提交于 2019-12-12 02:52:23
问题 I'm creating my Cell view by extending LinearLayout, it's creating parent, but not showing children. I really couldn't find the problem? Cell cell = new Cell(ctx); cell.setLetterAndPosition(new Point(1,1), new Letter("A"); import android.content.Context; import android.graphics.Color; import android.graphics.Point; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget

How get to all value of EditText in Custom ListView

柔情痞子 提交于 2019-12-12 02:44:05
问题 Good day guys, I successfully populated my custom-listview-layout in my activity, but the problem is I can't get all the value of populated EditText in my listview, please help me what approach should I do, thanks Picture Adapter.java public View getView(int position, View convertView, ViewGroup parent) { View row; row = convertView; final dataHandler handler; if(convertView == null){ LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE

MaterialDrawer How to customize mini drawer

安稳与你 提交于 2019-12-12 02:38:26
问题 I am trying to figured out how to customize MaterialDrawer by https://github.com/mikepenz/MaterialDrawer At moment the width is too big. I want to make width smaller with bigger icons to cover the spaces and change the background color. This App will be for tablet only. thanks. Here is my drawer: <LinearLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/toolbar"> <RelativeLayout android:layout_width="match

IndoorAtlas SDK 2.0: Using Picasso with custom ImageView

倖福魔咒の 提交于 2019-12-12 02:24:31
问题 So...., I want to use Picasso image loader library with an existing custom imageview class to load,resize,and rotate my image. The problem is I am unsuccessful with it as if I use this code: "Picasso.with(this).load(url).into(custom ImageView)" ,it gives me an error and suggests "cast parameter to target" . After casting the parameter "custom imageview" to target, when I test the application it gives me error saying "custom imageview cannot be cast to target" in the Logcat. After this problem

Get Touch Coordinates Relative To A Custom ImageView

橙三吉。 提交于 2019-12-12 02:07:44
问题 I implemented custom ImageView. Because my image is large I'm using ScrollView and HorizontalScrollView to scrolling image. I want to draw circle in onTouch event, but its not work in all cases. When I scroll image and fire touch event the x,y coordinates apply to current visible sector of image ( in top right corner its e.g. 0x0, but when I scroll somwhere and in visible top corner it will be 0x0 too), but circle is drawing according to image size. Another problem is that app could be used