Example usage for android.graphics Color WHITE

List of usage examples for android.graphics Color WHITE

Introduction

In this page you can find the example usage for android.graphics Color WHITE.

Prototype

int WHITE

To view the source code for android.graphics Color WHITE.

Click Source Link

Usage

From source file:com.nttec.everychan.ui.gallery.GalleryActivity.java

private Spanned getSpannedText(String message) {
    message = " " + message + " ";
    SpannableStringBuilder spanned = new SpannableStringBuilder(message);
    for (Object span : new Object[] { new ForegroundColorSpan(Color.WHITE),
            new BackgroundColorSpan(Color.parseColor("#88000000")) }) {
        spanned.setSpan(span, 0, message.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    }/*from  w  w w . ja  v  a2  s  . c  om*/
    return spanned;
}

From source file:com.zertinteractive.wallpaper.MainActivity.java

private void initRecyclerView(int mColumn) {
    recyclerView = (RecyclerView) findViewById(R.id.recycler);
    recyclerView.setBackgroundColor(Color.WHITE);
    recyclerView.setLayoutManager(new GridLayoutManager(this, mColumn));
    //        recyclerView.addItemDecoration(new SpacesItemDecoration(2));
}

From source file:com.zertinteractive.wallpaper.MainActivity.java

private void setRecyclerAdapter(List<ViewModel> mViewModels, String mTitle) {
    setTitle(mTitle);/*from w w  w . j ava2  s  . com*/
    RecyclerViewAdapter adapter = new RecyclerViewAdapter(mViewModels, this);
    adapter.setOnItemClickListener(this);
    recyclerView.setAdapter(adapter);
    recyclerView.scheduleLayoutAnimation();
    recyclerView.setBackgroundColor(Color.WHITE);
    mAdView.setVisibility(View.VISIBLE);
}

From source file:com.hichinaschool.flashcards.anki.StudyOptionsFragment.java

private void updateChart(double[][] serieslist) {
    if (mSmallChart != null) {
        Resources res = getResources();
        XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
        XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
        XYSeriesRenderer r = new XYSeriesRenderer();
        r.setColor(res.getColor(R.color.stats_young));
        renderer.addSeriesRenderer(r);// w  w  w.  ja  va  2  s .c o  m
        r = new XYSeriesRenderer();
        r.setColor(res.getColor(R.color.stats_mature));
        renderer.addSeriesRenderer(r);

        for (int i = 1; i < serieslist.length; i++) {
            XYSeries series = new XYSeries("");
            for (int j = 0; j < serieslist[i].length; j++) {
                series.add(serieslist[0][j], serieslist[i][j]);
            }
            dataset.addSeries(series);
        }
        renderer.setBarSpacing(0.4);
        renderer.setShowLegend(false);
        renderer.setLabelsTextSize(13);
        renderer.setXAxisMin(-0.5);
        renderer.setXAxisMax(7.5);
        renderer.setYAxisMin(0);
        renderer.setGridColor(Color.LTGRAY);
        renderer.setShowGrid(true);
        renderer.setBackgroundColor(Color.WHITE);
        renderer.setMarginsColor(Color.WHITE);
        renderer.setAxesColor(Color.BLACK);
        renderer.setLabelsColor(Color.BLACK);
        renderer.setYLabelsColor(0, Color.BLACK);
        renderer.setYLabelsAngle(-90);
        renderer.setXLabelsColor(Color.BLACK);
        renderer.setXLabelsAlign(Align.CENTER);
        renderer.setYLabelsAlign(Align.CENTER);
        renderer.setZoomEnabled(false, false);
        // mRenderer.setMargins(new int[] { 15, 48, 30, 10 });
        renderer.setAntialiasing(true);
        renderer.setPanEnabled(true, false);
        GraphicalView chartView = ChartFactory.getBarChartView(getActivity(), dataset, renderer,
                BarChart.Type.STACKED);
        mSmallChart.addView(chartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        if (mDeckChart.getVisibility() == View.INVISIBLE) {
            mDeckChart.setVisibility(View.VISIBLE);
            mDeckChart.setAnimation(ViewAnimation.fade(ViewAnimation.FADE_IN, 500, 0));
        }
    }
}

From source file:bizapps.com.healthforusPatient.activity.RegisterActivity.java

public void termsDialog(String title, String text) {
    final Dialog dialog = new Dialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
    dialog.setContentView(R.layout.terms_layout);

    TextView titleTv = (TextView) dialog.findViewById(R.id.title_text);
    titleTv.setText(title);//  ww  w.  j  ava 2  s  .  c o m
    ImageView imgView = (ImageView) dialog.findViewById(R.id.imageView1);
    imgView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.cancel();
        }
    });

    String terms = "";
    if (text.equalsIgnoreCase("pp")) {
        terms = "Welcome to Medico4us!\n"
                + "These terms and conditions outline the rules and regulations for the use of Medico4us Website/Application. \n"
                + "By accessing this website, we assume you accept these terms and conditions in full. Do not continue to use Medico4us application or website if you do not accept all of the terms and conditions stated on this page.\n"
                + "The following terminology applies to these Terms and Conditions, Privacy Statement and Disclaimer Notice and any or all Agreements: \"Client\", You? and Your? refers to you, the person accessing this website and accepting the Companys terms and conditions. \"The Company\", Ourselves?, We?, Our? and \"Us\", refers to our Company. Party?, Parties?, or Us?, refers to both the Client and ourselves, or either the Client or ourselves. All terms refer to the offer, acceptance and consideration of payment necessary to undertake the process of our assistance to the Client in the most appropriate manner, whether by formal meetings of a fixed duration, or any other means, for the express purpose of meeting the Clients needs in respect of provision of the Companys stated services/products, in accordance with and subject to, prevailing law of India. Any use of the above terminology or other words in the singular, plural, capitalization and/or he/she or they, are taken as interchangeable and therefore as referring to same.\n"
                + "Cookies\n"
                + "We employ the use of cookies. By using Medico4us website you consent to the use of cookies in accordance with Medico4us privacy policy.\n"
                + "Most of the modern day interactive web sites/ applications use cookies to enable us to retrieve user details for each visit. Cookies are used in some areas of our site to enable the functionality of this area and ease of use for those people visiting. Some of our affiliate / advertising partners may also use cookies.\n"
                + "License\n"
                + "Unless otherwise stated, Medico4us and/or its licensors own the intellectual property rights for all material on Medico4us All intellectual property rights are reserved. You may view and/or print pages for your own personal use subject to restrictions set in these terms and conditions.\n"
                + "You must not:\n" + "Republish material from Medico4us\n"
                + "Sell, rent or sub-license material fromMedico4us\n"
                + "Reproduce, duplicate or copy material from Medico4us\n"
                + "Redistribute content from Medico4us (unless content is specifically made for redistribution).\n"
                + "\n" + "User Comments\n" + "This Agreement shall begin on the date hereof.\n"
                + "Certain parts of this application/website offer the opportunity for users to post and exchange opinions, information, material and data ('Comments') in areas of the feedback(website/application). Medico4us does not screen, edit, publish or review Comments prior to their appearance on the website and Comments do not reflect the views or opinions of Medico4us, its agents or affiliates. Comments reflect the view and opinion of the person who posts such view or opinion. To the extent permitted by applicable laws Medico4us shall not be responsible or liable for the Comments or for any loss cost, liability, damages or expenses caused and or suffered as a result of any use of and/or posting of and/or appearance of the Comments on this website/application.\n"
                + "Medico4us reserves the right to monitor all Comments and to remove any Comments which it considers in its absolute discretion to be inappropriate, offensive or otherwise in breach of these Terms and Conditions.\n"
                + "You warrant and represent that: You are entitled to post the Comments on our website and have all necessary licenses and consents to do so;\n"
                + "The Comments do not infringe any intellectual property right, including without limitation copyright, patent or trademark, or other proprietary right of any third party;\n"
                + "The Comments do not contain any defamatory, libelous, offensive, indecent or otherwise unlawful material or material which is an invasion of privacy\n"
                + "The Comments will not be used to solicit or promote business or custom or present commercial activities or unlawful activity.\n"
                + "You hereby grant to Medico4us a non-exclusive royalty-free license to use, reproduce, edit and authorize others to use, reproduce and edit any of your Comments in any and all forms, formats or media.\n"
                + "Hyperlinking to our Content\n"
                + "The following organizations may link to our Web site without prior written approval:\n"
                + "Government agencies;\n" + "Search engines;\n" + "News organizations;\n" + "\n"
                + "Online directory distributors when they list us in the directory may link to our Web site/application in the same manner as they hyperlink to the Web sites of other listed businesses; and System wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and its products or services; and (c) fits within the context of the linking party's site.\n"
                + "We may consider and approve in our sole discretion other link requests from the following types of organizations:\n"
                + "Commonly-known consumer and/or business information sources such as Chambers of Commerce, community sites; associations or other groups representing charities, including charity giving sites, online directory distributors; internet portals; accounting, law and consulting firms whose primary clients are businesses; and trade associations.\n"
                + "We will approve link requests from these organizations if we determine that: (a) the link would not reflect unfavorably on us or our accredited businesses (for example, trade associations or other organizations representing inherently suspect types of business, such as work-at-home opportunities, shall not be allowed to link); (b)the organization does not have an unsatisfactory record with us; (c) the benefit to us from the visibility associated with the hyperlink outweighs the absence of Medico4us; and (d) where the link is in the context of general resource information or is otherwise consistent with editorial content in a newsletter or similar product furthering the mission of the organization.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and it products or services; and (c) fits within the context of the linking party's site.\n"
                + "Approved organizations may hyperlink to our Web site as follows:\n"
                + "By use of our corporate name; or\n"
                + "By use of the uniform resource locator (Web address) being linked to; or\n"
                + "By use of any other description of our Web site or material being linked to that makes sense within the context and format of content on the linking party's site.\n"
                + "No use of (name)s logo or other artwork will be allowed for linking absent a trademark license agreement.\n"
                + "\n" + "Reservation of Rights\n"
                + "We reserve the right at any time and in its sole discretion to request that you remove all links or any particular link to our Web site/application. You agree to immediately remove all links to our Web site upon such request. We also reserve the right to amend these terms and conditions and its linking policy at any time. By continuing to link to our Web site/application, you agree to be bound to and abide by these linking terms and conditions.\n"
                + "Whilst we endeavor to ensure that the information on this website is correct, we do not warrant its completeness or accuracy; nor do we commit to ensuring that the website remains available or that the material on the website is kept up to date.\nWelcome to Medico4us!\n"
                + "These terms and conditions outline the rules and regulations for the use of Medico4us Website/Application. \n"
                + "By accessing this website, we assume you accept these terms and conditions in full. Do not continue to use Medico4us application or website if you do not accept all of the terms and conditions stated on this page.\n"
                + "The following terminology applies to these Terms and Conditions, Privacy Statement and Disclaimer Notice and any or all Agreements: \"Client\", You? and Your? refers to you, the person accessing this website and accepting the Companys terms and conditions. \"The Company\", Ourselves?, We?, Our? and \"Us\", refers to our Company. Party?, Parties?, or Us?, refers to both the Client and ourselves, or either the Client or ourselves. All terms refer to the offer, acceptance and consideration of payment necessary to undertake the process of our assistance to the Client in the most appropriate manner, whether by formal meetings of a fixed duration, or any other means, for the express purpose of meeting the Clients needs in respect of provision of the Companys stated services/products, in accordance with and subject to, prevailing law of India. Any use of the above terminology or other words in the singular, plural, capitalization and/or he/she or they, are taken as interchangeable and therefore as referring to same.\n"
                + "Cookies\n"
                + "We employ the use of cookies. By using Medico4us website you consent to the use of cookies in accordance with Medico4us privacy policy.\n"
                + "Most of the modern day interactive web sites/ applications use cookies to enable us to retrieve user details for each visit. Cookies are used in some areas of our site to enable the functionality of this area and ease of use for those people visiting. Some of our affiliate / advertising partners may also use cookies.\n"
                + "License\n"
                + "Unless otherwise stated, Medico4us and/or its licensors own the intellectual property rights for all material on Medico4us All intellectual property rights are reserved. You may view and/or print pages for your own personal use subject to restrictions set in these terms and conditions.\n"
                + "You must not:\n" + "Republish material from Medico4us\n"
                + "Sell, rent or sub-license material fromMedico4us\n"
                + "Reproduce, duplicate or copy material from Medico4us\n"
                + "Redistribute content from Medico4us (unless content is specifically made for redistribution).\n"
                + "\n" + "User Comments\n" + "This Agreement shall begin on the date hereof.\n"
                + "Certain parts of this application/website offer the opportunity for users to post and exchange opinions, information, material and data ('Comments') in areas of the feedback(website/application). Medico4us does not screen, edit, publish or review Comments prior to their appearance on the website and Comments do not reflect the views or opinions of Medico4us, its agents or affiliates. Comments reflect the view and opinion of the person who posts such view or opinion. To the extent permitted by applicable laws Medico4us shall not be responsible or liable for the Comments or for any loss cost, liability, damages or expenses caused and or suffered as a result of any use of and/or posting of and/or appearance of the Comments on this website/application.\n"
                + "Medico4us reserves the right to monitor all Comments and to remove any Comments which it considers in its absolute discretion to be inappropriate, offensive or otherwise in breach of these Terms and Conditions.\n"
                + "You warrant and represent that: You are entitled to post the Comments on our website and have all necessary licenses and consents to do so;\n"
                + "The Comments do not infringe any intellectual property right, including without limitation copyright, patent or trademark, or other proprietary right of any third party;\n"
                + "The Comments do not contain any defamatory, libelous, offensive, indecent or otherwise unlawful material or material which is an invasion of privacy\n"
                + "The Comments will not be used to solicit or promote business or custom or present commercial activities or unlawful activity.\n"
                + "You hereby grant to Medico4us a non-exclusive royalty-free license to use, reproduce, edit and authorize others to use, reproduce and edit any of your Comments in any and all forms, formats or media.\n"
                + "Hyperlinking to our Content\n"
                + "The following organizations may link to our Web site without prior written approval:\n"
                + "Government agencies;\n" + "Search engines;\n" + "News organizations;\n" + "\n"
                + "Online directory distributors when they list us in the directory may link to our Web site/application in the same manner as they hyperlink to the Web sites of other listed businesses; and System wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and its products or services; and (c) fits within the context of the linking party's site.\n"
                + "We may consider and approve in our sole discretion other link requests from the following types of organizations:\n"
                + "Commonly-known consumer and/or business information sources such as Chambers of Commerce, community sites; associations or other groups representing charities, including charity giving sites, online directory distributors; internet portals; accounting, law and consulting firms whose primary clients are businesses; and trade associations.\n"
                + "We will approve link requests from these organizations if we determine that: (a) the link would not reflect unfavorably on us or our accredited businesses (for example, trade associations or other organizations representing inherently suspect types of business, such as work-at-home opportunities, shall not be allowed to link); (b)the organization does not have an unsatisfactory record with us; (c) the benefit to us from the visibility associated with the hyperlink outweighs the absence of Medico4us; and (d) where the link is in the context of general resource information or is otherwise consistent with editorial content in a newsletter or similar product furthering the mission of the organization.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and it products or services; and (c) fits within the context of the linking party's site.\n"
                + "Approved organizations may hyperlink to our Web site as follows:\n"
                + "By use of our corporate name; or\n"
                + "By use of the uniform resource locator (Web address) being linked to; or\n"
                + "By use of any other description of our Web site or material being linked to that makes sense within the context and format of content on the linking party's site.\n"
                + "No use of (name)s logo or other artwork will be allowed for linking absent a trademark license agreement.\n"
                + "\n" + "Reservation of Rights\n"
                + "We reserve the right at any time and in its sole discretion to request that you remove all links or any particular link to our Web site/application. You agree to immediately remove all links to our Web site upon such request. We also reserve the right to amend these terms and conditions and its linking policy at any time. By continuing to link to our Web site/application, you agree to be bound to and abide by these linking terms and conditions.\n"
                + "Whilst we endeavor to ensure that the information on this website is correct, we do not warrant its completeness or accuracy; nor do we commit to ensuring that the website remains available or that the material on the website is kept up to date.\nPrivacy Policy\n"
                + "The information provided in Medico4us are posted by registered members of this website and moderated by the team of Medico4us. Doctors & Patients full name, contact number and email id is the only identifying information that is being collected on the application about a user/reader/vendor when they list/post or comment. Medico4us will sell or make use of such information to third parties. We will occasionally analyze such information and will share the results of such analysis in our advisory section. Medico4us may change the policy anytime by posting changes online. Medico4us is not responsible for third party content accessible through the site, including opinions, advice, rating, reviews, statements, and advertisements, and user shall bear all risks associated with the use of such content. \n"
                + "Medico4us is not responsible for any loss or damage of any sort user may incur from dealing with any third party. This policy describes how Medico4us collects and handles Doctors/Patients/Customers information to help us serve our services better. Personal information is any information that identifies you, such as your name, address, email address, phone number, and previous use of Medico4us application. By visiting our site/application, you accept the practices outlined in this privacy policy.\n"
                + "COLLECTING INFORMATION\n"
                + "Medico4us collects information when you register with Medico4us or update your details to receive our newsletters, participate in discussions, events, promotions or any upcoming activities, which will be informed to you over time-to-time. When you register with Medico4us, we may ask for information such as your name, phone number, email address, city, state, and zip code. Once you create and sign into your account, Medico4us automatically receives information from your browser, such as your IP address, and cookies. Cookies enable our platform to recognize you as you move throughout our website. Your web browser also allows us to track statistics such as type of browsers on our platform, page views, navigational patterns, and high traffic areas. This information does NOT track personally identifiable information about our users.\n"
                + "\n" + "PROTECTING INFORMATION\n"
                + "Occasionally, we work with trusted partners who work on our behalf to improve our services to you. These partners may have access to your personal information after they have agreed to our confidentiality agreement. In the case whereMedico4us is acquired by or merged with another company, Medico4us may disclose your personal information to a purchaser that agrees to abide by the terms and conditions of this privacy policy.\n"
                + "We may disclose information about you if required to do so by law, governmental request, process, or court order or based on our good faith belief that there is suspected fraud or situation involving potential threats to the safety of any person or violation of the Medico4us terms of use.\n"
                + "MARKETING COMMUNICATIONS\n"
                + "In addition to using your personal information to improve and enhance your experience with Medico4us, we use information to better target our marketing to your behavioral preferences. If you create an account on our platform, you will be required to provide your email address & contact number and you may automatically be added to our email list and receive updates. If you do not wish to receive Medico4us updates, emails, you may opt out by clicking on the unsubscribe link found at the bottom of all Medico4us marketing emails. Please be aware that it can take up to 30 business days to remove you from our marketing email lists.\n"
                + "\n" + "\n" + "\n" + "NOTIFICATION OF CHANGES\n"
                + "Medico4us is committed to protecting your privacy and may update this policy from time-to-time. Changes will be updated on our website with the date of the most recent update. We will notify you about significant changes to our privacy policy by sending a notice to the primary email address on your account.\n"
                + "Privacy Policy Changes\n"
                + "Although most changes are likely to be minor, Medico4us may change its Privacy Policy from time to time, and in Medico4us sole discretion. Medico4us encourages visitors to frequently check this page for any changes to its Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.\n"
                + "Aggregated Statistics\n"
                + "Medico4us may collect statistics about the behavior of visitors to its website/ application. \n"
                + "Medico4us may display this information publicly or provide it to others. However, Medico4us does not disclose your personally-identifying information.\n";
    } else {
        terms = "Welcome to Medico4us!\n"
                + "These terms and conditions outline the rules and regulations for the use of Medico4us Website/Application. \n"
                + "By accessing this website, we assume you accept these terms and conditions in full. Do not continue to use Medico4us application or website if you do not accept all of the terms and conditions stated on this page.\n"
                + "The following terminology applies to these Terms and Conditions, Privacy Statement and Disclaimer Notice and any or all Agreements: \"Client\", You? and Your? refers to you, the person accessing this website and accepting the Companys terms and conditions. \"The Company\", Ourselves?, We?, Our? and \"Us\", refers to our Company. Party?, Parties?, or Us?, refers to both the Client and ourselves, or either the Client or ourselves. All terms refer to the offer, acceptance and consideration of payment necessary to undertake the process of our assistance to the Client in the most appropriate manner, whether by formal meetings of a fixed duration, or any other means, for the express purpose of meeting the Clients needs in respect of provision of the Companys stated services/products, in accordance with and subject to, prevailing law of India. Any use of the above terminology or other words in the singular, plural, capitalization and/or he/she or they, are taken as interchangeable and therefore as referring to same.\n"
                + "Cookies\n"
                + "We employ the use of cookies. By using Medico4us website you consent to the use of cookies in accordance with Medico4us privacy policy.\n"
                + "Most of the modern day interactive web sites/ applications use cookies to enable us to retrieve user details for each visit. Cookies are used in some areas of our site to enable the functionality of this area and ease of use for those people visiting. Some of our affiliate / advertising partners may also use cookies.\n"
                + "License\n"
                + "Unless otherwise stated, Medico4us and/or its licensors own the intellectual property rights for all material on Medico4us All intellectual property rights are reserved. You may view and/or print pages for your own personal use subject to restrictions set in these terms and conditions.\n"
                + "You must not:\n" + "Republish material from Medico4us\n"
                + "Sell, rent or sub-license material fromMedico4us\n"
                + "Reproduce, duplicate or copy material from Medico4us\n"
                + "Redistribute content from Medico4us (unless content is specifically made for redistribution).\n"
                + "\n" + "User Comments\n" + "This Agreement shall begin on the date hereof.\n"
                + "Certain parts of this application/website offer the opportunity for users to post and exchange opinions, information, material and data ('Comments') in areas of the feedback(website/application). Medico4us does not screen, edit, publish or review Comments prior to their appearance on the website and Comments do not reflect the views or opinions of Medico4us, its agents or affiliates. Comments reflect the view and opinion of the person who posts such view or opinion. To the extent permitted by applicable laws Medico4us shall not be responsible or liable for the Comments or for any loss cost, liability, damages or expenses caused and or suffered as a result of any use of and/or posting of and/or appearance of the Comments on this website/application.\n"
                + "Medico4us reserves the right to monitor all Comments and to remove any Comments which it considers in its absolute discretion to be inappropriate, offensive or otherwise in breach of these Terms and Conditions.\n"
                + "You warrant and represent that: You are entitled to post the Comments on our website and have all necessary licenses and consents to do so;\n"
                + "The Comments do not infringe any intellectual property right, including without limitation copyright, patent or trademark, or other proprietary right of any third party;\n"
                + "The Comments do not contain any defamatory, libelous, offensive, indecent or otherwise unlawful material or material which is an invasion of privacy\n"
                + "The Comments will not be used to solicit or promote business or custom or present commercial activities or unlawful activity.\n"
                + "You hereby grant to Medico4us a non-exclusive royalty-free license to use, reproduce, edit and authorize others to use, reproduce and edit any of your Comments in any and all forms, formats or media.\n"
                + "Hyperlinking to our Content\n"
                + "The following organizations may link to our Web site without prior written approval:\n"
                + "Government agencies;\n" + "Search engines;\n" + "News organizations;\n" + "\n"
                + "Online directory distributors when they list us in the directory may link to our Web site/application in the same manner as they hyperlink to the Web sites of other listed businesses; and System wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and its products or services; and (c) fits within the context of the linking party's site.\n"
                + "We may consider and approve in our sole discretion other link requests from the following types of organizations:\n"
                + "Commonly-known consumer and/or business information sources such as Chambers of Commerce, community sites; associations or other groups representing charities, including charity giving sites, online directory distributors; internet portals; accounting, law and consulting firms whose primary clients are businesses; and trade associations.\n"
                + "We will approve link requests from these organizations if we determine that: (a) the link would not reflect unfavorably on us or our accredited businesses (for example, trade associations or other organizations representing inherently suspect types of business, such as work-at-home opportunities, shall not be allowed to link); (b)the organization does not have an unsatisfactory record with us; (c) the benefit to us from the visibility associated with the hyperlink outweighs the absence of Medico4us; and (d) where the link is in the context of general resource information or is otherwise consistent with editorial content in a newsletter or similar product furthering the mission of the organization.\n"
                + "These organizations may link to our home page, to publications or to other Web site information so long as the link: (a) is not in any way misleading; (b) does not falsely imply sponsorship, endorsement or approval of the linking party and it products or services; and (c) fits within the context of the linking party's site.\n"
                + "Approved organizations may hyperlink to our Web site as follows:\n"
                + "By use of our corporate name; or\n"
                + "By use of the uniform resource locator (Web address) being linked to; or\n"
                + "By use of any other description of our Web site or material being linked to that makes sense within the context and format of content on the linking party's site.\n"
                + "No use of (name)s logo or other artwork will be allowed for linking absent a trademark license agreement.\n"
                + "\n" + "Reservation of Rights\n"
                + "We reserve the right at any time and in its sole discretion to request that you remove all links or any particular link to our Web site/application. You agree to immediately remove all links to our Web site upon such request. We also reserve the right to amend these terms and conditions and its linking policy at any time. By continuing to link to our Web site/application, you agree to be bound to and abide by these linking terms and conditions.\n"
                + "Whilst we endeavor to ensure that the information on this website is correct, we do not warrant its completeness or accuracy; nor do we commit to ensuring that the website remains available or that the material on the website is kept up to date.\n";
    }

    TextView termsTv = (TextView) dialog.findViewById(R.id.tv_terms);
    termsTv.setText(terms);

    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
    dialog.show();
}

