android-xml

Switching Color of a Progressbar programmatically

不问归期 提交于 2019-12-21 02:33:11
问题 so i have a Layer-List with an Item with a shape and a solid color. Now i want to change this color inside my code. <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <clip> <shape android:id="@+id/seekbar_shape_color"> <solid android:color="#FFD00000" /> </shape> </clip> </item> </layer-list> i tryed getting the LayerDrawable and requesting the first item, now iam stuck getting the clipDrawable and finally get the ShapeDrawable LayerDrawable sd = (LayerDrawable) v

Custom shaped Linearlayout with curved side in android

允我心安 提交于 2019-12-20 11:59:09
问题 I am trying to make a custom shaped linearlayout like below I am trying to make only one side curved. Tried with corner radius but it doesn't give the same look as above. Already tried this background shape as below :- <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#3F51B5" /> <padding android:bottom="7dp" android:left="7dp" android:right="7dp" android:top="7dp" /> <corners android

ImageView not keeping max height and width

与世无争的帅哥 提交于 2019-12-20 10:58:50
问题 I load an image into an ImageView using .setImageURI(selectedImageUri) that is retrieved from the user's photo gallery. I have the image view restrict the size with android:maxHeight="150dp" android:minHeight="150dp" android:maxWidth="150dp" android:minWidth="150dp" It's fine up until the you add the image from the gallery. The image then forgets about the max height and width. It is as wide as the display and there is a lot of space above and below the image. I had to add a scrollview just

Custom Spinner with rounded corners, stroked edge and a selector icon

♀尐吖头ヾ 提交于 2019-12-20 10:44:18
问题 I want my Spinner to have a black gradient background with white text on the left and a selector icon on the right (a white downwards pointing triangle). As I see it there are two ways of going about this: If I set the background to an xml drawable resource I can make my Spinner look perfect, but then I need to somehow add the white triangle on the right, which I don't know how to go about: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res

How to remove border only from one side of the element?

无人久伴 提交于 2019-12-20 09:49:43
问题 I have: <stroke android:width="1px" android:color="#A6ACB1"/> I'd like to remove this border from the bottom (for example) of the element. Is it possible? (Eclipse suggests me only: color, width, dashWidth and dashGap). 回答1: As far as I understand it, there isn't an easy way of doing it. but if you use layer-list with an item that has the border and then one that doesn't with an offset from all the sides for which you want a border equal to the border width, you'd achieve that. Let me make

design a layout like below image with image buttons in android

筅森魡賤 提交于 2019-12-20 08:29:53
问题 Hi, I want to design the buttons like the image above. eight button in a circular way. I am confusing how to design them in a circular to cricket logo. I have tried it using relative layout and linear layout but can not make like this. Please help me to make this view possible to implement. 回答1: Check out the Wheel Component which shows the circular views with the scrolling layout. You can also download the reference demo HERE. EDITED: Check out other similar demo HERE and HERE 来源: https:/

Android change Fragment page

大憨熊 提交于 2019-12-20 07:47:10
问题 you can download my zip here ok so i made an app with Swipe+Tab View i want each tab to show a diffrent .xml page if u click above you can download my workspace to edit it .. i really need help please be spicific to if u want i can setup teamviwer if it could be faster.. if u dont want to download the file cause u think "it has a virus" just make a reply down below here is my code for the mainactivity.java package twh.reviser.root; import java.util.Locale; import android.os.Bundle; import

Thumbnail does not fill_parent as expected

萝らか妹 提交于 2019-12-20 05:47:40
问题 I'm attempting to get my thumbnail (userVideoThumbImageView) to extend to the edge of the screen but it does not seem to do so. I have the width set to fill_parent so I'm not sure why it isn't doing so: Screenshot: http://www.flickr.com/photos/110503723@N07/11207214295 list_item_user_video.xml: <?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="fill_parent" android:gravity=

OnClick for navigationDrawer not loading new fragments

ⅰ亾dé卋堺 提交于 2019-12-20 05:17:06
问题 I have been trying to create a navigationDrawer for my project. I have been following this review here: http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ I have been editing the code a bit, to use my own layout, in order to take out the icons and notifications in the navigation drawer. I just needed a simple one. I have the drawer mostly working except for the onCLicks. I am not getting any errors, but when I click an item in my NavDrawer it does not load the

ListView item with list_selector_background as LayerList drawable

故事扮演 提交于 2019-12-20 01:05:49
问题 If we use a ListView or an ExpandableListView the default background is @android:drawable/list_selector_background . I have an ExpandableListView which shows data grouped by date. I like the state list list_selector_background drawable and want to keep the behaviour for different states. But for the weekend (for some of the list view items) i'd like to define a custom background. But these items should still use the drawables for different states defined through list_selector_background. I