Search code examples
androidandroid-holo-everywhere

What's a correct way of using HoloEverywhere


I'm trying to use dev branch of HoloEverywhere library to in my app. I understood that this is still during development but the demo seems to work okay so I give it a try.

I put android:theme="@style/Holo.Theme.Sherlock.Light" in the activity in my manifest. The structure of the activity is that it's using Fragment, one is a list and another is just Fragment. The ActionBar looks Holo just fine.

I turned my SherlockFragmentActivity into SActivity and Fragment into SFragment. Just as I checked in the accompanied demo app. I open dialog using this block of code in my SFragment.

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle("Work in Progress")
            .setView(inflater.inflate(R.layout.extra_input))
            .setIcon(R.drawable.icon);
    builder.setPositiveButton("Positive", null);
    builder.setNegativeButton("Negative", null);
    builder.setNeutralButton("Neutral", null);
    builder.show();

The dialog popped up looking like the OS's AlertDialog where EditText inside extra_input layout shown as Holo. ProgressDialog also display with OS's theme as well.

I believed this is me incorrectly implemented the library. The question is how to do it right?

Edit: Solved it, I need to use com.WazaBe.HoloEverywhere.app.AlertDialog instead of android.app.AlertDialog. Silly me.


Solution

  • Solved it, I need to use com.WazaBe.HoloEverywhere.app.AlertDialog instead of android.app.AlertDialog. Silly me.

    Answer added as recommended.