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:io.cloudmatch.demo.swipeandcolor.SACActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_swipe_and_color_demo);
    ButterKnife.bind(this);

    mColorIV.setBackgroundColor(Color.TRANSPARENT);

    // create layout programmatically so we can pass the activity as context
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    mDrawingLayout = new SACDrawingLayout(this, mSwipeAndColorDemoSEL, new LocationProvider() {
        @Override//from w w  w  .  j  av a2s  . c  o  m
        public Location getLocation() {
            if (mGoogleApiClient.isConnected()) {
                mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
            }
            return mLastLocation;
        }
    });
    mDrawingLayout.setLayoutParams(params);
    mDrawingLayout.setBackgroundColor(Color.TRANSPARENT);
    mContainer.addView(mDrawingLayout);

    // init google api client
    mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
            .enableAutoManage(this, this).addApi(LocationServices.API).build();
}

From source file:com.facebook.react.views.scroll.ReactScrollViewManager.java

/**
 * When set, fills the rest of the scrollview with a color to avoid setting a background and
 * creating unnecessary overdraw./*  w w  w.j a v  a  2  s  .  c o m*/
 * @param view
 * @param color
 */
@ReactProp(name = "endFillColor", defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBottomFillColor(ReactScrollView view, int color) {
    view.setEndFillColor(color);
}

From source file:com.jackpan.TaiwanpetadoptionApp.HeadpageActivity.java

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);//    
    requestWindowFeature(Window.FEATURE_NO_TITLE);// ?APP
    setContentView(R.layout.activity_headpage);
    ConnectivityManager conManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
    NetworkInfo networInfo = conManager.getActiveNetworkInfo();

    if (networInfo == null || !networInfo.isAvailable()) {
        new AlertDialog.Builder(HeadpageActivity.this).setTitle(getString(R.string.Network_status))
                .setMessage(getString(R.string.no_network)).setCancelable(false)
                .setPositiveButton(getString(R.string.setting), new DialogInterface.OnClickListener() {

                    @Override//from  w w  w.  j ava2  s  .  c  o  m
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        Intent settintIntent = new Intent(android.provider.Settings.ACTION_SETTINGS);
                        startActivity(settintIntent);

                    }
                }).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        HeadpageActivity.this.finish();
                    }
                }).show();

    } else {
        final ProgressDialog progressDialog = ProgressDialog.show(HeadpageActivity.this,
                getString(R.string.Network_in), getString(R.string.waitting));
        final Handler handler = new Handler();
        final Runnable runnable = new Runnable() {

            @Override
            public void run() {
                // TODO Auto-generated method stub
                new AlertDialog.Builder(HeadpageActivity.this);

                progressDialog.dismiss();

            }
        };

        Thread thread = new Thread() {

            @Override
            public void run() {
                try {
                    Thread.sleep(1500);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                handler.post(runnable);
            }
        };
        thread.start();

    }

    final TextView test = (TextView) findViewById(R.id.textView1);
    Timer timer = new Timer();

    TimerTask task = new TimerTask() {
        public void run() {
            runOnUiThread(new Runnable() {
                public void run() {
                    if (change) {
                        change = false;
                        test.setTextColor(Color.TRANSPARENT); // ?
                    } else {
                        change = true;
                        test.setTextColor(Color.DKGRAY);
                    }
                }
            });
        }
    };
    timer.schedule(task, 1, 800); // ?(timer???)

    mHelper = new IabHelper(this, getString(R.string.my_license_key));
    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
        public void onIabSetupFinished(IabResult result) {
            if (!result.isSuccess()) {

                MySharedPrefernces.saveIsBuyed(HeadpageActivity.this, false);
            } else {

                MySharedPrefernces.saveIsBuyed(HeadpageActivity.this, false);
                mHelper.queryInventoryAsync(mGotInventoryListener);
            }

        }
    });

    GetButtonView();
    setButtonEvent();
    buildGoogleApiClient();

}

From source file:com.rnnestedscrollview.ReactNestedScrollViewManager.java

/**
 * When set, fills the rest of the scrollview with a color to avoid setting a background and
 * creating unnecessary overdraw./* w w w  . ja  v a  2s  .  c  o  m*/
 * @param view
 * @param color
 */
