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.albedinsky.android.ui.widget.SearchView.java

/**
 * Applies current tint from {@link #mTintInfo} to all drawable components of this widget.
 *///  w  w  w . ja  v a 2 s. c  o m
@SuppressWarnings("ConstantConditions")
private void applyTint() {
    if (mTintInfo == null || (!mTintInfo.hasTintList && !mTintInfo.hasTintMode)) {
        return;
    }
    this.applyTintToButton(mButtonIcon);
    this.applyTintToButton(mButtonVoiceSearch);
    this.applyTintToButton(mButtonClear);
    if (!UiConfig.MATERIALIZED) {
        // Tint also left/right and middle search selection handles. These handles can not be
        // unfortunately set programmatically so we will tint directly drawables within resources.
        final Resources resources = getResources();
        final Resources.Theme theme = mContext.getTheme();
        final int tintColor = mTintInfo.textSelectHandleTintList != null
                ? mTintInfo.textSelectHandleTintList.getDefaultColor()
                : Color.TRANSPARENT;
        TintManager.tintRawDrawable(
                ResourceUtils.getDrawable(resources, R.drawable.ui_search_text_select_handle_left_alpha, theme),
                tintColor, PorterDuff.Mode.SRC_IN);
        TintManager
                .tintRawDrawable(
                        ResourceUtils.getDrawable(resources,
                                R.drawable.ui_search_text_select_handle_middle_alpha, theme),
                        tintColor, PorterDuff.Mode.SRC_IN);
        TintManager.tintRawDrawable(ResourceUtils.getDrawable(resources,
                R.drawable.ui_search_text_select_handle_right_alpha, theme), tintColor, PorterDuff.Mode.SRC_IN);
    }
}

From source file:com.bilibili.magicasakura.utils.ThemeUtils.java

static @ColorInt int replaceColorById(Context context, @ColorRes int colorId) {
    return mSwitchColor == null ? Color.TRANSPARENT : mSwitchColor.replaceColorById(context, colorId);
}

From source file:com.bilibili.magicasakura.utils.ThemeUtils.java

static @ColorInt int replaceColor(Context context, @ColorInt int color) {
    return mSwitchColor == null ? Color.TRANSPARENT : mSwitchColor.replaceColor(context, color);
}

From source file:com.gigigo.vuforia.core.sdkimagerecognition.cloudrecognition.CloudRecognition.java

@Override
public void onInitARDone(VuforiaException exception) {
    if (exception == null) {
        initApplicationAR();//from w w w  . ja v  a2 s  .c  o  m

        // Start the camera:
        try {
            vuforiaAppSession.startAR(CameraDevice.CAMERA_DIRECTION.CAMERA_DIRECTION_DEFAULT);
        } catch (VuforiaException e) {
            GGGLogImpl.log(e.getMessage(), LogLevel.ERROR);
        }

        boolean result = CameraDevice.getInstance()
                .setFocusMode(CameraDevice.FOCUS_MODE.FOCUS_MODE_CONTINUOUSAUTO);

        if (!result)
            GGGLogImpl.log("Unable to enable continuous autofocus", LogLevel.ERROR);

        mUILayout.bringToFront();

        // Hides the Loading Dialog
        loadingDialogHandler.sendEmptyMessage(HIDE_LOADING_DIALOG);

        mUILayout.setBackgroundColor(Color.TRANSPARENT);
        this.mCommunicator.setContentViewTop(mGlView);
    } else {
        GGGLogImpl.log(exception.getString(), LogLevel.ERROR);
        if (mInitErrorCode != 0) {

            showErrorMessage(mInitErrorCode, 10, true);
        } else {
            this.mActivity.finish();
            GGGLogImpl.log(exception.getMessage(), LogLevel.ERROR);
        }
    }
}

From source file:babbq.com.searchplace.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(// ww  w  .  j  a  v  a 2s . co  m
                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
            public void onAnimationEnd(Animator animation) {
                confirmSaveContainer.setVisibility(View.GONE);
                resultsScrim.setVisibility(View.GONE);
                //                    fab.setVisibility(results.getVisibility());
            }
        });
        hideConfirmation.start();
    }
}

From source file:com.saulcintero.moveon.fragments.Summary3.java

