Example usage for android.view View setBackgroundColor

List of usage examples for android.view View setBackgroundColor

Introduction

In this page you can find the example usage for android.view View setBackgroundColor.

Prototype

@RemotableViewMethod
public void setBackgroundColor(@ColorInt int color) 

Source Link

Document

Sets the background color for this view.

Usage

From source file:com.aniruddhc.acemusic.player.Drawers.QueueDrawerFragment.java

@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
@Override/*from   w  ww  .j a va 2s. c o m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    mContext = getActivity();
    mApp = (Common) mContext.getApplicationContext();

    View rootView = inflater.inflate(R.layout.fragment_queue_drawer, null);
    if (mApp.getCurrentTheme() == Common.LIGHT_THEME) {
        rootView.setBackgroundColor(0xFFFFFFFF);
    } else {
        rootView.setBackgroundColor(0xFF191919);
    }

    mMiniPlayerLayout = (RelativeLayout) rootView.findViewById(R.id.queue_drawer_mini_player_layout);
    mMiniPlayerAlbumArt = (ImageView) rootView.findViewById(R.id.queue_drawer_album_art);
    mPlayPauseBackground = (RelativeLayout) rootView.findViewById(R.id.playPauseButtonBackground);
    mPlayPauseButton = (ImageButton) rootView.findViewById(R.id.playPauseButton);
    mNextButton = (ImageButton) rootView.findViewById(R.id.nextButton);
    mPreviousButton = (ImageButton) rootView.findViewById(R.id.previousButton);
    mTitleText = (TextView) rootView.findViewById(R.id.songName);
    mSubText = (TextView) rootView.findViewById(R.id.artistAlbumName);
    mListView = (DragSortListView) rootView.findViewById(R.id.queue_drawer_list_view);
    mEmptyInfoText = (TextView) rootView.findViewById(R.id.queue_drawer_empty_text);

    mPlayPauseBackground.setBackgroundResource(UIElementsHelper.getShadowedCircle(mContext));
    mPlayPauseButton.setId(R.drawable.pause_light);

    mTitleText.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Regular"));
    mSubText.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Regular"));
    mEmptyInfoText.setTypeface(TypefaceHelper.getTypeface(getActivity(), "Roboto-Regular"));

    //Set the click listeners.
    mMiniPlayerLayout.setOnClickListener(mOnClickMiniPlayer);
    mPlayPauseBackground.setOnClickListener(playPauseClickListener);
    mPlayPauseButton.setOnClickListener(playPauseClickListener);
    mNextButton.setOnClickListener(mOnClickNextListener);
    mPreviousButton.setOnClickListener(mOnClickPreviousListener);

    //Restrict all touch events to this fragment.
    rootView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }

    });

    //KitKat translucent navigation/status bar.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        int navBarHeight = Common.getNavigationBarHeight(mContext);
        if (mListView != null) {
            mListView.setPadding(0, 0, 0, navBarHeight);
            mListView.setClipToPadding(false);
        }

    }

    return rootView;
}

From source file:mchs.neverforget.NeverForgetActivity.java

private void setupBookListViewListener() {
    booksListView = (ListView) findViewById(R.id.booksListView);
    booksListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override/*from  w  w w. ja  v a  2 s .c  o m*/
        public void onItemClick(final AdapterView<?> parent, final View view, final int position, long id) {
            booksListView.post(new Runnable() {
                @Override
                public void run() {
                    if (isBookSelected[position]) {
                        view.setBackgroundColor(
                                ContextCompat.getColor(getApplicationContext(), R.color.colorListView));
                        isBookSelected[position] = false;
                        Toast.makeText(getApplicationContext(), R.string.nfa_book_removed, Toast.LENGTH_SHORT)
                                .show();
                    } else {
                        isBookSelected[position] = true;
                        view.setBackgroundColor(
                                ContextCompat.getColor(getApplicationContext(), R.color.colorSelected));
                        Toast.makeText(getApplicationContext(), R.string.nfa_book_added, Toast.LENGTH_SHORT)
                                .show();
                    }
                }
            });

        }
    });
}

From source file:org.gots.ui.NewSeedActivity.java

/**
*
*//*from   w  ww . j a v  a 2  s.  co m*/
private void initSpecieList() {
    // final LocalSeedProvider helper = new LocalSeedProvider(getApplicationContext());
    new AsyncTask<Void, Void, String[]>() {
        @Override
        protected String[] doInBackground(Void... params) {
            String[] specieList = seedManager.getArraySpecies(true);
            return specieList;
        }

        @Override
        protected void onPostExecute(String[] specieList) {
            // TODO Auto-generated method stub
            ListSpeciesAdapter listSpeciesAdapter = new ListSpeciesAdapter(getApplicationContext(), specieList,
                    newSeed);
            gallerySpecies.setAdapter(listSpeciesAdapter);
            gallerySpecies.setSpacing(5);
            super.onPostExecute(specieList);
        }
    }.execute();

    gallerySpecies.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            gallerySpecies.dispatchSetSelected(false);
            if (((String) view.getTag()).equals(newSeed.getSpecie())) {
                // clicked already selected item
                return;
            }
            // Selected specie changed -> remove background on others
            for (int i = 0; i < parent.getChildCount(); i++) {
                View childView = parent.getChildAt(i);
                if (childView != view) {
                    childView.setBackgroundColor(0);
                }
            }
            view.setSelected(true);
            view.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_state_warning));
            newSeed.setSpecie((String) view.getTag());
            String family = seedManager.getFamilyBySpecie(newSeed.getSpecie());
            newSeed.setFamily(family);
            seedWidgetLong.setSeed(newSeed);
            seedWidgetLong.invalidate();
        }
    });

}

From source file:com.mobicage.rogerthat.GroupDetailActivity.java

private void setViewColors(View view, TextView name, boolean selected) {
    T.UI();//from  w  w  w.jav  a2s  .  c  om
    Resources resources = getResources();
    name.setTextColor(ContextCompat.getColor(mService, android.R.color.primary_text_light));
    if (selected) {
        view.setBackgroundColor(ContextCompat.getColor(mService, R.color.mc_highlight_background));
        name.setTypeface(Typeface.DEFAULT_BOLD);
    } else {
        view.setBackgroundColor(ContextCompat.getColor(mService, R.color.mc_background_color));
        name.setTypeface(Typeface.DEFAULT);
    }
}

From source file:org.liberty.android.fantastischmemo.ui.QACardActivity.java

/**
 * Called the loaders are done. Override it for customized initialization
 *//*from w  ww  .j  a va 2  s .  com*/
protected void onPostInit() {
    View buttonsView = findViewById(R.id.buttons_root);
    if (buttonsView != null && !setting.isDefaultColor()) {
        buttonsView.setBackgroundColor(setting.getAnswerBackgroundColor());
    }

}

From source file:com.roiland.crm.sm.ui.view.SmOppoInfoFragment.java

/**
 * /*from   w ww .  java2  s.  c  om*/
 * <pre>
 * ?
 * </pre>
 *
 * @param custFlag ??
 * @param carFlag ??
 */
public void displayProject(boolean custFlag, boolean carFlag) {
    if (!custFlag) {
        if (!isFromCustManager) {
            customInfoAdapter.clearData();
            mCustomInfo.removeAllViews();
            customInfoAdapter.addItem(getString(R.string.custName),
                    project != null ? project.getCustomer().getCustName() : "");
            customInfoAdapter.addItem(getString(R.string.custFrom),
                    project != null ? project.getCustomer().getCustFrom() : "");
            customInfoAdapter.addItem(getString(R.string.custType),
                    project != null ? project.getCustomer().getCustType() : "");
            customInfoAdapter.addItem(getString(R.string.infoFrom),
                    project != null ? project.getCustomer().getInfoFrom() : "");
            customInfoAdapter.addItem(getString(R.string.custMobile),
                    project != null ? project.getCustomer().getCustMobile() : "");
            customInfoAdapter.addItem(getString(R.string.custOtherPhone),
                    project != null ? project.getCustomer().getCustOtherPhone() : "");
            customInfoAdapter.addItem(getString(R.string.comment),
                    project != null ? project.getCustomer().getCustComment() : "");
        }
    } else {
        if (!isFromCustManager) {
            customInfoAdapter.clearData();
            mCustomInfo.removeAllViews();
            customInfoAdapter.addItem(getString(R.string.custName),
                    project != null ? project.getCustomer().getCustName() : "");
            customInfoAdapter.addItem(getString(R.string.custFrom),
                    project != null ? project.getCustomer().getCustFrom() : "");
            customInfoAdapter.addItem(getString(R.string.custType),
                    project != null ? project.getCustomer().getCustType() : "");
            customInfoAdapter.addItem(getString(R.string.infoFrom),
                    project != null ? project.getCustomer().getInfoFrom() : "");
            customInfoAdapter.addItem(getString(R.string.custMobile),
                    project != null ? project.getCustomer().getCustMobile() : "");
            customInfoAdapter.addItem(getString(R.string.custOtherPhone),
                    project != null ? project.getCustomer().getCustOtherPhone() : "");
            customInfoAdapter.addItem(getString(R.string.gender),
                    project != null ? project.getCustomer().getGender() : "");
            customInfoAdapter.addItem(getString(R.string.birthday),
                    project != null ? DateFormatUtils.formatDate(project.getCustomer().getBirthday()) : null);
            customInfoAdapter.addItem(getString(R.string.idType),
                    project != null ? project.getCustomer().getIdType() : "");
            customInfoAdapter.addItem(getString(R.string.idNumber),
                    project != null ? project.getCustomer().getIdNumber() : "");
            customInfoAdapter.addItem(getString(R.string.province),
                    project != null ? project.getCustomer().getProvince() : "");
            customInfoAdapter.addItem(getString(R.string.city),
                    project != null ? project.getCustomer().getCity() : "");
            customInfoAdapter.addItem(getString(R.string.district),
                    project != null ? project.getCustomer().getDistrict() : "");
            customInfoAdapter.addItem(getString(R.string.qq),
                    project != null ? project.getCustomer().getQq() : "");
            customInfoAdapter.addItem(getString(R.string.address),
                    project != null ? project.getCustomer().getAddress() : "");
            customInfoAdapter.addItem(getString(R.string.postcode),
                    project != null ? project.getCustomer().getPostcode() : "");
            customInfoAdapter.addItem(getString(R.string.email),
                    project != null ? project.getCustomer().getEmail() : "");
            customInfoAdapter.addItem(getString(R.string.convContactTime),
                    project != null ? project.getCustomer().getConvContactTime() : "");
            customInfoAdapter.addItem(getString(R.string.expectContactWay),
                    project != null ? project.getCustomer().getExpectContactWay() : "");
            customInfoAdapter.addItem(getString(R.string.fax),
                    project != null ? project.getCustomer().getFax() : "");
            customInfoAdapter.addItem(getString(R.string.existingCar),
                    project != null ? project.getCustomer().getExistingCar() : "");
            customInfoAdapter.addItem(getString(R.string.industry),
                    project != null ? project.getCustomer().getIndustry() : "");
            customInfoAdapter.addItem(getString(R.string.position),
                    project != null ? project.getCustomer().getPosition() : "");
            customInfoAdapter.addItem(getString(R.string.education),
                    project != null ? project.getCustomer().getEducation() : "");
            customInfoAdapter.addItem(getString(R.string.existingcarbrand),
                    project != null ? project.getCustomer().getExistingCarBrand() : "");
            customInfoAdapter.addItem(getString(R.string.custInterest1),
                    project != null ? project.getCustomer().getCustInterest1() : "");
            customInfoAdapter.addItem(getString(R.string.custInterest2),
                    project != null ? project.getCustomer().getCustInterest2() : "");
            customInfoAdapter.addItem(getString(R.string.custInterest3),
                    project != null ? project.getCustomer().getCustInterest3() : "");
            customInfoAdapter.addItem(getString(R.string.existLisenPlate),
                    project != null ? project.getCustomer().getExistLisenPlate() : "");
            customInfoAdapter.addItem(getString(R.string.enterpType),
                    project != null ? project.getCustomer().getEnterpType() : "");
            customInfoAdapter.addItem(getString(R.string.enterpPeopleCount),
                    project != null ? project.getCustomer().getEnterpPeopleCount() : "");
            customInfoAdapter.addItem(getString(R.string.registeredCapital),
                    project != null ? project.getCustomer().getRegisteredCapital() : "");
            customInfoAdapter.addItem(getString(R.string.compeCarModel),
                    project != null ? project.getCustomer().getCompeCarModel() : "");
            customInfoAdapter.addItem(getString(R.string.rebuyStoreCustTag),
                    project != null ? String.valueOf(project.getCustomer().getRebuyStoreCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.rebuyOnlineCustTag),
                    project != null ? String.valueOf(project.getCustomer().getRebuyOnlineCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.changeCustTag),
                    project != null ? String.valueOf(project.getCustomer().getChangeCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.regularCustTag),
                    project != null ? String.valueOf(project.getCustomer().getRegularCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.regularCust),
                    project != null ? project.getCustomer().getRegularCust() : "");
            customInfoAdapter.addItem(getString(R.string.loanCustTag),
                    project != null ? String.valueOf(project.getCustomer().getLoanCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.headerQuartCustTag),
                    project != null ? String.valueOf(project.getCustomer().getHeaderQuartCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.bigCustTag),
                    project != null ? String.valueOf(project.getCustomer().getBigCustTag()) : "false");
            customInfoAdapter.addItem(getString(R.string.bigCusts),
                    project != null ? project.getCustomer().getBigCusts() : "");
            customInfoAdapter.addItem(getString(R.string.comment),
                    project != null ? project.getCustomer().getCustComment() : "");
        }
    }
    //??
    if (isFromCustManager) {
        carFlag = true;
        mCarInfoMore.setVisibility(View.GONE);
        mCarInfoHide.setVisibility(View.GONE);
    }
    if (!carFlag) {
        carInfoAdapter.clearData();
        mCarInfo.removeAllViews();
        carInfoAdapter.addItem(getString(R.string.brand_1),
                project != null ? project.getPurchaseCarIntention().getBrand() : "",
                project != null ? project.getPurchaseCarIntention().getBrandCode() : null);
        carInfoAdapter.addItem(getString(R.string.model),
                project != null ? project.getPurchaseCarIntention().getModel() : "",
                project != null ? project.getPurchaseCarIntention().getModelCode() : null);
        //???
        if (project != null && !project.getPurchaseCarIntention().isGiveupTag()
                && getString(R.string.flowStatus_1).equals(project.getPurchaseCarIntention().getFlowStatus())) {
            carInfoAdapter.addItem(getString(R.string.finish_preorderDate),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : DataVerify.systemDate());
        }
        if (project != null && project.getPurchaseCarIntention().isGiveupTag()) {
            carInfoAdapter.addItem(getString(R.string.lose_date),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : null);
        } else {
            carInfoAdapter.addItem(getString(R.string.preorderDate),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : null);
        }
        carInfoAdapter.addItem(getString(R.string.flowStatus),
                project != null ? project.getPurchaseCarIntention().getFlowStatus()
                        : getString(R.string.flowStatus_2),
                project != null ? project.getPurchaseCarIntention().getFlowStatusCode() : null);
        carInfoAdapter.addItem("" + getString(R.string.purchasecarintention_comment),
                project != null ? project.getPurchaseCarIntention().getProjectComment() : "");
    } else {
        carInfoAdapter.clearData();
        mCarInfo.removeAllViews();
        carInfoAdapter.addItem(getString(R.string.brand_1),
                project != null ? project.getPurchaseCarIntention().getBrand() : "",
                project != null ? project.getPurchaseCarIntention().getBrandCode() : null);
        carInfoAdapter.addItem(getString(R.string.model),
                project != null ? project.getPurchaseCarIntention().getModel() : "",
                project != null ? project.getPurchaseCarIntention().getModelCode() : null);
        carInfoAdapter.addItem(getString(R.string.outsideColor),
                project != null ? project.getPurchaseCarIntention().getOutsideColor() : "",
                project != null ? project.getPurchaseCarIntention().getOutsideColorCode() : null);
        carInfoAdapter.addItem(getString(R.string.insideColor),
                project != null ? project.getPurchaseCarIntention().getInsideColor() : "",
                project != null ? project.getPurchaseCarIntention().getInsideColorCode() : null);
        if (!isFromCustManager) {
            carInfoAdapter.addItem(getString(R.string.insideColorCheck),
                    project != null ? String.valueOf(project.getPurchaseCarIntention().isInsideColorCheck())
                            : "false");
        }
        carInfoAdapter.addItem(getString(R.string.carConfiguration),
                project != null ? project.getPurchaseCarIntention().getCarConfiguration() : "",
                project != null ? project.getPurchaseCarIntention().getCarConfigurationCode() : null);
        carInfoAdapter.addItem(getString(R.string.salesQuote),
                project != null ? project.getPurchaseCarIntention().getSalesQuote() : "");
        carInfoAdapter.addItem(getString(R.string.dealPriceInterval),
                project != null ? project.getPurchaseCarIntention().getDealPriceInterval() : "",
                project != null ? project.getPurchaseCarIntention().getDealPriceIntervalCode() : null);
        carInfoAdapter.addItem(getString(R.string.payment),
                project != null ? project.getPurchaseCarIntention().getPayment() : "",
                project != null ? project.getPurchaseCarIntention().getPaymentCode() : null);
        carInfoAdapter.addItem(getString(R.string.preorderCount),
                project != null ? project.getPurchaseCarIntention().getPreorderCount() : "1");
        //???
        if (project != null
                && getString(R.string.flowStatus_1).equals(project.getPurchaseCarIntention().getFlowStatus())) {
            carInfoAdapter.addItem(getString(R.string.finish_preorderDate),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : DataVerify.systemDate());
        } else if (project != null && project.getPurchaseCarIntention().isGiveupTag()) {
            carInfoAdapter.addItem(getString(R.string.lose_date),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : null);
        } else {
            carInfoAdapter.addItem(getString(R.string.preorderDate),
                    project != null
                            ? DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPreorderDate())
                            : null);
        }
        carInfoAdapter.addItem(getString(R.string.flowStatus),
                project != null ? project.getPurchaseCarIntention().getFlowStatus()
                        : getString(R.string.flowStatus_2),
                project != null ? project.getPurchaseCarIntention().getFlowStatusCode() : null);
        carInfoAdapter.addItem(getString(R.string.dealPossibility),
                project != null ? project.getPurchaseCarIntention().getDealPossibility() : "0.05");
        carInfoAdapter.addItem(getString(R.string.purchMotivation),
                project != null ? project.getPurchaseCarIntention().getPurchMotivation() : "",
                project != null ? project.getPurchaseCarIntention().getPurchMotivationCode() : null);
        carInfoAdapter.addItem(getString(R.string.chassisNo),
                project != null ? project.getPurchaseCarIntention().getChassisNo() : "");
        carInfoAdapter.addItem(getString(R.string.engineNo),
                project != null ? project.getPurchaseCarIntention().getEngineNo() : "");
        carInfoAdapter.addItem(getString(R.string.licensePlate),
                project != null ? project.getPurchaseCarIntention().getLicensePlate() : "");

        carInfoAdapter.addItem(getString(R.string.licenseProp),
                project != null ? project.getPurchaseCarIntention().getLicenseProp() : "",
                project != null ? project.getPurchaseCarIntention().getLicensePropCode() : null);
        carInfoAdapter.addItem(getString(R.string.pickupDate), project != null
                ? ("0".equals(project.getPurchaseCarIntention().getPickupDate())
                        || project.getPurchaseCarIntention().getPickupDate() == null ? ""
                                : DateFormatUtils.formatDate(project.getPurchaseCarIntention().getPickupDate()))
                : "");
        carInfoAdapter.addItem(getString(R.string.preorderTag),
                project != null ? project.getPurchaseCarIntention().getPreorderTag() : "");
        carInfoAdapter.addItem(getString(R.string.giveupTag),
                project != null ? String.valueOf(project.getPurchaseCarIntention().isGiveupTag()) : "false");
        carInfoAdapter.addItem(getString(R.string.giveupReason),
                project != null ? project.getPurchaseCarIntention().getGiveupReason() : "");
        carInfoAdapter.addItem(getString(R.string.invoiceTitle),
                project != null ? project.getPurchaseCarIntention().getInvoiceTitle() : "");
        carInfoAdapter.addItem("" + getString(R.string.purchasecarintention_comment),
                project != null ? project.getPurchaseCarIntention().getProjectComment() : "");
    }
    if (!isFromCustManager) {
        for (int i = 0; i < customInfoAdapter.getCount(); i++) {
            mCustomInfo.addView(customInfoAdapter.getView(i, null, null));
            View dividerView = new View(getActivity());
            dividerView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 1));
            dividerView.setBackgroundColor(getResources().getColor(R.color.list_divider));
            mCustomInfo.addView(dividerView);
        }
    }
    for (int i = 0; i < carInfoAdapter.getCount(); i++) {
        mCarInfo.addView(carInfoAdapter.getView(i, null, null));
        View dividerView = new View(getActivity());
        dividerView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 1));
        dividerView.setBackgroundColor(getResources().getColor(R.color.list_divider));
        mCarInfo.addView(dividerView);
    }

}

From source file:com.cw.litenote.note.Note_adapter.java

@SuppressLint("SetJavaScriptEnabled")
@Override/*from   w  w  w . jav a 2 s. com*/
public Object instantiateItem(ViewGroup container, final int position) {
    System.out.println("Note_adapter / instantiateItem / position = " + position);
    // Inflate the layout containing 
    // 1. picture group: image,video, thumb nail, control buttons
    // 2. text group: title, body, time 
    View pagerView = inflater.inflate(R.layout.note_view_adapter, container, false);
    int style = Note.getStyle();
    pagerView.setBackgroundColor(ColorSet.mBG_ColorArray[style]);

    // Picture group
    ViewGroup pictureGroup = (ViewGroup) pagerView.findViewById(R.id.pictureContent);
    String tagPictureStr = "current" + position + "pictureView";
    pictureGroup.setTag(tagPictureStr);

    // image view
    TouchImageView imageView = ((TouchImageView) pagerView.findViewById(R.id.image_view));
    String tagImageStr = "current" + position + "imageView";
    imageView.setTag(tagImageStr);

    // video view
    VideoViewCustom videoView = ((VideoViewCustom) pagerView.findViewById(R.id.video_view));
    String tagVideoStr = "current" + position + "videoView";
    videoView.setTag(tagVideoStr);

    ProgressBar spinner = (ProgressBar) pagerView.findViewById(R.id.loading);

    // link web view
    CustomWebView linkWebView = ((CustomWebView) pagerView.findViewById(R.id.link_web_view));
    String tagStr = "current" + position + "linkWebView";
    linkWebView.setTag(tagStr);

    // line view
    View line_view = pagerView.findViewById(R.id.line_view);

    // text group
    ViewGroup textGroup = (ViewGroup) pagerView.findViewById(R.id.textGroup);

    // Set tag for text web view
    CustomWebView textWebView = ((CustomWebView) textGroup.findViewById(R.id.textBody));

    // set accessibility
    textGroup.setContentDescription(act.getResources().getString(R.string.note_text));
    textWebView.getRootView().setContentDescription(act.getResources().getString(R.string.note_text));

    tagStr = "current" + position + "textWebView";
    textWebView.setTag(tagStr);

    // set text web view
    setWebView(textWebView, spinner, CustomWebView.TEXT_VIEW);

    String linkUri = db_page.getNoteLinkUri(position, true);
    String strTitle = db_page.getNoteTitle(position, true);
    String strBody = db_page.getNoteBody(position, true);

    // View mode
    // picture only
    if (Note.isPictureMode()) {
        System.out.println("Note_adapter / _instantiateItem / isPictureMode ");
        pictureGroup.setVisibility(View.VISIBLE);
        showPictureView(position, imageView, videoView, linkWebView, spinner);

        line_view.setVisibility(View.GONE);
        textGroup.setVisibility(View.GONE);
    }
    // text only
    else if (Note.isTextMode()) {
        System.out.println("Note_adapter / _instantiateItem / isTextMode ");
        pictureGroup.setVisibility(View.GONE);

        line_view.setVisibility(View.VISIBLE);
        textGroup.setVisibility(View.VISIBLE);

        if (Util.isYouTubeLink(linkUri) || !Util.isEmptyString(strTitle) || !Util.isEmptyString(strBody)
                || linkUri.startsWith("http")) {
            showTextWebView(position, textWebView);
        }
    }
    // picture and text
    else if (Note.isViewAllMode()) {
        System.out.println("Note_adapter / _instantiateItem / isViewAllMode ");

        // picture
        pictureGroup.setVisibility(View.VISIBLE);
        showPictureView(position, imageView, videoView, linkWebView, spinner);

        line_view.setVisibility(View.VISIBLE);
        textGroup.setVisibility(View.VISIBLE);

        // text
        if (!Util.isEmptyString(strTitle) || !Util.isEmptyString(strBody) || Util.isYouTubeLink(linkUri)
                || linkUri.startsWith("http")) {
            showTextWebView(position, textWebView);
        } else {
            textGroup.setVisibility(View.GONE);
        }
    }

    // footer of note view
    TextView footerText = (TextView) pagerView.findViewById(R.id.note_view_footer);
    if (!Note.isPictureMode()) {
        footerText.setVisibility(View.VISIBLE);
        footerText.setText(String.valueOf(position + 1) + "/" + pager.getAdapter().getCount());
        footerText.setTextColor(ColorSet.mText_ColorArray[Note.mStyle]);
        footerText.setBackgroundColor(ColorSet.mBG_ColorArray[Note.mStyle]);
    } else
        footerText.setVisibility(View.GONE);

    container.addView(pagerView, 0);

    return pagerView;
}

From source file:com.secretparty.app.PartyFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ActionBarActivity act = (ActionBarActivity) getActivity();
    if (act.getSupportFragmentManager().getBackStackEntryCount() == 0) {
        act.getSupportActionBar().setDisplayHomeAsUpEnabled(false);
    }/*www .j a  v  a  2  s  . c  o  m*/

    View rootView = inflater.inflate(R.layout.party_layout, container, false);
    TextView partyName, partyTimeLeft, partyThematic;
    View divider;
    ListView thematic_list;
    Party currentParty = mCallback.getParty();

    partyName = (TextView) rootView.findViewById(R.id.TV_party_name);
    partyTimeLeft = (TextView) rootView.findViewById(R.id.TV_time_left);
    partyThematic = (TextView) rootView.findViewById(R.id.TV_party_thema);
    divider = rootView.findViewById(R.id.V_divider);
    thematic_list = (ListView) rootView.findViewById(R.id.list);

    partyName.setText(currentParty.getName());
    partyThematic.setText(currentParty.getThematic().getName());
    partyTimeLeft.setText(getRemainingTimeString(currentParty.getFinishDate()));

    divider.setBackgroundColor(
            getResources().getIntArray(R.array.pic_color)[currentParty.getThematic().getColor()]);

    ListAdapter mAdapter = new UserAdapter(this.getActivity(), currentParty.getUsers(),
            currentParty.getThematic().getId());
    thematic_list.setAdapter(mAdapter);
    thematic_list.setOnItemClickListener(null);
    return rootView;
}