@ReactProp(name = "endFillColor", defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBottomFillColor(ReactNestedScrollView view, int color) {
    view.setEndFillColor(color);
}

From source file:com.cryart.sabbathschool.ui.fragment.SSWebViewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View _view = inflater.inflate(R.layout.ss_webview_fragment, null);

    _SSPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());

    _SSWebView = (SSWebView) _view.findViewById(R.id.ss_webview);
    _SSWebViewLoading = (ProgressBar) _view.findViewById(R.id.ss_webview_loading);
    _SSWebView.setBackgroundColor(Color.TRANSPARENT);

    _SSHero = (KenBurnsView) getActivity().findViewById(R.id.ss_hero);

    _SSWebView.addJavascriptInterface(new SSWebInterface(getActivity()), "SSBridge");
    _SSWebView.getSettings().setJavaScriptEnabled(true);
    _SSWebView.setWebViewClient(new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            _SSWebViewLoading.setVisibility(View.INVISIBLE);
            view.setVisibility(View.VISIBLE);

            setHighlights(_SSDay._day_highlights);
            setComments(_SSDay._day_comments);
        }// w ww  .  j a  va  2 s  . com
    });

    this.loadDay(_SSDayDate);

    _SSWebView.setOnScrollChangedCallback((SSMainActivity) getActivity());

    return _view;
}

From source file:com.adkdevelopment.earthquakesurvival.utils.Utilities.java

/**
 * Creates Bitmap for a Map marker depending on the magnitude of an earthquake
 * @param context from which call is being made
 * @param magnitude from 0 to 10 scale earthquake intensity
 * @return colorful oval of size depending on magnitude
 *//*from ww  w.  j  a  v  a 2  s.com*/
public static Bitmap getEarthquakeMarker(Context context, Double magnitude) {

    if (magnitude < 1) {
        magnitude = 1.0;
    }

    GradientDrawable oval;
    oval = (GradientDrawable) ContextCompat.getDrawable(context, R.drawable.marker);

    if (oval != null) {

        int STROKE_SIZE = 5;
        float DASH_WIDTH = 9f;
        float DASH_GAP = 3f;

        if (magnitude >= 3 && magnitude <= 5) {
            oval.setColors(new int[] { Color.TRANSPARENT, Color.BLUE });
            oval.setStroke(STROKE_SIZE, Color.BLUE, DASH_WIDTH, DASH_GAP);
        } else if (magnitude > 5 && magnitude < 7) {
            oval.setColors(new int[] { Color.TRANSPARENT, Color.YELLOW });
            oval.setStroke(STROKE_SIZE, Color.YELLOW, DASH_WIDTH, DASH_GAP);
        } else if (magnitude >= 7) {
            oval.setColors(new int[] { Color.TRANSPARENT, Color.RED });
            oval.setStroke(STROKE_SIZE, Color.RED, DASH_WIDTH, DASH_GAP);
        } else {
            oval.setColors(new int[] { Color.TRANSPARENT, Color.GREEN });
            oval.setStroke(STROKE_SIZE, Color.GREEN, DASH_WIDTH, DASH_GAP);
        }

        int diameter = (int) (oval.getIntrinsicWidth() * magnitude / 4);

        Canvas canvas = new Canvas();
        Bitmap icon = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888);

        canvas.setBitmap(icon);
        oval.setBounds(0, 0, diameter, diameter);
        oval.draw(canvas);

        return icon;
    } else {
        return null;
    }
}

From source file:com.justwayward.reader.base.BaseActivity.java

protected void hideStatusBar() {
    WindowManager.LayoutParams attrs = getWindow().getAttributes();
    attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
    getWindow().setAttributes(attrs);//  w w w.ja  v  a  2 s. com
    if (statusBarView != null) {
        statusBarView.setBackgroundColor(Color.TRANSPARENT);
    }
}

From source file:com.example.haizhu.myvoiceassistant.ui.RobotChatActivity.java

private void setStatusBarTranslate() {
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(Color.TRANSPARENT);
    }//from  w w w  .  j a v a2  s . co  m
}

From source file:com.google.android.gms.samples.vision.face.sleepAlert.DAssistActivity.java

