Example usage for android.graphics Color TRANSPARENT

List of usage examples for android.graphics Color TRANSPARENT

Introduction

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

Prototype

int TRANSPARENT

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

Click Source Link

Usage

From source file:com.gosuncn.core.util.view.StatusBarUtils.java

/**
 * ???/*from   w w  w.j  ava 2  s  . c o  m*/
 */
@TargetApi(Build.VERSION_CODES.KITKAT)
private static void transparentStatusBar(Activity activity) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
    } else {
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
}

From source file:de.madvertise.android.sdk.MadvertiseMraidView.java

private ImageButton addCloseButtonToViewGroup(final ViewGroup parent) {
    final ImageButton closeButton = new ImageButton(getContext());
    final FrameLayout.LayoutParams closeButtonParams = new FrameLayout.LayoutParams(CLOSE_BUTTON_SIZE,
            CLOSE_BUTTON_SIZE);/*from  w w  w.j  a v  a 2s . c om*/
    closeButtonParams.gravity = Gravity.RIGHT;
    closeButton.setLayoutParams(closeButtonParams);
    closeButton.setBackgroundColor(Color.TRANSPARENT);
    closeButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            close();
        }
    });

    parent.addView(closeButton);

    return closeButton;
}

From source file:com.hannesdorfmann.search.SearchActivity.java

@OnClick(R.id.results_scrim)
  protected void hideSaveConfimation() {
      if (confirmSaveContainer.getVisibility() == View.VISIBLE) {
          // contract the bubble & hide the scrim
          AnimatorSet hideConfirmation = new AnimatorSet();
          hideConfirmation.playTogether(
                  ViewAnimationUtils.createCircularReveal(confirmSaveContainer,
                          confirmSaveContainer.getWidth() / 2, confirmSaveContainer.getHeight() / 2,
                          confirmSaveContainer.getWidth() / 2, fab.getWidth() / 2),
                  ObjectAnimator.ofArgb(resultsScrim, ViewUtils.BACKGROUND_COLOR, Color.TRANSPARENT));
          hideConfirmation.setDuration(150L);
          hideConfirmation.setInterpolator(
                  AnimationUtils.loadInterpolator(SearchActivity.this, android.R.interpolator.fast_out_slow_in));
          hideConfirmation.addListener(new AnimatorListenerAdapter() {
              @Override/*from w w w . j  av a 2 s  .com*/
              public void onAnimationEnd(Animator animation) {
                  confirmSaveContainer.setVisibility(View.GONE);
                  resultsScrim.setVisibility(View.GONE);
                  fab.setVisibility(results.getVisibility());
              }
          });
          hideConfirmation.start();
      }
  }

From source file:com.geecko.QuickLyric.fragment.LyricsViewFragment.java

private void exitEditTagsMode() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ((ImageButton) getActivity().findViewById(R.id.edit_tags_btn))
                .setImageResource(R.drawable.ic_done_anim);
        Drawable editIcon = ((ImageButton) getActivity().findViewById(R.id.edit_tags_btn)).getDrawable();
        ((Animatable) editIcon).start();
    } else/*from  ww w  .j  a va2s  .c om*/
        ((ImageButton) getActivity().findViewById(R.id.edit_tags_btn)).setImageResource(R.drawable.ic_edit);

    if (getActivity().getCurrentFocus() != null) {
        InputMethodManager imm = (InputMethodManager) getActivity()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm.isAcceptingText())
            imm.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
    }

    EditText songTV = (EditText) getActivity().findViewById(R.id.song);
    EditText artistTV = ((EditText) getActivity().findViewById(R.id.artist));
    EditText newLyrics = (EditText) getActivity().findViewById(R.id.edit_lyrics);

    songTV.setInputType(InputType.TYPE_NULL);
    artistTV.setInputType(InputType.TYPE_NULL);
    songTV.setBackgroundColor(Color.TRANSPARENT);
    artistTV.setBackgroundColor(Color.TRANSPARENT);

    String txt = mLrcThread == null ? null : mLyrics.getText();
    if (txt == null)
        txt = "";

    File musicFile = Id3Reader.getFile(getActivity(), mLyrics.getOriginalArtist(), mLyrics.getOriginalTrack());

    if (!mLyrics.getArtist().equals(artistTV.getText().toString())
            || !mLyrics.getTitle().equals(songTV.getText().toString())
            || !Html.fromHtml(txt).toString().equals(newLyrics.getText().toString())) {
        mLyrics.setArtist(artistTV.getText().toString());
        mLyrics.setTitle(songTV.getText().toString());
        mLyrics.setText(newLyrics.getText().toString().replaceAll("\n", "<br/>"));
        if (PermissionsChecker.requestPermission(getActivity(), "android.permission.WRITE_EXTERNAL_STORAGE", 0,
                Id3Writer.REQUEST_CODE))
            new Id3Writer(this).execute(mLyrics, musicFile);
    } else
        new Id3Writer(this).onPreExecute();
}

From source file:org.csp.everyaware.offline.Map.java

@Override
public void onResume() {
    Utils.paused = false;// w w  w  . ja va  2  s  .  co  m
    super.onResume();
    mMapView.onResume();

    //acquire partial wake lock
    if (!mWakeLock.isHeld())
        mWakeLock.acquire();

    mLocationSource.registerLocUpdates();

    if (Utils.uploadOn == Constants.INTERNET_ON_INT)
        mInterUplStatus.setBackgroundResource(R.drawable.internet_on);
    else if (Utils.uploadOn == Constants.INTERNET_OFF_INT)
        mInterUplStatus.setBackgroundResource(R.drawable.internet_off);
    else if (Utils.uploadOn == Constants.UPLOAD_ON_INT)
        mInterUplStatus.setBackgroundResource(R.drawable.upload);

    if (mCameraTrackOn)
        mFollowCamBtn.setBackgroundResource(R.drawable.follow_camera_pressed);
    else
        mFollowCamBtn.setBackgroundResource(R.drawable.follow_camera_not_pressed);

    //register receiver for messages from store'n'forward service
    IntentFilter internetOnFilter = new IntentFilter(Constants.INTERNET_ON);
    registerReceiver(mServiceReceiver, internetOnFilter);
    IntentFilter internetOffFilter = new IntentFilter(Constants.INTERNET_OFF);
    registerReceiver(mServiceReceiver, internetOffFilter);
    IntentFilter uploadOnFilter = new IntentFilter(Constants.UPLOAD_ON);
    registerReceiver(mServiceReceiver, uploadOnFilter);
    IntentFilter uploadOffFilter = new IntentFilter(Constants.UPLOAD_OFF);
    registerReceiver(mServiceReceiver, uploadOffFilter);

    //register receiver for messages from gps tracking service
    IntentFilter phoneGpsOnFilter = new IntentFilter(Constants.PHONE_GPS_ON);
    registerReceiver(mGpsServiceReceiver, phoneGpsOnFilter);
    IntentFilter networkGpsOnFilter = new IntentFilter(Constants.NETWORK_GPS_ON);
    registerReceiver(mGpsServiceReceiver, networkGpsOnFilter);
    IntentFilter phoneGpsOffFilter = new IntentFilter(Constants.PHONE_GPS_OFF);
    registerReceiver(mGpsServiceReceiver, phoneGpsOffFilter);

    //get selected track and draw it on map
    mTrack = Utils.track;

    if (mTrack != null) {
        Log.d("Map", "onCreate()--> shown session id: " + mTrack.mSessionId);

        if (mGoogleMap != null)
            mGoogleMap.clear();

        int divider = 1;

        long trackLength = mTrack.mNumOfRecords;

        Log.d("Map", "onResume()--> track length: " + trackLength);

        if (trackLength > 1800)
            divider = 2;
        if (trackLength > 3600)
            divider = 4;
        if (trackLength > 7200)
            divider = 8;
        if (trackLength > 14400)
            divider = 16;

        mLatLngPoints = mDbManager.loadLatLngPointsBySessionId(mTrack.mSessionId, divider);
        if (mLatLngPoints != null) {
            int size = mLatLngPoints.size();

            if (size > 0) {
                calcMinAvgPollValue();
                drawPath();
                mCameraTrackOn = false;
                if (mGoogleMap != null)
                    try {
                        mGoogleMap.animateCamera(
                                CameraUpdateFactory.newLatLng(mLatLngPoints.get(size - 1).mLatLng));
                    } catch (NullPointerException e) {
                        e.printStackTrace();
                    }
            }
        }
    }

    if (mMapPolygons == null)
        mMapPolygons = new ArrayList<Polygon>();

    int color;

    //draw map cluster on the map
    if ((mMapClusters != null) && (mMapClusters.size() > 0)) {
        for (int i = 0; i < mMapClusters.size(); i++) {
            MapCluster mapCluster = mMapClusters.get(i);

            if (mapCluster.mBcLevel != 0) {
                if ((mapCluster.mBcLevel > 0) && (mapCluster.mBcLevel <= 10))
                    color = ColorHelper.numberToColor(mapCluster.mBcLevel * BC_MULTIPLIER);
                else
                    color = ColorHelper.numberToColor(100);

                mMapPolygons.add(mGoogleMap.addPolygon(new PolygonOptions()
                        .add(new LatLng(mapCluster.mMinLat, mapCluster.mMinLon),
                                new LatLng(mapCluster.mMinLat, mapCluster.mMaxLon),
                                new LatLng(mapCluster.mMaxLat, mapCluster.mMaxLon),
                                new LatLng(mapCluster.mMaxLat, mapCluster.mMinLon))
                        .strokeColor(Color.TRANSPARENT)
                        .fillColor(Color.parseColor("#66" + String.format("%06X", 0xFFFFFF & color)))));
            }
        }
    }
}

From source file:babbq.com.searchplace.SearchActivity.java

@OnClick(R.id.fab)
protected void save() {
    // show the save confirmation bubble
    fab.setVisibility(View.INVISIBLE);
    confirmSaveContainer.setVisibility(View.VISIBLE);
    resultsScrim.setVisibility(View.VISIBLE);

    // expand it once it's been measured and show a scrim over the search results
    confirmSaveContainer.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {

        @Override/* ww w.  ja  v  a2s.c o  m*/
        public boolean onPreDraw() {
            // expand the confirmation
            confirmSaveContainer.getViewTreeObserver().removeOnPreDrawListener(this);
            Animator reveal = ViewAnimationUtils.createCircularReveal(confirmSaveContainer,
                    confirmSaveContainer.getWidth() / 2, confirmSaveContainer.getHeight() / 2,
                    fab.getWidth() / 2, confirmSaveContainer.getWidth() / 2);
            reveal.setDuration(250L);
            reveal.setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,
                    android.R.interpolator.fast_out_slow_in));
            reveal.start();

            // show the scrim
            int centerX = (fab.getLeft() + fab.getRight()) / 2;
            int centerY = (fab.getTop() + fab.getBottom()) / 2;
            Animator revealScrim = ViewAnimationUtils.createCircularReveal(resultsScrim, centerX, centerY, 0,
                    (float) Math.hypot(centerX, centerY));
            revealScrim.setDuration(400L);
            revealScrim.setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,
                    android.R.interpolator.linear_out_slow_in));
            revealScrim.start();
            ObjectAnimator fadeInScrim = ObjectAnimator.ofArgb(resultsScrim, ViewUtils.BACKGROUND_COLOR,
                    Color.TRANSPARENT, ContextCompat.getColor(SearchActivity.this, R.color.scrim));
            fadeInScrim.setDuration(800L);
            fadeInScrim.setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,
                    android.R.interpolator.linear_out_slow_in));
            fadeInScrim.start();

            // ease in the checkboxes
            //                saveDribbble.setAlpha(0.6f);
            //                saveDribbble.setTranslationY(saveDribbble.getHeight() * 0.4f);
            //                saveDribbble.animate()
            //                        .alpha(1f)
            //                        .translationY(0f)
            //                        .setDuration(200L)
            //                        .setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,
            //                                android.R.interpolator.linear_out_slow_in));
            //                saveDesignerNews.setAlpha(0.6f);
            //                saveDesignerNews.setTranslationY(saveDesignerNews.getHeight() * 0.5f);
            //                saveDesignerNews.animate()
            //                        .alpha(1f)
            //                        .translationY(0f)
            //                        .setDuration(200L)
            //                        .setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,
            //                                android.R.interpolator.linear_out_slow_in));
            return false;
        }
    });
}

From source file:com.spoiledmilk.ibikecph.LeftMenu.java

@SuppressWarnings("deprecation")
public void updateControls() {
    LOG.d("LeftMenu updateControls");
    if (!IbikeApplication.isUserLogedIn()) {
        favoritesContainer.setBackgroundDrawable(null);
        textFavoriteHint.setTextColor(getHintDisabledTextColor());
        textNewFavorite.setTextColor(Color.rgb(60, 60, 60));
        imgAdd.setImageResource(R.drawable.fav_plus_none);
        favoritesList.setAdapter(null);//from  w  w w .  j  a  va  2s  .com
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT, Util.dp2px(150));
        favoritesContainerHeight = Util.dp2px(150);
        params.addRule(RelativeLayout.CENTER_HORIZONTAL);
        params.addRule(RelativeLayout.BELOW, favoritesHeaderContainer.getId());
        favoritesContainer.setLayoutParams(params);
        addContainer.setPadding((int) (Util.getScreenWidth() / 7 + Util.dp2px(7)), (int) Util.dp2px(5), 0,
                (int) Util.dp2px(34));
        // getView().findViewById(R.id.imgRightArrow).setVisibility(View.INVISIBLE);
        textFavoriteHint.setVisibility(View.VISIBLE);
        btnEditFavorites.setVisibility(View.INVISIBLE);
        btnEditFavorites.setEnabled(false);
        lastListDivider.setVisibility(View.GONE);
        params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        params.topMargin = Util.dp2px(3);
        // imgAdd.setLayoutParams(params);
        textNewFavorite.setPadding(Util.dp2px(0), 0, 0, Util.dp2px(0));
        params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        params.bottomMargin = Util.getDensity() >= 2 ? Util.dp2px(40) : Util.dp2px(20);
        addContainer.setLayoutParams(params);
        addContainer.setPadding(Util.getDensity() >= 2 ? Util.dp2px(60) : Util.dp2px(40), Util.dp2px(7), 0,
                Util.dp2px(7));
        addContainer.setBackgroundColor(Color.TRANSPARENT);
        addContainer.setClickable(false);
    } else if (favorites == null || favorites.size() == 0) {
        favoritesContainer.setBackgroundResource(R.drawable.add_fav_background_selector);
        addContainer.setBackgroundColor(Color.TRANSPARENT);// addContainer.setBackgroundResource(R.drawable.add_fav_background_selector);
        lastListDivider.setVisibility(View.GONE);
        favoritesList.setVisibility(View.GONE);
        textFavoriteHint.setVisibility(View.VISIBLE);
        // getView().findViewById(R.id.imgRightArrow).setVisibility(View.VISIBLE);
        favoritesContainer.setClickable(true);
        imgAdd.setImageResource(R.drawable.fav_add);
        textFavoriteHint.setTextColor(getHintEnabledTextColor());
        textNewFavorite.setTextColor(getAddFavoriteTextColor());
        btnEditFavorites.setVisibility(View.INVISIBLE);
        btnEditFavorites.setEnabled(false);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT, Util.dp2px(150));
        favoritesContainerHeight = Util.dp2px(150);
        params.addRule(RelativeLayout.CENTER_HORIZONTAL);
        params.addRule(RelativeLayout.BELOW, getView().findViewById(R.id.favoritesHeaderContainer).getId());
        favoritesContainer.setLayoutParams(params);
        addContainer.setPadding((int) (Util.getScreenWidth() / 7 + Util.dp2px(7)), (int) Util.dp2px(5), 0,
                (int) Util.dp2px(34));
        params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        params.topMargin = Util.dp2px(3);
        // imgAdd.setLayoutParams(params);
        textNewFavorite.setPadding(0, 0, 0, 0);
        params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        params.addRule(RelativeLayout.CENTER_HORIZONTAL);
        params.bottomMargin = Util.getDensity() >= 2 ? Util.dp2px(40) : Util.dp2px(20);
        addContainer.setLayoutParams(params);
        addContainer.setPadding(Util.getDensity() >= 2 ? Util.dp2px(0) : Util.dp2px(10), Util.dp2px(7), 0,
                Util.dp2px(7));
        addContainer.setClickable(false);
    } else {
        // Loged in, and there is a list of favorites
        favoritesList.clearAnimations();
        favoritesList.setVisibility(View.VISIBLE);
        if (listAdapter != null) {
            ((FavoritesAdapter) listAdapter).setIsEditMode(isEditMode);
            btnEditFavorites.setVisibility(isEditMode ? View.INVISIBLE : View.VISIBLE);
            btnEditFavorites.setEnabled(!isEditMode);
            btnDone.setVisibility(isEditMode ? View.VISIBLE : View.INVISIBLE);
            btnDone.setEnabled(isEditMode);
        }
        textFavoriteHint.setVisibility(View.GONE);
        if (getView() != null) {
            addContainer.setVisibility(isEditMode ? View.GONE : View.VISIBLE);
            // getView().findViewById(R.id.imgRightArrow).setVisibility(View.GONE);
            getView().findViewById(R.id.favoritesContainer).setClickable(false);
            int count = favorites.size();
            int listHeight = count * (menuItemHeight) + Util.dp2px(1) * count;
            int viewHeight = (int) (Util.getScreenHeight() - Util.dp2px(26)); //
            // screen height without the
            // notifications bar
            int avaliableHeight = viewHeight - (menuItemHeight * (getMenuItemsCount() + (isEditMode ? 0 : 1)))
                    - (getMenuItemsCount() * dividerHeight);
            LOG.d("available height = " + avaliableHeight);
            LOG.d("list height = " + listHeight);
            if (listHeight > avaliableHeight) {
                listHeight = avaliableHeight;
            }
            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                    RelativeLayout.LayoutParams.MATCH_PARENT,
                    (isEditMode ? listHeight : (listHeight + menuItemHeight)));
            favoritesContainerHeight = (isEditMode ? listHeight : (listHeight + menuItemHeight));
            params.addRule(RelativeLayout.CENTER_HORIZONTAL);
            params.addRule(RelativeLayout.BELOW, getView().findViewById(R.id.horizontalDivider1).getId());
            favoritesContainer.setLayoutParams(params);
            params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, listHeight);
            params.addRule(RelativeLayout.CENTER_HORIZONTAL);
            params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
            getView().findViewById(R.id.favoritesListContainer).setLayoutParams(params);
            imgAdd.setImageResource(R.drawable.fav_add);
            textFavoriteHint.setTextColor(Color.WHITE);
            textNewFavorite.setTextColor(getAddFavoriteTextColor());
            lastListDivider.setVisibility(
                    (isEditMode || favorites.size() <= getFavoritesVisibleItemCount()) ? View.GONE
                            : View.VISIBLE);
            updateFavoritesContainer();
            addContainer.setPadding((int) Util.dp2px(30), (int) Util.dp2px(0), 0, (int) Util.dp2px(0));
            params = new RelativeLayout.LayoutParams(Util.dp2px(14), Util.dp2px(14));
            params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
            params.addRule(RelativeLayout.CENTER_VERTICAL);
            params.bottomMargin = Util.dp2px(0);
            // imgAdd.setLayoutParams(params);
            params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, menuItemHeight);
            params.addRule(RelativeLayout.BELOW, getView().findViewById(R.id.favoritesListContainer).getId());
            if (!isEditMode) {
                addContainer.setLayoutParams(params);
            }
            addContainer.setBackgroundResource(R.drawable.add_fav_background_selector);
            addContainer.setClickable(true);
            textNewFavorite.setPadding(Util.dp2px(4), 0, 0, 0);
            ((FavoritesAdapter) listAdapter).notifyDataSetChanged();
        }
    }

}

