Archive for March, 2010

Another Splash Trick

Posted: March 31, 2010 in Android
Tags: , ,

You know if you set android :windowBackground to a drawable and set your Layout container to either  a background color or drawable that you get a nice very brief splash right? How could you use this?

As you know most of us recommend that use an activity as a dialog screen. You could use it to flash a splash screen for your dialogs as activities as youcan set a theme for each dialog activity.

Reblog this post [with Zemanta]
Advertisement

10,000 views

Posted: March 30, 2010 in Android
Tags:

This month this blog reaches 10,000 views largely due to the interest and views of the Android Development Knols. Thanks for all the views and thanks to all the comments.

Advance Tabs Knol

Posted: March 29, 2010 in Android
Tags: , ,

If you want ot change the tabs look ot something like this:

Thank read the Advance Tabs Knol.

That is a fully working custom set-up with text color changes, etc.  Basically, I used the concept that since its a view group(TabWidget) I can manipulate the child elements. If it was just a plain view than you still can grab the object and manipulate.

Why is this important? With iPhone you are limited to the application UI guidelines that Mr Steve jobs wants you to follow. On Android you are not and thus use the look and feel of the application to establish your brand.

Reblog this post [with Zemanta]

Tab Customization Sneak Peek

Posted: March 29, 2010 in Android
Tags: ,

Left to fix is the drawable, fix my image states. and the text colors as the text label is taking the default text colors. I had to switch co around and replace the bottom strip first and than replace the tab indicator:

for (int i =0; i < tabWidget.getChildCount(); i++) {
        	/**
             * set height and width
             * under TabActivity
             * setting width has no effect
             * due to fill_parent
             * layout parameter
             *
             */
            tabWidget.getChildAt(i).getLayoutParams().height = height;
            tabWidget.getChildAt(i).getLayoutParams().width = width;

            /**
             * In TabWidget:
             * void setDrawBottomStrips(boolean drawBottomStrips) {
             * mDrawBottomStrips = drawBottomStrips;
             * }
             *
             * is not public thus we use reflection
             */
            try {
               mBottomLeftStrip = tabWidget.getClass().getDeclaredField ("mBottomLeftStrip");
               mBottomRightStrip = tabWidget.getClass().getDeclaredField ("mBottomRightStrip");
               if(!mBottomLeftStrip.isAccessible()) {
                    mBottomLeftStrip.setAccessible(true);
               }
                if(!mBottomRightStrip.isAccessible()){
                    mBottomRightStrip.setAccessible(true);
                }
               mBottomLeftStrip.set(tabWidget, getResources().getDrawable (R.drawable.tabs_one));
                mBottomRightStrip.set(tabWidget, getResources().getDrawable (R.drawable.tabs_one));
            } catch (Exception e) {
                e.printStackTrace();
            }
        	View vvv = tabWidget.getChildAt(i);
        	/**
        	 * I kept all drawables in selector so that the
        	 * we could get correct drawablea applied to
        	 * tabs as the selector pointed to has
        	 * both the tabs and the bottom tab-bar
        	 * drawables referenced
        	 */
        	vvv.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_one_indicator));

        }
        

Bottom Tab strip Gone

Posted: March 28, 2010 in Android
Tags: , ,

I was able to remove the bottom strip off the tab bar:

Which means I should be able to also modify the dividers. The Advance Tab tutorial should be up in my Android Development Knols collection tonight.

Custom Tab Working

Posted: March 27, 2010 in Android
Tags: , ,

Its working. The solution is imperfect in that it will break when the API changes. The Knol tutorial should be up sometime today. in the Android U Design category. The main thing was to grab the drawables from he TAbWidget.

Tab Highlights Custom

Posted: March 27, 2010 in Android
Tags: , ,

I still have to fix some drawable selectors but its working:

Okay, now for the secret sauce:

        /**
         * grabs tab indicator drawables to fix
         */
        for (int i = 0; i &lt; tabs.getChildCount(); i++) {
            View vv = tabs.getChildAt(i);
            vv.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_indicator));
          }
        /**
         * grabs tabWidget drawables to fix
         */
        for (int i =0; i &lt; tabWidget.getChildCount(); i++) {
        	View vvv = tabWidget.getChildAt(i);
        	vvv.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bottom_left_right));
        }
    }

That sits in my onCreate method. the only bad things is it will break when the APi changes.

Reblog this post [with Zemanta]

Custom Highlights for Widgets

Posted: March 25, 2010 in Android
Tags: ,

While I am working customizing certain widgets to get customized highlights, you might want to look at MWilliford’s example of customizing highlights for those widgets/views you do not have to extend and customize.

Android Training

Posted: March 24, 2010 in Android
Tags:

I guess I should speak up about this. okay some background.  While both Apple’s iPhone OS and Google/OHA’s Android OS are  relatively new platforms(iPhone at almost 4 years and Android at 3), Android for application developers is still somewhat undocumented due to the Android team being somewhat smaller and having more stakeholders to hand-hold.

Thus, from the training perspective I could teach Android Application Programming  the same way that everyone else does. But, that would than leave without the skills to find out how to do something new. Whereas if I moved discussion of Android OS and SDK internals to beginning tutorials/classes, etc than you would have the tools to use to do new stuff when a new SDK comes out.

But than the problem is what application programming examples do I use to teach that going through the parts of the SDK or OS source to find  out how to do new stuff? Themes is an easy example as far as poking through SDK internals but what would be a good OS source one? Yes, developing a replacement HomeScreen is a good example but I want a smaller one dev-time-wise.

That is why you are seeing only one tutorial per day posted as I am attempting to determine how this could be done in an android training that makes sense and is implementable.