{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
GitHub- Source
Hey Guys i was fiddling around with the PlayView developed by GadgetCheck and thought it would be nice to recreate the whole Google Market Layout so that's what i did . Soon i realised the easiest way to implement Card like layout of Google Play was using a 9 patch drawable. During the process i also observed that the market listview had different no of cards for various screen orientations and resolutions like an auto adjust gridview . So it seemed that Every Single Listitem was holding a variable no of cards according to the dimensions of the screen that's when the Bucket-ListAdapter came into play . This is an adapter contributed by rzsombor at GitHub similar to what you see in the Google Play application. It features a grid-like layout of list elements, with the advantage that you can still use list headers and footers - something that's not possible with the standard GridView.The market like PagerSlidingTabStrip have already been implemented by astuetz . So In an hour or so i was ready with my implementation of the Android Market .
Listview with Simple ListAdapter
Listview with Bucket-ListAdapter
Listview with Bucket-ListAdapter Emulating GridView
GitHub Projects Used
Bucket-ListAdapter
Pager-SlidngTabStip
GitHub- Source-PlayCardsGrid
Note :
The bucket-List Adapter is still a work in progress and there are optimization issues .The adapter does not use recycling of views. Neither does it use the viewHolder pattern. So, it is very likely that the app will go out of memory if the number of items in list goes high. Also, the rendering of the items is very slow and the scrolling is not much smooth. We need to work on it to optimize it. Any Developers who wish to Contribute can fork the project and Share their implementation of the Bucket List Adapter in this thread.
Thanks . Happy Coding !
how to implement context menu on the items?
cHu-X said:
how to implement context menu on the items?
Click to expand...
Click to collapse
Its super simple to implement context menu on items. Register a onClickListener on the Overflow ImageView and start a PopupMenu when the overflow icon is clicked. That's it..hope it helped. Also you can now check the code on GitHub. I have added a GitHuB repo for PlayCards GridView
Here you go. :angel:
GitHub - Source
Related
http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!480.entry
The enabling UI technology was Windows Presentation Foundation (WPF). With WPF we could rapidly build something that looks a lot like iPhone in a very short time. I was playing the dual role of a Designer + Developer and tools like Blend and Design greatly helped in skinning the app. Below you can see a bunch of screenshots and a short video of accepting a call.
Notification received. You can talk, IM or just ignore.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In an audio chat (call)
Contact list
Video of accepting a notification (via Talk)
How was it built?
* Blend and Design were used for creating the skin of the app. The XAML UI was created in Blend and the graphics were developed in Design. I had made a post earlier about how the icons for the app were created in Design.
* The GlassWindow control was used for creating the window chrome.
* Although you cannot see in the screenshots above, the Drag 'n' Drop library was also used
* I missed out using the ElementFlow, but that can be easily added. I only need to find a business case for that
This example only goes to show how powerful WPF can be. With greater tool support from Blend + Design, lot can be achieved in a far lesser time. Now until I get my own iPhone, I will continue to use the WPF version
Didnt know you could get WPF on win mobile, would be nice to see it used to do something other than clone the iPhone though
iPhone is overrated. It was a fad, we dressed our pdas up for a while, but its tiring. I feel for iPhone owners who actually have to deal with it everyday.
If you look on the link you provided in your first post, you'll see a video that shows this is not running on a mobile but on a desktop. WPF is a component of Vista, and the app probably runs in an emulator of some kind (you can see a mouse cursor in the vid).
Hello Guys,
How can i add an ongoing notification with 2 or 3 buttons... play stop next !?
Something like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
...When i tap a button i want to do an url post.
android 4+
Thanks
Its actually very easy to just add an expandable button to the bottom of your notification (android 4.1+ only I believe):
Code:
Intent mIntent = new Intent();
mIntent.setClass(context, MyClass.class);
PendingIntent mPendingIntent = PendingIntent.getService(context, 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mNotificationBuilder.addAction(R.drawable.icon, "Test", mPendingIntent);
This call will simply add a button at the bottom of the layout with a little icon called "icon" from your drawables, the text "Test" next to it, and when clicked on will take you to the class that you set as the pending intent.
you can add up to 3 of these (i believe, someone correct me if i'm wrong) per notification.
To get layouts that have buttons on the side (or anywhere other then just under the actual notification) is little trickier though. you'll have to create a layout and then use remote views to get the job done and I dont have an example for that! check out here at the bottom of the page though and it talks about using remote views a little bit. Just be careful with the layout that it will work for different screen sizes and devices!
as for an ongoing notification, here is what you want to call:
Code:
mNotificationBuilder.setOngoing(true)
its also a good idea to set priority for ongoing notifications in my opinion so that they appear where you want them to in the drawer.
Code:
mNotificationBuilder.setPriority(Notification.PRIORITY_MIN); // there are lots of options other then PRIORITY_MIN as well to check out
Hope that helps get you started!
@klinkdawg what you are describing are the action buttons which appear below the notification. In the Google Music app the play/stop buttons are embedded within a custom notification design. You can set a RemoveView with your layout with SetContent function:
http://developer.android.com/refere...er.html#setContent(android.widget.RemoteViews)
However all this good stuff is only available in API level 11+, and the notification with bigger content in API level 16+.
As stated in the subject, I'd like to implement in my project that little auto-dismissing text popup that sometimes appears when applying an action in certain apps.
It's a simple floating text with a dark rectangle as background positioned in the bottom part of the app that remains between activities/application switches and goes away automatically after X seconds.
Does anybody know how it's called?
It was called Toast.
You can easily custom a toast to have a interface like whatever you want, look Titanium Backup for example.
Default usage like below:
Code:
Toast.makeText(mContext, "Hello", Toast.LENGTH_LONG).show();
As a side note, the App-Msg(Crouton) library provides a good alternative to toasts : in that it is context-centric, the message will only be displayed on the activity/fragment it was generated from, whereas if the user quits your app while a toast is displayed, for example, the toast will be displayed on his launcher or on he app he switched to, which could be confusing.
Its usage is also very simple :
Code:
AppMsg.makeText(/*Activity*/, /*CharSequence*/, /*AppMsg.Style*/).show();
Maybe this library can be helpful on my app. I have a custom toast, which still displayed after I choose to leave the activity via a button. So with this library the toast dissapear when the activity goes to background? And also can customize the look of toast?
dancer_69 said:
Maybe this library can be helpful on my app. I have a custom toast, which still displayed after I choose to leave the activity via a button. So with this library the toast dissapear when the activity goes to background? And also can customize the look of toast?
Click to expand...
Click to collapse
Yeah exactly.
And yes, you can modify the appearance of the toast to a certain extent (background color, gravity and display length afaik) using the static methods already setup in the library, but nothing prevents you from forking the library and modifying it to suit your needs.
You can also choose to have a toast which will only be dismissed when the user clicks it.
There are 3 types of preset styles for the croutons (from left to right in the image below) :
AppMsg.STYLE_ALERT (red) AppMsg.STYLE_CONFIRM (yellow) AppMsg.STYLE_INFO (green)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
But you can create your own using something like this :
Changing length & color :
Code:
AppMsg.Style style = new AppMsg.Style(AppMsg.LENGTH_SHORT, R.color.holo_blue); [COLOR="SeaGreen"]// the default length is [I]AppMsg.LENGTH_LONG[/COLOR][/I]
colors.xml :
Code:
<resources>
<color name="holo_blue">#33B5E5</color>
</resources>
Changing gravity :
Code:
appMsg.setLayoutGravity(Gravity.BOTTOM); [COLOR="SeaGreen"] // the crouton is displayed at the top by default[/COLOR]
Result in the thumbnail
Thanks to Evgeny Shishkin for his work on this library by the way.
Often we find ourselves messed up with simple things such as layouts.
So I made this library modifying AOSP code to help put items in a Grid Layout.
You can add this as a library or put it separately into your package since it consists of just a single Java file.
Its pretty simple and extremely easy to use. Just put the items in xml between the following tags:
Code:
<tk.eatheat.gridlayout.GridLayout>
....
</tk.eatheat.gridlayout.GridLayout>
By default, it creates a 3x3 grid. To change it just set the number of rows and columns in these lines:
Code:
static private final int COLUMNS = 3;
static private final int ROWS = 3;
Here's a sample app made with the library to show the result.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Sample app can be found here.
Library can be found here on my Github here.
-------------------------------
Featured on Portal:
http://www.xda-developers.com/android/simple-gridlayout/
Hey, cool library.
Thanks. :good:
I recently started hobby android app development and this was the thing that always bothered me the most !
Thanks a ton ! this saves me a lot of effort and simplifies everything
sheennick123456 said:
I recently started hobby android app development and this was the thing that always bothered me the most !
Thanks a ton ! this saves me a lot of effort and simplifies everything
Click to expand...
Click to collapse
You are welcome. Glad to be of help.
EatHeat said:
You are welcome. Glad to be of help.
Click to expand...
Click to collapse
Could you add activity starter to buttons?
Sent from my GT-S5570I using xda app-developers app
@m4RinKo2
Code:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(newComponentName("com.package.app","com.package.app.ExampleActivity"));
startActivity(intent);
Set intent on the buttons with the correct package and activity names.
Thanks for your hard-work.
This library will be surely somewhere used by me.
Sent from my GT-I9300 using XDA Premium 4 mobile app
Nice lib brother I have a question before importing it to my project how can we add Item click listener so that if i have a list of images in grid i can select one image from that silly question plz help @EatHeat
How would I show a map in an activity with a customized marker that shows the current location of the device?
If you're planning to use Google Maps, it's pretty easy: https://google-developers.appspot.com/maps/documentation/android/
And for the device location: http://developer.android.com/training/location/retrieve-current.html
Ianlmt said:
How would I show a map in an activity with a customized marker that shows the current location of the device?
Click to expand...
Click to collapse
Look into using a MapFragment.
Stick one in your layout;
Code:
<fragment
class="com.google.android.gms.maps.MapFragment"
android:id="@+id/myMap"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Then in the onCreate of your activity, get a handle to the fragment and then get the map as a GoogleMap object from there;
Code:
final MapFragment mapFragment = ((MapFragment)getFragmentManager().findFragmentById(R.id.myMap));
final GoogleMap googleMap = mapFragment.getMap();
When you have the GoogleMap instance, it's easy to set positions and markers;
Code:
final LatLng position = new LatLng(100, 100);
map.setMyLocationEnabled(true);
map.moveCamera(CameraUpdateFactory.newLatLngZoomposition, 10));
map.addMarker(new MarkerOptions().title("Some place of interest").position(position));
Hope this helps.
Thank you so much! Going to play with it later today and see what I can produce!
Ianlmt said:
Thank you so much! Going to play with it later today and see what I can produce!
Click to expand...
Click to collapse
Cool, remember that you need to get you API key's sorted to get it to work.
bornander said:
Cool, remember that you need to get you API key's sorted to get it to work.
Click to expand...
Click to collapse
How do I do that (sorry so new to this whole thing)... Do you mean I need to apply for an API key?
Ok I have attached what I worked out in a zipped project file below this post, what it produces is this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Close, but no actual map is displayed... where did I go wrong?
Thanks for all the help
never-mind it appears I have fixed it ... what I did;
was missing a bunch of code, and the keystone had to match the one that was given to google api, I also had to enable the api from google develper control panel.
Seems to be working now! I am going to keep on tinkering with it, but this is the first map activity I have created... yaaaay