From source file:com.kll.collect.android.activities.FormEntryActivity.java

/**
 * Creates a view given the View type and an event
 *
 * @param event//from  www .j  a v  a 2  s.  c o  m
 * @param advancingPage
 *            -- true if this results from advancing through the form
 * @return newly created View
 */
private View createView(int event, boolean advancingPage, int swipeCase) {
    FormController formController = Collect.getInstance().getFormController();
    /*   setTitle(getString(R.string.app_name) + " > "
    + formController.getFormTitle());*/
    int questioncount = formController.getFormDef().getDeepChildCount();

    switch (event) {
    case FormEntryController.EVENT_BEGINNING_OF_FORM:
        progressValue = 0.0;
        progressUpdate(progressValue, questioncount);
        View startView = View.inflate(this, R.layout.form_entry_start, null);
        /*setTitle(getString(R.string.app_name) + " > "
              + formController.getFormTitle());*/

        Drawable image = null;
        File mediaFolder = formController.getMediaFolder();
        String mediaDir = mediaFolder.getAbsolutePath();
        BitmapDrawable bitImage = null;
        // attempt to load the form-specific logo...
        // this is arbitrarily silly
        bitImage = new BitmapDrawable(getResources(), mediaDir + File.separator + "form_logo.png");

        if (bitImage != null && bitImage.getBitmap() != null && bitImage.getIntrinsicHeight() > 0
                && bitImage.getIntrinsicWidth() > 0) {
            image = bitImage;
        }

        if (image == null) {
            // show the opendatakit zig...
            // image =
            // getResources().getDrawable(R.drawable.opendatakit_zig);
            ((ImageView) startView.findViewById(R.id.form_start_bling)).setVisibility(View.GONE);
        } else {
            ImageView v = ((ImageView) startView.findViewById(R.id.form_start_bling));
            v.setImageDrawable(image);
            v.setContentDescription(formController.getFormTitle());
        }

        // change start screen based on navigation prefs
        String navigationChoice = PreferenceManager.getDefaultSharedPreferences(this)
                .getString(PreferencesActivity.KEY_NAVIGATION, PreferencesActivity.KEY_NAVIGATION);
        Boolean useSwipe = false;
        Boolean useButtons = false;
        ImageView ia = ((ImageView) startView.findViewById(R.id.image_advance));
        ImageView ib = ((ImageView) startView.findViewById(R.id.image_backup));
        TextView ta = ((TextView) startView.findViewById(R.id.text_advance));
        TextView tb = ((TextView) startView.findViewById(R.id.text_backup));
        TextView d = ((TextView) startView.findViewById(R.id.description));

        if (navigationChoice != null) {
            if (navigationChoice.contains(PreferencesActivity.NAVIGATION_SWIPE)) {
                useSwipe = true;
            }
            if (navigationChoice.contains(PreferencesActivity.NAVIGATION_BUTTONS)) {
                useButtons = true;
            }
        }
        if (useSwipe && !useButtons) {
            d.setText(getString(R.string.swipe_instructions, formController.getFormTitle()));
        } else if (useButtons && !useSwipe) {
            ia.setVisibility(View.GONE);
            ib.setVisibility(View.GONE);
            ta.setVisibility(View.GONE);
            tb.setVisibility(View.GONE);
            d.setText(getString(R.string.buttons_instructions, formController.getFormTitle()));
        } else {
            d.setText(getString(R.string.swipe_buttons_instructions, formController.getFormTitle()));
        }

        if (mBackButton.isShown()) {
            mBackButton.setEnabled(false);
        }
        if (mNextButton.isShown()) {
            mNextButton.setEnabled(true);
        }

        return startView;
    case FormEntryController.EVENT_END_OF_FORM:
        progressValue = questioncount;
        progressUpdate(progressValue, questioncount);
        View endView = View.inflate(this, R.layout.form_entry_end, null);

        ((ImageView) endView.findViewById(R.id.completed))
                .setImageDrawable(getResources().getDrawable(R.drawable.complete_tick));
        ((TextView) endView.findViewById(R.id.description))
                .setText(getString(R.string.save_enter_data_description, formController.getFormTitle()));

        // checkbox for if finished or ready to send
        final CheckBox instanceComplete = ((CheckBox) endView.findViewById(R.id.mark_finished));
        instanceComplete.setChecked(isInstanceComplete(true));

        if (!mAdminPreferences.getBoolean(AdminPreferencesActivity.KEY_MARK_AS_FINALIZED, true)) {
            instanceComplete.setVisibility(View.GONE);
        }

        // edittext to change the displayed name of the instance
        final EditText saveAs = (EditText) endView.findViewById(R.id.save_name);

        // disallow carriage returns in the name
        InputFilter returnFilter = new InputFilter() {
            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
                    int dend) {
                for (int i = start; i < end; i++) {
                    if (Character.getType((source.charAt(i))) == Character.CONTROL) {
                        return "";
                    }
                }
                return null;
            }
        };
        saveAs.setFilters(new InputFilter[] { returnFilter });
        String saveName = getSaveName();

        if (saveName == null) {
            // no meta/instanceName field in the form -- see if we have a
            // name for this instance from a previous save attempt...
            if (getContentResolver().getType(getIntent().getData()) == InstanceColumns.CONTENT_ITEM_TYPE) {
                Uri instanceUri = getIntent().getData();
                Cursor instance = null;
                try {
                    instance = getContentResolver().query(instanceUri, null, null, null, null);
                    if (instance.getCount() == 1) {
                        instance.moveToFirst();
                        saveName = instance.getString(instance.getColumnIndex(InstanceColumns.DISPLAY_NAME));
                    }
                } finally {
                    if (instance != null) {
                        instance.close();
                    }
                }
            }
            if (saveName == null) {
                // last resort, default to the form title
                saveName = formController.getFormTitle();
            }
            // present the prompt to allow user to name the form
            TextView sa = (TextView) endView.findViewById(R.id.save_form_as);
            sa.setVisibility(View.VISIBLE);
            saveAs.setText(saveName);
            saveAs.setEnabled(true);
            saveAs.setVisibility(View.VISIBLE);
        } else {
            // if instanceName is defined in form, this is the name -- no
            // revisions
            // display only the name, not the prompt, and disable edits
            TextView sa = (TextView) endView.findViewById(R.id.save_form_as);
            sa.setVisibility(View.GONE);
            saveAs.setText(saveName);
            saveAs.setEnabled(false);
            saveAs.setBackgroundColor(Color.WHITE);
            saveAs.setVisibility(View.VISIBLE);
        }

        // override the visibility settings based upon admin preferences
        if (!mAdminPreferences.getBoolean(AdminPreferencesActivity.KEY_SAVE_AS, true)) {
            saveAs.setVisibility(View.GONE);
            TextView sa = (TextView) endView.findViewById(R.id.save_form_as);
            sa.setVisibility(View.GONE);
        }

        // Create 'save' button
        ((Button) endView.findViewById(R.id.save_exit_button)).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Collect.getInstance().getActivityLogger().logInstanceAction(this, "createView.saveAndExit",
                        instanceComplete.isChecked() ? "saveAsComplete" : "saveIncomplete");
                // Form is marked as 'saved' here.
                if (saveAs.getText().length() < 1) {
                    Toast.makeText(FormEntryActivity.this, R.string.save_as_error, Toast.LENGTH_SHORT).show();
                } else {
                    saveDataToDisk(EXIT, instanceComplete.isChecked(), saveAs.getText().toString());
                }
            }
        });

        if (mBackButton.isShown()) {
            mBackButton.setEnabled(true);
        }
        if (mNextButton.isShown()) {
            mNextButton.setEnabled(false);
        }

        return endView;
    case FormEntryController.EVENT_QUESTION:
    case FormEntryController.EVENT_GROUP:
    case FormEntryController.EVENT_REPEAT:
        ODKView odkv = null;
        // should only be a group here if the event_group is a field-list
        try {
            double depth = (double) formController.getFormIndex().getDepth();
            double local_index = (double) formController.getFormIndex().getLocalIndex();
            double instance_index = (double) formController.getFormIndex().getInstanceIndex();
            Log.i("Question coint", Integer.toString(questioncount));

            Log.i("Depth", Integer.toString(formController.getFormIndex().getDepth()));
            Log.i("Local Index", Integer.toString(formController.getFormIndex().getLocalIndex()));
            Log.i("Instance Index", Integer.toString(formController.getFormIndex().getInstanceIndex()));

            if (swipeCase == NEXT) {

                Log.i("progressValue", Double.toString(progressValue));

            }
            if (swipeCase == PREVIOUS) {
                progressValue = progressValue - (1 - (instance_index * local_index / questioncount * depth));

                Log.i("progressValue", Double.toString(progressValue));
            }
            Log.i("progressValue", Double.toString(progressValue));
            progressUpdate(progressValue, questioncount);
            FormEntryPrompt[] prompts = formController.getQuestionPrompts();
            FormEntryCaption[] groups = formController.getGroupsForCurrentIndex();
            odkv = new ODKView(this, formController.getQuestionPrompts(), groups, advancingPage);
            Log.i(t, "created view for group "
                    + (groups.length > 0 ? groups[groups.length - 1].getLongText() : "[top]") + " "
                    + (prompts.length > 0 ? prompts[0].getQuestionText() : "[no question]"));
        } catch (RuntimeException e) {
            Log.e(t, e.getMessage(), e);
            // this is badness to avoid a crash.
            try {
                event = formController.stepToNextScreenEvent();
                createErrorDialog(e.getMessage(), DO_NOT_EXIT);
            } catch (JavaRosaException e1) {
                Log.e(t, e1.getMessage(), e1);
                createErrorDialog(e.getMessage() + "\n\n" + e1.getCause().getMessage(), DO_NOT_EXIT);
            }
            return createView(event, advancingPage, swipeCase);
        }

        // Makes a "clear answer" menu pop up on long-click
        for (QuestionWidget qw : odkv.getWidgets()) {
            if (!qw.getPrompt().isReadOnly()) {
                registerForContextMenu(qw);
            }
        }

        if (mBackButton.isShown() && mNextButton.isShown()) {
            mBackButton.setEnabled(true);
            mNextButton.setEnabled(true);
        }
        return odkv;
    default:
        Log.e(t, "Attempted to create a view that does not exist.");
        // this is badness to avoid a crash.
        try {
            event = formController.stepToNextScreenEvent();
            createErrorDialog(getString(R.string.survey_internal_error), EXIT);
        } catch (JavaRosaException e) {
            Log.e(t, e.getMessage(), e);
            createErrorDialog(e.getCause().getMessage(), EXIT);
        }
        return createView(event, advancingPage, swipeCase);
    }

}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void clickForVideoOrPhoneTapReqFutureAction() {
    findViewById(R.id.dateTxtLayout).setVisibility(View.VISIBLE);
    tapSeetheDoctorTxtLayout.setVisibility(View.GONE);
    reqfutureapptBtnLayout.setVisibility(View.GONE);
    videophoneparentLl.setVisibility(View.VISIBLE);
    horizontalscrollview.setVisibility(View.GONE);
    //This condition is only for PHS Users

    final UserBasicInfo userBasicInfo = UserBasicInfo.readFromSharedPreference(getBaseContext());
    //PHS user/* w w  w  .jav a2s  . co m*/
    if (userBasicInfo.getPersonalInfo().getConsultMethod().equalsIgnoreCase("video")) {
        byphoneBtnLayout.setVisibility(View.INVISIBLE);
        byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
        byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn));
        ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray);
        byphoneBtnLayout.setClickable(false);

        saveAppmtType("video");
        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
        byvideoBtn.setTextColor(Color.GRAY);
        byvideoBtn.setTextColor(Color.GRAY);
        byvideoBtnLayout.setVisibility(View.VISIBLE);
        byvideoBtnLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                    byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                    byvideoBtn.setTextColor(Color.WHITE);
                    ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white);
                    ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray);
                    byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
                    byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn));
                    byphoneBtnLayout.setVisibility(View.INVISIBLE);
                    byphoneBtnLayout.setClickable(false);

                    horizontalscrollview.setVisibility(View.VISIBLE);
                    final LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
                    if (layout.getChildCount() > 0) {
                        layout.removeAllViews();
                    }

                    for (TextView tv : videoList) {
                        layout.addView(tv);
                    }
                    saveConsultationType("Video", MDLiveProviderDetails.this);
                    //Enable Request Appointment Button
                    enableReqAppmtBtn();
                    ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white);
                    //horizontalscrollview.smoothScrollTo(0,0);

                    horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                    horizontalscrollview.postDelayed(new Runnable() {
                        public void run() {
                            horizontalscrollview.fullScroll(HorizontalScrollView.FOCUS_LEFT);
                        }
                    }, 100L);
                    //horizontalscrollview.fullScroll(HorizontalScrollView.FOCUS_LEFT);
                    selectedTimeslot = false;
                    enableReqAppmtBtn();
                    clearTimeSlotViews();
                    horizontalscrollview.startAnimation(AnimationUtils.loadAnimation(MDLiveProviderDetails.this,
                            R.anim.mdlive_trans_left_in));

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

    } else if (userBasicInfo.getPersonalInfo().getConsultMethod().equalsIgnoreCase("phone")) {
        phsOnlyForPhone();
    }
    //Only For idaho
    else if (longLocation.equalsIgnoreCase("idaho")) {
        onlyForIdaho();
    }
    //Only For Texas
    else if (longLocation.equalsIgnoreCase("texas")) {
        phsOnlyForPhone();
    }
    //Vido or Phone Button on Click listener for Blue color
    else {
        //Disabling the Video or Phone Based on the Phone list and video list
        //if the phone list is empty we should not shown the Phone Layout
        //if the video list is empty then we should not show the Video Layout.
        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
        ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon);
        ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon);
        byvideoBtn.setTextColor(Color.GRAY);
        byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
        byphoneBtn.setTextColor(Color.GRAY);

        if (videoList.size() == 0) {
            saveAppmtType("phone");
            byvideoBtnLayout.setVisibility(View.VISIBLE);
            byvideoBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
            byvideoBtn.setTextColor(getResources().getColor(R.color.disableBtn));
            ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_gray);
            byvideoBtnLayout.setClickable(false);
        } else {
            byvideoBtnLayout.setVisibility(View.VISIBLE);
            byvideoBtnLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    try {
                        horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                        byvideoBtn.setTextColor(Color.WHITE);
                        ((ImageView) findViewById(R.id.videoicon))
                                .setImageResource(R.drawable.video_icon_white);
                        byphoneBtnLayout.setVisibility(View.VISIBLE);
                        byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                        byphoneBtn.setTextColor(Color.GRAY);
                        ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon);

                        horizontalscrollview.setVisibility(View.VISIBLE);
                        LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
                        if (layout.getChildCount() > 0) {
                            layout.removeAllViews();
                        }

                        for (TextView tv : videoList) {
                            layout.addView(tv);
                        }
                        saveConsultationType("Video", MDLiveProviderDetails.this);
                        //Enable Request Appointment Button

                        horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                        ((ImageView) findViewById(R.id.videoicon))
                                .setImageResource(R.drawable.video_icon_white);
                        ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon);
                        selectedTimeslot = false;
                        enableReqAppmtBtn();
                        clearTimeSlotViews();
                        horizontalscrollview.startAnimation(AnimationUtils
                                .loadAnimation(MDLiveProviderDetails.this, R.anim.mdlive_trans_left_in));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
        if (phoneList.size() == 0) {
            saveAppmtType("video");
            byphoneBtnLayout.setVisibility(View.VISIBLE);
            byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
            byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn));
            ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray);
            byphoneBtnLayout.setClickable(false);
        } else {
            byphoneBtnLayout.setVisibility(View.VISIBLE);
            byphoneBtnLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    try {
                        horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                        byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                        byphoneBtn.setTextColor(Color.WHITE);
                        ((ImageView) findViewById(R.id.phoneicon))
                                .setImageResource(R.drawable.phone_icon_white);

                        byvideoBtnLayout.setVisibility(View.VISIBLE);
                        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                        byvideoBtn.setTextColor(Color.GRAY);
                        ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_gray);
                        horizontalscrollview.setVisibility(View.VISIBLE);
                        LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
                        if (layout.getChildCount() > 0) {
                            layout.removeAllViews();
                        }
                        for (TextView tv : phoneList) {
                            layout.addView(tv);
                        }
                        saveConsultationType("Phone", MDLiveProviderDetails.this);
                        //Enable Request Appointment Button

                        horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                        ((ImageView) findViewById(R.id.phoneicon))
                                .setImageResource(R.drawable.phone_icon_white);
                        ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon);
                        selectedTimeslot = false;
                        enableReqAppmtBtn();
                        clearTimeSlotViews();
                        horizontalscrollview.startAnimation(AnimationUtils
                                .loadAnimation(MDLiveProviderDetails.this, R.anim.mdlive_trans_left_in));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }

    }

}

From source file:cl.gisred.android.StandardActivity.java

private void singleTapOnMap() {
    myMapView.setOnSingleTapListener(new OnSingleTapListener() {
        @Override/*w w  w  .  j av a2  s.  c o  m*/
        public void onSingleTap(float x, float y) {

            if (bMapTap) {

                Point oPoint = myMapView.toMapPoint(x, y);

                if (mBusquedaLayer != null && myMapView.getLayerByID(mBusquedaLayer.getID()) != null)
                    myMapView.removeLayer(mBusquedaLayer);

                if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                    myMapView.removeLayer(mSeleccionLayer);

                if (bCallOut) {

                    if (nIndentify > 0) {

                        mSeleccionLayer = new GraphicsLayer();
                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.BLACK, 10,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);

                        switch (nIndentify) {
                        case 1:
                            getCalleToDialog(oPoint);
                            break;
                        case 2:
                            getTramoToDialog(oPoint);
                            break;
                        }

                    } else {
                        mSeleccionLayer = new GraphicsLayer();
                        int[] selectedFeatures = oLySelectAsoc.getGraphicIDs(x, y, calcRadio(), 1000);

                        // select the features
                        oLySelectAsoc.clearSelection();
                        oLySelectAsoc.setSelectedGraphics(selectedFeatures, true);
                        Log.w("StandardActivity", "Selected Graphics " + selectedFeatures.length);

                        if (selectedFeatures.length > 0) {
                            Graphic[] results = oLySelectAsoc.getSelectedFeatures();
                            Callout mapCallout = myMapView.getCallout();
                            mapCallout.hide();

                            for (Graphic graphic : results) {

                                Map<String, Object> attr = graphic.getAttributes();
                                Util oUtil = new Util();
                                CalloutTvClass oCall = oUtil.getCalloutValues(attr);

                                GisTextView tv = new GisTextView(StandardActivity.this);
                                tv.setText(oCall.getVista());
                                tv.setHint(oCall.getValor());
                                tv.setIdObjeto(oCall.getIdObjeto());
                                tv.setPoint((Point) graphic.getGeometry());
                                tv.setTipo("nueva");
                                tv.setTextColor(Color.WHITE);

                                tv.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View v) {
                                        oTxtAsoc.setIdObjeto(((GisTextView) v).getIdObjeto());
                                        oTxtAsoc.setText(((GisTextView) v).getHint());
                                        oTxtAsoc.setTipo(((GisTextView) v).getTipo());
                                        oTxtAsoc.setPoint(myMapView.getCallout().getCoordinates());
                                        bCallOut = false;
                                        bMapTap = false;
                                        myMapView.getCallout().hide();
                                        oLySelectAsoc.clearSelection();
                                        dialogCrear.show();
                                        if (mSeleccionLayer != null
                                                && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                                            myMapView.removeLayer(mSeleccionLayer);

                                        // LINE PRINT
                                        if (mUbicacionLayer != null && oUbicacion != null) {
                                            SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4,
                                                    SimpleLineSymbol.STYLE.DASH);
                                            Polyline oLine = new Polyline();
                                            oLine.startPath(oUbicacion);
                                            oLine.lineTo(oTxtAsoc.getPoint());
                                            Graphic graphicDireccion = new Graphic(oLine, lineSymbol, null);
                                            mUbicacionLayer.addGraphic(graphicDireccion);
                                        }
                                    }
                                });

                                Point point = (Point) graphic.getGeometry();

                                mapCallout.setOffset(0, -3);
                                mapCallout.setCoordinates(point);
                                mapCallout.setMaxHeight(100);
                                mapCallout.setMaxWidth(400);
                                mapCallout.setStyle(R.xml.mycalloutprefs);
                                mapCallout.setContent(tv);

                                mapCallout.show();
                            }
                        } else {
                            getAsocObject(oPoint);
                        }

                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.BLACK, 10,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);
                    }

                } else {
                    if (mUbicacionLayer != null && myMapView.getLayerByID(mUbicacionLayer.getID()) != null)
                        myMapView.removeLayer(mUbicacionLayer);

                    oUbicacion = oPoint;
                    mUbicacionLayer = new GraphicsLayer();

                    SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.RED, 12,
                            SimpleMarkerSymbol.STYLE.DIAMOND);
                    Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                    mUbicacionLayer.addGraphic(resultLocGraphic);

                    myMapView.addLayer(mUbicacionLayer);

                    if (R.layout.dialog_poste == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_direccion == idResLayoutSelect) {
                        LyDIRECCIONES.setVisible(true);
                        if (LyDIRECCIONES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyDIRECCIONES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_cliente == idResLayoutSelect
                            || R.layout.dialog_cliente_cnr == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        LyDIRECCIONES.setVisible(true);
                        LyCLIENTES.setVisible(true);

                        if (idResLayoutSelect == R.layout.dialog_cliente_cnr)
                            LyREDBT.setVisible(true);

                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    }
                }
            } else {
                if (bVerData) {
                    double nExtendScale = myMapView.getScale();
                    double layerScala = 0;

                    ArrayList<ArcGISDynamicMapServiceLayer> arrayLay = new ArrayList<>();
                    Point oPoint = myMapView.toMapPoint(x, y);

                    if (oLyViewGraphs != null && myMapView.getLayerByID(oLyViewGraphs.getID()) != null)
                        myMapView.removeLayer(oLyViewGraphs);

                    oLyViewGraphs = new GraphicsLayer();
                    SimpleMarkerSymbol oMarketSymbol = new SimpleMarkerSymbol(Color.BLACK, 10,
                            SimpleMarkerSymbol.STYLE.CIRCLE);
                    oMarketSymbol.setOutline(new SimpleLineSymbol(Color.RED, 1, SimpleLineSymbol.STYLE.SOLID));
                    Graphic oGraph = new Graphic(oPoint, oMarketSymbol);
                    oLyViewGraphs.addGraphic(oGraph);

                    myMapView.addLayer(oLyViewGraphs);

                    for (Layer oLayer : myMapView.getLayers()) {

                        if ((oLayer.getName() != null && !oLayer.getName().equalsIgnoreCase("MapaBase"))
                                && oLayer.isVisible()) {

                            if (oLayer.getClass().equals(ArcGISDynamicMapServiceLayer.class)) {
                                for (ArcGISLayerInfo arcGISLayerInfo : ((ArcGISDynamicMapServiceLayer) oLayer)
                                        .getLayers()) {
                                    if (arcGISLayerInfo.isVisible()) {
                                        layerScala = (arcGISLayerInfo.getMinScale() > 0)
                                                ? arcGISLayerInfo.getMinScale()
                                                : 0;
                                        break;
                                    }
                                }

                                layerScala = (layerScala > 0) ? layerScala : nExtendScale;

                                if (nExtendScale <= layerScala) {
                                    arrayLay.add((ArcGISDynamicMapServiceLayer) oLayer);
                                }
                            }
                        }
                    }

                    if (arrayLay.size() > 0) {
                        ArcGISDynamicMapServiceLayer[] aLay = new ArcGISDynamicMapServiceLayer[arrayLay.size()];
                        aLay = arrayLay.toArray(aLay);
                        getInfoObject(oPoint, aLay);
                    } else {
                        Toast.makeText(getApplicationContext(), "No hay capas visibles", Toast.LENGTH_SHORT)
                                .show();
                    }
                }
            }
        }
    });
}

From source file:com.lifehackinnovations.siteaudit.FloorPlanActivity.java

public static AlertDialog getaddtextdialog(String title, final int itemnumber, Context ctx) {

    AlertDialog.Builder getaddtext = new AlertDialog.Builder(ctx);

    final LinearLayout linearlayout = new LinearLayout(ctx);
    linearlayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
    linearlayout.setOrientation(LinearLayout.VERTICAL);

    final EditText nameet = new EditText(ctx);
    nameet.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

    final TextView fontname = new TextView(ctx);
    fontname.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

    final TextView colorname = new TextView(ctx);
    colorname.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

    final Spinner fontsizespinner = new Spinner(ctx);
    fontsizespinner.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
    final Spinner colorspinner = new Spinner(ctx);
    fontsizespinner.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

    List<String> fontsizelist = new ArrayList<String>();
    for (int t = 1; t < 200; t++) {
        fontsizelist.add(u.s(t));//from   ww w . j a v  a 2s  .  c  o  m
    }
    ArrayAdapter<String> fontsizearrayadapter = new ArrayAdapter<String>(ctx, R.layout.spinnertextview,
            fontsizelist);
    fontsizearrayadapter.setDropDownViewResource(R.layout.spinnertextview);

    List<String> colorlist = new ArrayList<String>();
    {
        colorlist.add("RED");
        colorlist.add("BLACK");
        colorlist.add("BLUE");
        colorlist.add("GREEN");
        colorlist.add("WHITE");
        colorlist.add("GRAY");
    }
    ArrayAdapter<String> colorlistarrayadapter = new ArrayAdapter<String>(ctx, R.layout.spinnertextview,
            colorlist);
    fontsizearrayadapter.setDropDownViewResource(R.layout.spinnertextview);
    colorspinner.setAdapter(colorlistarrayadapter);
    fontsizespinner.setAdapter(fontsizearrayadapter);
    fontsizespinner.setSelection(getIndexofSpinner(fontsizespinner, "25"));

    fontname.setText("Select Font Size");
    fontname.setTextSize(20f);
    colorname.setText("Select Color");
    colorname.setTextSize(20f);

    linearlayout.addView(nameet);
    linearlayout.addView(fontname);
    linearlayout.addView(fontsizespinner);
    linearlayout.addView(colorname);
    linearlayout.addView(colorspinner);

    if (!(itemnumber == view.i)) {
        nameet.setText(view.ITEMstring[itemnumber]);
        fontsizespinner.setSelection(getIndexofSpinner(fontsizespinner, u.s(view.ITEMfontsize[itemnumber])));
        colorspinner.setSelection(getIndexofSpinner(colorspinner, u.s(view.ITEMfontcolor[itemnumber])));
    }

    getaddtext.setView(linearlayout);
    getaddtext.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            dialog.cancel();
        }
    });
    getaddtext.setTitle(title);
    getaddtext.setPositiveButton("OK", new DialogInterface.OnClickListener() {

        @Override

        public void onClick(DialogInterface dialog, int which) {
            // TODO Auto-generated method stub
            String string = nameet.getText().toString();

            float fontsize = fontsizespinner.getSelectedItemPosition() + 1;
            //ITEMelcnumber[itemselectednumber]=u.i(string);
            int colpos = colorspinner.getSelectedItemPosition();
            int[] col = new int[] { Color.RED, Color.BLACK, Color.BLUE, Color.GREEN, Color.WHITE, Color.GRAY };
            int color = col[colpos];

            Log.d("addtext", u.s((int) fontsize) + colpos + color);

            view.ITEMstring[itemnumber] = string;
            view.ITEMfontsize[itemnumber] = (int) fontsize;
            view.ITEMfontcolor[itemnumber] = color;

            view.itemname = string;
            view.fontsize = (int) fontsize;
            view.color = color;
            view.invalidate();
            dialog.dismiss();
            FloorPlanActivity.writeonedbitem(itemnumber);
        }

    });

    return getaddtext.create();
}

