Guidance for the background, Please design - java

I need to place two boxes next to the recycle view. One blue box with text "working" and one red box with text "not working". It is to tell the user which way to swipe the item either left or right. Is this possible, I am struggling even to rotate the text and display it like I want.
I have tried designing a custom xml, but no luck. its just for gradient stuff. which I don't want.
Please see the attached images of what I want.

Related

I want to build an Android app with overlay over the map, What layout should I use to achieve the result as the image?

enter image description here
Should I use fragments? but I want an overlay over the map activity. How can I achieve this?
So far, I have been trying, to add two buttons and on click of a button opens a floating map, but it doesn't give me this result, it resembles a bookmark bar on chrome with three dots on the sides which aren't what I want.
Not sure what you are going to do when user will tap on go back or any button or back press
but here i assume it that you are going to remove that white overlay and only map will be shown
if yes then you can simply use map in your activity/fragment whatever you like and white overlay should be created and shown using BottomSheetDialogFragment
to understand how you will create BottomSheetDialogFragment , you can refer this example
https://medium.com/#kosta.palash/using-bottomsheetdialogfragment-with-material-design-guideline-f9814c39b9fc
I think the best bet is using coordinatorLayout with a child layout that has BottomsheetBehaviour for the overlay. or simply BottomSheetDialogFragment if user isn't going to interact with map when the overlay is drawn up.
a layout with app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" fits the picture. more on that here

Java: Clickable grid project - what to use? (JFrames & JPanels)?

I'm currently getting started on a project where I use a grid for a game (Dot game, but that's not very important). Basically, it will be a grid of dots, where a player can click on the lines between the dots (like this).
I currently am using a JFrame, and was thinking about ways I could populate it with JPanel components to create clickable regions. Currently, I was thinking about trying to create for loops to correctly populate it, but I don't know how I could efficiently do this.
Any recommendations for how to do this? I'm not asking people to write code for me, just point me in the right direction. Is there any layout (GridLayout?) that would work well for this?
Welp, I ended up figuring it out on my own, but using a soulution not quite ideal. I have a for loop making every odd line have a black panel, then clickable jbutton, then a black panel, etc. Every even line has a clickable j button, then a white middle pannel, then a clickable jbutton, etc.
Looks like this:
https://gyazo.com/79b80dfe13b017a234e6fad2aa224d58

Draggable overlay that can go offscreen?

I have created an overlay menu that is a rectangle.
It displays on top of everything else while active. All other apps, the home screen, etc.
If you click anywhere outside of this rectangle your click hits
whatever is visible.
If you click the red part it allows you to drag the menu around the
screen. Clicking the green part performs some function.
I have created this rectangle from inflating layout xml. The rectangle itself is a relativeLayout and the green and red parts are both imageView children.
Since I'm unable to move the relativeView off screen and since the background needs to be clickable my only solution was to calculate margins and apply them to the relative view to imitate the desired effect.
However, the code to calculate these margins is almost 50 lines and fairly complex and hard to understand at a glance if someone else needs to refactor. I can post the code but I don't believe it's relevant to the actual problem's context.
Is there a much simpler way to do this that I'm missing? Is my approach wrong?
I hope this simple project may help you Android Floating Widget

How to create a customizable User Interface with swing

I've searched through google, but there doesn't seem to be anything on this. In almost every user interface, you can resize parts of it in order to make it more custom (from the users perspective). For instants, in eclipse, one can resize the consul relative to the area with the code by clicking on the spot in-between the two panels/parts and dragging. One can also click and drag the area in between the Package Explorer and the rest of the parts in order to resize that. How would I do this? By "this", I mean allow users to resize the amount of space given to each part of the layout? How do I get the little division-sign-like curser to show up? What layout should I use?
You seem to be describing a JSplitPane.
Take a look at How to use Split Panes for tones of examples

Getting graphical buttons to line up in xml

I have a custom popup window with a custom image background in which I need to place three custom buttons with their own background images. I have only one set of images for all the components, so I want all the parts to scale appropriately. My question now is how do I make sure that the buttons line up with the appropriate parts of the background image of the popup window. I have been experimenting with all sorts of widths and heights and I can not make it look consistent on all my test devices. Can anyone give me some pointers?
EDIT: Just to make it as clear as possible, the image below illustrates the kind of thing I am talking about:
I want the graphical button to line up with the arrows which are a part of the popup window background image.
arrange buttons in an xml layout and set this view to your custom popup and you can set images to buttons from code.

Categories