Note that there are some explanatory texts on larger screens.

plurals
  1. POProgress Dialog not aligned in the ActionBarSherlock after API Level 11+
    primarykey
    data
    text
    <p>In my Project i have add Library ActionBar Sherlock and create the custom theme for my project.</p> <p>I have created custom theme from <a href="http://jgilfelt.github.io/android-actionbarstylegenerator/" rel="nofollow noreferrer">here</a>. But after applying the theme my Progress Dialog in not aligned(means not displayed in the center of screen).</p> <p>Please not this issue appears in API Level 11 or above.<br> Here i have attached the screen shot of emulator running OS 4.2.2.</p> <p>I am unable to figure out this issue...</p> <p><strong>ScreenShot ::</strong> </p> <p><img src="https://i.stack.imgur.com/1a9H1.png" alt="enter image description here"></p> <p><strong>MyCustomTheme ::(values folder)</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;style name="Theme.Custom_ThemeSherlockLight" parent="@style/Theme.Sherlock.Light"&gt; &lt;item name="actionBarItemBackground"&gt;@drawable/selectable_background_exampthemesherlocklightle&lt;/item&gt; &lt;item name="popupMenuStyle"&gt;@style/PopupMenu.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="dropDownListViewStyle"&gt;@style/DropDownListView.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="actionBarTabStyle"&gt;@style/ActionBarTabStyle.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="actionDropDownStyle"&gt;@style/DropDownNav.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="actionBarStyle"&gt;@style/ActionBar.Solid.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="actionModeBackground"&gt;@drawable/cab_background_top_exampthemesherlocklightle&lt;/item&gt; &lt;item name="actionModeSplitBackground"&gt;@drawable/cab_background_bottom_exampthemesherlocklightle&lt;/item&gt; &lt;item name="actionModeCloseButtonStyle"&gt;@style/ActionButton.CloseMode.Custom_ThemeSherlockLight&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Solid.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"&gt; &lt;item name="background"&gt;@drawable/ab_solid_exampthemesherlocklightle&lt;/item&gt; &lt;item name="backgroundStacked"&gt;@drawable/ab_stacked_solid_exampthemesherlocklightle&lt;/item&gt; &lt;item name="backgroundSplit"&gt;@drawable/ab_bottom_solid_exampthemesherlocklightle&lt;/item&gt; &lt;item name="progressBarStyle"&gt;@style/ProgressBar.Custom_ThemeSherlockLight&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Transparent.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ActionBar"&gt; &lt;item name="background"&gt;@drawable/ab_transparent_exampthemesherlocklightle&lt;/item&gt; &lt;item name="progressBarStyle"&gt;@style/ProgressBar.Custom_ThemeSherlockLight&lt;/item&gt; &lt;/style&gt; &lt;style name="PopupMenu.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ListPopupWindow"&gt; &lt;item name="android:popupBackground"&gt;@drawable/menu_dropdown_panel_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;style name="DropDownListView.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ListView.DropDown"&gt; &lt;item name="android:listSelector"&gt;@drawable/selectable_background_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBarTabStyle.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ActionBar.TabView"&gt; &lt;item name="android:background"&gt;@drawable/tab_indicator_ab_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;style name="DropDownNav.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar"&gt; &lt;item name="android:background"&gt;@drawable/spinner_background_ab_exampthemesherlocklightle&lt;/item&gt; &lt;item name="android:popupBackground"&gt;@drawable/menu_dropdown_panel_exampthemesherlocklightle&lt;/item&gt; &lt;item name="android:dropDownSelector"&gt;@drawable/selectable_background_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;style name="ProgressBar.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ProgressBar.Horizontal"&gt; &lt;item name="android:progressDrawable"&gt;@drawable/progress_horizontal_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionButton.CloseMode.Custom_ThemeSherlockLight" parent="@style/Widget.Sherlock.Light.ActionButton.CloseMode"&gt; &lt;item name="android:background"&gt;@drawable/btn_cab_done_exampthemesherlocklightle&lt;/item&gt; &lt;/style&gt; &lt;!-- this style is only referenced in a Light.DarkActionBar based theme --&gt; &lt;style name="Theme.Custom_ThemeSherlockLight.Widget" parent="@style/Theme.Sherlock"&gt; &lt;item name="popupMenuStyle"&gt;@style/PopupMenu.Custom_ThemeSherlockLight&lt;/item&gt; &lt;item name="dropDownListViewStyle"&gt;@style/DropDownListView.Custom_ThemeSherlockLight&lt;/item&gt; &lt;/style&gt; &lt;style name="Theme.Sherlock.Translucent" parent="@style/Theme.Sherlock"&gt; &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt; &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt; &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt; &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt; &lt;item name="android:backgroundDimEnabled"&gt;false&lt;/item&gt; &lt;item name="android:backgroundDimEnabled"&gt;true&lt;/item&gt; &lt;/style&gt; &lt;style name="Theme.Translucent" parent="@android:style/Theme.Translucent"&gt; &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt; &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;item name="android:backgroundDimEnabled"&gt;true&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p><strong>AndroidManifest.xml ::</strong> </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testproject" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Custom_ThemeSherlockLight" &gt; &lt;activity android:name="com.example.testproject.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><strong>MainActivity.java</strong></p> <pre><code>public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ProgressDialog pDialog=new ProgressDialog(this); pDialog =ProgressDialog.show(this,null, "Please Wait..", true); pDialog.setContentView(R.layout.progress); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } </code></pre> <p><strong>progress.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="130dp" android:layout_height="80dp" android:background="@android:color/transparent" android:gravity="center" android:orientation="vertical" &gt; &lt;ProgressBar android:id="@+id/progress" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:gravity="center" android:text="Please wait.." android:textColor="@color/black" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload