How can I check if a view is visible or not in Android? [duplicate]

Although View.getVisibility() does get the visibility, its not a simple true/false. A view can have its visibility set to one of three things. View.VISIBLE The view is visible. View.INVISIBLE The view is invisible, but any spacing it would normally take up will still be used. Its “invisible” View.GONE The view is gone, you can’t see … Read more

How to change color of the back arrow in the new material theme?

You can achieve it through code. Obtain the back arrow drawable, modify its color with a filter, and set it as back button. final Drawable upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha); upArrow.setColorFilter(getResources().getColor(R.color.grey), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); Revision 1: Starting from API 23 (Marshmallow) the drawable resource abc_ic_ab_back_mtrl_am_alpha is changed to abc_ic_ab_back_material. EDIT: You can use this code to achieve the … Read more

Presenting a UIAlertController properly on an iPad using iOS 8

You can present a UIAlertController from a popover by using UIPopoverPresentationController. In Obj-C: UIViewController *self; // code assumes you’re in a view controller UIButton *button; // the button you want to show the popup sheet from UIAlertController *alertController; UIAlertAction *destroyAction; UIAlertAction *otherAction; alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; destroyAction = [UIAlertAction actionWithTitle:@”Remove All Data” style:UIAlertActionStyleDestructive … Read more

Mac SQLite editor [closed]

Base is younger than your question, and definitely feels like a 1.0, but the user experience is miles better than the experience of using any of the “cross-platform” apps on a Mac. http://menial.co.uk/software/base/ I recommend you buy a license before the developer realizes he is charging too little for it. UPDATE: Since December 2008, Base … Read more

Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot? [closed]

Decision tree: Frameworks like Qt and SWT need native DLLs. So you have to ask yourself: Are all necessary platforms supported? Can you package the native DLLs with your app? See here, how to do this for SWT. If you have a choice here, you should prefer Qt over SWT. Qt has been developed by … Read more

UINavigationBar custom back button without title

It’s actually pretty easy, here is what I do: Objective C // Set this in every view controller so that the back button displays back instead of the root view controller name self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@”” style:UIBarButtonItemStylePlain target:nil action:nil]; Swift 2 self.navigationItem.backBarButtonItem = UIBarButtonItem(title: “”, style: .Plain, target: nil, action: nil) Swift 3 self.navigationItem.backBarButtonItem … Read more