|
@ -40,6 +40,7 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter |
|
|
private CustomAlertDialog customAlertDialog; |
|
|
private CustomAlertDialog customAlertDialog; |
|
|
|
|
|
|
|
|
private boolean shouldEnableAppScreenShot = true; |
|
|
private boolean shouldEnableAppScreenShot = true; |
|
|
|
|
|
private boolean shouldallowDefaultActivityTransition = false; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) { |
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) { |
|
@ -47,7 +48,8 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter |
|
|
if (!shouldEnableAppScreenShot) { |
|
|
if (!shouldEnableAppScreenShot) { |
|
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); |
|
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); |
|
|
} |
|
|
} |
|
|
overridePendingTransition(0,0); |
|
|
|
|
|
|
|
|
if (!shouldallowDefaultActivityTransition) |
|
|
|
|
|
overridePendingTransition(0, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -88,6 +90,10 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter |
|
|
this.shouldEnableAppScreenShot = action; |
|
|
this.shouldEnableAppScreenShot = action; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void allowDefaultActivityTransition(boolean action) { |
|
|
|
|
|
this.shouldallowDefaultActivityTransition = action; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void showPopUpMessage(String message, CustomAlertDialog.AlertType alertType, CustomAlertDialog.CustomDialogActionListener listener) { |
|
|
public void showPopUpMessage(String message, CustomAlertDialog.AlertType alertType, CustomAlertDialog.CustomDialogActionListener listener) { |
|
|
try { |
|
|
try { |
|
@ -111,9 +117,9 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void showToastMessage(String message) { |
|
|
public void showToastMessage(String message) { |
|
|
Toast toast=Toast.makeText(this, message, Toast.LENGTH_SHORT); |
|
|
|
|
|
|
|
|
Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT); |
|
|
TextView v = (TextView) toast.getView().findViewById(android.R.id.message); |
|
|
TextView v = (TextView) toast.getView().findViewById(android.R.id.message); |
|
|
if( v != null) v.setGravity(Gravity.CENTER); |
|
|
|
|
|
|
|
|
if (v != null) v.setGravity(Gravity.CENTER); |
|
|
toast.show(); |
|
|
toast.show(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -192,6 +198,6 @@ public class BaseActivity extends AppCompatActivity implements BaseContractInter |
|
|
@Override |
|
|
@Override |
|
|
public void finish() { |
|
|
public void finish() { |
|
|
super.finish(); |
|
|
super.finish(); |
|
|
overridePendingTransition(0,0); |
|
|
|
|
|
|
|
|
overridePendingTransition(0, 0); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |