SwiftUI and WidgetKit - Automatically updating components - text

I am working with WidgetKit and I found that the text component initialised with init(Date, style: Text.DateStyle) is creating automatically updating texts. This is something special because iOS widgets usually require to set a timeline about when to update the view. Unfortunately scheduling these updates is in the hands of the operating system, bases on a limited budget and thus, is unreliable.
Do you know about other SwiftUI views, that are automatically updating (and might also be passively updating in a widget)? Animated shapes would also be nice to have.
I have already tried using publishing timers, which won't work in widgets.

According to Apple's documentation, the only self-updating SwiftUI view is Text, configured to display a relative date or time. See Displaying Dynamic Dates in Widgets for details.
The options are:
Text(futureDate, style: .relative)
Text(futureDate, style: .offset)
Text(futureDate, style: .timer)
Text(aprilFirstDate, style: .date)
Text("Date: \(aprilFirstDate, style: .date)")
Text(startDate ... endDate)
Text("The meeting will take place: \(startDate ... endDate)")

Related

Angular | Scale SVG in child component from parent

I've created a Star Rating component for use in feedback screens and views. Please check the Stackblitz URL that I've given here. I've put in some more notes in there.
https://stackblitz.com/edit/angular-ivy-4fnkj1?file=src/app/app.component.ts
I'm not very knowledgeable on SVG scaling and deep nest styling of Angular. I want to basically create a reusable StarRating component that can be used in several places but what basically changes is the size of the component (the size of the stars).
Let's say that I have a feedback form wherein I want the user to be able to choose rating by clicking on the stars. In this case, I want the stars to be large. At the same time I have a different component listing all reviews in which I want to show rating using this same component like maybe below the review comment.
Or in the other cases, I want the stars to resize based on different screen sizes.
Right now the size is fixed because I have it hard-coded in the HTML template. How do I make it dynamic
I'm using Angular v10.2.4 along with some Bootstrap styles.

Material Design Dimensions in Flutter

I'm new to flutter and I want to make an application like WhatsApp
I decided to know design dimensions and I went to
I found the dimensions in dps when I applied the stated dimensions on the app bar this was the result while this is the original app bar, so how can I apply material design dimensions (dps, px, etc...) in Flutter
All material design widgets in Flutter satisfies material design guidelines by default. For example a Floating action button comes with a default marigin witch you don't need to specify manually. So you don't need to provide custom padding or marigin to your appbar action items.
You can wrap any widget in a Container. Than you can set width and height if it has none.
A lot of widgets do have it though.
For example, IconButton that you can put in actions of AppBar has iconSize
IconButton(iconSize: 36.0,icon: Icon(Icons.search,));
But if you want asymmetrical touch field you can combine few widgets together
InkWell(
child: new Container(
width: 36.0,
height: 24.0,
child: Icon(
Icons.search,
),
));
There are many combinations available, so its best to ask specific question for a specific component.

How do I make rich:dataGrid responsive?

I'm looking for a way to make a dataGrid provided by richfaces responsive.
Meaning, the grid scales based on the size of the device screen.
I've taken a look at Richfaces Bootstrap : http://planet.jboss.org/post/richfaces_bootstrap
but they recommend not to use it in any production code since it is still under development. Tags and attributes are subject to change at anytime.
You'll need to overwrite the default CSS. Here is the list of classes that make up a dataGrid.
The responsivness is achieved by queries like this:
#media(min-width:768px) and (max-width:979px) {
/* styles for the given width range */
}
You shouldn't use the Bootstrap components but you can use the CSS. However the dataGrid is a table and those don't scale very well.

drawing grids in a UITableViewCell using Monotouch

Hi I am just a week old with Monotouch, the task that I have in hand is to display a table on an ipad with multiple rows and multiple columns i.e. a grid like structure with many cells and each cell containing some data which can later be edited too.
My application should look somewhat like the figure below, except that it has to be working on an ipad.
The only useful link I've found is this, but this article discusses how to do so using Objective C(now since I am using Monotouch & c# so I am not comfortable with Objective C so I cannot understand this solution).
So my question how to achieve the same (i.e. a table with many columns and rows - a grid) using Monotouch.
Please help! Thanks in Advance.
Ajit,
If you want to use the UITableView'to render your data, you should effectively make it so that each "row" can render the columns in the way that you need.
What you need to do is to create a UIView subclass that can render the elements in your columns. There are various ways of doing that, you can:
Create your own UIView that implements a draw method and draws on demand.
Create a UIView that is a composite and merely has some children views
Once you have the view, you can add this to your UITableViewCell
You can follow some of my recommendations for creating those UITableViewCells here:
http://tirania.org/monomac/archive/2011/Jan-18.html
But 2-D browsing using a 1-D design is not optimal. Chances are that all that you want is to render your various items in a grid, so you might as well just use the UIScrollView directly and add all of your child UIViews there.
The only difference is that UITableView is designed to recycle/reuse some expensive objects (each row) while a basic design that stashes everything on the view will not have any of those benefits.
A more advanced option would be for you to create/destroys the views that are shown/hidden as the user scrolls.

Metro UI as a XPages theme

I would like to present XP application with Metro style UI.
I think of three unique styles:
1) App launcher (aka Navigator from LN client) showing boxed "links", what is common image of Metro: http://en.wikipedia.org/wiki/File:Windows_8_Consumer_Preview_Start_Screen.png.
2) List (aka View) - scrollable bars representing documents in view: http://www.brianbondy.com/static/img/blogpost_135/screenshot-filepicker.jpg
http://www.purplesquirrels.com.au/?p=940
3) Form - sorry, images of metro theme are not very common for this kind of usecase.
Options:
Wait for Dojo framework to include Metro styled mobile components (no signs of this plan at Dojo site).
Wait for IBM to include Metro on Extlib mobile themes (probably not going to happen).
Make own theme definition and/or controls (lot of work...)
Forget it, it is just waste of time.
Did any of you think about making metro.theme for XPages?
If I where you I would try to create it yourself. Its not that difficult. Its actualy a bunch of boxes ;) which is perfectly possible with html/css ( and thus with xpages ). The only thing you need to take or of is what to do after a user clicked on a box. I dont see the problem in creating it yourself...

Resources