Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Dialog showPopupOneButton(String popupType, String messsage, Context context, View.OnClickListener listener) {
- final Dialog common_one_button_popup = new Dialog(context); // Bir dialog olustur
- common_one_button_popup.setCancelable(false);
- common_one_button_popup.requestWindowFeature(Window.FEATURE_NO_TITLE); // Dialog basligini
- common_one_button_popup.setContentView(R.layout.popup_common_one_button);
- // viewlari getir
- ImageView imageViewCommonPopupType = (ImageView) common_one_button_popup.findViewById(R.id.imageViewCommonPopupType);
- LoginFontTextView textViewCommonPopupType = (LoginFontTextView) common_one_button_popup.findViewById(R.id.textViewCommonPopupType);
- LoginFontTextView textViewCommonPopupInfo = (LoginFontTextView) common_one_button_popup.findViewById(R.id.textViewCommonPopupInfo);
- Button buttonCommonPopup = (Button) common_one_button_popup.findViewById(R.id.buttonCommonPopup);
- Typeface typeFaceBold = Typeface.createFromAsset(context.getAssets(), "fonts/Turkcell_Satura_Bold.ttf");
- buttonCommonPopup.setTypeface(typeFaceBold);
- // ture gore basliklari sekillendir
- if (popupTypeError.equalsIgnoreCase(popupType)) {
- imageViewCommonPopupType.setImageResource(R.drawable.commonpopuperror);
- textViewCommonPopupType.setText(context.getString(R.string.commonPopupHeaderError));
- } else if (popupTypeCaution.equalsIgnoreCase(popupType)) {
- imageViewCommonPopupType.setImageResource(R.drawable.commonpopupcaution);
- textViewCommonPopupType.setText(context.getString(R.string.commonPopupHeaderCaution));
- } else if (popupTypePositive.equalsIgnoreCase(popupType)) {
- imageViewCommonPopupType.setImageResource(R.drawable.commonpopuppositive);
- textViewCommonPopupType.setText(context.getString(R.string.commonPopupHeaderPositive));
- } else if (popupTypeInformation.equalsIgnoreCase(popupType)) {
- imageViewCommonPopupType.setImageResource(R.drawable.commonpopupinfo);
- textViewCommonPopupType.setText(context.getString(R.string.commonPopupHeaderInfo));
- } else if (popupTypeApproval.equalsIgnoreCase(popupType)) {
- imageViewCommonPopupType.setImageResource(R.drawable.commonpopupinfo);
- textViewCommonPopupType.setText(context.getString(R.string.commonPopupHeaderApproval));
- }
- // mesaji set et
- textViewCommonPopupInfo.setText(messsage);
- // popun in listenerlari
- if (listener == null)
- buttonCommonPopup.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- common_one_button_popup.dismiss();
- }
- });
- else
- buttonCommonPopup.setOnClickListener(listener);
- // Popupi goster
- common_one_button_popup.show();
- return common_one_button_popup;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement