I already had buttons on my original app but now I created an image on canvas in Android and have combined the two together, however I cannot view the buttons on the page but can only see the image on the page. These buttons were designed to move to different pages. Does anyone know how this can be done. I have also used extend Activity instead of View/SurfaceView is that ok or will that be causing the problem?
Thanks.
Related
I'm trying to make my app be able to draw with your finger like Snapchat on part of the screen but not the whole thing? Every example I have seen of drawing is just an app that turns your whole screen into the canvas and does nothing else but I'm having a hard time implementing it as just part of my app. So as well as how to just choose a section of the screen as the canvas is it possible to make another activity just like the examples that extends view that I include or can I put everything in MainActivity.java?
Yes, there is. You can create a fragment, or as many as you want, and them place the fragment(s) wherever you want in the activity by using some of the available layouts.
For example, you can use a relative layout. You can add a frame layout to the relative layout and align it in the activity where you want, set its size, and then add the fragment to it. You can check this link to learn about fragments and their usage if you don't know them.
I want to make it such that when a person clicks an image, it opens up in full screen.
What is the most effective way to do this in Android?
The simplest way I can think of is creating an activity, with a layout with the ImageView filling the whole screen. But I think there's some way to directly open just the layout or the ImageView with an Intent?
The Best way to do this is..
When you click on image open a full screen Custom dialog with the image in it having attributes fill parent. You don't need to go in another activity your purpose will be solved in 1 activity itself thereby increasing performance and also lesser activities will be in stack.
I have completely lost my focus now.
I was trying to create a transparent background to show users phone screen like this.
https://market.android.com/details?id=net.kreci.crackedscreen&hl=en
Now i got it working. But i want to now add an image but it wont show till after the click.
Can this be done in Viewflipper with showing the activity Transclucent then showing image after the click? (cause i dont want the screen to flip to another activity, I want it to show straight away)
So technically if you don't understand what I meant.... Similar to the market link i added in this post.
I don't have knowledge regarding ViewFlipper class to implement in this situation,
But
I have one Idea to implement while creating two different activities to show 2 Images.
In onCreate of both activities write the below line right after super.onCreate()
getWindow().setWindowAnimations(0);
This will set Window Animation to 0 so your screen will be changed without any effects.
The main screen of my program has a number of icons that I set dynamically, due to that number can be different according to some parameters that I have in my database. To achive that, I use a gridview and it works perfectly.
But now, I need to change this main screen to behave as the home screen, I mean: I want to be able to drag and drop the icons to everywhere in the screen and also I need to be able to set my custom widget. The only thing I don't need is the flinging gesture.
Any idea how to start?
I tried to take a look to this sample (http://developer.android.com/resources/samples/Home/src/com/example/android/home/index.html) but I couldnt get how it works.
Thanks a lot
I need to create some custom buttons as shown in the image below
what is the best approach to follow?
thanks
Abdul Khaliq
That's a hard one. I made a lot of custom views, and the first thing I would thinking of is, made one Button with that above image, and handle onTouch by yourself so you can distinguish which area the user hit. There you can also change the state of the button, like changing the image to a bevel one e.g. when the left button is hit.
Can you imagine this ansatz?
You can place two transparent "invisible" buttons over the top of a background in a LinearView. Like two ImageButtons with a transparent png inside.
It is also possible to make this background animated when buttons are clicked using android animation class.