1

I've 2 activities with ProgressDialog.

First activities code:

@Override
    protected void onPreExecute() {
        super.onPreExecute();
        mProgressDialog = new ProgressDialog(ShowGuestPhoto.this);
        mProgressDialog.setTitle("Загрузка фотографий");
        mProgressDialog.setMessage("Загрузка..");
        mProgressDialog.setIndeterminate(false);
        mProgressDialog.show();
        Typeface avenirnextregular= Typeface.createFromAsset(getAssets(), "avenirnextregular.ttf");
        ((TextView) mProgressDialog.findViewById(getResources().getIdentifier("alertTitle", "id", "android"))).setTypeface(avenirnextregular);
    }

And here is screenshot how it look likes.

My second activities code:

Override
    protected void onPreExecute() {
        super.onPreExecute();
        mProgressDialog = new ProgressDialog(GiftsActivity.this);
        mProgressDialog.setTitle("Подарки");
        mProgressDialog.setMessage("Пожалуйста, подождите: обновляется список подарков");
        mProgressDialog.setIndeterminate(false);
        mProgressDialog.show();
        Typeface avenirnextregular= Typeface.createFromAsset(getAssets(), "avenirnextregular.ttf");
        ((TextView) mProgressDialog.findViewById(getResources().getIdentifier("alertTitle", "id", "android"))).setTypeface(avenirnextregular);
    }

And here is screenshot how it look likes.

The code is identicals!

And so i have 2 questions:

1. Why there are don't same?

2. How i can make ALL ProgressDialog in my app like on first screenshot?

Manifest:
 <activity android:name="com.appforwed.ShowGuestPhoto"
            android:screenOrientation="portrait"/>
<activity android:name="com.appforwed.GiftsActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>

UPD.

    <application
    android:allowBackup="true"
    android:largeHeap ="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@style/Theme.AppCompat.NoActionBar"
    android:name="com.photolab.Lab">
androidFan
  • 33
  • 6

1 Answers1

2
  1. Why there are don't same?

Each activity have different style applied, that's why they looks different.

  1. How i can make ALL ProgressDialog in my app like on first screenshot?

To make them look the same just create style themes child of the same parent, in your case is preferable Theme.AppCompat


You could create a custom style like this:

<style name="Theme.AppCompat.NoActionBar.FullScreen"  parent="@style/Theme.AppCompat">
   <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

And change @android:style/Theme.NoTitleBar.Fullscreen to your custom Theme.AppCompat.NoActionBar.FullScreen

For more info check this question related to your issue: Full Screen Theme for AppCompat

Hope it helps!

Надеюсь, поможет ;)

Community
  • 1
  • 1
Gueorgui Obregon
  • 5,077
  • 3
  • 33
  • 57