From source file:com.cssweb.android.base.QuoteGridActivity.java

public void setSelectRow(int paramInt) throws Exception {
    LinearLayout localLinearLayout1 = this.mLinerLock;
    Integer localInteger1 = Integer.valueOf(this.m_nPos);
    View localView1 = localLinearLayout1.findViewWithTag(localInteger1);
    if (localView1 != null) {
        int l = this.residCol;
        //         int l = this.residSelColor;
        localView1.setBackgroundResource(l);
    }//from   w  w  w  .j  a v a  2  s.c  o  m
    LinearLayout localLinearLayout2 = this.mLinerLock;
    Integer localInteger2 = Integer.valueOf(paramInt);
    View localView2 = localLinearLayout2.findViewWithTag(localInteger2);
    if (localView2 != null) {
        int i1 = this.residSelColor;
        localView2.setBackgroundColor(i1);
    }

    LinearLayout localLinearLayout3 = this.mLinerHScroll;
    Integer localInteger3 = Integer.valueOf(this.m_nPos);
    LinearLayout localLinearLayout4 = (LinearLayout) localLinearLayout3.findViewWithTag(localInteger3);

    if (localLinearLayout4 != null) {
        int i3 = localLinearLayout4.getChildCount();
        for (int i = 0; i < i3; i++) {
            View localView3 = localLinearLayout4.getChildAt(i);
            int i0 = 0;
            if (i == i3 - 1)
                i0 = this.residScrollCol[2];
            else if (i == 13)
                i0 = this.residScrollCol[1];
            else if (i % 2 == 0)
                i0 = this.residScrollCol[0];
            else
                i0 = this.residScrollCol[1];
            localView3.setBackgroundResource(i0);
        }
    }

    LinearLayout localLinearLayout5 = this.mLinerHScroll;
    Integer localInteger4 = Integer.valueOf(paramInt);
    LinearLayout localLinearLayout6 = (LinearLayout) localLinearLayout5.findViewWithTag(localInteger4);
    if (localLinearLayout6 != null) {
        int i4 = this.residSelColor;
        localLinearLayout6.setBackgroundColor(i4);
    }
    int i6 = localLinearLayout6.getChildCount();
    for (int i = 0; i < i6; i++) {
        View localView6 = localLinearLayout6.getChildAt(i);
        int i10 = this.residSelColor;
        localView6.setBackgroundColor(i10);
    }

    this.m_nPos = paramInt;
    this.cssStock = list.get(paramInt - 1);
}

From source file:com.WazaBe.GooglePlusStream.SocialStreamFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    view.setBackgroundColor(Color.WHITE);

    final ListView listView = getListView();
    listView.setCacheColorHint(Color.WHITE);
    listView.setOnScrollListener(this);
    listView.setDrawSelectorOnTop(true);
    // TypedValue v = new TypedValue();
    // getActivity().getTheme().resolveAttribute(R.attr.activatableItemBackground,
    // v, true);/* w w  w  .j a  v  a  2s.  com*/
    // listView.setSelector(v.resourceId);
}