Taishi-Y / FlipProgressDialog

Airbnb like ProgressDialog with Image Flip Animation.🛌🍞✨
Apache License 2.0
104 stars 24 forks source link

Behavior different on earlier devices (4.4.2) #3

Open benzabill opened 7 years ago

benzabill commented 7 years ago

Hello! Great library.

Tested my app on a 4.4.2 device, and the dimensions of the dialog were wrong.

On recent device, showed up as a circle in the middle of screen.

On older device, showed up as an oval, with the icons showing off center.

image (ignore the red marks, had to obscure the text)

Taishi-Y commented 7 years ago

Thank you for reporting this issue! I'll figure out why it occurred..

I'm glad if you give me the code which you write for this screen shot.

Cheers!🎉

benzabill commented 7 years ago

I wrote the following helper class that wraps a flip progress button helper. I call show when i want to show. Hide when i want to hide.

import android.app.FragmentManager;
import android.graphics.Color;
import android.util.Log;

import com.taishi.flipprogressdialog.FlipProgressDialog;

import java.util.ArrayList;
import java.util.List;

class FlipProgressButtonHelper {

private static final String TAG = "FlipProgressBttnHelper";
FlipProgressDialog fpd;

public void showProgressButton(FragmentManager fragmentManager) {

    List<Integer> imageList = new ArrayList<Integer>();
    imageList.add(R.drawable.image1);
    imageList.add(R.drawable.image2);
    imageList.add(R.drawable.image3);
    try {

        fpd = new FlipProgressDialog();
        fpd.setImageList(imageList);

        fpd.setBackgroundColor(Color.parseColor("#FF1744"));
        fpd.setCornerRadius(200);
        fpd.setCanceledOnTouchOutside(false);
        fpd.setOrientation("rotationY");

        fpd.setDuration(600);

        fpd.show(fragmentManager, "");
    } catch (Exception e) {
        Log.i(TAG, "flip progress helper exception");
        e.printStackTrace();
    }
}

public void dismissFlipProgressButton() {
    if (fpd == null) {
        Log.i(TAG, "tried to dismiss null flip progress button helper");
        return;
    }
    try {
        fpd.dismiss();
    } catch (Exception e) {
        Log.i(TAG, "flip progress helper exception");
        e.printStackTrace();
    }
}

} `

benzabill commented 7 years ago

Hi Taishi! Any word on fixing this?

tank777 commented 7 years ago

@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); return dialog; }

add this to FlipProgressDialog.java

benzabill commented 7 years ago

Could you add this to the library/update dependency?