Example usage for android.graphics Color BLACK

List of usage examples for android.graphics Color BLACK

Introduction

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

Prototype

int BLACK

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

Click Source Link

Usage

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

/**
 * resets the styles. This loads the style
 * from reading the values of the current
 * theme./*  w  w  w .  j  a  va2 s .  co  m*/
 */
public void resetStyles() {
    // get matching styles from theme
    TypedValue typedValue = new TypedValue();
    mGraphView.getContext().getTheme().resolveAttribute(android.R.attr.textAppearanceSmall, typedValue, true);

    int color1;
    int color2;
    int size;
    int size2;

    TypedArray array = null;
    try {
        array = mGraphView.getContext().obtainStyledAttributes(typedValue.data,
                new int[] { android.R.attr.textColorPrimary, android.R.attr.textColorSecondary,
                        android.R.attr.textSize, android.R.attr.horizontalGap });
        color1 = array.getColor(0, Color.BLACK);
        color2 = array.getColor(1, Color.GRAY);
        size = array.getDimensionPixelSize(2, 20);
        size2 = array.getDimensionPixelSize(3, 20);
        array.recycle();
    } catch (Exception e) {
        color1 = Color.BLACK;
        color2 = Color.GRAY;
        size = 20;
        size2 = 20;
    }

    mStyles.verticalLabelsColor = color1;
    mStyles.verticalLabelsSecondScaleColor = color1;
    mStyles.horizontalLabelsColor = color1;
    mStyles.gridColor = color2;
    mStyles.textSize = size;
    mStyles.padding = size2;
    mStyles.labelsSpace = (int) mStyles.textSize / 5;

    mStyles.verticalLabelsAlign = Paint.Align.RIGHT;
    mStyles.verticalLabelsSecondScaleAlign = Paint.Align.LEFT;
    mStyles.highlightZeroLines = true;

    mStyles.verticalAxisTitleColor = mStyles.verticalLabelsColor;
    mStyles.horizontalAxisTitleColor = mStyles.horizontalLabelsColor;
    mStyles.verticalAxisTitleTextSize = mStyles.textSize;
    mStyles.horizontalAxisTitleTextSize = mStyles.textSize;

    mStyles.horizontalLabelsVisible = true;
    mStyles.verticalLabelsVisible = true;

    mStyles.horizontalLabelsAngle = 0f;

    mStyles.gridStyle = GridStyle.BOTH;

    reloadStyles();
}

From source file:com.moarub.lumiaura.MainActivity.java

public int getColor(String[] events) {
    return Color.BLACK;
}

From source file:com.esri.arcgisruntime.sample.offlinegeocode.MainActivity.java

private void setUpOfflineMapGeocoding() {
    // create a basemap from a local tile package
    TileCache tileCache = new TileCache(extern + getResources().getString(R.string.sandiego_tpk));
    tiledLayer = new ArcGISTiledLayer(tileCache);
    Basemap basemap = new Basemap(tiledLayer);

    // create ArcGISMap with imagery basemap
    mMap = new ArcGISMap(basemap);

    mMapView.setMap(mMap);//from  w  w w  .  j ava2 s.c  o m

    mMap.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            Point p = new Point(-117.162040, 32.718260, SpatialReference.create(4326));
            Viewpoint vp = new Viewpoint(p, 10000);
            mMapView.setViewpointAsync(vp, 3);
        }
    });

    // add a graphics overlay
    graphicsOverlay = new GraphicsOverlay();
    graphicsOverlay.setSelectionColor(0xFF00FFFF);
    mMapView.getGraphicsOverlays().add(graphicsOverlay);

    mGeocodeParameters = new GeocodeParameters();
    mGeocodeParameters.getResultAttributeNames().add("*");
    mGeocodeParameters.setMaxResults(1);

    //[DocRef: Name=Picture Marker Symbol Drawable-android, Category=Fundamentals, Topic=Symbols and Renderers]
    //Create a picture marker symbol from an app resource
    BitmapDrawable startDrawable = (BitmapDrawable) ContextCompat.getDrawable(this, R.drawable.pin);
    mPinSourceSymbol = new PictureMarkerSymbol(startDrawable);
    mPinSourceSymbol.setHeight(90);
    mPinSourceSymbol.setWidth(20);
    mPinSourceSymbol.loadAsync();
    mPinSourceSymbol.setLeaderOffsetY(45);
    mPinSourceSymbol.setOffsetY(-48);

    mReverseGeocodeParameters = new ReverseGeocodeParameters();
    mReverseGeocodeParameters.getResultAttributeNames().add("*");
    mReverseGeocodeParameters.setOutputSpatialReference(mMap.getSpatialReference());
    mReverseGeocodeParameters.setMaxResults(1);

    mLocatorTask = new LocatorTask(extern + getResources().getString(R.string.sandiego_loc));

    mCalloutContent = new TextView(getApplicationContext());
    mCalloutContent.setTextColor(Color.BLACK);
    mCalloutContent.setTextIsSelectable(true);
}

From source file:com.alexlionne.apps.avatars.Utils.DirectoryChooserFragment.java

private void adjustResourceLightness() {
    // change up button to light version if using dark theme
    int color = 0xFFFFFF;
    final Resources.Theme theme = getActivity().getTheme();

    if (theme != null) {
        TypedArray backgroundAttributes = theme
                .obtainStyledAttributes(new int[] { android.R.attr.colorBackground });

        if (backgroundAttributes != null) {
            color = backgroundAttributes.getColor(0, 0xFFFFFF);
            backgroundAttributes.recycle();
        }//from w w  w  . j  av  a 2  s.co  m
    }

    // convert to greyscale and check if < 128
    if (color != 0xFFFFFF
            && 0.21 * Color.red(color) + 0.72 * Color.green(color) + 0.07 * Color.blue(color) < 128) {

        mBtnNavUp.setImageDrawable(new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_expand_less)
                .sizeDp(16).color(Color.WHITE));
        mBtnCreateFolder.setImageDrawable(
                new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_add).sizeDp(16).color(Color.WHITE));
    } else {
        mBtnNavUp.setImageDrawable(new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_expand_less)
                .sizeDp(16).color(Color.BLACK));
        mBtnCreateFolder.setImageDrawable(
                new IconicsDrawable(getActivity(), GoogleMaterial.Icon.gmd_add).sizeDp(16).color(Color.BLACK));
    }
}

From source file:com.prey.activities.CheckPasswordActivity.java

@Override
protected void onResume() {
    super.onResume();
    bindPasswordControls();//w ww  .j a va 2s  .  c o m
    TextView device_ready_h2_text = (TextView) findViewById(R.id.device_ready_h2_text);
    final TextView textForgotPassword = (TextView) findViewById(R.id.link_forgot_password);

    Button password_btn_login = (Button) findViewById(R.id.password_btn_login);
    EditText password_pass_txt = (EditText) findViewById(R.id.password_pass_txt);

    TextView textView1 = (TextView) findViewById(R.id.textView1);
    TextView textView2 = (TextView) findViewById(R.id.textView2);

    Typeface titilliumWebRegular = Typeface.createFromAsset(getAssets(),
            "fonts/Titillium_Web/TitilliumWeb-Regular.ttf");
    Typeface titilliumWebBold = Typeface.createFromAsset(getAssets(),
            "fonts/Titillium_Web/TitilliumWeb-Bold.ttf");
    Typeface magdacleanmonoRegular = Typeface.createFromAsset(getAssets(),
            "fonts/MagdaClean/magdacleanmono-regular.ttf");

    textView1.setTypeface(magdacleanmonoRegular);
    textView2.setTypeface(magdacleanmonoRegular);

    device_ready_h2_text.setTypeface(titilliumWebRegular);
    textForgotPassword.setTypeface(titilliumWebBold);
    password_btn_login.setTypeface(titilliumWebBold);
    password_pass_txt.setTypeface(magdacleanmonoRegular);

    try {

        textForgotPassword.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                try {
                    String url = PreyConfig.getPreyConfig(getApplicationContext()).getPreyPanelUrl();
                    Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(url));
                    startActivity(browserIntent);
                } catch (Exception e) {
                }
            }
        });
    } catch (Exception e) {
    }

    TextView textView5_1 = (TextView) findViewById(R.id.textView5_1);
    TextView textView5_2 = (TextView) findViewById(R.id.textView5_2);

    textView5_1.setTypeface(magdacleanmonoRegular);
    textView5_2.setTypeface(titilliumWebBold);

    TextView textViewUninstall = (TextView) findViewById(R.id.textViewUninstall);
    LinearLayout linearLayoutTour = (LinearLayout) findViewById(R.id.linearLayoutTour);
    textViewUninstall.setTypeface(titilliumWebBold);

    if (PreyConfig.getPreyConfig(getApplication()).getProtectTour()) {
        linearLayoutTour.setVisibility(View.GONE);
        textViewUninstall.setVisibility(View.VISIBLE);

        textViewUninstall.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String url = PreyConfig.getPreyConfig(getApplication()).getPreyUninstallUrl();

                Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(url));
                startActivity(browserIntent);

                finish();
            }
        });
    } else {

        linearLayoutTour.setVisibility(View.VISIBLE);
        textViewUninstall.setVisibility(View.GONE);
        try {

            linearLayoutTour.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(getApplication(), TourActivity1.class);
                    Bundle b = new Bundle();
                    b.putInt("id", 1);
                    intent.putExtras(b);
                    startActivity(intent);
                    finish();
                }
            });
        } catch (Exception e) {

        }
    }

    boolean showLocation = false;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        boolean canAccessFineLocation = PreyPermission.canAccessFineLocation(this);
        boolean canAccessCoarseLocation = PreyPermission.canAccessCoarseLocation(this);
        boolean canAccessCamera = PreyPermission.canAccessCamera(this);
        boolean canAccessReadPhoneState = PreyPermission.canAccessReadPhoneState(this);
        boolean canAccessReadExternalStorage = PreyPermission.canAccessReadExternalStorage(this);

        if (!canAccessFineLocation || !canAccessCoarseLocation || !canAccessCamera || !canAccessReadPhoneState
                || !canAccessReadExternalStorage) {

            AlertDialog.Builder builder = new AlertDialog.Builder(this);

            final FrameLayout frameView = new FrameLayout(this);
            builder.setView(frameView);

            final AlertDialog alertDialog = builder.create();
            LayoutInflater inflater = alertDialog.getLayoutInflater();
            View dialoglayout = inflater.inflate(R.layout.warning, frameView);

            TextView warning_title = (TextView) dialoglayout.findViewById(R.id.warning_title);
            TextView warning_body = (TextView) dialoglayout.findViewById(R.id.warning_body);

            warning_title.setTypeface(magdacleanmonoRegular);
            warning_body.setTypeface(titilliumWebBold);

            Button button_ok = (Button) dialoglayout.findViewById(R.id.button_ok);
            Button button_close = (Button) dialoglayout.findViewById(R.id.button_close);
            button_ok.setTypeface(titilliumWebBold);
            button_close.setTypeface(titilliumWebBold);

            final Activity thisActivity = this;
            button_ok.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    PreyLogger.d("askForPermission");
                    askForPermission();
                    alertDialog.dismiss();

                }
            });

            button_close.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    PreyLogger.d("close ask");

                    alertDialog.dismiss();
                }
            });

            alertDialog.show();
            showLocation = false;

        } else {
            showLocation = true;
        }

    } else {
        showLocation = true;
    }
    if (showLocation) {
        LocationManager mlocManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
        boolean isGpsEnabled = mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
        boolean isNetworkEnabled = mlocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
        if (isGpsEnabled || isNetworkEnabled) {
            PreyLogger.d("isGpsEnabled || isNetworkEnabled");

        } else {
            PreyLogger.d("no gps ni red");
            AlertDialog.Builder builder = new AlertDialog.Builder(this);

            final AlertDialog alertDialog = builder.create();
            TextView textview = new TextView(this);
            textview.setText(getString(R.string.location_settings));
            textview.setMaxLines(10);
            textview.setTextSize(18F);
            textview.setPadding(20, 0, 20, 20);
            textview.setTextColor(Color.BLACK);
            builder.setView(textview);
            builder.setPositiveButton(getString(R.string.go_to_settings),
                    new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialoginterface, int i) {
                            dialoginterface.dismiss();
                            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                            startActivityForResult(intent, 0);
                            return;

                        }

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

                public void onClick(DialogInterface dialoginterface, int i) {
                    dialoginterface.dismiss();
                }

            });
            builder.create().show();
        }
    }

}

From source file:cn.njmeter.njmeter.widget.spinner.NiceSpinner.java

private int getDefaultTextColor(Context context) {
    TypedValue typedValue = new TypedValue();
    context.getTheme().resolveAttribute(android.R.attr.textColorPrimary, typedValue, true);
    TypedArray typedArray = context.obtainStyledAttributes(typedValue.data,
            new int[] { android.R.attr.textColorPrimary });
    int defaultTextColor = typedArray.getColor(0, Color.BLACK);
    typedArray.recycle();//w w  w  .  ja v  a 2  s .c  o  m
    return defaultTextColor;
}

