Skip to content

How to change the background of the waiting dialog. #30

Open

Description

@freeschool

Hi,

When a user picks the google drive file, the waiting dialog is displayed.

Screenshot_20221011-094410_Trimble SiteVision

This is the original screen before calling the Native File Picker plugin. As you can see, only three items are listed.

While displaying the waiting dialog.

Screenshot_20221011-094323_Trimble SiteVision

The background image shows the previous list image (before deleting items)

How can I make it a black-colored background or the correct image?

Activity

  1. yasirkula commented on Oct 10, 2022

    @yasirkula
    Owner

    You can modify the native NativeFilePickerPickResultFragment source code in Android Studio:

    public Dialog onCreateDialog( Bundle savedInstanceState )
    {
    // Credit: https://stackoverflow.com/a/49272722/2373034
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT );
    layoutParams.gravity = Gravity.CENTER;
    LinearLayout layout = new LinearLayout( getActivity() );
    layout.setOrientation( LinearLayout.VERTICAL );
    layout.setPadding( 30, 30, 30, 30 );
    layout.setGravity( Gravity.CENTER );
    layout.setLayoutParams( layoutParams );
    layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT );
    layoutParams.gravity = Gravity.CENTER;
    layoutParams.width = (int) ( 175 * getActivity().getResources().getDisplayMetrics().density );
    progressBar = new ProgressBar( getActivity(), null, android.R.attr.progressBarStyleHorizontal );
    progressBar.setIndeterminate( true );
    progressBar.setPadding( 0, 30, 0, 0 );
    progressBar.setLayoutParams( layoutParams );
    if( progressBarLabel != null && progressBarLabel.length() > 0 )
    {
    layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT );
    layoutParams.gravity = Gravity.CENTER;
    TextView progressBarText = new TextView( getActivity() );
    progressBarText.setText( progressBarLabel );
    progressBarText.setTextColor( Color.BLACK );
    progressBarText.setTextSize( 20 );
    progressBarText.setLayoutParams( layoutParams );
    layout.addView( progressBarText );
    }
    layout.addView( progressBar );
    AlertDialog dialog = new AlertDialog.Builder( getActivity() )
    .setNegativeButton( android.R.string.cancel, new DialogInterface.OnClickListener()
    {
    @Override
    public void onClick( DialogInterface dialog, int which )
    {
    resultOperation.cancel();
    resultOperation.sendResultToUnity();
    dismiss();
    }
    } )
    .setCancelable( false )
    .setView( layout ).create();
    dialog.setCancelable( false );
    dialog.setCanceledOnTouchOutside( false );
    return dialog;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions