Android - Show Back Button from XML - android-xml

Before I begin, I want to mention that I've found a million answers showing how to do this from code, which involves setDisplayHomeAsUpEnabled(true) from your Activity. However, what I have not been able to find is a way how to do it from XML. (I would like to hide as much UI code in the XML files as possible).
One article I did find is this, which states
Step 3: Specifying the parent activity name in the AndroidManifest.xml adds the Back-Button arrow
and Click-action. Tapping on the back-arrow takes us to the Parent
Activity i.e Home Screen.
which doesn't work for me (the Back Button doesn't appear). I've followed all the steps in the article.
Does anyone know how to do this via xml? Is it even possible?

Yes, it's possible but still, you have to set the listener in java code. You can create a custom toolbar view and add a button to it. Then create a button in the java file and set the CilckListener.
Or You can use the default toolbar and do setDisplayHomeAsUpEnabled(true) from your Activity.
We usually make a custom toolbar, suppose you need a search bar in the toolbar then what you will do? So try to make an xml then use <include> tag in xml. You can search youtube. Follow the channel CodingInFlow, that guy explains very perfectly. If you don't understand what I am saying then understand the basics first, it will help you learn faster.

Related

How to show a bootstrap modal from another component?

I'm building an app to manage some users, where i have a page to list them. On each user i have some buttons to make some actions on them, like edit them or delete them.
When the delete button is pressed, i would like to have a modal to show up and ask if you really wawnt to delete the user. As i may be using this modal in other places, i thought i should make it kind of generic to receive the different messages i want to show, so i built a component for it.
I've searched through some examples, but i couldn't find one similar to mine.
I've made the template for the modal and the component to back it up, but i don't know how to show it, for example, on a button click.
Any help is appretiated :)
Thanks
EDIT: i'm trying to use bootstrap modals
use bootbox instead of making a modal from scratch. they can be perfectly used for delete confirm or alerts. I use them. http://bootboxjs.com/. It is also available for angularjs.

ionic framework hide ion-tabs on certain tab state

I've been trying to find a solution but I can't find any.
I'll use basic examples so anyone who knows ionic can understand my problem well.
ionic start myApp tabs will create a new project with tabs ready to go.
Those tabs are Dashboard, Chat and Settings.
When you go to the Chat Tab you will then select a person to view its chat content (which directs you to the Chat-Detail Page in actuallity)
I wanted to hide the ion-tabs directive when I go to the chat-detail page so I can force the user to use the Back button instead of clicking anything on the ion-tabs.
Simply put : you will have a hard time doing that. At best it will not look good, IF you succeed to hide using css (I did it, and really, it's not pretty). Basically you would need to define a variable on the parent scope, that changes when entering the chat-detail state, and bind it to ng-class directives on multiple elements (the ion-tabs to hide it, the ion-content to translate it up to cover the area where the tabs were, and add some transition to make it not too brutal).
The logical thing to do would be to have the chat-detail state not being a child of the state containing the tabs. The problem you will have, though, is that there is a huge bug going to / from tabbed state. See details here : https://github.com/driftyco/ionic/issues/2997
At the end of this discussion you can find some posts by Jason and Jerrybels (that would be me), that could lead you on the right way to do it. Basically, you will have to get rid of the ion-tabs directive, and use Ionic's CSS for tabs instead, doing all the states manipulations yourself.
Good luck !
You can use "hidden" attribute of ion-tab like this -
<ion-tab hidden={{condition}}" />
Using this we can show/hide tab.

Build some sort of workflow in JavaFX

I'm trying to build some sort of visual workflow in JavaFX. I want my application to have one main screen with the next and previous buttons, something like an installer. When a user clicks next, all the elements of the next screen appear in the same element. All previous choices of the user have to be saved. So when a user clicks on the previous button that all of his choices are still there.
How would I go on to do this?
I found these links on Google, but they don't seem to help me. Something like this is a bit the direction that I want to go, but the code in this tutorial isnt't really that good for scene's with a lot of elements.
The DataFX Framework provides a Flow API that can be used to define workflows. By doing so you can simply navigate between MVC Groups by only using annotations or configurations. You can find some examples of the API here:
http://www.guigarage.com/2014/06/datafx-tutorial-5/
http://www.guigarage.com/2015/02/quick-overview-datafx-mvc-flow-api/
http://www.guigarage.com/2015/01/datafx-tutorial-6/
I haven't worked with JavaFX in a while, but I'll start by saying I really hope you are using the JavaFX scene builder.
The way I would do it off the top of my head without going back and relearning JavaFX is to create a main window in the scene builder, and have a sort of central content display area, which holds another custom JavaFX container that contains the content you want to display, of which you can then create several of and swap out which one is being displayed programmatically.
Basically, create several smaller components representing each step or screen and display them programmatically in an owning container.

Predefined Add Dialog not working as expected in Lightswitch 2012

I've created a query to use in an AutoCompleteBox and it works as expected when the user select the AutoCompleteBox in the grid as shown in the picture below
However if the user click the plus button to add a new record using the predefined Add Dialog then the query and the AutoCompleteBox's format doesn't work as shown in the picture below
Why is this happening and how I can fix that?
Thanks
I haven't yet found a way to edit the default Add New dialog.
Instead, make a new screen, select the "New Data Screen" template, and link it to your entity data. You can customize the screen to fit your needs, even make it a Modal Window by changing the Control Type in the screen properties. Once you have the screen set up the way you want, go back to your grid screen, and double click on the Add... command in the Command Bar of your grid, to edit the AddAndEditNew_Execute code. In that method, call your custom screen.
So, as I got to thinking about this some more, I came back to the thought I had when I tried to do this a few months ago. There has to be a better way, so I Googled it again.
This time, I found something. He's using an old version of Lightswitch, but I've successfully applied his technique in my application built in Lightswitch 2012.
http://www.c-sharpcorner.com/UploadFile/051e29/modal-window-in-editable-grid-screen-in-lightswitch-2011/

Make clickable text to another UIViewController

I have a block of text shown like:
What I am trying to accomplish is that when I add the test to this table view cell, I want to make a specific word or group of words clickable. Lets take the group of words Grand Turk Lighthouse for example. Is there a way to add a href to the word that when I click it, it will send me to say View2 which is in the app. I am building an app that will not go to the internet and so I want a way for the link to be clickable to send to another page within the app. Thanks for any help provided.
I can't give you specific answer, but you may try this :
https://github.com/AliSoftware/OHAttributedLabel
it also could give different style, color, and href in one label.
another alternative, is to use UIWebView, and listen / delegate to it. load html within the app.
hope it helps.