From source file:br.com.anteros.android.synchronism.view.AbstractSynchronismFragment.java

private void finishSynchronism() {
    pbTables.setProgress(0);/*from  w  w w .  ja  va  2 s  .c  o m*/
    lbStatus.setText("Sincronismo concludo");
    pbActions.setProgress(0);
    lbActions.setText("Aes");
    lbTables.setText("Tabelas");
    lbStatus.setTextColor(Color.BLACK);
    syncronized = true;
    setSynchronizing(false);
    onSynchronized();
}

From source file:com.example.mapdemo.TopView.java

private void UpdateBubbles(double lat, double lon) {

    mMap.setOnMapLongClickListener(this);

    mFillColor = Color.BLUE;//from   w w  w  .  jav  a2 s . com
    mStrokeColor = Color.BLACK;
    mWidth = 2;

    DraggableCircle circle2 = new DraggableCircle(new LatLng(lat + 0.00006, lon + 0.00009), 2 * DEFAULT_RADIUS);
    DraggableCircle circle3 = new DraggableCircle(new LatLng(lat - 0.00006, lon + 0.00015),
            1.1 * DEFAULT_RADIUS);
    DraggableCircle circle4 = new DraggableCircle(new LatLng(lat - 0.00010, lon - 0.00015),
            1.5 * DEFAULT_RADIUS);
    DraggableCircle circle9 = new DraggableCircle(new LatLng(lat + 0.00020, lon + 0.00019),
            1.5 * DEFAULT_RADIUS);

    mFillColor = Color.YELLOW;
    mStrokeColor = Color.BLACK;
    mWidth = 2;

    DraggableCircle circle5 = new DraggableCircle(new LatLng(lat + 0.00010, lon - 0.00012),
            0.8 * DEFAULT_RADIUS);
    DraggableCircle circle6 = new DraggableCircle(new LatLng(lat - 0.0002, lon + 0.00012),
            0.5 * DEFAULT_RADIUS);
    DraggableCircle circle7 = new DraggableCircle(new LatLng(lat + 0.00011, lon), 2.5 * DEFAULT_RADIUS);
    DraggableCircle circle8 = new DraggableCircle(new LatLng(lat + 0.00021, lon - 0.00020),
            1.4 * DEFAULT_RADIUS);

    //  Log.d("location",longitude+ " ");
    //mCircles.add(circle);
    mCircles.add(circle2);
    mCircles.add(circle3);

    mCircles.add(circle4);

    mCircles.add(circle5);
    //    Log.d("location4234",longitude+ " 111 ");
    //UpdateBubbles(latitude,longitude);
    mCircles.add(circle6);
    mCircles.add(circle7);
    mCircles.add(circle8);

    //            DraggableCircle circle2 = new DraggableCircle(INDIA, DEFAULT_RADIUS);
    //            DraggableCircle circle3 = new DraggableCircle(PAK, DEFAULT_RADIUS);
    //            DraggableCircle circle4 = new DraggableCircle(ENG, DEFAULT_RADIUS);
    //            DraggableCircle circle5 = new DraggableCircle(DC, DEFAULT_RADIUS);
    //        mCircles.add(circle);

}

From source file:com.openerp.addons.messages.Message.java

public void setupListView(List<OEListViewRows> message_list) {
    // Destroying pre-loaded instance and going to create new one
    lstview = null;//w  ww  . j  a va  2s . c o m

    // Fetching required messages for listview by filtering of requrement
    if (list != null && list.size() <= 0) {
        list = message_list;// getMessages(message_list);
    } else {
        rootView.findViewById(R.id.messageSyncWaiter).setVisibility(View.GONE);
        rootView.findViewById(R.id.txvMessageAllReadMessage).setVisibility(View.GONE);
    }

    // Handling List View controls and keys
    String[] from = new String[] { "subject|type", "body", "starred", "author_id|email_from", "date",
            "model|type" };
    int[] to = new int[] { R.id.txvMessageSubject, R.id.txvMessageBody, R.id.imgMessageStarred,
            R.id.txvMessageFrom, R.id.txvMessageDate, R.id.txvMessageTag };

    // Creating instance for listAdapter
    listAdapter = new OEListViewAdapter(scope.context(), R.layout.message_listview_items, list, from, to, db,
            true, new int[] { R.drawable.message_listview_bg_toread_selector,
                    R.drawable.message_listview_bg_tonotread_selector },
            "to_read");
    // Telling adapter to clean HTML text for key value
    listAdapter.cleanHtmlToTextOn("body");
    listAdapter.cleanDate("date", scope.User().getTimezone());
    // Setting callback handler for boolean field value change.
    listAdapter.setBooleanEventOperation("starred", R.drawable.ic_action_starred,
            R.drawable.ic_action_unstarred, updateStarred);
    listAdapter.addViewListener(new OEListViewOnCreateListener() {

        @Override
        public View listViewOnCreateListener(int position, View row_view, OEListViewRows row_data) {
            String model_name = row_data.getRow_data().get("model").toString();
            String model = model_name;
            String res_id = row_data.getRow_data().get("res_id").toString();
            if (model_name.equals("false")) {
                model_name = capitalizeString(row_data.getRow_data().get("type").toString());
            } else {
                String[] model_parts = TextUtils.split(model_name, "\\.");
                HashSet unique_parts = new HashSet(Arrays.asList(model_parts));
                model_name = capitalizeString(TextUtils.join(" ", unique_parts.toArray()));

            }
            TextView msgTag = (TextView) row_view.findViewById(R.id.txvMessageTag);
            int tag_color = 0;
            if (message_model_colors.containsKey(model_name)) {
                tag_color = message_model_colors.get(model_name);
            } else {
                tag_color = Color.parseColor(tag_colors[tag_color_count]);
                message_model_colors.put(model_name, tag_color);
                tag_color_count++;
                if (tag_color_count > tag_colors.length) {
                    tag_color_count = 0;
                }
            }
            if (model.equals("mail.group")) {
                if (UserGroups.group_names.containsKey("group_" + res_id)) {
                    model_name = UserGroups.group_names.get("group_" + res_id);
                    tag_color = UserGroups.menu_color.get("group_" + res_id);
                }
            }
            msgTag.setBackgroundColor(tag_color);
            msgTag.setText(model_name);
            TextView txvSubject = (TextView) row_view.findViewById(R.id.txvMessageSubject);
            TextView txvAuthor = (TextView) row_view.findViewById(R.id.txvMessageFrom);
            if (row_data.getRow_data().get("to_read").toString().equals("false")) {
                txvSubject.setTypeface(null, Typeface.NORMAL);
                txvSubject.setTextColor(Color.BLACK);

                txvAuthor.setTypeface(null, Typeface.NORMAL);
                txvAuthor.setTextColor(Color.BLACK);
            } else {
                txvSubject.setTypeface(null, Typeface.BOLD);
                txvSubject.setTextColor(Color.parseColor("#414141"));
                txvAuthor.setTypeface(null, Typeface.BOLD);
                txvAuthor.setTextColor(Color.parseColor("#414141"));
            }

            return row_view;
        }
    });

    // Creating instance for listview control
    lstview = (ListView) rootView.findViewById(R.id.lstMessages);
    // Providing adapter to listview
    scope.context().runOnUiThread(new Runnable() {

        @Override
        public void run() {
            lstview.setAdapter(listAdapter);

        }
    });

    // Setting listview choice mode to multiple model
    lstview.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);

    // Seeting item long click listern to activate action mode.
    lstview.setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> arg0, View view, int index, long arg3) {
            // TODO Auto-generated method stub

            OEListViewRows data = (OEListViewRows) lstview.getAdapter().getItem(index);

            Toast.makeText(scope.context(), data.getRow_id() + " id clicked", Toast.LENGTH_LONG).show();
            view.setSelected(true);
            if (mActionMode != null) {
                return false;
            }
            // Start the CAB using the ActionMode.Callback defined above
            mActionMode = scope.context().startActionMode(mActionModeCallback);
            selectedCounter++;
            view.setBackgroundResource(R.drawable.listitem_pressed);
            // lstview.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
            return true;

        }
    });

    // Setting multi choice selection listener
    lstview.setMultiChoiceModeListener(new MultiChoiceModeListener() {
        HashMap<Integer, Boolean> selectedList = new HashMap<Integer, Boolean>();

        @Override
        public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
            // Here you can do something when items are
            // selected/de-selected,
            // such as update the title in the CAB
            selectedList.put(position, checked);
            if (checked) {
                selectedCounter++;
            } else {
                selectedCounter--;
            }
            if (selectedCounter != 0) {
                mode.setTitle(selectedCounter + "");
            }

        }

        @Override
        public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
            // Respond to clicks on the actions in the CAB
            HashMap<Integer, Integer> msg_pos = new HashMap<Integer, Integer>();
            OEDialog dialog = null;
            switch (item.getItemId()) {
            case R.id.menu_message_mark_unread_selected:
                Log.e("menu_message_context", "Mark as Unread");
                for (int pos : selectedList.keySet()) {
                    msg_pos.put(list.get(pos).getRow_id(), pos);
                }
                readunreadoperation = new PerformReadUnreadArchiveOperation(msg_pos, false);
                readunreadoperation.execute((Void) null);
                mode.finish();
                return true;
            case R.id.menu_message_mark_read_selected:
                Log.e("menu_message_context", "Mark as Read");
                for (int pos : selectedList.keySet()) {
                    msg_pos.put(list.get(pos).getRow_id(), pos);
                }
                readunreadoperation = new PerformReadUnreadArchiveOperation(msg_pos, true);
                readunreadoperation.execute((Void) null);
                mode.finish();
                return true;
            case R.id.menu_message_more_move_to_archive_selected:
                Log.e("menu_message_context", "Archive");
                for (int pos : selectedList.keySet()) {
                    msg_pos.put(list.get(pos).getRow_id(), pos);
                }
                readunreadoperation = new PerformReadUnreadArchiveOperation(msg_pos, false);
                readunreadoperation.execute((Void) null);
                mode.finish();
                return true;
            case R.id.menu_message_more_add_star_selected:
                for (int pos : selectedList.keySet()) {
                    msg_pos.put(list.get(pos).getRow_id(), pos);
                }

                markasTodoTask = new PerformOperation(msg_pos, true);
                markasTodoTask.execute((Void) null);

                mode.finish();

                return true;
            case R.id.menu_message_more_remove_star_selected:
                for (int pos : selectedList.keySet()) {
                    msg_pos.put(list.get(pos).getRow_id(), pos);
                }

                markasTodoTask = new PerformOperation(msg_pos, false);
                markasTodoTask.execute((Void) null);
                mode.finish();
                return true;
            default:
                return false;
            }
        }

        @Override
        public boolean onCreateActionMode(ActionMode mode, Menu menu) {
            // Inflate the menu for the CAB
            MenuInflater inflater = mode.getMenuInflater();
            inflater.inflate(R.menu.menu_fragment_message_context, menu);
            return true;
        }

        @Override
        public void onDestroyActionMode(ActionMode mode) {
            // Here you can make any necessary updates to the activity when
            // the CAB is removed. By default, selected items are
            // deselected/unchecked.

            /*
             * Perform Operation on Selected Ids.
             * 
             * row_ids are list of selected message Ids.
             */

            selectedList.clear();
            selectedCounter = 0;
            lstview.clearChoices();

        }

        @Override
        public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
            // Here you can perform updates to the CAB due to
            // an invalidate() request
            return false;
        }
    });
    lstview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View view, int index, long id) {
            // TODO Auto-generated method stub
            MessageDetail messageDetail = new MessageDetail();
            Bundle bundle = new Bundle();
            bundle.putInt("message_id", list.get(index).getRow_id());
            bundle.putInt("position", index);
            messageDetail.setArguments(bundle);
            scope.context().fragmentHandler.setBackStack(true, null);
            scope.context().fragmentHandler.replaceFragmnet(messageDetail);
            if (!type.equals("archive")) {
                list.remove(index);
            }
            listAdapter.refresh(list);
        }
    });

    // Getting Pull To Refresh Attacher from Main Activity
    mPullToRefreshAttacher = scope.context().getPullToRefreshAttacher();

    // Set the Refreshable View to be the ListView and the refresh listener
    // to be this.
    if (mPullToRefreshAttacher != null & lstview != null) {
        mPullToRefreshAttacher.setRefreshableView(lstview, this);
    }
}

From source file:com.CloudRecognition.CloudReco.java

private void startLoadingAnimation() {
    // Inflates the Overlay Layout to be displayed above the Camera View
    LayoutInflater inflater = LayoutInflater.from(this);
    mUILayout = (RelativeLayout) inflater.inflate(R.layout.camera_overlay, null, false);

    mUILayout.setVisibility(View.VISIBLE);
    mUILayout.setBackgroundColor(Color.BLACK);

    // By default
    loadingDialogHandler.setContenido(mUILayout);

    loadingDialogHandler.mLoadingDialogContainer.setVisibility(View.VISIBLE);

    addContentView(mUILayout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

}