Android Open Source - PharmaApp Info Popup






From Project

Back to project page PharmaApp.

License

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.

Java Source Code

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();
    }
}




Java Source Code List

mobi.pharmaapp.models.DataModel.java
mobi.pharmaapp.models.UserModel.java
mobi.pharmaapp.util.JSONEmergencyPharmacyScraper.java
mobi.pharmaapp.util.JSONPharmacyScraper.java
mobi.pharmaapp.util.LocalConstants.java
mobi.pharmaapp.util.Location.java
mobi.pharmaapp.util.PharmacyAlphComparator.java
mobi.pharmaapp.util.PharmacyComparator.java
mobi.pharmaapp.util.Pharmacy.java
mobi.pharmaapp.view.AboutActivity.java
mobi.pharmaapp.view.DashboardLayout.java
mobi.pharmaapp.view.EmergencyPharmacistsActivity.java
mobi.pharmaapp.view.InfoPopup.java
mobi.pharmaapp.view.LoadDataDialog.java
mobi.pharmaapp.view.LoadEmergencyDataDialog.java
mobi.pharmaapp.view.LocateActivity.java
mobi.pharmaapp.view.MainActivity.java
mobi.pharmaapp.view.MapOverlayItem.java
mobi.pharmaapp.view.PharmacyAdapter.java
mobi.pharmaapp.view.SearchActivity.java