android-gui

Android: draw arc within canvas api with a gradient fill color

与世无争的帅哥 提交于 2019-11-29 21:44:25
问题 I want to draw an arc using canvas using a gradient fill. How can achieve this? 回答1: Hey I stole this from here: Draw an arc with a SweepGradient in Android but it works fine, I used a LinearGradient instead. Shader gradient = new SweepGradient (0,getMeasuredHeight()/2, Color.RED, Color.WHITE); lightRed.setShader(gradient); canvas.drawArc(rectf, -90, 360, false, lightRed); 回答2: In my cause i I had to draw someone like this: Maybe you too. So, let's think! How does Sweep Gradient works? If you

Change the style of AlertDialog

懵懂的女人 提交于 2019-11-29 02:30:17
When I run this code the alert dialog is shown but there is one white border around the dialog and also the borders are little round. I do not want this white border and I want to have real corners with angle of 90. I hope you understand what I am trying to do. AlertDialog.Builder ad = new AlertDialog.Builder(this); Button bbb=new Button(MvcnContactList.this); ad.setView(bbb); alertDialog = ad.create(); alertDialog.show(); Is there any way to style the alert dialog but not the text color or text size or something similar... I want to style the borders of the alert dialog, so setting just a

How to make the linearlayout in scrollview to fill the whole area

半腔热情 提交于 2019-11-29 02:28:18
问题 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ScrollView android:id="@+id/scrollView1" android:background="#000000" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/linear1" android:background="#FF0000" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match

Accessing a font under assets folder from XML file in Android

偶尔善良 提交于 2019-11-27 21:04:57
I am trying to do a application-wide font change and creating a style file to do so. In this file (below) I just want to change typeface value of TextAppearance style of Android. <?xml version="1.0" encoding="utf-8"?> <resources> <style name="NightRiderFont" parent="@android:style/TextAppearance"> <item name="android:typeface"> /***help need here***/ </item> </style> </resources> However font is in "assets/fonts/". How can I access this font, so I can use that style as a theme to get rid of changing all TextViews by hand programatically. As summary: How can I access 'a file from assets folder'

How to disable behind view click event Framelayout

无人久伴 提交于 2019-11-27 18:39:34
Here i have one view pager activity which has one imageview and 2 overlay bars. there overlay bars i made using android xml file layout itself. Here my requirement is like that 1) single tap on view pager's imageview first time = show top and bottom rectangle overlaybar. 2) single tap on view pager's imageview second time = hide these overlays. These both are functions like android gallary view type. But here when these top and bottom layout bar displays at that time i want to use only buttons click only which buttons are declare within this layout. But I am not getting success to achieve this

Change the style of AlertDialog

ぃ、小莉子 提交于 2019-11-27 16:48:56
问题 When I run this code the alert dialog is shown but there is one white border around the dialog and also the borders are little round. I do not want this white border and I want to have real corners with angle of 90. I hope you understand what I am trying to do. AlertDialog.Builder ad = new AlertDialog.Builder(this); Button bbb=new Button(MvcnContactList.this); ad.setView(bbb); alertDialog = ad.create(); alertDialog.show(); Is there any way to style the alert dialog but not the text color or

Android Hardware Acceleration - to use or not to use?

隐身守侯 提交于 2019-11-27 05:12:42
问题 I'm developing an app that it functionality very similar to Facebook Android native app: social network that most of the time the user will spend in an endless ListView displaying lot's of images, entering an image gallery, and so on. let's say for the discussion that I'm doing all the right things and best android practices to achieve smooth scroll (recycling views as it should, using different view types when needed, loading to memory only scaled bitmaps in the needed size, caching bitmaps,

Accessing a font under assets folder from XML file in Android

我与影子孤独终老i 提交于 2019-11-26 20:32:04
问题 I am trying to do a application-wide font change and creating a style file to do so. In this file (below) I just want to change typeface value of TextAppearance style of Android. <?xml version="1.0" encoding="utf-8"?> <resources> <style name="NightRiderFont" parent="@android:style/TextAppearance"> <item name="android:typeface"> /***help need here***/ </item> </style> </resources> However font is in "assets/fonts/". How can I access this font, so I can use that style as a theme to get rid of

How to disable behind view click event Framelayout

痞子三分冷 提交于 2019-11-26 19:33:20
问题 Here i have one view pager activity which has one imageview and 2 overlay bars. there overlay bars i made using android xml file layout itself. Here my requirement is like that 1) single tap on view pager's imageview first time = show top and bottom rectangle overlaybar. 2) single tap on view pager's imageview second time = hide these overlays. These both are functions like android gallary view type. But here when these top and bottom layout bar displays at that time i want to use only