I am designing a calculator in android and I want to make a button for math pow operation. but instead of X^y, I want the button to show "y" as a propper superscript. also, a special sign for division operation rather than "/". is there a way to do this.
it would best if it was possible to write a line in Values/String.xml file. I can write the special symbol for the registered sign with this code "\u00AE" but codes like division doesn't work this way.
Here, รท, Copy paste this symbol, or alternatively you can use an image.
And as for the power thing. You've control over the whole UI, don't take it as a WordPad, why don't you use TextView and position it dynamically so that it looks like it is in the superscript? Like scaling it down, and translating a bit up in the y direction.
Related
Am a newbee to javascript but have plenty of experience in VB, C, and even 86 assembler. Maybe I am trying to do the impossible in porting a VB app to js here. Basically, I need to change the color for only part of the string in an input element. Here is the problem:
A function takes an entered input box text field, and processes it first to see if it is in conformity to a set of requirements. If part of that string is not in conformity, I would like to in some way highlight that part in the input field. For instance, maybe I can send back the string to the input element (eg using the value attribute) but with some highlighting for that part, such as changing its text color or background color. Is this possible in js?
I'm not sure whether you can change colors of partial text in a simple text box. But what you're trying to do is certainly possible with this: https://editorjs.io/
The example on the homepage shows you how.
I hope this is a possibility for you and not too heavy for your purpose.
Horizonal splitting is simple.
Is it possible to split vertically? Have wide screen so right hand side is empty anyways.
Edit: I would want to see basically a view of the SAME module on the left, and on the right side of the screen. I know I can put multiple windows next to each other about different modules.
A workaround could be to split the code into multiple modules and change variable scope, but I hope there is a simpler way.
Appears when a new window is inserted.
Think the only workaround is to:
insert an additional module
copy over your code there
arrange these 2 modules vertically, and use e.g. the right-hand side only for viewing, while modifying the left-hand one, to stay consistent.
Trying to use AndroidStudio (3.4.2) for the first time and it appers to be substantially different to the tutorial at
https://developer.android.com/training/basics/firstapp/building-ui
For example:
There is no layout editor toolbar let alone a show button.
There is no autoconnect button
It doesn't show any wiggly lines from the middle of the blue square to its edges.
When adding a text box it goes to the top left and can't be moved.
WTF is going on? This is awful!
So I know this may sound like the hard answer, but in the long run it will make life 1000x easier.
You need to learn XML to design the activities. It's fairly simple and really easy to research. The reason the textbox can't be moved is because the default layout is ConstraintLayout. In order to fix this, go to the xml file and change the Constraint layout to either Relative layout or Linear Layout. In the end, its more simple to learn straight xml.
I suggest you learn Android programming from here or somewhere else because the Android documentation can be confusing especially for a beginner like yourself and trust me, I've been there.
How to deal with the numeric keypad in a canvas-based application? I want all the input features of text controls (like, switch between ABC/Abc/abc/123/T9, special chars input and stuff) without text controls.
There is no real way to do that. The best you can find is to duplicate by code all functions. The only library I'm aware of that gives you something like that is LWUIT, but it is way to heavy, and you don't get predictive text
I'd like to write a Linux screen magnifier that's customized to my liking. Ideally, the magnified window would be a square about 150 pixels wide that follows the mouse cursor wherever it goes.
Is it possible to do this in X11? Would it be easier to have an application window that follows the mouse around, or would it be better (or possible) to forget about the window altogether and just make the mouse pointer a 150x150 square that magnifies whatever's underneath?
Look at the source to xeyes?
This actually already exists, it's called Xmag (do a Google search for additional info). You might want to check out the source code for it if you want to know how it works.
EDIT: looks like I misread your question a little bit... if you want a magnified square to follow the mouse pointer around, I suppose it should be possible, but I don't know the technical details of how you'd do it. Regardless, the place to start is probably by looking at Xmag as a starting point.
I am unsure if this can run as its own app or would have to be integrated into your window manager. Either way, you would need libx11 (might have a different name from distro to distro). Also, I would suggest taking a look at swarp. I know this is not even close to what you are talking about, but the source code is only 35 lines and it shows what can be done with libx11.
I would personally make that a frameless window that always stays atop with a 1px hole in the middle. The events that the user makes (Mouse clicks, keypresses, whatever) is passed to the window below.
And when the user moves it's cursor it is ought to be visible to your window and you just move it over a bit. For the magnifying part, well - that is left as an exercise to the reader (Because I do not know how to do that as of yet ;-).
Texworks comes with such a feature to inspect the pdf resulting from typesetting a latex source. You can also choose between a square or a circular magnifier. See https://www.tug.org/texworks/ for access to the code which can serve a launchpad.