I am following this tutorial on creating basic pin code screens: http://lomza.totem-soft.com/pin-input-view-in-android/
I'm just stucked because I don't know how I would call another activity after the Pin code screen has been shown. I'm thinking that there's a button but I don't know where in the code exactly I would be putting the listener.
I just started studying android development so I'm not really familiar with it. Any response would be appreciated.
#Senya is correct, the tutorial is pretty much basic stuff, there's no Button provided and you should add one yourself if you really want one.
However the whole point of a pin is quick access for the user so it is better if you don't provide a separate done button but just listen for the keys in onKey() method and verify the pin as correct, and you can launch your Activity if it is.
In the tutorial just an example of PIN View without extra logic. You can add Button to layout or set listener to EditText for EditorInfo.IME_ACTION_DONE if you want.
Update: in this case listener should be added to the last EditText.
Related
Apologies for the rough sketch.
Basically I want, the first time the user opens the app, is to draw their attention to a button and have some text like "You can click me for more information!" or something like that.
Does anyone know what this is called? Is there a name for this sort of thing - and can it be done in native Android or would I need a third party library? Thanks
I think what you are talking about is called ShowCase View
Example Library : https://github.com/amlcurran/ShowcaseView
Edit : Note there are other libraries too. You can check android-arsenal for more
I think you can do it on your own with android's relative layout and it's textbox, by inflating the container(Relative layout) whenever you want to show, in this case at the first time of the activity and hide it later.
Try to keep the boolean value in shared preference so that your activity knows about when to show dialogue, since you would have changed the value to true at first run it will obviously hides.
However for the first time experience try the code in the given link, proof read, track and build your own later
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
Hope it helps.
You can design an overlay screen for first time instructions.This tutorial might help -http://www.christianpeeters.com/android-tutorials/android-tutorial-overlay-with-user-instructions/
here i want to develop an app that can run a simple quiz for psychology character test, but here i need some advice on how to show the question on the activity. Because i want to showing each question without moving to other activity.
This is my temporary layout (it's still ugly XD), but i want the question can appear on the inside of that red box. And when user press Next button, the question inside that box can changed but before it change the app has been stored the answer of previous question.
I really don't know how to use fragment or something like that.
NB. This is my mainActivity look :
For your app I would recommend not to use fragments at all, it will make your app much slower than it can be.
What I would do in your case, is only load the new question in the textbox on pressing next, and call an asynchronous function (asynctask) to perform the storage of the answer. This way the user sees no delays whatshowever.
If getting the next question required a server connection, use a progress dialog in between to show the user something happens.
Agree with Bas van Stein, using different fragments will slow down the app. What you could do is separate frequently changing part of your screen (e.g. question with answer options) into a fragment and reload it's data on Next/Answer button click. This will separate the code and make it easier to maintain and change it later.
On the other hand you could do it in the activity itself if you don't want to use fragment.
I have a button which on clicking opens another activity which comes up from below and covers half the screen. I searched about it but did not get any useful approach except the overridePendingTransition function which is useful in getting the animation on activity transition, but this didn't solve my problem. I know this is done in google hangout as shown in the images but can't find any useful solution.
When we press the button this activity comes up and covers half the screen size
when we scroll up the activity becomes our main activity
Any idea how this can be done?
Thanks
you can use bottom sheet for this type of UI.
here is first sample.
another sample
here is code
After some searching i got exactly what i wanted with all the codes, but still the profile picture animation is remaining, rest the SlidingPanelLayout code can be seen here . It contains some detailed information with all the classes implemented which you can use directly. I think this will surely help you. :D
Edit: As said by #MrsEd i would like to add some code that helped me. This is the custom built DraggableLayout which you can use directly, the code can be found here. Then the activity must implement the onStopVerticalDragDown() of the DraggableLayoutCallbackListener inteface and set the content view as this xml file.
Hope this clears all the doubt and makes it easier for anyone to implement their own custom built DraggableLayout without using any third party library. :D
Please. Don't redo this.
And instead, use Flipboard's BottomSheet.
I am going to code a walkthrough tutorial for my app.
I wish the user will follow the step of the tutorial. So I want to force the user to click on a specific button but not other parts of the app.
My app has many UI components and some of them are added programmatically so disabling them one by one is not practical.
One immediate solution is that I make a transparent Activity to cover the original Activity.
But I don't know how should I detect the touch event through the overlay Activity to operate the original Activity.
Or are there any better way to make a walkthrough tutorial on android apps without much affects to the original code? Tutorial is an adhoc feature and I dont want these adhoc features to ruin my coding with a lot of if-statement on every Activity.
Thank you.
Activity won't work. Only the one at the top of the stack can process infos.
Simply add a semi-opaque view above the screen using a relativelayout
Then simply monitor the ontouch event of this view. If the touch is in the accepted zone of the tutorial, then let it bubble up to underneath control. If if is outside the accepted zone consume the event.
Button btn = new Button(getActivity());
btn.setText("Next");
// Adding button to bottom
lv.addFooterView(btn);
I am developing an application in android. I have an Activity where I have a couple of buttons. Among them when I click on one button, I want to get dropdown like iPhone default picker.
To achieve that, I am using Android wheel concept. I have implemented like this, when I click on the button, it is calling another activity where my required custom layout is shown. Problem is custom layout should come from bottom of the screen in the same activity where the button I am clicking exists.
I have attached a screenshot. I want to achieve as shown in the screenshot (missing).
Please help me providing the required solution. Pardon me if there any mistakes in my question. This is the first time to ask a question.
Since the lack of a screenshot that helps to understand your issue, this is more some kind of guess: Are you known to the concept of Spinners in Android? They provide a dropdown mechanism and are easily implemented.