android-ui

How to customize ActionBar in Android (ActionbarSherlock)?

人走茶凉 提交于 2019-12-06 12:18:54
问题 I have used ActionBarSherlock in my application for providing ActionBars to pre honeycomb devices. I want to use Light.DarkActionBar Theme in, How can I customize following for parts of the ActionBar (see image) Background color of ActionBar Background Image for ActionBar tab bar The bottom line which represents the selected tab The divider between tabs... I have tried using following settings, Though I have achieved some success but the result however doesn't look as expected, <item name=

What is the use of 9patch PNG?

倖福魔咒の 提交于 2019-12-06 10:32:27
I read article (Android Developers) on 9patch PNG in Android. But I'm not getting what is the real use of it ? If i use Gradient Image then it is going to behave same as 9Patch PNG. I had discussion with my graphics designer, he was telling me that it is same as Image Repeat used in CSS. Is it so ? -Thanks No it's not the same. Think about a button you want to give a new look. With the 9patch way you simply design your button's design in a image editing program like e.g. Photoshop and save it to a png file. After this you open it with the Android SDK's 9patch png tool and define the areas

Toast message not shown

限于喜欢 提交于 2019-12-06 10:13:21
问题 I am trying to show a toast message in my application using the following code. AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("Do you want to continue?"); alert.setPositiveButton("Continue", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { try{ //This code generates an Activity Not Found exception } catch(ActivityNotFoundException e) { System.out.println("Activity Not Found Exception Raised"); Toast.makeText

Custom Tab bar in Android

我们两清 提交于 2019-12-06 09:36:00
Is it possible to customize tab bar in android? Customize in the sense, like in iPhone, the tab bar is at the bottom of the screen; in Android, can we place the tab bar at the bottom and its content on top of it? Herry Yes It is Possible to make custom Tab Bar in android like as in iphone you can get that from link . visit here 来源: https://stackoverflow.com/questions/3911887/custom-tab-bar-in-android

Navigation Drawer - Slowly animate menu items

流过昼夜 提交于 2019-12-06 09:23:29
I've implemented a DrawerLayout with this tutorial and everything works fine. @Override public boolean onPrepareOptionsMenu(Menu menu) { // if nav drawer is opened, hide the action items boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList); menu.findItem(R.id.action_settings).setVisible(!drawerOpen); return super.onPrepareOptionsMenu(menu); } onPrepareOptionsMenu simply toggles the menu visibility in one shot. But I'd like to slowly animate the alpha value of my menu items as the drawer slides. i want it should be invisible slowly while opening the navigation drawer A really simple way

How do I update the state of a ProgressBar on every element of a GridView / ListView?

徘徊边缘 提交于 2019-12-06 07:36:56
问题 Currently I have a GridView, and every element should have a separate ProgressBar. The elements represent separate downloads, and I'd like to show the state of the downloads using these ProgressBars. But how should I update them? My problem is, that according to the docs (and what I've heard on the Google IO videos), the only way to update elements in AdapterViews is to update the assigned adapter, and call .notifyDatasetChanged() after every update. Of course this does actually work in this

How to block UI for some seconds in android?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:27:40
问题 How can i block UI from all interactions for some seconds by user in Android? I would like to know, how to do this with some delay timing like wait(5000); 回答1: You can override dispatchTouchEvent and stop the call to super.dispatchTouchEvent(ev); Any touch event will have to go through this method before it is handled. Set a boolean that you control and use it in the method to determine whether you wish to block control. private boolean stopUserInteractions = false; public boolean

How to draw on ActionBar tab when using ActionBarSherlock in Android?

这一生的挚爱 提交于 2019-12-06 06:37:57
问题 I am using ActionBarSherlock to provide ActionBars for pre HoneyComb devices. My Activity has four fragments namely 1. User 2. Chat 3. Video 4. Extra, see image I have created actionBar using following code:- actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setTitle("Meeting"); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(false); actionBar.setDisplayShowTitleEnabled(false); /* Set Custom view */

How to keep actionbar fixed across all activities?

时光怂恿深爱的人放手 提交于 2019-12-06 05:40:57
In the Facebook app v2.3, when you navigate from one activity(or frgament?) to another, the actionbar stays fixed across all activities(or fragments?). For example, If you navigate from you news feed to someone's profile page, then the action bar stays constant, and the page below is refreshed. So my question is, is it possible to have this behavior using only activities? Or should i just have one main activity, and fragments for all sub activities? One activity and as many fragments as you need. the moment you call startActivity(intent); the framework will roll the activity transition

Android gridview skip cell

限于喜欢 提交于 2019-12-06 03:32:59
How can I skip some cells in grid view. I mean I have next source: public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new