MCPcopy Create free account
hub / github.com/EXALAB/AnLinux-App / showFirstDialog

Method showFirstDialog

AnLinux/app/src/main/java/exa/lnx/a/MainUI.java:874–921  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

872 return a == b;
873 }
874 protected void showFirstDialog(){
875
876 final ViewGroup nullParent = null;
877
878 final AlertDialog.Builder builder = new AlertDialog.Builder(this);
879
880 LayoutInflater layoutInflater = LayoutInflater.from(this);
881 View view = layoutInflater.inflate(R.layout.first_warning, nullParent);
882 CheckBox checkBox = view.findViewById(R.id.checkBox);
883 builder.setView(view);
884 builder.setCancelable(false);
885 builder.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
886 public void onClick(DialogInterface dialog, int which){
887 SharedPreferences.Editor editor = sharedPreferences.edit();
888 editor.putBoolean("IsOreoNotified", true);
889 editor.apply();
890 isOreoNotified = sharedPreferences.getBoolean("IsOreoNotified", false);
891 new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
892 @Override
893 public void run() {
894 appOpenAdManager.showAdIfAvailable(MainUI.this, new AppOpenAdManager.OnShowAdCompleteListener() {
895 @Override
896 public void onShowAdComplete() {
897 // Empty because the user will go back to the activity that shows the ad.
898 showOpenAdsNow = false;
899 i = -1;
900 }
901 });
902 }
903 }, 1500);
904 dialog.dismiss();
905 }
906 });
907 final AlertDialog dialog = builder.create();
908 dialog.show();
909
910 dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
911 checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
912 @Override
913 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
914 if(isChecked){
915 dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
916 }else{
917 dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
918 }
919 }
920 });
921 }
922 protected void showFirstReportBugDialog(){
923
924 final ViewGroup nullParent = null;

Callers 1

onCreateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected