Example usage for android.graphics.drawable ColorDrawable ColorDrawable

List of usage examples for android.graphics.drawable ColorDrawable ColorDrawable

Introduction

In this page you can find the example usage for android.graphics.drawable ColorDrawable ColorDrawable.

Prototype

public ColorDrawable(@ColorInt int color) 

Source Link

Document

Creates a new ColorDrawable with the specified color.

Usage

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);//from   ww w.j  a v a  2s  .  c om
    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.haomee.chat.activity.ChatActivity.java

/**
 * ?/*from ww w. j  a va  2s  . co m*/
 */
private View inflateYanWenZi(int current_page, List<String> list) {

    View view = LayoutInflater.from(this).inflate(R.layout.yanwenzi_grid, null);
    GridView grid = (GridView) view.findViewById(R.id.gridView1);
    grid.setSelector(new ColorDrawable(Color.TRANSPARENT));

    final NewYanWenZiAdapter new_express_adapter = new NewYanWenZiAdapter(ChatActivity.this);
    grid.setAdapter(new_express_adapter);

    int total_page = (list.size() - 1) / 12 + 1;
    if (current_page < total_page - 1) {
        new_express_adapter.setData(list.subList(current_page * 12, (current_page + 1) * 12));
    } else {
        new_express_adapter.setData(list.subList(current_page * 12, list.size()));
    }

    grid.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
            String wenzi = new_express_adapter.getData().get(position);

            if (!mEditTextContent.getText().toString().equals("")) {
                mEditTextContent.setText(mEditTextContent.getText().toString() + wenzi);
            } else {
                mEditTextContent.setText(wenzi);
            }
            mEditTextContent.setSelection(mEditTextContent.getText().toString().length());
        }
    });

    return view;
}

From source file:com.android.messaging.ui.conversation.ConversationFragment.java

private void updateActionAndStatusBarColor(final ActionBar actionBar) {
    final int themeColor = ConversationDrawables.get().getConversationThemeColor();
    actionBar.setBackgroundDrawable(new ColorDrawable(themeColor));
    UiUtils.setStatusBarColor(getActivity(), themeColor);
}

From source file:com.xplink.android.carchecklist.CarCheckListActivity.java

private void SlideEngineLayout() {

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    float height = metrics.heightPixels;
    float width = metrics.widthPixels;

    int left840 = (int) ((width / 100) * 65.625);

    final SharedPreferences settings = getSharedPreferences("mysettings", 0);
    final SharedPreferences.Editor editor = settings.edit();
    final Dialog enginedialog = new Dialog(CarCheckListActivity.this, R.style.backgrounddialog);
    enginedialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    enginedialog.setContentView(R.layout.enginedialoglayout);
    enginedialog.getWindow().getAttributes().windowAnimations = R.style.EngineDialogAnimation;
    enginedialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    // make everything around Dialog brightness than default
    WindowManager.LayoutParams lp = enginedialog.getWindow().getAttributes();
    lp.dimAmount = 0f;/*from www. j  a  va 2  s  . c o m*/

    final CheckBox chkengine_hood = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_hood);
    final CheckBox chkengine_backHood = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_backHood);
    final CheckBox chkengine_underEngine = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_underEngine);
    final CheckBox chkengine_brakeOil = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_brakeOil);
    final CheckBox chkengine_engineOil = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_engineOil);
    final CheckBox chkengine_waterCoolant = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_waterCoolant);
    final CheckBox chkengine_belt = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_belt);
    final CheckBox chkengine_gear = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_gear);
    final CheckBox chkengine_liquidLevel = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_liquidLevel);
    final CheckBox chkengine_soundOut = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_soundOut);
    final CheckBox chkengine_soundIn = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_soundIn);

    // Change font
    chkengine_hood.setTypeface(type);
    chkengine_backHood.setTypeface(type);
    chkengine_underEngine.setTypeface(type);
    chkengine_brakeOil.setTypeface(type);
    chkengine_engineOil.setTypeface(type);
    chkengine_waterCoolant.setTypeface(type);
    chkengine_belt.setTypeface(type);
    chkengine_gear.setTypeface(type);
    chkengine_liquidLevel.setTypeface(type);
    chkengine_soundOut.setTypeface(type);
    chkengine_soundIn.setTypeface(type);

    enginedialog.setCanceledOnTouchOutside(true);
    enginedialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            headengine.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadengine = new TranslateAnimation(0, 0, 490, -500);
            slideoutheadengine.setDuration(300);
            slideoutheadengine.setFillAfter(true);
            headengine.startAnimation(slideoutheadengine);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("engine_hood", chkengine_hood.isChecked());
            mp.put("engine_backHood", chkengine_backHood.isChecked());
            mp.put("engine_underEngine", chkengine_underEngine.isChecked());
            mp.put("engine_brakeOil", chkengine_brakeOil.isChecked());
            mp.put("engine_engineOil", chkengine_engineOil.isChecked());
            mp.put("engine_waterCoolant", chkengine_waterCoolant.isChecked());
            mp.put("engine_belt", chkengine_belt.isChecked());
            mp.put("engine_gear", chkengine_gear.isChecked());
            mp.put("engine_liquidLevel", chkengine_liquidLevel.isChecked());
            mp.put("engine_soundOut", chkengine_soundOut.isChecked());
            mp.put("engine_soundIn", chkengine_soundIn.isChecked());

            filterStore("engine", mp);
            save(mp);

        }
    });

    TextView engine = (TextView) enginedialog.getWindow().findViewById(R.id.Engine);
    engine.setTypeface(type);
    Button engineback = (Button) enginedialog.getWindow().findViewById(R.id.Engineback);
    engineback.setTypeface(type);
    engineback.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            enginedialog.dismiss();

            headengine.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadengine = new TranslateAnimation(0, 0, 490, -500);
            slideoutheadengine.setDuration(300);
            slideoutheadengine.setFillAfter(true);
            headengine.startAnimation(slideoutheadengine);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("engine_hood", chkengine_hood.isChecked());
            mp.put("engine_backHood", chkengine_backHood.isChecked());
            mp.put("engine_underEngine", chkengine_underEngine.isChecked());
            mp.put("engine_brakeOil", chkengine_brakeOil.isChecked());
            mp.put("engine_engineOil", chkengine_engineOil.isChecked());
            mp.put("engine_waterCoolant", chkengine_waterCoolant.isChecked());
            mp.put("engine_belt", chkengine_belt.isChecked());
            mp.put("engine_gear", chkengine_gear.isChecked());
            mp.put("engine_liquidLevel", chkengine_liquidLevel.isChecked());
            mp.put("engine_soundOut", chkengine_soundOut.isChecked());
            mp.put("engine_soundIn", chkengine_soundIn.isChecked());

            filterStore("engine", mp);
            save(mp);

        }
    });

    chkengine_hood.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_backHood.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_underEngine.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_brakeOil.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_engineOil.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_waterCoolant.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_belt.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_gear.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_liquidLevel.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_soundOut.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_soundIn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    headengine.setVisibility(ImageView.VISIBLE);
    TranslateAnimation slideheadengine = new TranslateAnimation(0, 0, 0, 490);
    slideheadengine.setDuration(300);
    slideheadengine.setFillAfter(true);
    headengine.startAnimation(slideheadengine);

    enginedialog.show();

    WindowManager.LayoutParams params = enginedialog.getWindow().getAttributes();
    params.y = 1;
    params.x = left840;
    params.gravity = Gravity.TOP | Gravity.LEFT;
    enginedialog.getWindow().setAttributes(params);

    chkengine_hood.setChecked(load("engine_hood"));
    chkengine_backHood.setChecked(load("engine_backHood"));
    chkengine_underEngine.setChecked(load("engine_underEngine"));
    chkengine_brakeOil.setChecked(load("engine_brakeOil"));
    chkengine_engineOil.setChecked(load("engine_engineOil"));
    chkengine_waterCoolant.setChecked(load("engine_waterCoolant"));
    chkengine_belt.setChecked(load("engine_belt"));
    chkengine_gear.setChecked(load("engine_gear"));
    chkengine_liquidLevel.setChecked(load("engine_liquidLevel"));
    chkengine_soundOut.setChecked(load("engine_soundOut"));
    chkengine_soundIn.setChecked(load("engine_soundIn"));

}

From source file:com.google.appinventor.components.runtime.Form.java

private void setBackground(View bgview) {
    Drawable setDraw = backgroundDrawable;
    if (backgroundImagePath != "" && setDraw != null) {
        setDraw = backgroundDrawable.getConstantState().newDrawable();
        setDraw.setColorFilter(//from   w  w w  .ja  v a 2  s .com
                (backgroundColor != Component.COLOR_DEFAULT) ? backgroundColor : Component.COLOR_WHITE,
                PorterDuff.Mode.DST_OVER);
    } else {
        setDraw = new ColorDrawable(
                (backgroundColor != Component.COLOR_DEFAULT) ? backgroundColor : Component.COLOR_WHITE);
    }
    ViewUtil.setBackgroundImage(bgview, setDraw);
    bgview.invalidate();
}

From source file:com.amaze.filemanager.activities.MainActivity.java

void initialiseViews() {
    appBarLayout = (AppBarLayout) findViewById(R.id.lin);

    if (!ImageLoader.getInstance().isInited()) {

        ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(this));
    }/* ww w  . j  av  a2s .c  o m*/
    displayImageOptions = new DisplayImageOptions.Builder().showImageOnLoading(R.drawable.amaze_header)
            .showImageForEmptyUri(R.drawable.amaze_header).showImageOnFail(R.drawable.amaze_header)
            .cacheInMemory(true).cacheOnDisk(true).considerExifParams(true).bitmapConfig(Bitmap.Config.RGB_565)
            .build();

    buttonBarFrame = (FrameLayout) findViewById(R.id.buttonbarframe);
    buttonBarFrame.setBackgroundColor(Color.parseColor(skin));
    drawerHeaderLayout = getLayoutInflater().inflate(R.layout.drawerheader, null);
    drawerHeaderParent = (RelativeLayout) drawerHeaderLayout.findViewById(R.id.drawer_header_parent);
    drawerHeaderView = (View) drawerHeaderLayout.findViewById(R.id.drawer_header);
    drawerHeaderView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Intent intent;
            if (Build.VERSION.SDK_INT < 19) {
                intent = new Intent();
                intent.setAction(Intent.ACTION_GET_CONTENT);
            } else {
                intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

            }
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.setType("image/*");
            startActivityForResult(intent, image_selector_request_code);
            return false;
        }
    });
    drawerProfilePic = (RoundedImageView) drawerHeaderLayout.findViewById(R.id.profile_pic);
    mGoogleName = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_name);
    mGoogleId = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_email);
    toolbar = (Toolbar) findViewById(R.id.action_bar);
    setSupportActionBar(toolbar);
    frameLayout = (FrameLayout) findViewById(R.id.content_frame);
    indicator_layout = findViewById(R.id.indicator_layout);
    mDrawerLinear = (ScrimInsetsRelativeLayout) findViewById(R.id.left_drawer);
    if (theme1 == 1)
        mDrawerLinear.setBackgroundColor(Color.parseColor("#303030"));
    else
        mDrawerLinear.setBackgroundColor(Color.WHITE);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackgroundColor(Color.parseColor(skin));
    mDrawerList = (ListView) findViewById(R.id.menu_drawer);
    drawerHeaderView.setBackgroundResource(R.drawable.amaze_header);
    drawerHeaderParent.setBackgroundColor(Color.parseColor(skin));
    if (findViewById(R.id.tab_frame) != null) {
        mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN, mDrawerLinear);
        mDrawerLayout.setScrimColor(Color.TRANSPARENT);
        isDrawerLocked = true;
    }
    mDrawerList.addHeaderView(drawerHeaderLayout);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    View v = findViewById(R.id.fab_bg);
    if (theme1 == 1)
        v.setBackgroundColor(Color.parseColor("#a6ffffff"));
    v.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            floatingActionButton.close(true);
            revealShow(view, false);
        }
    });

    pathbar = (LinearLayout) findViewById(R.id.pathbar);
    buttons = (LinearLayout) findViewById(R.id.buttons);
    scroll = (HorizontalScrollView) findViewById(R.id.scroll);
    scroll1 = (HorizontalScrollView) findViewById(R.id.scroll1);
    scroll.setSmoothScrollingEnabled(true);
    scroll1.setSmoothScrollingEnabled(true);
    ImageView divider = (ImageView) findViewById(R.id.divider1);
    if (theme1 == 0)
        divider.setImageResource(R.color.divider);
    else
        divider.setImageResource(R.color.divider_dark);

    setDrawerHeaderBackground();
    View settingsbutton = findViewById(R.id.settingsbutton);
    if (theme1 == 1) {
        settingsbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) settingsbutton.findViewById(R.id.settingicon))
                .setImageResource(R.drawable.ic_settings_white_48dp);
        ((TextView) settingsbutton.findViewById(R.id.settingtext))
                .setTextColor(getResources().getColor(android.R.color.white));
    }
    settingsbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent in = new Intent(MainActivity.this, Preferences.class);
            finish();
            final int enter_anim = android.R.anim.fade_in;
            final int exit_anim = android.R.anim.fade_out;
            Activity s = MainActivity.this;
            s.overridePendingTransition(exit_anim, enter_anim);
            s.finish();
            s.overridePendingTransition(enter_anim, exit_anim);
            s.startActivity(in);
        }

    });
    View appbutton = findViewById(R.id.appbutton);
    if (theme1 == 1) {
        appbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) appbutton.findViewById(R.id.appicon)).setImageResource(R.drawable.ic_doc_apk_white);
        ((TextView) appbutton.findViewById(R.id.apptext))
                .setTextColor(getResources().getColor(android.R.color.white));
    }
    appbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            android.support.v4.app.FragmentTransaction transaction2 = getSupportFragmentManager()
                    .beginTransaction();
            transaction2.replace(R.id.content_frame, new AppsList());
            findViewById(R.id.lin).animate().translationY(0).setInterpolator(new DecelerateInterpolator(2))
                    .start();
            pending_fragmentTransaction = transaction2;
            if (!isDrawerLocked)
                mDrawerLayout.closeDrawer(mDrawerLinear);
            else
                onDrawerClosed();
            select = -2;
            adapter.toggleChecked(false);
        }
    });
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));

    // status bar0
    sdk = Build.VERSION.SDK_INT;

    if (sdk == 20 || sdk == 19) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(Color.parseColor(skin));
        FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.drawer_layout)
                .getLayoutParams();
        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
        if (!isDrawerLocked)
            p.setMargins(0, config.getStatusBarHeight(), 0, 0);
    } else if (Build.VERSION.SDK_INT >= 21) {
        colourednavigation = Sp.getBoolean("colorednavigation", true);

        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        //window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (isDrawerLocked) {
            window.setStatusBarColor((skinStatusBar));
        } else
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (colourednavigation)
            window.setNavigationBarColor(skinStatusBar);

    }
}

From source file:com.filemanager.free.activities.MainActivity.java

@SuppressLint("InflateParams")
private void initialiseViews() {
    mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.main_frame);
    appBarLayout = (AppBarLayout) findViewById(R.id.lin);
    if (!ImageLoader.getInstance().isInited()) {
        ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(this));
    }/*from  w  ww  .  j  a v a 2  s  .  com*/
    if (displayImageOptions != null) {
        displayImageOptions = new DisplayImageOptions.Builder().showImageOnLoading(R.drawable.amaze_header)
                .showImageForEmptyUri(R.drawable.amaze_header).showImageOnFail(R.drawable.amaze_header)
                .cacheInMemory(true).cacheOnDisk(true).considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565).build();
    }

    buttonBarFrame = (FrameLayout) findViewById(R.id.buttonbarframe);
    buttonBarFrame.setBackgroundColor(Color.parseColor(skin));
    drawerHeaderLayout = getLayoutInflater().inflate(R.layout.drawerheader, null);
    drawerHeaderParent = (RelativeLayout) drawerHeaderLayout.findViewById(R.id.drawer_header_parent);
    drawerHeaderView = (View) drawerHeaderLayout.findViewById(R.id.drawer_header);
    drawerHeaderView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Intent intent;
            if (Build.VERSION.SDK_INT < 19) {
                intent = new Intent();
                intent.setAction(Intent.ACTION_GET_CONTENT);
            } else {
                intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

            }
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.setType("image/*");
            startActivityForResult(intent, image_selector_request_code);
            return false;
        }
    });
    drawerProfilePic = (RoundedImageView) drawerHeaderLayout.findViewById(R.id.profile_pic);
    mGoogleName = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_name);
    mGoogleId = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_email);
    toolbar = (Toolbar) findViewById(R.id.action_bar);
    setSupportActionBar(toolbar);
    frameLayout = (FrameLayout) findViewById(R.id.content_frame);
    indicator_layout = findViewById(R.id.indicator_layout);
    mDrawerLinear = (ScrimInsetsRelativeLayout) findViewById(R.id.left_drawer);
    if (theme1 == 1)
        mDrawerLinear.setBackgroundColor(Color.parseColor("#303030"));
    else {
        assert mDrawerLinear != null;
        mDrawerLinear.setBackgroundColor(Color.WHITE);
    }
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackgroundColor(Color.parseColor(skin));
    mDrawerList = (ListView) findViewById(R.id.menu_drawer);
    drawerHeaderView.setBackgroundResource(R.drawable.amaze_header);
    drawerHeaderParent.setBackgroundColor(Color.parseColor(skin));
    if (findViewById(R.id.tab_frame) != null) {
        mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN, mDrawerLinear);
        mDrawerLayout.setScrimColor(Color.TRANSPARENT);
        isDrawerLocked = true;
    }
    mDrawerList.addHeaderView(drawerHeaderLayout);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayShowTitleEnabled(false);
    }

    View v = findViewById(R.id.fab_bg);
    if (theme1 == 1) {
        assert v != null;
        v.setBackgroundColor(Color.parseColor("#a6ffffff"));
    }

    assert v != null;
    v.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            floatingActionButton.close(true);
            utils.revealShow(view, false);
        }
    });

    pathbar = (LinearLayout) findViewById(R.id.pathbar);
    buttons = (LinearLayout) findViewById(R.id.buttons);
    scroll = (HorizontalScrollView) findViewById(R.id.scroll);
    scroll1 = (HorizontalScrollView) findViewById(R.id.scroll1);
    scroll.setSmoothScrollingEnabled(true);
    scroll1.setSmoothScrollingEnabled(true);
    ImageView divider = (ImageView) findViewById(R.id.divider1);
    if (theme1 == 0) {
        assert divider != null;
        divider.setImageResource(R.color.divider);
    } else {
        assert divider != null;
        divider.setImageResource(R.color.divider_dark);
    }

    setDrawerHeaderBackground();
    View settingsbutton = findViewById(R.id.settingsbutton);
    if (theme1 == 1) {
        assert settingsbutton != null;
        settingsbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) settingsbutton.findViewById(R.id.settingicon))
                .setImageResource(R.drawable.ic_settings_white_48dp);
        ((TextView) settingsbutton.findViewById(R.id.settingtext))
                .setTextColor(ContextCompat.getColor(con, android.R.color.white));
    }
    assert settingsbutton != null;
    settingsbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent in = new Intent(MainActivity.this, Preferences.class);
            finish();
            final int enter_anim = android.R.anim.fade_in;
            final int exit_anim = android.R.anim.fade_out;
            Activity s = MainActivity.this;
            s.overridePendingTransition(exit_anim, enter_anim);
            s.finish();
            s.overridePendingTransition(enter_anim, exit_anim);
            s.startActivity(in);
        }

    });
    View appbutton = findViewById(R.id.appbutton);
    if (theme1 == 1) {
        assert appbutton != null;
        appbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) appbutton.findViewById(R.id.appicon)).setImageResource(R.drawable.ic_doc_apk_white);
        ((TextView) appbutton.findViewById(R.id.apptext))
                .setTextColor(ContextCompat.getColor(con, android.R.color.white));
    }
    assert appbutton != null;
    appbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            android.support.v4.app.FragmentTransaction transaction2 = getSupportFragmentManager()
                    .beginTransaction();
            transaction2.replace(R.id.content_frame, new AppsList());
            findViewById(R.id.lin).animate().translationY(0).setInterpolator(new DecelerateInterpolator(2))
                    .start();
            pending_fragmentTransaction = transaction2;
            if (!isDrawerLocked)
                mDrawerLayout.closeDrawer(mDrawerLinear);
            else
                onDrawerClosed();
            select = -2;
            adapter.toggleChecked(false);
        }
    });
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));

    // status bar0
    sdk = Build.VERSION.SDK_INT;

    if (sdk == 20 || sdk == 19) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(Color.parseColor(skin));
        FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.drawer_layout)
                .getLayoutParams();
        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
        if (!isDrawerLocked)
            p.setMargins(0, config.getStatusBarHeight(), 0, 0);
    } else if (Build.VERSION.SDK_INT >= 21) {
        colourednavigation = Sp.getBoolean("colorednavigation", true);

        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        //window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (isDrawerLocked) {
            window.setStatusBarColor((skinStatusBar));
        } else
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (colourednavigation)
            window.setNavigationBarColor(skinStatusBar);

    }
    //admob
    mAdView = (View) findViewById(R.id.ads);
}

From source file:com.xplink.android.carchecklist.CarCheckListActivity.java

private void SlideExteriorLayout() {
    final SharedPreferences settings = getSharedPreferences("mysettings", 0);
    final SharedPreferences.Editor editor = settings.edit();
    final Dialog exteriordialog = new Dialog(CarCheckListActivity.this, R.style.backgrounddialog);
    exteriordialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    exteriordialog.setContentView(R.layout.exteriordialoglayout);
    exteriordialog.getWindow().getAttributes().windowAnimations = R.style.ExteriorDialogAnimation;
    exteriordialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    // make everything around Dialog brightness than default
    WindowManager.LayoutParams lp = exteriordialog.getWindow().getAttributes();
    lp.dimAmount = 0f;// w  ww .  j av  a  2  s . co m

    final CheckBox chkoutside_color = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_color);
    final CheckBox chkoutside_window = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_window);
    final CheckBox chkoutside_doorHood = (CheckBox) exteriordialog.getWindow()
            .findViewById(R.id.outside_doorHood);
    final CheckBox chkoutside_jack = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_jack);
    final CheckBox chkoutside_wrench = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_wrench);
    final CheckBox chkoutside_tires = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_tires);
    final CheckBox chkoutside_light = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_light);
    final CheckBox chkoutside_seal = (CheckBox) exteriordialog.getWindow().findViewById(R.id.outside_seal);
    final CheckBox chkoutside_tirePart = (CheckBox) exteriordialog.getWindow()
            .findViewById(R.id.outside_tirePart);

    // Change font
    chkoutside_color.setTypeface(type);
    chkoutside_window.setTypeface(type);
    chkoutside_doorHood.setTypeface(type);
    chkoutside_jack.setTypeface(type);
    chkoutside_wrench.setTypeface(type);
    chkoutside_tires.setTypeface(type);
    chkoutside_light.setTypeface(type);
    chkoutside_seal.setTypeface(type);
    chkoutside_tirePart.setTypeface(type);

    exteriordialog.setCanceledOnTouchOutside(true);
    exteriordialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            headexterior.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadexterior = new TranslateAnimation(0, 0, 380, -400);
            slideoutheadexterior.setDuration(500);
            slideoutheadexterior.setFillAfter(true);
            headexterior.startAnimation(slideoutheadexterior);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("outside_color", chkoutside_color.isChecked());
            mp.put("outside_window", chkoutside_window.isChecked());
            mp.put("outside_doorHood", chkoutside_doorHood.isChecked());
            mp.put("outside_jack", chkoutside_jack.isChecked());
            mp.put("outside_wrench", chkoutside_wrench.isChecked());
            mp.put("outside_tires", chkoutside_tires.isChecked());
            mp.put("outside_light", chkoutside_light.isChecked());
            mp.put("outside_seal", chkoutside_seal.isChecked());
            mp.put("outside_tirePart", chkoutside_tirePart.isChecked());

            filterStore("exterior", mp);
            save(mp);

        }
    });

    TextView exterior = (TextView) exteriordialog.getWindow().findViewById(R.id.Exterior);
    exterior.setTypeface(type);
    Button exteriorback = (Button) exteriordialog.getWindow().findViewById(R.id.Exteriorback);
    exteriorback.setTypeface(type);
    exteriorback.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            exteriordialog.dismiss();

            headexterior.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadexterior = new TranslateAnimation(0, 0, 380, -400);
            slideoutheadexterior.setDuration(500);
            slideoutheadexterior.setFillAfter(true);
            headexterior.startAnimation(slideoutheadexterior);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("outside_color", chkoutside_color.isChecked());
            mp.put("outside_window", chkoutside_window.isChecked());
            mp.put("outside_doorHood", chkoutside_doorHood.isChecked());
            mp.put("outside_jack", chkoutside_jack.isChecked());
            mp.put("outside_wrench", chkoutside_wrench.isChecked());
            mp.put("outside_tires", chkoutside_tires.isChecked());
            mp.put("outside_light", chkoutside_light.isChecked());
            mp.put("outside_seal", chkoutside_seal.isChecked());
            mp.put("outside_tirePart", chkoutside_tirePart.isChecked());

            filterStore("exterior", mp);
            save(mp);

        }
    });

    chkoutside_color.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_window.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_doorHood.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_jack.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_wrench.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_tires.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_light.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_seal.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkoutside_tirePart.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalExterior(increment);
            } else {
                increment = false;
                getTotalExterior(increment);
            }
            ExteriorProgress.setProgress(PercenExterior);
            percenexterior.setText("" + PercenExterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    headexterior.setVisibility(ImageView.VISIBLE);
    TranslateAnimation slideheadexterior = new TranslateAnimation(0, 0, 0, 380);
    slideheadexterior.setDuration(500);
    slideheadexterior.setFillAfter(true);
    headexterior.startAnimation(slideheadexterior);

    exteriordialog.show();

    WindowManager.LayoutParams params = exteriordialog.getWindow().getAttributes();
    params.y = 0;
    params.x = 60;
    params.gravity = Gravity.TOP | Gravity.LEFT;
    exteriordialog.getWindow().setAttributes(params);

    chkoutside_color.setChecked(load("outside_color"));
    chkoutside_window.setChecked(load("outside_window"));
    chkoutside_doorHood.setChecked(load("outside_doorHood"));
    chkoutside_jack.setChecked(load("outside_jack"));
    chkoutside_wrench.setChecked(load("outside_wrench"));
    chkoutside_tires.setChecked(load("outside_tires"));
    chkoutside_light.setChecked(load("outside_light"));
    chkoutside_seal.setChecked(load("outside_seal"));
    chkoutside_tirePart.setChecked(load("outside_tirePart"));

}

From source file:com.xplink.android.carchecklist.CarCheckListActivity.java

private void SlideInteriorLayout() {
    final SharedPreferences settings = getSharedPreferences("mysettings", 0);
    final SharedPreferences.Editor editor = settings.edit();
    final Dialog interiordialog = new Dialog(CarCheckListActivity.this, R.style.backgrounddialog);
    interiordialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    interiordialog.setContentView(R.layout.interiordialoglayout);
    interiordialog.getWindow().getAttributes().windowAnimations = R.style.InteriorDialogAnimation;
    interiordialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    // make everything around Dialog brightness than default
    WindowManager.LayoutParams lp = interiordialog.getWindow().getAttributes();
    lp.dimAmount = 0f;/*from  w ww . java  2 s.  co m*/

    final CheckBox chkinside_seat = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_seat);
    final CheckBox chkinside_console = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_console);
    final CheckBox chkinside_steeringWheel = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_steeringWheel);
    final CheckBox chkinside_transmission = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_transmission);
    final CheckBox chkinside_sideDoors = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_sideDoors);
    final CheckBox chkinside_dashBoard = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_dashBoard);
    final CheckBox chkinside_carpet = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_carpet);
    final CheckBox chkinside_curtain = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_curtain);
    final CheckBox chkinside_seatBelt = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_seatBelt);
    final CheckBox chkinside_backDoor = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_backDoor);
    final CheckBox chkinside_lidOil = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_lidOil);
    final CheckBox chkinside_setSeat = (CheckBox) interiordialog.getWindow().findViewById(R.id.inside_setSeat);
    final CheckBox chkinside_brakePedal = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_brakePedal);
    final CheckBox chkinside_accelerator = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_accelerator);
    final CheckBox chkinside_handBrake = (CheckBox) interiordialog.getWindow()
            .findViewById(R.id.inside_handBrake);

    // Change font
    chkinside_seat.setTypeface(type);
    chkinside_console.setTypeface(type);
    chkinside_steeringWheel.setTypeface(type);
    chkinside_transmission.setTypeface(type);
    chkinside_sideDoors.setTypeface(type);
    chkinside_dashBoard.setTypeface(type);
    chkinside_carpet.setTypeface(type);
    chkinside_curtain.setTypeface(type);
    chkinside_seatBelt.setTypeface(type);
    chkinside_backDoor.setTypeface(type);
    chkinside_lidOil.setTypeface(type);
    chkinside_setSeat.setTypeface(type);
    chkinside_brakePedal.setTypeface(type);
    chkinside_accelerator.setTypeface(type);
    chkinside_handBrake.setTypeface(type);

    interiordialog.setCanceledOnTouchOutside(true);
    interiordialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            headinterior.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadinterior = new TranslateAnimation(0, 0, 180, 800);
            slideoutheadinterior.setDuration(500);
            slideoutheadinterior.setFillAfter(true);
            headinterior.startAnimation(slideoutheadinterior);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("inside_seat", chkinside_seat.isChecked());
            mp.put("inside_console", chkinside_console.isChecked());
            mp.put("inside_steeringWheel", chkinside_steeringWheel.isChecked());
            mp.put("inside_transmission", chkinside_transmission.isChecked());
            mp.put("inside_sideDoors", chkinside_sideDoors.isChecked());
            mp.put("inside_dashBoard", chkinside_dashBoard.isChecked());
            mp.put("inside_carpet", chkinside_carpet.isChecked());
            mp.put("inside_curtain", chkinside_curtain.isChecked());
            mp.put("inside_seatBelt", chkinside_seatBelt.isChecked());
            mp.put("inside_backDoor", chkinside_backDoor.isChecked());
            mp.put("inside_lidOil", chkinside_lidOil.isChecked());
            mp.put("inside_setSeat", chkinside_setSeat.isChecked());
            mp.put("inside_brakePedal", chkinside_brakePedal.isChecked());
            mp.put("inside_accelerator", chkinside_accelerator.isChecked());
            mp.put("inside_handBrake", chkinside_handBrake.isChecked());

            filterStore("interior", mp);
            save(mp);
        }
    });
    TextView interior = (TextView) interiordialog.getWindow().findViewById(R.id.Interior);
    interior.setTypeface(type);
    Button interiorback = (Button) interiordialog.getWindow().findViewById(R.id.Interiorback);
    interiorback.setTypeface(type);
    interiorback.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            interiordialog.dismiss();

            headinterior.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadinterior = new TranslateAnimation(0, 0, 180, 800);
            slideoutheadinterior.setDuration(500);
            slideoutheadinterior.setFillAfter(true);
            headinterior.startAnimation(slideoutheadinterior);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("inside_seat", chkinside_seat.isChecked());
            mp.put("inside_console", chkinside_console.isChecked());
            mp.put("inside_steeringWheel", chkinside_steeringWheel.isChecked());
            mp.put("inside_transmission", chkinside_transmission.isChecked());
            mp.put("inside_sideDoors", chkinside_sideDoors.isChecked());
            mp.put("inside_dashBoard", chkinside_dashBoard.isChecked());
            mp.put("inside_carpet", chkinside_carpet.isChecked());
            mp.put("inside_curtain", chkinside_curtain.isChecked());
            mp.put("inside_seatBelt", chkinside_seatBelt.isChecked());
            mp.put("inside_backDoor", chkinside_backDoor.isChecked());
            mp.put("inside_lidOil", chkinside_lidOil.isChecked());
            mp.put("inside_setSeat", chkinside_setSeat.isChecked());
            mp.put("inside_brakePedal", chkinside_brakePedal.isChecked());
            mp.put("inside_accelerator", chkinside_accelerator.isChecked());
            mp.put("inside_handBrake", chkinside_handBrake.isChecked());

            filterStore("interior", mp);
            save(mp);

        }
    });

    chkinside_seat.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_console.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_steeringWheel.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_transmission.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_sideDoors.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_dashBoard.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_carpet.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_curtain.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_seatBelt.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_backDoor.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_lidOil.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_setSeat.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_brakePedal.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_accelerator.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkinside_handBrake.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalInterior(increment);
            } else {
                increment = false;
                getTotalInterior(increment);
            }
            InteriorProgress.setProgress(PercenInterior);
            perceninterior.setText("" + PercenInterior + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    headinterior.setVisibility(ImageView.VISIBLE);
    TranslateAnimation slideheadinterior = new TranslateAnimation(0, 0, 800, 180);
    slideheadinterior.setDuration(500);
    slideheadinterior.setFillAfter(true);
    headinterior.startAnimation(slideheadinterior);

    interiordialog.show();

    WindowManager.LayoutParams params = interiordialog.getWindow().getAttributes();
    params.y = 180;
    params.x = 60;
    params.gravity = Gravity.TOP | Gravity.LEFT;
    interiordialog.getWindow().setAttributes(params);

    chkinside_seat.setChecked(load("inside_seat"));
    chkinside_console.setChecked(load("inside_console"));
    chkinside_steeringWheel.setChecked(load("inside_steeringWheel"));
    chkinside_transmission.setChecked(load("inside_transmission"));
    chkinside_sideDoors.setChecked(load("inside_sideDoors"));
    chkinside_dashBoard.setChecked(load("inside_dashBoard"));
    chkinside_carpet.setChecked(load("inside_carpet"));
    chkinside_curtain.setChecked(load("inside_curtain"));
    chkinside_seatBelt.setChecked(load("inside_seatBelt"));
    chkinside_backDoor.setChecked(load("inside_backDoor"));
    chkinside_lidOil.setChecked(load("inside_lidOil"));
    chkinside_setSeat.setChecked(load("inside_setSeat"));
    chkinside_brakePedal.setChecked(load("inside_brakePedal"));
    chkinside_accelerator.setChecked(load("inside_accelerator"));
    chkinside_handBrake.setChecked(load("inside_handBrake"));

}

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

/**
 * Parses JSON response from Cigna Coach request and displays popup displaying the extracted info
 *
 * data structure:/*  w w w  .j a  v a 2s . c  o m*/
 * "appointment_instructions" : {
 *      "title" : "Schedule an Appointment",
 *      "description" : "To schedule a video coaching appointment, please call:",
 *      "team_name" : "Marriott TakeCare Team",
 *      "toll_free_number" : "1-800-700-1092",
 *      "additional_info" : "Se habla Espaol"
 *  }
 *
 * @param response      HTTP response object
 */
private void handleCignaCoachSuccessResponse(String response) {
    //Fetch Data From the Services
    //Log.e("Response details", "************\n**********"+response.toString());
    JsonParser parser = new JsonParser();
    JsonObject responseObj = null, profileObj = null, providerObj = null, appointment_obj = null;
    String dialog_title = null, dialog_desc = null, dialog_teamname = null, dialog_extrainfo = null,
            phonenumber = null;
    try {
        responseObj = (JsonObject) parser.parse(response.toString());
        profileObj = responseObj.get("doctor_profile").getAsJsonObject();
        providerObj = profileObj.get("provider_details").getAsJsonObject();
        appointment_obj = providerObj.get("appointment_instructions").getAsJsonObject();

        dialog_title = appointment_obj.get("title").getAsString();
        dialog_desc = appointment_obj.get("description").getAsString();
        dialog_teamname = appointment_obj.get("team_name").getAsString();
        phonenumber = appointment_obj.get("toll_free_number").getAsString();
        dialog_extrainfo = appointment_obj.get("additional_info").getAsString();

    } catch (NullPointerException nex) {
        //Log.e("Error details", "************\n" + nex.getMessage());
        /*Toast.makeText(this, R.string.mdl_cignacoach_data_error, Toast.LENGTH_SHORT).show();*/
        Snackbar.make(findViewById(android.R.id.content), getString(R.string.mdl_cignacoach_data_error),
                Snackbar.LENGTH_SHORT).show();
        return;
    }

    final String dialog_phonenumber = phonenumber;

    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MDLiveProviderDetails.this);
    LayoutInflater inflater = MDLiveProviderDetails.this.getLayoutInflater();
    View dialogView = inflater.inflate(R.layout.cignacoach_popup, null);
    messagesView = dialogView;
    alertDialogBuilder.setView(dialogView);

    // populate the dialog's text fields
    final TextView txt_title = (TextView) dialogView.findViewById(R.id.title);
    txt_title.setText(dialog_title);
    final TextView txt_desc = (TextView) dialogView.findViewById(R.id.desc);
    txt_desc.setText(dialog_desc);
    final TextView txt_team = (TextView) dialogView.findViewById(R.id.team);
    txt_team.setText(dialog_teamname);
    final TextView txt_phone = (TextView) dialogView.findViewById(R.id.phone);
    txt_phone.setText(getString(R.string.mdl_cignacoach_phonenumber, dialog_phonenumber));
    final TextView txt_extra = (TextView) dialogView.findViewById(R.id.extra);
    txt_extra.setText(dialog_extrainfo);

    alertDialogBuilder.setCancelable(true);

    // create alert dialog
    final AlertDialog alertDialog = alertDialogBuilder.create();
    // suppress default background to allow rounded corners to show through
    alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

    txt_phone.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (ContextCompat.checkSelfPermission(MDLiveProviderDetails.this,
                    Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {

                ActivityCompat.requestPermissions(MDLiveProviderDetails.this,
                        new String[] { android.Manifest.permission.CALL_PHONE },
                        MDLiveProviderDetails.PERMISSION_ACCESS_PHONE);
            } else {
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:" + dialog_phonenumber));
                startActivity(callIntent);
            }
            alertDialog.dismiss();
        }
    });

    // display it
    alertDialog.show();

}