I'm working on a native android application in java with Android Studio and I want to add comments on full screen images like this. This based upon a feature of "Figma" where you can place comments on prototypes.
I have already made a xml file that normally has an Imageview in full screen. So I probably need to draw a circle on the exact coordinates of the view where I click. So how can I achieve this in java code?
Figma example 1
Figma example 2
use draggable view and when user clicks it display dialog where they can enter a comment,
then save the position of the view and the comment to SQLite or wherever you want so the user can retrieve it again whenever they need it
Related
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
I have this kind of use-case
User is looking at ImageView, this ImageView should implement two types of gestures:
Swipe left/right to move to previous/next image
Zoom image (two-fingers, double-tap)
For swipe I've used implementation from here https://stackoverflow.com/a/8806468/492624
You can see it here: https://github.com/smarek/Simple-Dilbert/blob/master/src/com/mareksebera/dilbert/ActivitySwipeDetector.java
For double-tap, two-fingers I've used library named PhotoView
You can see it here: https://github.com/smarek/Simple-Dilbert/blob/master/src/com/mareksebera/dilbert/ImageZoomActivity.java
The problem is, I'm not currently able to combine these two implementations.
I'd like user to have both options on one page, one idea is to rewrite it from "single ImageView" to "ViewPager", to implement paging on lower level (not as OnTouchListener) and use PhotoView as library to provide zoom function.
Possible user-scenario is for me:
If image is not zoomed, user can use swipe gestures to move through images
If image is zoomed, user can work with zoom and move in zoomed image, but left-right swipe will not work in this case, so user will be forced to un-zoom it to be able to display another
So two qeustions are on the table
Whether my user-scenario is right and understandable
If there is option to combine these or use another library without need to rewrite it to ViewPager
Can't you just use the code from sample of PhotoView?
This works well for me:
https://play.google.com/store/apps/details?id=uk.co.senab.photoview.sample
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.
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.
I am working on an android app, where I would like the user to be able to drag the screen up and down to see the fields form fields. this is hard right now because the keyboard gets in the way. Is this something I am just looking over? As you can see the keyboard covers most of the fields. I just want the user to be able to drag the screen up to see the lower fields.
Try using some of these:
android:windowSoftInputMode=["adjustUnspecified", "adjustResize", "adjustPan"] >
Read more here about each attribute http://developer.android.com/guide/topics/manifest/activity-element.html
Use a ScrollView with android:fillViewport="true" so that your content still fills the screen up.