private XYMultipleSeriesRenderer getRenderer_type2(int type) {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    XYSeriesRenderer r = new XYSeriesRenderer();

    r = new XYSeriesRenderer();
    r.setFillPoints(true);/*  ww w . j a va 2s.  c  om*/
    r.setLineWidth(2f);
    r.setDisplayChartValues(false);
    r.setChartValuesTextSize(10f);

    switch (type) {
    case 1:
        r.setColor(Color.rgb(0, 0, 188));
        r.setFillBelowLine(true);
        break;
    case 2:
        r.setColor(Color.rgb(255, 124, 0));
        break;
    }

    renderer.addSeriesRenderer(r);
    renderer.setAxesColor(Color.WHITE);
    renderer.setLabelsColor(Color.LTGRAY);
    renderer.setBackgroundColor(Color.TRANSPARENT);
    renderer.setTextTypeface("sans_serif", Typeface.BOLD);

    renderer.setLabelsTextSize(14f);
    renderer.setAxisTitleTextSize(15);
    renderer.setLegendTextSize(15);

    renderer.setXTitle(FunctionUtils.capitalizeFirtsLetter(getString(R.string.minutes)));
    renderer.setXLabels(20);
    renderer.setYLabels(20);
    renderer.setYLabelsAlign(Align.LEFT);
    renderer.setShowGrid(false);
    renderer.setXAxisMin((timeList.get(0) / 60));
    renderer.setXAxisMax((float) ((float) timeList.get(timeList.size() - 1) / 60));

    switch (type) {
    case 1:
        renderer.setYTitle(
                isMetric ? FunctionUtils.capitalizeFirtsLetter(getString(R.string.long_unit1_detail_10))
                        : FunctionUtils.capitalizeFirtsLetter(getString(R.string.long_unit2_detail_10)));
        renderer.setYAxisMin(min_altitude);
        renderer.setYAxisMax(max_altitude);
        break;
    case 2:
        renderer.setYTitle(
                isMetric ? getString(R.string.long_unit1_detail_7) : getString(R.string.long_unit2_detail_7));
        renderer.setYAxisMin(min_speed);
        renderer.setYAxisMax(max_speed);
        break;
    }

    return renderer;
}

From source file:com.afollestad.polar.ui.MainActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override//from www.  j a  va 2  s .  c om
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));
        }
    }
}

From source file:com.aware.Aware_Preferences.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mSensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);

    //Start the Aware
    Intent startAware = new Intent(getApplicationContext(), Aware.class);
    startService(startAware);//from   www  .  j a va  2s  . c  om

    addPreferencesFromResource(R.xml.aware_preferences);
    setContentView(R.layout.aware_ui);

    navigationDrawer = (DrawerLayout) findViewById(R.id.aware_ui_main);
    navigationList = (ListView) findViewById(R.id.aware_navigation);
    navigationToggle = new ActionBarDrawerToggle(this, navigationDrawer, R.drawable.ic_drawer,
            R.string.drawer_open, R.string.drawer_close) {
        @Override
        public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            if (Build.VERSION.SDK_INT > 11) {
                getActionBar().setTitle(getTitle());
                invalidateOptionsMenu();
            }
        }

        @Override
        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            if (Build.VERSION.SDK_INT > 11) {
                getActionBar().setTitle(getTitle());
                invalidateOptionsMenu();
            }
        }
    };

    navigationDrawer.setDrawerListener(navigationToggle);

    String[] options = { "Stream", "Sensors", "Plugins", "Studies" };
    NavigationAdapter nav_adapter = new NavigationAdapter(getApplicationContext(), options);
    navigationList.setAdapter(nav_adapter);
    navigationList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            LinearLayout item_container = (LinearLayout) view.findViewById(R.id.nav_container);
            item_container.setBackgroundColor(Color.DKGRAY);

            for (int i = 0; i < navigationList.getChildCount(); i++) {
                if (i != position) {
                    LinearLayout other = (LinearLayout) navigationList.getChildAt(i);
                    LinearLayout other_item = (LinearLayout) other.findViewById(R.id.nav_container);
                    other_item.setBackgroundColor(Color.TRANSPARENT);
                }
            }

            Bundle animations = ActivityOptions.makeCustomAnimation(Aware_Preferences.this,
                    R.anim.anim_slide_in_left, R.anim.anim_slide_out_left).toBundle();
            switch (position) {
            case 0: //Stream
                Intent stream_ui = new Intent(Aware_Preferences.this, Stream_UI.class);
                startActivity(stream_ui, animations);
                break;
            case 1: //Sensors
                Intent sensors_ui = new Intent(Aware_Preferences.this, Aware_Preferences.class);
                startActivity(sensors_ui, animations);
                break;
            case 2: //Plugins
                Intent plugin_manager = new Intent(Aware_Preferences.this, Plugins_Manager.class);
                startActivity(plugin_manager, animations);
                break;
            case 3: //Studies
                if (Aware.getSetting(getApplicationContext(), "study_id").length() > 0) {
                    new Async_StudyData().execute(
                            Aware.getSetting(getApplicationContext(), Aware_Preferences.WEBSERVICE_SERVER));
                } else {
                    Intent join_study = new Intent(Aware_Preferences.this, CameraStudy.class);
                    startActivityForResult(join_study, REQUEST_JOIN_STUDY, animations);
                }
                break;
            }

            navigationDrawer.closeDrawer(navigationList);
        }
    });

    if (getActionBar() != null) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
        getActionBar().setHomeButtonEnabled(true);
    }

    SharedPreferences prefs = getSharedPreferences(getPackageName(), Context.MODE_PRIVATE);
    if (prefs.getAll().isEmpty()
            && Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID).length() == 0) {
        is_first_time = true;
        PreferenceManager.setDefaultValues(getApplicationContext(), getPackageName(), Context.MODE_PRIVATE,
                R.xml.aware_preferences, true);
        prefs.edit().commit(); //commit changes
    } else {
        PreferenceManager.setDefaultValues(getApplicationContext(), getPackageName(), Context.MODE_PRIVATE,
                R.xml.aware_preferences, false);
    }

    Map<String, ?> defaults = prefs.getAll();
    for (Map.Entry<String, ?> entry : defaults.entrySet()) {
        if (Aware.getSetting(getApplicationContext(), entry.getKey()).length() == 0) {
            Aware.setSetting(getApplicationContext(), entry.getKey(), entry.getValue());
        }
    }

    if (Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID).length() == 0) {
        UUID uuid = UUID.randomUUID();
        Aware.setSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID, uuid.toString());
    }
}

