Back to project page PharmaApp.
The source code is released under:
MIT License
If you think the Android project PharmaApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mobi.pharmaapp.view; //from w ww.j a v a2s. c o m import android.app.ActionBar.LayoutParams; import android.app.Dialog; import android.content.Context; import android.text.util.Linkify; import android.util.TypedValue; import android.widget.LinearLayout; import android.widget.TextView; import java.util.regex.Pattern; import mobi.pharmaapp.R; import mobi.pharmaapp.util.Pharmacy; /** * * @author see /AUTHORS */ public class InfoPopup { public InfoPopup() { } public static void showPopup(final Context c, final Pharmacy a) { Dialog d = new Dialog(c); d.setContentView(R.layout.popup_layout); d.setTitle(a.getName()); ((TextView) d.findViewById(R.id.apo_name)).setText(c.getString(R.string.name) + ": " + a.getName()); ((TextView) d.findViewById(R.id.apo_address)).setText(c.getString(R.string.address) + ": " + a.getAddress()); ((TextView) d.findViewById(R.id.apo_zipcode)).setText(c.getString(R.string.zipcode) + ": " + a.getZipcode()); ((TextView) d.findViewById(R.id.apo_town)).setText(c.getString(R.string.town) + ": " + a.getTown()); if (!a.getTelnr().isEmpty()) { LinearLayout ll = (LinearLayout) d.findViewById(R.id.layout); TextView tel = new TextView(c); tel.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1)); tel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20); tel.setText(c.getString(R.string.tel) + ": " + a.getTelnr()); Linkify.addLinks(tel, Pattern.compile("\\+?(\\d){8,11}"), "tel:"); ll.addView(tel); } d.show(); } }