Android Crouton library implementing Custom Views - android

Is it possible to completely change the Layout of a Crouton? I've seen a few of posts about changing the view which actually came down to just wanting to change the font but nothing about actually changing the layout.
I've already got croutons displaying nicely and been playing about with styles but couldn't quite find how to do what I want. Basically what I want is something like this, which dismisses the crouton when clicking the cross. So it's just a textview and a button!
I did see this within the Crouton Library but couldn't really see how to use it for my purpose.
public static Crouton make(Activity activity, View customView) {
return new Crouton(activity, customView);
}

Follow this link you may get answer
Another Link
His idea is to show in-app notifications (not to be confused with Android’s persistent notifications) at a fixed place of the Activity to which the notification is relevant. This way the context of the notification is always correct

Related

In Android TV leanback UI BrowseFragment how could I find when HeadersFragment is put away?

I'm writing a POC Android TV app for my company based on our existing mobile OTT product and backend.
I'm modifying the PageAndListRowFragment example from Google's Leanback Showcase code.
When a header option is selected (with OK or right arrow) I want the RowsFragment side to popup an AlertDialog to let me filter the content displayed ('all', 'latest', etc).
My problem is that I have the AlertDialog in the RowsFragment onCreate So, It displays as soon as the HeadersFragment is highlighted. This stops the user from scrolling down the header smoothly and is confusing because you still have to select the header item after the dialog.
Most advice on the web seems to point to overriding the OnItemViewClickedListener function on the HeadersFragment but I can't find a way to do this. (The leanback showcase uses the deprecated BrowseFragement code, Not BrowseSupportFragment and if I try to change up I get into FragmentFactory errors I'm not experienced enough to resolve).
I've also tried implementing isShowingHeaders() in the RowsFragment.
I've tried to find a stage of the fragment lifecycle in either HeadersFragment or RowsFragment that will let me popup the dialog when the RowsFragment is full screen without success.
I'm already using the PageRowFragmentFactory code in the leanback showcase code to send an EventBus message containing the header option chosen and was hoping to send a similar message to trigger the dialog.
I've tried setting up a setOnHeaderViewSelectedListener on the BrowseFragment but can't seem to successfully get it invoked.
I'm new to Android programming so apologies for my ignorance, but I'm determined to make this work somehow.
Any suggestions on the approach would be very much appreciated, thanks.

Android - Show more information on a popup

I'm developing an app that includes reviews of items and due to my design, I want to only show all the reviews in a popup window like in Google Play Store:
What should I use to create that white panel that appears over the current window and contains the necessary information? This should be simple but I'm a newbie and I can't seem to figure out what this "widget" is. Please help me if you are familiar with this so I can use this cool design pattern. Thanks.
It seems you want to display a layout as a popup in another activity.
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="#android:style/Theme.Dialog" in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
A better way to do it would be using a DialogFragment. You can display information in the form of a popup and it will have its own lifecycle. That will be much better than displaying an activity like a dialog
Ram kiran's answer is a good one and one which I like to give also. But just so you have another option to look at you can consider PopupWindow
As stated in the docs, it is
A popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.
I've used this and it works out nicely in some situations. It really depends on what your exact needs are as to which will work best for you.

android: How can I implement first time tutorial like Go Launcher in my app?

Go Launcher have a nice first-time tutorial. it is very similar to Stock ICS first time run. I want to learn how to make the similar tutorial display at the first launch of my app. How can I implement this Transparent view (which interacts with screen objects) in my android app?
I was trying to do something similar using a transparent activity with a viewpager inside it. I wanted static 'tutorial' images that users could swipe through.
One of the answers to my question mentioned an interesting library (called ShowcaseView). It seems like it may be a good fit for your requirements as well.
https://github.com/Espiandev/ShowcaseView
You can either use a FrameLayout or RelativeLayout as root of your Activity/Fragment, and put your "first time" View upon content with a (almost) transparent background, or use another Activity/Fragment themed with a transluscent window. (like this)
I'd rather use an Activity/Fragment, but this is up to you!
I wrote little library That contains a simple component for making ​​a app tour. It`s very restricted to my case but maybe could be your case . Single LessonCardView Showed onstartactivity for the first time or on button click Any criticism ,help or advice will be appreciated. thanks https://github.com/dnocode/DnoLib
You can implement a first-time user guide with the Spotlight library by TakuSemba.
It is similar to the one shared above and it is still well-maintained (as of 2021).
https://github.com/TakuSemba/Spotlight

In Android how can I design a view like the attached image?

I am new in android and I have a view which is in the attach image. I have to open this view after clicking on list item, but I am not finding any proper way to solve this please suggest me how can i open a dialog like in Image.
Check PopupWindow control in android developers, does exactly what you want. There are numerous tutorials on the web on how to customize, animate, have functionality etc. It has an onCreate method and in simple words it works just like an Activity with specific bounds. It can be attached and shown anywhere and anytime. It's actually quite useful. When you don't want to use dialogs this is the best option.

ProgressBar in an AppWidget

I ran into an interesting situation with using a ProgressBar in an App Widget... The documentation (http://developer.android.com/guide/topics/appwidgets/index.html) says that ProgressBar is a supported widget class...
I have no problem getting the ProgressBar to display in my App Widget but the problem is that I want it to only be displayed as visual feedback to the user when background processing is happening.
On ImageViews I do this via RemoteViews.setViewVisibility() and everything works fine. However, with ProgressBar I get an exception saying that ProgressBar can't use this method.
Is this intentional or is this a bug? Is there any way to workaround this problem?
An even simpler idea, is to put the progress bar inside some container (say a linear layout) and show/hide the container.
It might be a bug. There's a particular annotation (#RemotableViewMethod) you need in the Java source code of Android itself to mark a method as being available via RemoteViews. View has this for setVisibility(), but ProgressBar overrides that method and does not have the annotation on its own edition. If #RemotableViewMethod is not inherited, and the override "undoes" the annotation, that would explain the symptom you see.
A workaround is to use two app widget layouts and choose the one you want (with or without ProgressBar) when you create your RemoteViews object when updating your app widget.
I'll make a note to try to replicate this and, if I see the same thing, I'll post an issue on it on the Android issue tracker.

Categories

Resources