android-widget

Can Jetpack Compose be used to build App Widgets?

三世轮回 提交于 2020-12-09 16:36:05
问题 With swift, widgets can be written using SwiftUI, but I have not seen any statements regarding whether Jetpack Compose can be used to build Android App Widgets. Is there any information where I can see how that can be done now that Compose is in Alpha? 回答1: That depends a lot on what you mean by "Jetpack Compose". We were discussing this just yesterday on Kotlinlang Slack. If you mean Compose UI and related packages — the library of composables that we can use to build the UIs displayed by

Can Jetpack Compose be used to build App Widgets?

血红的双手。 提交于 2020-12-09 16:33:49
问题 With swift, widgets can be written using SwiftUI, but I have not seen any statements regarding whether Jetpack Compose can be used to build Android App Widgets. Is there any information where I can see how that can be done now that Compose is in Alpha? 回答1: That depends a lot on what you mean by "Jetpack Compose". We were discussing this just yesterday on Kotlinlang Slack. If you mean Compose UI and related packages — the library of composables that we can use to build the UIs displayed by

Can Jetpack Compose be used to build App Widgets?

一个人想着一个人 提交于 2020-12-09 16:27:07
问题 With swift, widgets can be written using SwiftUI, but I have not seen any statements regarding whether Jetpack Compose can be used to build Android App Widgets. Is there any information where I can see how that can be done now that Compose is in Alpha? 回答1: That depends a lot on what you mean by "Jetpack Compose". We were discussing this just yesterday on Kotlinlang Slack. If you mean Compose UI and related packages — the library of composables that we can use to build the UIs displayed by

SwipeRefreshLayout not working

泪湿孤枕 提交于 2020-05-29 04:46:05
问题 I'm using SwipeRefreshListener from the support libraries. I am calling setRefresh from onPreExecute and onPostExecute of my AsyncTask . However, nothing changes, there is no animation. Is there something that I'm missing? Are there certain setup parameters I need to set in order for it to work properly? 回答1: This has worked for me, see more here: http://antonioleiva.com/swiperefreshlayout/ SwipeRefreshLayout: The layout you only need to decorate the swipable content (probable the whole

Get the size of my homescreen widget

断了今生、忘了曾经 提交于 2020-05-24 21:40:58
问题 I just want to know how big my current widget is. I found tons of questions to set the minimum size, but I don't want to set it. Instead I want to show that informations which simply fit on the widget. If the widget is too small I need to hide some things, but I need to know the size for that. I read the source code of some classes like the AppWidgetProvider , even the documentation. There are allways just references about the minimum or maximum size, but never the current size. Please point

How to get android default attributes in a custom view

血红的双手。 提交于 2020-03-21 17:57:28
问题 I have created a simple custom view that contains a RelativeLayout and an EditText : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/edt_content" android:layout_width="match_parent" android:layout_height="wrap_content"/> </RelativeLayout> Also I have added some custom attributes in res/values/attrs.xml and I retrieve these attributes in my custom view constructor and