From source file:com.jjoe64.graphview.Viewport.java

/**
 * creates the viewport//  www  . j  a  va2s.  co  m
 *
 * @param graphView graphview
 */
Viewport(GraphView graphView) {
    mScroller = new OverScroller(graphView.getContext());
    mEdgeEffectTop = new EdgeEffectCompat(graphView.getContext());
    mEdgeEffectBottom = new EdgeEffectCompat(graphView.getContext());
    mEdgeEffectLeft = new EdgeEffectCompat(graphView.getContext());
    mEdgeEffectRight = new EdgeEffectCompat(graphView.getContext());
    mGestureDetector = new GestureDetector(graphView.getContext(), mGestureListener);
    mScaleGestureDetector = new ScaleGestureDetector(graphView.getContext(), mScaleGestureListener);

    mGraphView = graphView;
    mXAxisBoundsStatus = AxisBoundsStatus.INITIAL;
    mYAxisBoundsStatus = AxisBoundsStatus.INITIAL;
    mBackgroundColor = Color.TRANSPARENT;
    mPaint = new Paint();
}

From source file:com.amaze.carbonfilemanager.fragments.ProcessViewer.java

/**
 * Initialize chart for the first time//from   ww w.ja  v  a2  s .c  om
 * @param totalBytes maximum value for x-axis
 */
private void chartInit(long totalBytes) {
    mLineChart.setBackgroundColor(accentColor);
    mLineChart.getLegend().setEnabled(false);

    // no description text
    mLineChart.getDescription().setEnabled(false);

    XAxis xAxis = mLineChart.getXAxis();
    YAxis yAxisLeft = mLineChart.getAxisLeft();
    mLineChart.getAxisRight().setEnabled(false);
    yAxisLeft.setTextColor(Color.WHITE);
    yAxisLeft.setAxisLineColor(Color.TRANSPARENT);
    yAxisLeft.setTypeface(Typeface.DEFAULT_BOLD);
    yAxisLeft.setGridColor(Utils.getColor(getContext(), R.color.white_translucent));

    xAxis.setAxisMaximum(Futils.readableFileSizeFloat(totalBytes));
    xAxis.setAxisMinimum(0.0f);
    xAxis.setAxisLineColor(Color.TRANSPARENT);
    xAxis.setGridColor(Color.TRANSPARENT);
    xAxis.setTextColor(Color.WHITE);
    xAxis.setTypeface(Typeface.DEFAULT_BOLD);
    mLineChart.setData(mLineData);
    mLineChart.invalidate();
}