I want to make an app, and there would be an list view with items and its info. In the right bottom corner there would be a button, and there is my question: how to add an image and some informational text by clicking on that button?
You really need more basics ... maybe you should start with a few simple tutorials. Whatever, for your problem you need a RecyclerView.
Related
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
i have a project that is calculator, there is many button and layout above the main layout, i have a history frame that hidden at the right screen, i want that if i swipe the edge of the whole screen and ignore the button and other objects there, the history frame shown
i already read the question here
how to fire an event when someone clicks anywhere on the screen in an android app?
but it didnt work for me
thanks
I solved this problem using dispatchTouchEvent.
I am developing an application in which map is integrated and there are multi markers on it...
As you seen in the picture I want to design my application like this...
Means in first the map markers are visible on the map. By clicking on it the bottom menu will appear as in the first screen in example picture...
Then if the user drag up this menu then the more detailed view will cover the half of the screen.
And by dragging up again then the full screen will cover up with activity or by fragment and the toolbar name is changed...
As seen in the example picture.
In my application (only for my application), I want to add a button to the navigation system bar
How I can do that in my code?
You cannot do anything there. Not to mention some devices will not show this bar at all if they got hardware buttons.
You can't.
Maybe try to add a fragment that will be exactly above it.
Some phones don't even have that buttons on screen.
firstly check mobile or tab has soft buttons if has then make full screen by programaticaly after that create custum button bar like tab bar at bottom and put buttons as you like thats better if u dont have any other idea
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
I have a simple soundboard which uses Buttons to represent the sounds. When a sound button is clicked. The background image is changed using the view.
Button butt = (Button)view;
butt.setBackgroundResource(buttons_on[media]);
buttons_on is a int[] representing the drawables of the buttons.
This all works perfect, but I also use a FragmentActivity to create a paged App. The App has 4 different pages which you can swipe through. When I change a button using the above code and swipe two pages to the right and than swipe back. The image of the button has changed back to it's default defined in the page.xml.
How can I prevent this behavior?
change the Buttons to ImageButtons and setting the src?
somehow prevent the page from reloading
Instead of doing that you should look at how to use a StateListDrawable. It will simplify your approach.