/**
 * Initializes the UI and initiates the creation of a face detector.
 */// w  w w  .  j  av a  2s  .c  o m
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.main);

    mPreview = (CameraSourcePreview) findViewById(R.id.preview);
    mGraphicOverlay = (GraphicOverlay) findViewById(R.id.faceOverlay);
    this.jumbleButton = (Button) findViewById(R.id.Button01);
    this.exitButton = (Button) findViewById(R.id.button);
    this.mp = new MediaPlayer();
    this.tv = (TextView) findViewById(R.id.DisplayMsg);
    this.layout = (RelativeLayout) findViewById(R.id.topLayout);
    this.sc = (CameraSourcePreview) findViewById(R.id.preview);
    this.go = (GraphicOverlay) findViewById(R.id.faceOverlay);
    AssetManager am = getApplicationContext().getAssets();
    AssetFileDescriptor afd = null;
    try {
        afd = am.openFd("Song.mp3");
        this.mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
        this.mp.prepare();
    } catch (IOException e) {
        e.printStackTrace();
    }

    // Check for the camera permission before accessing the camera.  If the
    // permission is not granted yet, request permission.
    int rc = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
    if (rc == PackageManager.PERMISSION_GRANTED) {
        createCameraSource();
    } else {
        requestCameraPermission();
    }
    navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(final MenuItem menuItem) {
            System.out.println("Srini in onNavigationItemSelected part");
            // Handle navigation view item clicks here.
            int id = menuItem.getItemId();

            if (id == R.id.nav_slideshow) {
                // Handle the camera action
            } else if (id == R.id.nav_manage) {

            } else if (id == R.id.nav_manage_toggle) {

                if (checked == 0) {
                    go.setBackgroundColor(Color.TRANSPARENT);
                    checked = 1;
                } else {
                    go.setBackgroundColor(Color.BLUE);
                    checked = 0;

                }

            }

            DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
            drawer.closeDrawer(GravityCompat.START);
            return true;
        }

    });
}

From source file:com.github.guwenk.smuradio.SignInDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    builder = new AlertDialog.Builder(getActivity());
    View signInDialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_sign_in, null);
    builder.setView(signInDialogView);//from  w  w  w. j  a  va  2 s.  c o  m
    builder.setMessage(R.string.upload_your_song);

    checkBox = (CheckBox) signInDialogView.findViewById(R.id.checkBox2);

    int currentOrientation = getResources().getConfiguration().orientation;
    if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
        getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    } else {
        getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
    }

    check1 = false;
    check2 = false;
    check3 = false;
    // Log.d(AuthTag, "onCreateDialog " + check1 + " " + check2 + " " + check3);

    this.mGoogleApiClient = OrderActivity.getmGoogleApiClient();
    mAuth = FirebaseAuth.getInstance();

    selectFileButton = (Button) signInDialogView.findViewById(R.id.selectFileButton);
    selectFileButton.setOnClickListener(new customButtonClickListener());

    signInButton = (SignInButton) signInDialogView.findViewById(R.id.sign_in_button);
    signInButton.setStyle(SignInButton.SIZE_WIDE, SignInButton.COLOR_AUTO);
    signInButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            signIn();
        }
    });

    builder.setPositiveButton(getString(R.string.next), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            // TODO upload song
        }
    });

    builder.setNegativeButton(R.string.close, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });

    SpannableString ss = new SpannableString(getString(R.string.you_accepting_license_agreement));
    ClickableSpan clickableSpan = new ClickableSpan() {
        @Override
        public void onClick(View textView) {
            Log.d(AuthTag, "click");
            LicenseDialog licenseDialog = new LicenseDialog();
            licenseDialog.show(getFragmentManager(), "Sing in dialog");
        }

        @Override
        public void updateDrawState(TextPaint ds) {
            super.updateDrawState(ds);
            ds.setUnderlineText(true);
        }
    };
    ss.setSpan(clickableSpan, 14, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    TextView textView = (TextView) signInDialogView.findViewById(R.id.textView);
    textView.setText(ss);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    textView.setHighlightColor(Color.TRANSPARENT);

    checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            check2 = isChecked;
            Log.d(AuthTag, "Checked: " + isChecked);
            buttonStatus();
        }
    });

    mStorageRef = FirebaseStorage.getInstance().getReference();

    alert = builder.create();
    return alert;
}