immlatr quilan rosabela

0 views
Skip to first unread message

Priamo Gregory

unread,
Aug 2, 2024, 9:10:00 PM8/2/24
to spactitoleg

I like my UIs to be intuitive; each screen should naturally and unobtrusively guide the user on to the next step in the app. Barring that, I strive to make things as confusing and confounding as possible.

I've got three TableRows, each containing a read-only and non-focusable EditText control and then a button to its right. Each button starts the same activity but with a different argument. The user makes a selection there and the sub-activity finishes, populating the appropriate EditText with the user's selection.

It's the classic cascading values mechanism; each selection narrows the available options for the next selection, etc. Thus I'm disabling both controls on each of the next rows until the EditText on the current row contains a value.

I need UI consistency in either direction--either no buttons have focus after the sub-activity finishes or each button receives focus depending on its place in the logic flow, including the very first (and only) active button prior to any selection.

There's yet another point of contention to be aware of. By default, Android will automatically assign initial focus to the first EditText or focusable control in your Activity. It naturally follows that the InputMethod (typically the soft keyboard) will respond to the focus event by showing itself. The windowSoftInputMode attribute in AndroidManifest.xml, when set to stateAlwaysHidden, instructs the keyboard to ignore this automatically-assigned initial focus.

You could try turning off the main Activity's ability to save its state (thus making it forget what control had text and what had focus). You will need to have some other way of remembering what your EditText's have and repopulating them onResume(). Launch your sub-Activities with startActivityForResult() and create an onActivityResult() handler in your main Activity that will update the EditText's correctly. This way you can set the proper button you want focused onResume() at the same time you repopulate the EditText's by using a myButton.post(new Runnable() run() myButton.requestFocus(); );

The View.post() method is useful for setting focus initially because that runnable will be executed after the window is created and things settle down, allowing the focus mechanism to function properly by that time. Trying to set focus during onCreate/Start/Resume() usually has issues, I've found.

Your solution does not prevent the TAB key from switch to the next control, the reason being the order events are sent to the control callback. If you select the Operate tool in the UIR editor (the button with the small hand pressing buttons) and operate on the control, in the upper right corner of the editor you can see listed the events that are fired by your actions: you may notice that EVENT_KEYPRESS while pressing the TAB key is fired before EVENT_COMMIT. But in the callback you are handling the commit event and try to swallow it: this does not swallow the tab key event because this has already been fired, so the focus switches to the next control.

A different approach could be to avoid handling the commit event and operate only on KEYPRESS events but you need to intercept exactly all keys that switch focus to another control (tab, ctrl+tab and all shortcut keys that are assigned to other controls quite a long list may be!).

But it is true that also my solution has some problem: when the user clicks on another control, the warning popup fires and then the UIR is somewhat freezed (the caret is in the new control while the focus is still on the old one, no response to keyboard actions... only a new click anywhere on the panel unblocks the program!)

How do I enable auto-reply in Focus modes other than Driving? For example if I want to create a custom Focus, there's no option for me to enable auto-reply. I.e. if I'm on vacation and just want to reply to customers that I'm away, etc.

If it can do it for driving, I don't understand why it couldn't for any other focus. I've even tried looking in shortcuts for an automation but they only will do something when the focus is turned on or off. I'm a college student currently studying for finals and I have a "school work" focus to help limit my distractions. It would be great to have an auto-reply just to say "Hey I'm studying right now, I'll get back to you later".

That's probably a good fix for some, but the problem I have with that is when in "driving" mode, it shuts off all cellular functionality practically and won't allow incoming calls. I still want to allow incoming calls and send texts which Driving mode won't let you do. It forces you to turn Driving mode off in order to do those things.

Thank you for posting in Apple Support Communities. We understand you'd like to let others know what's going on when you're away and have enabled Focus. While not exactly what you're looking for, the information below may help.