From source file:com.dwdesign.tweetings.fragment.StatusFragment.java

@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {
    if (intent == null || mStatus == null)
        return;/* w w w.  j  av a 2s .c  om*/
    switch (requestCode) {
    case REQUEST_SET_COLOR: {
        if (resultCode == Activity.RESULT_OK)
            if (intent != null && intent.getExtras() != null) {
                final int color = intent.getIntExtra(Accounts.USER_COLOR, Color.TRANSPARENT);
                setUserColor(getActivity(), mStatus.user_id, color);
                updateUserColor();
            }
        break;
    }
    }

}

From source file:com.gmail.walles.johan.batterylogger.BatteryPlotFragment.java

private LineAndPointFormatter getMedianFormatter() {
    LineAndPointFormatter medianFormatter = new LineAndPointFormatter();
    medianFormatter.setPointLabelFormatter(new PointLabelFormatter());
    medianFormatter.setPointLabeler(new PointLabeler() {
        @Override/*from   ww  w . j ava  2s . c  o  m*/
        public String getLabel(XYSeries xySeries, int i) {
            return "";
        }
    });
    medianFormatter.getLinePaint().setStrokeWidth(7);
    medianFormatter.getLinePaint().setColor(Color.GREEN);
    medianFormatter.getVertexPaint().setColor(Color.TRANSPARENT);
    medianFormatter.getFillPaint().setColor(Color.TRANSPARENT);
    return medianFormatter;
}

From source file:com.sergioventura.wxllpaper.ui.MainActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override/*w ww  .j a  va  2  s.co  m*/
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == RQ_CROPANDSETWALLPAPER) {
        WallpapersFragment.showToast(this, R.string.wallpaper_set);
        WallpaperUtils.resetOptionCache(true);
    } else if (requestCode == RQ_VIEWWALLPAPER) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mDrawer != null) {
            getWindow().setStatusBarColor(Color.TRANSPARENT);
            mDrawer.setStatusBarBackgroundColor(DialogUtils.resolveColor(this, R.attr.colorPrimaryDark));
        }
        if (mRecyclerView != null) {
            mRecyclerView.requestFocus();
            final int currentPos = data.getIntExtra(STATE_CURRENT_POSITION, 0);
            mRecyclerView.post(new Runnable() {
                @Override
                public void run() {
                    mRecyclerView.smoothScrollToPosition(currentPos);
                }
            });
        }
    }
}