How to highlight object on the picture - java

I set a picture as background in my main activity with some objects like home.gif, car.gif, dog.gif, etc. All object files are transparent.
I want to highlight this objects that user can interact with it.
I could not found examples in web how to get this effect. So I am asking here.
I would be grateful if you could help me.
Thank you for your time and consideration!
Ciao, Szymon

You want to show the border of the transparent images in an activity?
Then in selector of that view you just add a pressed state which has borders set.

Related

Enable/Disable Touch Screen on Android

Is there any way of disabling / enabling the touch events in a certain activity
without disabling certain buttons. like if the phone is "frozen" on a certain activity page for limited time?
I need that the user wont be able to go back on page, slide out or any other events.
Is it possible? (I'm using android studio, java)
Thanks in advance!
Any answer would help :)
It's possible.
Actually there is no special function to make it.
To make it, you can make a full screen button with transparent background.
And you will define a function of the button.
Of course, it will be an empty function.
Well, you can do nothing on the screen.
and then you can hide or visible the button according to your necessary.

How to control the screen slide by code in the android?

I'm trying to writing an app that can help me to control my screen.
For example,I can press a button,and my android phone can help me to slide from left to right by itself.
Please refer to the picture as below.
I saw some of the Transfer beads Game Cheat MAYBE use this method to control the screen slide automatically, but actually I don't know how it does.
For another example, refer form the following video. In this video,he made the phone slide the screen by itself. What I want to do is as same as his work. =)
https://youtu.be/a5quGThvjT4
Thank you all in advance!
As it figured out the OP needs a drag/drop on the same screen for his problem and not swiping between activities or fragments:
The keyword is "android drag and drop": https://developer.android.com/guide/topics/ui/drag-drop.html

Android Spinner change arrow color

I have seen questions about this previously but none seem to work for me.
I want to change the color of the material drop down, as seen here
I want to make the arrow black.
I have tried making a custom drawable and using that with dropDownSelector but it didn't show the arrow correctly. I have tried adding it as a style and it didn't work either.
Any ideas would be great.
Thanks
I have encountered the same problem as well. But i had some focus problems, because Spinner was inside ScrollView. I have solved the issue by implementing ListPopupWindow.
Here is great example how to implement ListPopupWindow :

Android list selector semitransparent

If this has already been asked, forgive me. But I'm wondering if there is a simple way to adjust the transparency for ListView selection. I know how to change the color, but is there any attribute that allows to adjust the transparency? Or would you have to upload some custom background?
If by transparent you mean see-through, and by ListView selection you mean a single item of the ListView, then its called alpha. The link should show you the info for the XML, but you can also set it using setAlpha(), which is accessible to any View.

View different images depending on what item in my list view I click

I'm fairly new to Android programming and I've got this project I need to finish and I'm currently stuck.
I've got a standard listview in a Menu class with an array containing around 20 different elements. So what I want to do is load images in an imageview depending on which item in the listview I click, and since I'm a beginner the only idea I had was to make a new activity for each imageview which seems like a pretty bad way to do it since I'd need about 20-30 new activities..
To sum things up what I want is:
Code for making ONE activity that will display a different image depending on which item in the listview I click, probably pretty basic coding I want as simple solution as possible.
If possible I'm also looking for a solution that includes an SQLite database that stores the URL of an image and then display it in a single activity, also depending on which item I press in my current listview.
(I hope you understand my needs, and if you need I can also post my current code for the Menu class if it helps you help me) Or you can just show me a different way to make this work, I appreciate every answer! Thanks in advance!
NOTE
And please keep in mind, I'm a noob at Java and Android so keep it rather simple or at least explain what you do.
When you click on a list item, display the image in another view in the same layout, unless you want the image to take up the entire screen real estate. If you want it in the entire screen, go to a new Activity by sending the activity an Intent.
Activities are the "controller" of your application. They interact with the visible UI and the input from the user. You don't need a separate activity for each image, just an activity that's associated with a "place" in the UI (an ImageView) where you'll display the image.
I'd start by adding the images as resources under res/drawable before going on to databases.
You are going to have to do most of this yourself. There really isn't any substitute for taking the time to learn Java and Android. There are several tutorials and Android University classes under the Resources tab in the Developers Guide; I suggest you do all of them.

Categories