When you set up a Focus, you can turn on Share Focus Status so that apps display to people who message you that you have notifications silenced. The apps only know that you have notifications silenced. Apps don't know which Focus you have turned on, so the name is never shared. Focus status is shared in apps when you have a Focus turned on and after you give an app permission.

(1) In lens design, infinity is not really infinity. It's a distance at which you can focus and everything beyond that point will appear to be in focus. (Sharpness of distant objects depends on how much you enlarge the image, but let's neglect that constraint for the moment).

(6) When autofocus focuses on a distant object, it's usually focusing at the lens' infinity setting. Depending on your level of skill, you might get a sharper photo if you override this setting and focus manually on the subject. But you'll lose sharpness in the foreground, so it's a trade-off. There's no such thing as a free lunch.

The trouble with kit lenses is that you are not supposed to do any of this stuff. A curse on Nikon for gelding their newer lenses. How is someone meant to learn? One good thing though, this will keep the prices up for earlier lenses.

Although it's hard to use technically-correct hyperfocal distance technique if you don't have distance markings on your lens, you can adapt the technique just by knowing that you have less depth of field in front of your focal plane than behind it.

Closest focus distance: 0.28 m (0.9 ft.) at all zoom settings. So you know it is about 1ft out to infinity. HFD is used more for a wide than, say 55mm. The basic idea is that at a wide angle, something that is closer (x) thought to infinity looks sharp. Mostly for the things that are closer and follows out, like for example a rock that is near and the mountains that is far.

Taken at F11 with the post at about 1FT away from the lens. The tripod is set low to the ground to make the post larger. In this example, the post is sharp. The building looks sharp, it is not. This was mentioned above.
So (in manual mode), if you simply (looking down on the lens while its on the body) Turn it all the way to the right until it stops, that is infinity, then turn slight to the left about 1/4". Then use F11, take the shot. Look at it in your software and you should see where it is sharp. You just need to find a subject like this image, that has something from near to far. Do the same for F16. These test shots will let you know, is it 1ft, 1.5ft or 2 ft. Then all you have to do is memorize the spot. Maybe make a mark on your lens so you know how far to turn it. Remember, the HFD is differant for F16 and F11, this just gives you two chocies.

This is not exact, but it will work without a scale. there are factors, DOF and HFD is subject to the eye of the beholder and how large a print and how far one stands back to view the image. Given an 8x10 and standing about 6ft to view it, what I think is the field of focus will be different than what you will see as the field of focus. But, that is the whole complicated thing about this, also mentioned above. Hope this helps.

This newsletter got me thinking about this concept and my curiosity got me doing further research and I found that it is claimed that successful people have high levels of resolve, willpower and determination so they stick at their long term goals and bring the necessary focus because they are good at:

Determination is what motivates us to keep going, to keep trying and to keep working to improve ourselves and make positive changes in our lives. It is determination that increases our chances of success and must be at the very essence of focus.
So if we want to build greater determination we:

man its pretty common to lose your focus while coding the best way to overcome this i think you should read some self-help books like the habit, mindset and etc . those helped me lot building coding habits

Concentration is not an infinite resource
www youtube com/watch?v=a-KCZ1sghLY
[Thomas Frank](www youtube com/channel/UCG-KntY7aVnIGXYEBQvmBAQ) has a lot of videos regarding studing and get things done

Tackle the easiest first
Focus on acomplish the smallest, most easilly to acomplish task first to get you going. You need those victories to rewire your brain into a doer, not a todo kind of guy ;). Pro tip suggestion: Start with your bed, easiest task, 1+ on your done list

A lot of times when I see something new I think, holy cow that looks hard, and my brain just shuts down. The problem, Ive found, is I look at the big overall picture, and get overwhelmed, so what helps me is to break it down into smaller pieces. Really small, sometimes I take a terminology and just research that to figure out what that particular part means to understand what Im looking at better.

c01484d022
Reply all
Reply to author
Forward
0 new messages