android-custom-view

Weird behaviour in drawing a ring using Path.arcTo() in Android

孤者浪人 提交于 2019-12-08 17:06:15
问题 I have implemented an animated drawing ring by start sweeping at angle 0 to 360 successfully. However when the tail of the ring meets its head at 360 angle, all drawing is disappear. This is my code for the ring in onDraw() float startAngle = 270; float sweepAngle = -359; paint.setColor(Color.DKGRAY); paint.setShadowLayer(4, 2, 2, 0x80000000); rectF.set(cenX - outerRadius, cenY - outerRadius, cenX + outerRadius, cenY + outerRadius); path.arcTo(rectF, startAngle, sweepAngle); //canvas.drawArc

How to implement Extracted Text for a custom Android View

被刻印的时光 ゝ 提交于 2019-12-08 17:06:14
问题 Background A custom editor view in Android is able to receive text from a system keyboard though an InputConnection . I have been able to make such a view successfully. However, when the device is in landscape mode, the system will sometimes choose to show a extracted text view. When users type in this mode the extracted text view should be updated with the same text that is in the custom view. I have not been able to implement the extracted text view functionality. (Here are some things I've

View which can be pulled up with a floating action button like google maps app

流过昼夜 提交于 2019-12-08 11:56:19
问题 I am trying to make something seen in Google Maps App when one clicks on a POI on the map a view comes up having a floating action button anchored to it. In my scenario it is like this but there is already a FAB which is already visible and when an action is triggered a small view is visible with an anchored FAB showing some details and when it is pulled up it covers the screen just like an activity (something visible in the aforementioned google maps app). I am compiling the app with SDK

how to fetch image from RSS feed

南楼画角 提交于 2019-12-08 07:31:15
问题 I am trying to fetch RSS news from a URL http://timesofindia.indiatimes.com/rssfeeds/1945062111.cms But I have a problem in displaying the images from this URL. Only the Title and the date are displaying but not the image. In this image description have some tags, I don't to show them. Only content should display My second question is how can I edit the description fetched from RSS because it is displaying some and tag. I don't want to show them in my news. Only the data should be displayed.

Behavior like tools:text in a custom view?

≯℡__Kan透↙ 提交于 2019-12-08 07:14:29
问题 I have a custom view with two text views in the layout. Let's call one key and the other value . So you know how TextView has this? <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="Preview text shown in the layout editor" /> I want to do something similar with my custom view, e.g.: <com.package.whatever.MyCustomView android:layout_width="wrap_content" android:layout_height="wrap_content" app:key_preview="Preview text for the key" app:value_preview

Get the total count of number of rows in the Custom Listview Android

浪子不回头ぞ 提交于 2019-12-08 04:53:01
问题 I am trying to getting the total Count of the getView custom listview. But want to display in the different layout. Here is my onCreatedView. I am not sure how to inflate the layout. Thanks for all your help. private static ListView addDropListView = null; private TransactionAddDropAdapter addDropAdapter = null; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { fragmentPendingTrades = inflater.inflate(R.layout.fragment_transactions_pending,

Importing a custom view in Android Studio

那年仲夏 提交于 2019-12-08 04:37:33
I've seen plenty of links that tell me how to create a custom view, but how how do you import an already existing one. I downloaded one and it looks like a whole project. How is it implemented into another project? Import it as a module via File -> Import Module Add as a dependency to your project. File -> Project Structure -> Your Module -> Dependencies Tab -> Add -> Module Dependency. Include in your settings.gradle via include ':module name' Clean & Build 来源: https://stackoverflow.com/questions/24637176/importing-a-custom-view-in-android-studio

Importing a custom view in Android Studio

妖精的绣舞 提交于 2019-12-08 04:31:58
问题 I've seen plenty of links that tell me how to create a custom view, but how how do you import an already existing one. I downloaded one and it looks like a whole project. How is it implemented into another project? 回答1: Import it as a module via File -> Import Module Add as a dependency to your project. File -> Project Structure -> Your Module -> Dependencies Tab -> Add -> Module Dependency. Include in your settings.gradle via include ':module name' Clean & Build 来源: https://stackoverflow.com

Calling a fragment method inside a custom view

前提是你 提交于 2019-12-08 03:54:51
问题 So for some background I've tried to call a method I have in my fragment (that's hosting the custom view) within the custom view. I've tried using an interface and implementing it in the fragment. I've also tried getting an instance of the fragment in the customview and calling the method that way. For whatever reason, I get null pointers both ways. Way #1 public SurveyView(Context context, AttributeSet attrs) { super(context, attrs); setOrientation(VERTICAL); options = new ArrayList<>(); /

how can I create a custom clickable shape on an image in android?

醉酒当歌 提交于 2019-12-08 03:43:37
问题 I want to create a clickable image, my image has some different clickable parts in it, like this one: I want to draw a custom shape like : A,B,C,D,E,F and make sure when user click on of this something happen. the problem is I don't have any kind of idea to, how create shapes like the shapes in the image make sure it just fix on the image and in different screen size don't see a massed up thing. 回答1: Will there be more than many of such images? If no I suggest you to create mask image for