|
@@ -3,17 +3,20 @@ package com.epson.mobilephone.common.wifidirect;
|
|
import android.app.Dialog;
|
|
import android.app.Dialog;
|
|
import android.content.DialogInterface;
|
|
import android.content.DialogInterface;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-import android.support.p000v4.app.FragmentManager;
|
|
|
|
-
|
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
+import androidx.annotation.NonNull;
|
|
|
|
+import androidx.annotation.Nullable;
|
|
|
|
+import androidx.appcompat.app.AlertDialog;
|
|
|
|
+import androidx.fragment.app.DialogFragment;
|
|
|
|
+import androidx.fragment.app.FragmentManager;
|
|
|
|
+
|
|
|
|
+import epson.print.R;
|
|
|
|
+
|
|
public class DialogProgressWiFiDirect extends DialogFragment {
|
|
public class DialogProgressWiFiDirect extends DialogFragment {
|
|
public static final int MESSAGE_BOTTOM = 1;
|
|
public static final int MESSAGE_BOTTOM = 1;
|
|
public static final int MESSAGE_ONLY = 2;
|
|
public static final int MESSAGE_ONLY = 2;
|
|
@@ -52,15 +55,15 @@ public class DialogProgressWiFiDirect extends DialogFragment {
|
|
bundle.putString(TAG_POSITIVE_MESSAGE, str4);
|
|
bundle.putString(TAG_POSITIVE_MESSAGE, str4);
|
|
bundle.putString(TAG_NEUTRAL_MESSAGE, str5);
|
|
bundle.putString(TAG_NEUTRAL_MESSAGE, str5);
|
|
bundle.putString(TAG_NEGATIVE_MESSAGE, str6);
|
|
bundle.putString(TAG_NEGATIVE_MESSAGE, str6);
|
|
- dialogProgressWiFiDirect.setArguments(bundle);
|
|
|
|
|
|
+ setArguments(bundle);
|
|
return dialogProgressWiFiDirect;
|
|
return dialogProgressWiFiDirect;
|
|
}
|
|
}
|
|
|
|
|
|
private void deleteFragment(FragmentManager fragmentManager, String str) {
|
|
private void deleteFragment(FragmentManager fragmentManager, String str) {
|
|
Dialog dialog;
|
|
Dialog dialog;
|
|
DialogProgressWiFiDirect dialogProgressWiFiDirect = (DialogProgressWiFiDirect) fragmentManager.findFragmentByTag(str);
|
|
DialogProgressWiFiDirect dialogProgressWiFiDirect = (DialogProgressWiFiDirect) fragmentManager.findFragmentByTag(str);
|
|
- if (dialogProgressWiFiDirect != null && (dialog = dialogProgressWiFiDirect.getDialog()) != null && dialog.isShowing()) {
|
|
|
|
- dialogProgressWiFiDirect.dismiss();
|
|
|
|
|
|
+ if (dialogProgressWiFiDirect != null && (dialog = getDialog()) != null && dialog.isShowing()) {
|
|
|
|
+ dismiss();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -81,54 +84,54 @@ public class DialogProgressWiFiDirect extends DialogFragment {
|
|
mActivity = null;
|
|
mActivity = null;
|
|
}
|
|
}
|
|
if (string2 != null) {
|
|
if (string2 != null) {
|
|
- builder.setTitle((CharSequence) string2);
|
|
|
|
|
|
+ builder.setTitle(string2);
|
|
}
|
|
}
|
|
if (string3 != null) {
|
|
if (string3 != null) {
|
|
- builder.setPositiveButton((CharSequence) string3, (DialogInterface.OnClickListener) new DialogInterface.OnClickListener() {
|
|
|
|
|
|
+ builder.setPositiveButton(string3, new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- DialogProgressWiFiDirect.this.dismiss();
|
|
|
|
- if (DialogProgressWiFiDirect.mActivity != null) {
|
|
|
|
- DialogProgressWiFiDirect.mActivity.onPositiveClick(DialogProgressWiFiDirect.mTag);
|
|
|
|
|
|
+ dismiss();
|
|
|
|
+ if (mActivity != null) {
|
|
|
|
+ mActivity.onPositiveClick(mTag);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if (string4 != null) {
|
|
if (string4 != null) {
|
|
- builder.setNeutralButton((CharSequence) string4, (DialogInterface.OnClickListener) new DialogInterface.OnClickListener() {
|
|
|
|
|
|
+ builder.setNeutralButton(string4, new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- DialogProgressWiFiDirect.this.dismiss();
|
|
|
|
- if (DialogProgressWiFiDirect.mActivity != null) {
|
|
|
|
- DialogProgressWiFiDirect.mActivity.onNeutralClick(DialogProgressWiFiDirect.mTag);
|
|
|
|
|
|
+ dismiss();
|
|
|
|
+ if (mActivity != null) {
|
|
|
|
+ mActivity.onNeutralClick(mTag);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if (string5 != null) {
|
|
if (string5 != null) {
|
|
- builder.setNegativeButton((CharSequence) string5, (DialogInterface.OnClickListener) new DialogInterface.OnClickListener() {
|
|
|
|
|
|
+ builder.setNegativeButton(string5, new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- DialogProgressWiFiDirect.this.dismiss();
|
|
|
|
- if (DialogProgressWiFiDirect.mActivity != null) {
|
|
|
|
- DialogProgressWiFiDirect.mActivity.onNegativeClick(DialogProgressWiFiDirect.mTag);
|
|
|
|
|
|
+ dismiss();
|
|
|
|
+ if (mActivity != null) {
|
|
|
|
+ mActivity.onNegativeClick(mTag);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- ProgressBar progressBar = (ProgressBar) inflate.findViewById(R.C1115id.dialog_progress_id);
|
|
|
|
|
|
+ ProgressBar progressBar = (ProgressBar) inflate.findViewById(R.id.dialog_progress_id);
|
|
if (i == 1) {
|
|
if (i == 1) {
|
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) progressBar.getLayoutParams();
|
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) progressBar.getLayoutParams();
|
|
layoutParams.addRule(14);
|
|
layoutParams.addRule(14);
|
|
progressBar.setLayoutParams(layoutParams);
|
|
progressBar.setLayoutParams(layoutParams);
|
|
- TextView textView = (TextView) inflate.findViewById(R.C1115id.dialog_progress_text_bottom);
|
|
|
|
|
|
+ TextView textView = (TextView) inflate.findViewById(R.id.dialog_progress_text_bottom);
|
|
textView.setText(string);
|
|
textView.setText(string);
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
textView.setVisibility(View.VISIBLE);
|
|
textView.setVisibility(View.VISIBLE);
|
|
} else if (i == 0) {
|
|
} else if (i == 0) {
|
|
- TextView textView2 = (TextView) inflate.findViewById(R.C1115id.dialog_progress_text_right);
|
|
|
|
|
|
+ TextView textView2 = (TextView) inflate.findViewById(R.id.dialog_progress_text_right);
|
|
textView2.setText(string);
|
|
textView2.setText(string);
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
progressBar.setVisibility(View.VISIBLE);
|
|
textView2.setVisibility(View.VISIBLE);
|
|
textView2.setVisibility(View.VISIBLE);
|
|
} else {
|
|
} else {
|
|
- TextView textView3 = (TextView) inflate.findViewById(R.C1115id.dialog_progress_text_right);
|
|
|
|
|
|
+ TextView textView3 = (TextView) inflate.findViewById(R.id.dialog_progress_text_right);
|
|
textView3.setText(string);
|
|
textView3.setText(string);
|
|
textView3.setVisibility(View.VISIBLE);
|
|
textView3.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|