From source file:cl.gisred.android.PowerOnActivity.java

private void singleTapOnMap() {
    myMapView.setOnSingleTapListener(new OnSingleTapListener() {
        @Override//from   w w  w .  java  2s.  com
        public void onSingleTap(float x, float y) {

            if (bMapTap) {

                Point oPoint = myMapView.toMapPoint(x, y);

                if (mBusquedaLayer != null && myMapView.getLayerByID(mBusquedaLayer.getID()) != null)
                    myMapView.removeLayer(mBusquedaLayer);

                if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                    myMapView.removeLayer(mSeleccionLayer);

                if (bCallOut) {

                    if (nIndentify > 0) {

                        mSeleccionLayer = new GraphicsLayer();
                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 12,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);

                        switch (nIndentify) {
                        case 1:
                            getCalleToDialog(oPoint);
                            break;
                        case 2:
                            getTramoToDialog(oPoint);
                            break;
                        }

                    } else {
                        mSeleccionLayer = new GraphicsLayer();
                        int[] selectedFeatures = oLySelectAsoc.getGraphicIDs(x, y, calcRadio(), 1000);

                        // select the features
                        oLySelectAsoc.clearSelection();
                        oLySelectAsoc.setSelectedGraphics(selectedFeatures, true);
                        Log.w("PowerOnActivity", "Selected Graphics " + selectedFeatures.length);

                        if (selectedFeatures.length > 0) {
                            Graphic[] results = oLySelectAsoc.getSelectedFeatures();
                            Callout mapCallout = myMapView.getCallout();
                            mapCallout.hide();

                            for (Graphic graphic : results) {

                                Map<String, Object> attr = graphic.getAttributes();
                                Util oUtil = new Util();
                                CalloutTvClass oCall = oUtil.getCalloutValues(attr);

                                GisTextView tv = new GisTextView(PowerOnActivity.this);
                                tv.setText(oCall.getVista());
                                tv.setHint(oCall.getValor());
                                tv.setIdObjeto(oCall.getIdObjeto());
                                tv.setPoint((Point) graphic.getGeometry());
                                tv.setTipo("nueva");
                                tv.setTextColor(Color.WHITE);

                                tv.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View v) {
                                        oTxtAsoc.setIdObjeto(((GisTextView) v).getIdObjeto());
                                        oTxtAsoc.setText(((GisTextView) v).getHint());
                                        oTxtAsoc.setTipo(((GisTextView) v).getTipo());
                                        oTxtAsoc.setPoint(myMapView.getCallout().getCoordinates());
                                        bCallOut = false;
                                        bMapTap = false;
                                        myMapView.getCallout().hide();
                                        oLySelectAsoc.clearSelection();
                                        dialogCur.show();
                                        if (mSeleccionLayer != null
                                                && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                                            myMapView.removeLayer(mSeleccionLayer);

                                        // LINE PRINT
                                        if (mUbicacionLayer != null && oUbicacion != null) {
                                            SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4,
                                                    SimpleLineSymbol.STYLE.DASH);
                                            Polyline oLine = new Polyline();
                                            oLine.startPath(oUbicacion);
                                            oLine.lineTo(oTxtAsoc.getPoint());
                                            Graphic graphicDireccion = new Graphic(oLine, lineSymbol, null);
                                            mUbicacionLayer.addGraphic(graphicDireccion);
                                        }
                                    }
                                });

                                Point point = (Point) graphic.getGeometry();

                                mapCallout.setOffset(0, -3);
                                mapCallout.setCoordinates(point);
                                mapCallout.setMaxHeight(100);
                                mapCallout.setMaxWidth(400);
                                mapCallout.setStyle(R.xml.mycalloutprefs);
                                mapCallout.setContent(tv);

                                mapCallout.show();
                            }
                        } else {
                            getAsocObject(oPoint);
                        }

                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 12,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);
                    }

                } else {
                    if (mUbicacionLayer != null && myMapView.getLayerByID(mUbicacionLayer.getID()) != null)
                        myMapView.removeLayer(mUbicacionLayer);

                    oUbicacion = oPoint;
                    mUbicacionLayer = new GraphicsLayer();

                    SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.RED, 12,
                            SimpleMarkerSymbol.STYLE.DIAMOND);
                    Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                    mUbicacionLayer.addGraphic(resultLocGraphic);

                    myMapView.addLayer(mUbicacionLayer);

                    if (R.layout.dialog_poste == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_direccion == idResLayoutSelect) {
                        LyDIRECCIONES.setVisible(true);
                        if (LyDIRECCIONES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyDIRECCIONES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_cliente == idResLayoutSelect
                            || R.layout.dialog_cliente_cnr == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        LyDIRECCIONES.setVisible(true);
                        LyCLIENTES.setVisible(true);

                        if (idResLayoutSelect == R.layout.dialog_cliente_cnr)
                            LyREDBT.setVisible(true);

                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    } else if (R.layout.form_lectores == idResLayoutSelect) {
                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    }
                }
            } else {
                if (bVerData) {
                    double nExtendScale = myMapView.getScale();
                    double layerScala = 0;

                    ArrayList<ArcGISDynamicMapServiceLayer> arrayLay = new ArrayList<>();
                    Point oPoint = myMapView.toMapPoint(x, y);

                    if (oLyViewGraphs != null && myMapView.getLayerByID(oLyViewGraphs.getID()) != null)
                        myMapView.removeLayer(oLyViewGraphs);

                    oLyViewGraphs = new GraphicsLayer();
                    SimpleMarkerSymbol oMarketSymbol = new SimpleMarkerSymbol(Color.BLACK, 10,
                            SimpleMarkerSymbol.STYLE.CIRCLE);
                    oMarketSymbol.setOutline(new SimpleLineSymbol(Color.RED, 1, SimpleLineSymbol.STYLE.SOLID));
                    Graphic oGraph = new Graphic(oPoint, oMarketSymbol);
                    oLyViewGraphs.addGraphic(oGraph);

                    myMapView.addLayer(oLyViewGraphs);

                    for (Layer oLayer : myMapView.getLayers()) {

                        if ((oLayer.getName() != null && !oLayer.getName().equalsIgnoreCase("MapaBase"))
                                && oLayer.isVisible()) {

                            if (oLayer.getClass().equals(ArcGISDynamicMapServiceLayer.class)) {
                                for (ArcGISLayerInfo arcGISLayerInfo : ((ArcGISDynamicMapServiceLayer) oLayer)
                                        .getLayers()) {
                                    if (arcGISLayerInfo.isVisible()) {
                                        layerScala = (arcGISLayerInfo.getMinScale() > 0)
                                                ? arcGISLayerInfo.getMinScale()
                                                : 0;
                                        break;
                                    }
                                }

                                layerScala = (layerScala > 0) ? layerScala : nExtendScale;

                                Log.w("layerScala " + layerScala, "nExtendScale " + nExtendScale);

                                if (nExtendScale <= layerScala) {
                                    arrayLay.add((ArcGISDynamicMapServiceLayer) oLayer);
                                }
                            }
                        }
                    }

                    if (arrayLay.size() > 0) {
                        ArcGISDynamicMapServiceLayer[] aLay = new ArcGISDynamicMapServiceLayer[arrayLay.size()];
                        aLay = arrayLay.toArray(aLay);
                        getInfoObject(oPoint, aLay);
                    } else {
                        Toast.makeText(getApplicationContext(), "No hay capas visibles", Toast.LENGTH_SHORT)
                                .show();
                    }
                }
            }
        }
    });
}