Example usage for android.graphics Color YELLOW

List of usage examples for android.graphics Color YELLOW

Introduction

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

Prototype

int YELLOW

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

Click Source Link

Usage

From source file:org.uguess.android.sysinfo.ApplicationManager.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.app_lst_view, container, false);

    ((Button) rootView.findViewById(R.id.btn_export)).setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            doExport();/*www. j  a  va2s.c  o  m*/
        }
    });

    ((Button) rootView.findViewById(R.id.btn_sel_all)).setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            toggleAllSelection(true);
        }
    });

    ((Button) rootView.findViewById(R.id.btn_desel_all)).setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            toggleAllSelection(false);
        }
    });

    ListView lstApps = (ListView) rootView.findViewById(android.R.id.list);

    lstApps.setFastScrollEnabled(true);

    registerForContextMenu(lstApps);

    ArrayAdapter<AppInfoHolder> adapter = new ArrayAdapter<AppInfoHolder>(getActivity(), R.layout.app_item) {

        public android.view.View getView(int position, android.view.View convertView,
                android.view.ViewGroup parent) {
            View view;
            TextView txt_name, txt_size, txt_ver, txt_time;
            ImageView img_type;
            CheckBox ckb_app;

            Activity ctx = getActivity();

            if (convertView == null) {
                view = ctx.getLayoutInflater().inflate(R.layout.app_item, parent, false);
            } else {
                view = convertView;
            }

            if (position >= getCount()) {
                return view;
            }

            AppInfoHolder itm = getItem(position);

            txt_name = (TextView) view.findViewById(R.id.app_name);
            if (itm.label != null) {
                txt_name.setText(itm.label);
            } else {
                txt_name.setText(itm.appInfo.packageName);
            }

            if (Util.getBooleanOption(ctx, PSTORE_APPMANAGER, PREF_KEY_SHOW_BACKUP_STATE)) {
                switch (itm.backupState) {
                case 1:
                    txt_name.setTextColor(Color.YELLOW);
                    break;
                case 2:
                    txt_name.setTextColor(0xff00bb00);
                    break;
                case 3:
                    txt_name.setTextColor(0xffF183BD);
                    break;
                default:
                    txt_name.setTextColor(Color.WHITE);
                    break;
                }
            } else {
                txt_name.setTextColor(Color.WHITE);
            }

            txt_ver = (TextView) view.findViewById(R.id.app_version);
            txt_ver.setText(itm.version);

            txt_size = (TextView) view.findViewById(R.id.app_size);
            if (Util.getBooleanOption(ctx, PSTORE_APPMANAGER, PREF_KEY_SHOW_SIZE)) {
                txt_size.setVisibility(View.VISIBLE);

                if (itm.size != null) {
                    txt_size.setText(itm.size);
                } else {
                    txt_size.setText(R.string.computing);
                }
            } else {
                txt_size.setVisibility(View.GONE);
            }

            txt_time = (TextView) view.findViewById(R.id.app_time);
            if (Util.getBooleanOption(ctx, PSTORE_APPMANAGER, PREF_KEY_SHOW_DATE)) {
                txt_time.setVisibility(View.VISIBLE);

                if (itm.appInfo.sourceDir != null) {
                    File f = new File(itm.appInfo.sourceDir);
                    txt_time.setText(DateUtils.formatDateTime(ctx, f.lastModified(), DateUtils.FORMAT_SHOW_YEAR
                            | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME));
                } else {
                    txt_time.setText(R.string.unknown);
                }
            } else {
                txt_time.setVisibility(View.GONE);
            }

            img_type = (ImageView) view.findViewById(R.id.img_app_icon);
            if (Util.getBooleanOption(ctx, PSTORE_APPMANAGER, PREF_KEY_SHOW_ICON)) {
                img_type.setVisibility(View.VISIBLE);

                if (itm.icon != null) {
                    img_type.setImageDrawable(itm.icon);
                } else {
                    try {
                        img_type.setImageDrawable(ctx.getPackageManager().getDefaultActivityIcon());
                    } catch (Exception fe) {
                        img_type.setImageDrawable(null);

                        Log.e(ApplicationManager.class.getName(), fe.getLocalizedMessage());
                    }
                }
            } else {
                img_type.setVisibility(View.GONE);
            }

            ckb_app = (CheckBox) view.findViewById(R.id.ckb_app);
            ckb_app.setTag(position);
            ckb_app.setChecked(itm.checked);
            ckb_app.setOnCheckedChangeListener(checkListener);

            View imgLock = view.findViewById(R.id.img_lock);
            imgLock.setVisibility(itm.isPrivate ? View.VISIBLE : View.GONE);

            return view;
        }
    };

    setListAdapter(adapter);

    return rootView;
}

From source file:tkj.android.homecontrol.mythmote.MythMote.java

/**
 * Called when MythCom status changes/*from  www .j ava  2  s  .  co m*/
 */
public void StatusChanged(String StatusMsg, int statusCode) {

    final String msg = StatusMsg;
    final int code = statusCode;

    this.runOnUiThread(new Runnable() {

        @Override
        public void run() {
            // set titleJUMPPOINT_guidegrid
            setTitle(msg);

            // change color based on status code
            if (code == MythCom.STATUS_ERROR) {
                setTitleColor(Color.RED);
            } else if (code == MythCom.STATUS_DISCONNECTED) {
                setTitleColor(Color.RED);
            } else if (code == MythCom.STATUS_CONNECTED) {
                setTitleColor(Color.GREEN);
            } else if (code == MythCom.STATUS_CONNECTING) {
                setTitleColor(Color.YELLOW);
            }
        }

    });
}

From source file:org.trakhound.www.trakhound.DeviceDetails.java

private void updateControllerStatus_SystemStatus(DeviceStatus status) {

    // Set System Status
    TextView txt = (TextView) findViewById(R.id.SystemStatusText);
    if (txt != null) {

        String s1 = status.controllerInfo.systemStatus;

        txt.setText(s1);//w  w w  .j a  v a 2  s.c  o  m

        if (s1.equals("Normal"))

            txt.setTextColor(getResources().getColor(R.color.statusGreen));

        else if (s1.equals("Fault"))

            txt.setTextColor(getResources().getColor(R.color.statusRed));

        else

            txt.setTextColor(getResources().getColor(R.color.foreground_normal_color));

        // Set System Message
        txt = (TextView) findViewById(R.id.SystemMessageText);
        if (txt != null) {

            String s2 = status.controllerInfo.systemMessage;

            // Set System Message Text
            txt.setText(s2);

            // Set Visibility of System Message
            if (s2 == null || s2.isEmpty())
                txt.setVisibility(View.GONE);
            else
                txt.setVisibility(View.VISIBLE);

            // Set Colors
            if (!s1.equals("Normal")) {

                txt.setTextColor(Color.WHITE);
                txt.setBackgroundColor(Color.RED);

            } else {

                txt.setTextColor(getResources().getColor(R.color.foreground_normal_color));
                txt.setBackgroundColor(Color.YELLOW);
            }
        }
    }
}

From source file:com.filemanager.free.activities.TextReader.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.prev:
        // upButton
        if (mCurrent > 0) {

            // setting older span back before setting new one
            Map.Entry keyValueOld = (Map.Entry) nodes.get(mCurrent).getKey();
            mInput.getText().setSpan(//from  ww w . jav a2 s .  com
                    theme1 == 0 ? new BackgroundColorSpan(Color.YELLOW) : new BackgroundColorSpan(Color.LTGRAY),
                    (Integer) keyValueOld.getKey(), (Integer) keyValueOld.getValue(),
                    Spanned.SPAN_INCLUSIVE_INCLUSIVE);

            // highlighting previous element in list
            Map.Entry keyValueNew = (Map.Entry) nodes.get(--mCurrent).getKey();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                mInput.getText().setSpan(
                        new BackgroundColorSpan(
                                getResources().getColor(R.color.search_text_highlight, getTheme())),
                        (Integer) keyValueNew.getKey(), (Integer) keyValueNew.getValue(),
                        Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            } else {
                mInput.getText().setSpan(
                        new BackgroundColorSpan(ContextCompat.getColor(c, R.color.search_text_highlight)),
                        (Integer) keyValueNew.getKey(), (Integer) keyValueNew.getValue(),
                        Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            }
        }
        break;
    case R.id.next:
        // downButton
        if (mCurrent < nodes.size() - 1) {

            // setting older span back before setting new one
            if (mCurrent != -1) {

                Map.Entry keyValueOld = (Map.Entry) nodes.get(mCurrent).getKey();
                mInput.getText().setSpan(
                        theme1 == 0 ? new BackgroundColorSpan(Color.YELLOW)
                                : new BackgroundColorSpan(Color.LTGRAY),
                        (Integer) keyValueOld.getKey(), (Integer) keyValueOld.getValue(),
                        Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            }

            Map.Entry keyValueNew = (Map.Entry) nodes.get(++mCurrent).getKey();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                mInput.getText().setSpan(
                        new BackgroundColorSpan(
                                getResources().getColor(R.color.search_text_highlight, getTheme())),
                        (Integer) keyValueNew.getKey(), (Integer) keyValueNew.getValue(),
                        Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            } else {
                mInput.getText().setSpan(
                        new BackgroundColorSpan(ContextCompat.getColor(c, R.color.search_text_highlight)),
                        (Integer) keyValueNew.getKey(), (Integer) keyValueNew.getValue(),
                        Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            }

            // scrolling to the highlighted element
            DisplayMetrics displayMetrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
            scrollView.scrollTo(0, (Integer) keyValueNew.getValue() + mInput.getLineHeight()
                    - displayMetrics.heightPixels / 2);
        }
        break;
    case R.id.close:
        onDestroyActionMode();
        // closeButton
        findViewById(R.id.searchview).setVisibility(View.GONE);
        break;
    default:
        return;
    }
}

From source file:org.zoumbox.mh_dla_notifier.Receiver.java

protected void displayNotification(Context context, NotificationType type, CharSequence title,
        CharSequence text, Pair<Boolean, Boolean> soundAndVibrate) {

    // The PendingIntent to launch our activity if the user selects this notification
    Intent mainActivity = new Intent(context, MainActivity.class);
    mainActivity.putExtra(MainActivity.EXTRA_FROM_NOTIFICATION, true);
    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, mainActivity, 0);

    Intent playIntent = MhDlaNotifierUtils.GET_PLAY_INTENT.apply(context);
    PendingIntent playPendingIntent = PendingIntent.getActivity(context, 0, playIntent, 0);
    long now = System.currentTimeMillis();

    Bitmap largeIcon = BitmapFactory.decodeResource(context.getResources(),
            R.drawable.trarnoll_square_transparent_128);

    NotificationCompat.Builder builder = new NotificationCompat.Builder(context).setOnlyAlertOnce(true)
            .setLights(Color.YELLOW, 1500, 1500).setSmallIcon(R.drawable.trarnoll_square_transparent_128)
            .setLargeIcon(largeIcon).setContentTitle(title).setContentText(text).setWhen(now)
            .setContentIntent(contentIntent).setAutoCancel(true).setTicker(title)
            .addAction(R.drawable.ic_action_play, context.getText(R.string.play), playPendingIntent);

    if (soundAndVibrate.left()) {
        Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        builder.setSound(defaultSound);//from  w w w .  j a v a 2 s .  c  o m
    }

    if (soundAndVibrate.right()) {
        builder.setVibrate(VIBRATE_PATTERN);
    } else {
        builder.setVibrate(NO_VIBRATION);
    }

    Notification notification = builder.build();

    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    int notifId = type.name().hashCode();
    notificationManager.notify(notifId, notification);
}

From source file:net.zorgblub.typhon.Configuration.java

public int getHighlightColor() {
    return getProfileSetting(KEY_HIGHLIGHT, Color.YELLOW, Color.YELLOW);
}

From source file:terse.a1.TerseActivity.java

private void viewPath9display(String path, LayoutParams widgetParams) {
    String explain;// w ww .  j av a 2s.c  om
    if (terp_error != null) {
        explain = "terp_error = " + terp_error;
    } else {
        try {
            terp.say("Sending to terp: %s", path);
            final Dict d = terp.handleUrl(path, taQuery);
            explain = "DEFAULT EXPLANATION:\n\n" + d.toString();

            Str TYPE = d.cls.terp.newStr("type");
            Str VALUE = d.cls.terp.newStr("value");
            Str TITLE = d.cls.terp.newStr("title");
            Str type = (Str) d.dict.get(TYPE);
            Ur value = d.dict.get(VALUE);
            Ur title = d.dict.get(TITLE);

            // {
            // double ticks = Static.floatAt(d, "ticks", -1);
            // double nanos = Static.floatAt(d, "nanos", -1);
            // Toast.makeText(
            // getApplicationContext(),
            // Static.fmt("%d ticks, %.3f secs", (long) ticks,
            // (double) nanos / 1e9), Toast.LENGTH_SHORT)
            // .show();
            // }

            if (type.str.equals("list") && value instanceof Vec) {
                final ArrayList<Ur> v = ((Vec) value).vec;
                final ArrayList<String> labels = new ArrayList<String>();
                final ArrayList<String> links = new ArrayList<String>();
                for (int i = 0; i < v.size(); i++) {
                    Ur item = v.get(i);
                    String label = item instanceof Str ? ((Str) item).str : item.toString();
                    if (item instanceof Vec && ((Vec) item).vec.size() == 2) {
                        // OLD STYLE
                        label = ((Vec) item).vec.get(0).toString();
                        Matcher m = LINK_P.matcher(label);
                        if (m.lookingAt()) {
                            label = m.group(2) + " " + m.group(3);
                        }
                        label += "    [" + ((Vec) item).vec.get(1).toString().length() + "]";
                        links.add(null); // Use old style, not links.
                    } else {
                        // NEW STYLE
                        label = item.toString();
                        if (label.charAt(0) == '/') {
                            String link = Terp.WHITE_PLUS.split(label, 2)[0];
                            links.add(link);
                        } else {
                            links.add("");
                        }
                    }
                    labels.add(label);
                }
                if (labels.size() != links.size())
                    terp.toss("lables#%d links#%d", labels.size(), links.size());

                ListView listv = new ListView(this);
                listv.setAdapter(new ArrayAdapter<String>(this, R.layout.list_item, labels));
                listv.setLayoutParams(widgetParams);
                listv.setTextFilterEnabled(true);

                listv.setOnItemClickListener(new OnItemClickListener() {
                    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                        // When clicked, show a toast with the TextView text
                        // Toast.makeText(getApplicationContext(),
                        // ((TextView) view).getText(),
                        // Toast.LENGTH_SHORT).show();
                        String toast_text = ((TextView) view).getText().toString();
                        // if (v.get(position) instanceof Vec) {
                        if (links.get(position) == null) {
                            // OLD STYLE
                            Vec pair = (Vec) v.get(position);
                            if (pair.vec.size() == 2) {
                                if (pair.vec.get(0) instanceof Str) {
                                    String[] words = ((Str) pair.vec.get(0)).str.split("\\|");
                                    Log.i("TT-WORDS", terp.arrayToString(words));
                                    toast_text += "\n\n" + Static.arrayToString(words);
                                    if (words[1].equals("link")) {
                                        Uri uri = new Uri.Builder().scheme("terse").path(words[2]).build();
                                        Intent intent = new Intent("android.intent.action.MAIN", uri);
                                        intent.setClass(getApplicationContext(), TerseActivity.class);

                                        startActivity(intent);
                                    }
                                }
                            }
                        } else {
                            // NEW STYLE
                            terp.say("NEW STYLE LIST SELECT #%d link=<%s> label=<%s>", position,
                                    links.get(position), labels.get(position));
                            if (links.get(position).length() > 0) {
                                Uri uri = new Uri.Builder().scheme("terse").path(links.get(position)).build();
                                Intent intent = new Intent("android.intent.action.MAIN", uri);
                                intent.setClass(getApplicationContext(), TerseActivity.class);

                                startActivity(intent);
                            }
                        }
                        // }
                        // Toast.makeText(getApplicationContext(),
                        // ((TextView) view).getText(),
                        // Toast.LENGTH_SHORT).show();
                    }
                });
                setContentView(listv);
                return;
            } else if (type.str.equals("edit") && value instanceof Str) {
                final EditText ed = new EditText(this);

                ed.setText(taSaveMe == null ? value.toString() : taSaveMe);

                ed.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE
                        | InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
                ed.setLayoutParams(widgetParams);
                // ed.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
                ed.setTextAppearance(this, R.style.teletype);
                ed.setBackgroundColor(Color.BLACK);
                ed.setGravity(Gravity.TOP);
                ed.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET);
                ed.setVerticalFadingEdgeEnabled(true);
                ed.setVerticalScrollBarEnabled(true);
                ed.setOnKeyListener(new OnKeyListener() {
                    public boolean onKey(View v, int keyCode, KeyEvent event) {
                        // If the event is a key-down event on the "enter"
                        // button
                        // if ((event.getAction() == KeyEvent.ACTION_DOWN)
                        // &&
                        // (keyCode == KeyEvent.KEYCODE_ENTER)) {
                        // // Perform action on key press
                        // Toast.makeText(TerseActivity.this, ed.getText(),
                        // Toast.LENGTH_SHORT).show();
                        // return true;
                        // }
                        return false;
                    }
                });

                Button btn = new Button(this);
                btn.setText("Save");
                btn.setOnClickListener(new OnClickListener() {
                    public void onClick(View v) {
                        // Perform action on clicks
                        String text = ed.getText().toString();
                        text = Parser.charSubsts(text);
                        Toast.makeText(TerseActivity.this, text, Toast.LENGTH_SHORT).show();
                        String action = stringAt(d, "action");
                        String query = "";

                        String f1 = stringAt(d, "field1");
                        String v1 = stringAt(d, "value1");
                        String f2 = stringAt(d, "field2");
                        String v2 = stringAt(d, "value2");
                        f1 = (f1 == null) ? "f1null" : f1;
                        v1 = (v1 == null) ? "v1null" : v1;
                        f2 = (f2 == null) ? "f2null" : f2;
                        v2 = (v2 == null) ? "v2null" : v2;

                        startTerseActivity(action, query, stringAt(d, "field1"), stringAt(d, "value1"),
                                stringAt(d, "field2"), stringAt(d, "value2"), "text", text);
                    }
                });

                LinearLayout linear = new LinearLayout(this);
                linear.setOrientation(LinearLayout.VERTICAL);
                linear.addView(btn);
                linear.addView(ed);
                setContentView(linear);
                return;

            } else if (type.str.equals("draw") && value instanceof Vec) {
                Vec v = ((Vec) value);
                DrawView dv = new DrawView(this, v.vec, d);
                dv.setLayoutParams(widgetParams);
                setContentView(dv);
                return;
            } else if (type.str.equals("live")) {
                Blk blk = value.mustBlk();
                Blk event = Static.urAt(d, "event").asBlk();
                TerseSurfView tsv = new TerseSurfView(this, blk, event);
                setContentView(tsv);
                return;
            } else if (type.str.equals("fnord")) {
                Blk blk = value.mustBlk();
                Blk event = Static.urAt(d, "event").asBlk();
                FnordView fnord = new FnordView(this, blk, event);
                setContentView(fnord);
                return;
            } else if (type.str.equals("world") && value instanceof Str) {
                String newWorld = value.toString();
                if (Terp.WORLD_P.matcher(newWorld).matches()) {
                    world = newWorld;
                    resetTerp();
                    explain = Static.fmt("Switching to world <%s>\nUse menu to go Home.", world);
                    Toast.makeText(getApplicationContext(), explain, Toast.LENGTH_LONG).show();
                } else {
                    terp.toss("Bad world syntax (must be 3 letters then 0 to 3 digits: <%s>", newWorld);
                }
                // Fall thru for explainv.setText(explain).
            } else if (type.str.equals("text")) {
                explain = "<<< " + title + " >>>\n\n" + value.toString();
                // Fall thru for explainv.setText(explain).
            } else if (type.str.equals("html")) {
                final WebView webview = new WebView(this);
                // webview.loadData(value.toString(), "text/html", null);
                webview.loadDataWithBaseURL("terse://terse", value.toString(), "text/html", "UTF-8", null);
                webview.setWebViewClient(new WebViewClient() {
                    @Override
                    public boolean shouldOverrideUrlLoading(WebView view, String url) {
                        // terp.say("WebView UrlLoading: url=%s", url);
                        URI uri = URI.create("" + url);
                        // terp.say("WebView UrlLoading: URI=%s", uri);
                        terp.say("WebView UrlLoading: getPath=%s", uri.getPath());
                        terp.say("WebView UrlLoading: getQuery=%s", uri.getQuery());

                        // Toast.makeText(getApplicationContext(),
                        // uri.toASCIIString(), Toast.LENGTH_SHORT)
                        // .show();
                        // webview.invalidate();
                        //
                        // TextView quick = new
                        // TextView(TerseActivity.this);
                        // quick.setText(uri.toASCIIString());
                        // quick.setBackgroundColor(Color.BLACK);
                        // quick.setTextColor(Color.WHITE);
                        // setContentView(quick);

                        startTerseActivity(uri.getPath(), uri.getQuery());

                        return true;
                    }
                });

                // webview.setWebChromeClient(new WebChromeClient());
                webview.getSettings().setBuiltInZoomControls(true);
                // webview.getSettings().setJavaScriptEnabled(true);
                webview.getSettings().setDefaultFontSize(18);
                webview.getSettings().setNeedInitialFocus(true);
                webview.getSettings().setSupportZoom(true);
                webview.getSettings().setSaveFormData(true);
                setContentView(webview);

                // ScrollView scrollv = new ScrollView(this);
                // scrollv.addView(webview);
                // setContentView(scrollv);
                return;
            } else {
                explain = "Unknown page type: " + type.str + " with vaule type: " + value.cls
                        + "\n\n##############\n\n";
                explain += value.toString();
                // Fall thru for explainv.setText(explain).
            }

        } catch (Exception ex) {
            ex.printStackTrace();
            explain = Static.describe(ex);
        }
    }

    TextView explainv = new TextView(this);
    explainv.setText(explain);
    explainv.setBackgroundColor(Color.BLACK);
    explainv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24);
    explainv.setTextColor(Color.YELLOW);

    SetContentViewWithHomeButtonAndScroll(explainv);
}

From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java

@Override
final public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;//from  ww w.j  a  va  2 s.co m

    View v = convertView;
    if (v == null) {
        LayoutInflater vi = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(id, null);
        holder = new ViewHolder();
        holder.tv_time = (TextView) v.findViewById(R.id.task_history_list_item_time);
        holder.tv_status = (TextView) v.findViewById(R.id.task_history_list_item_status);
        holder.tv_grp = (TextView) v.findViewById(R.id.task_history_list_item_grp);
        holder.tv_task = (TextView) v.findViewById(R.id.task_history_list_item_task);
        holder.tv_msg = (TextView) v.findViewById(R.id.task_history_list_item_msg);
        holder.stat_success = c.getString(R.string.msgs_status_view_stat_success);
        holder.stat_error = c.getString(R.string.msgs_status_view_stat_error);
        holder.stat_cancelled = c.getString(R.string.msgs_status_view_stat_cancelled);
        holder.stat_started = c.getString(R.string.msgs_status_view_stat_started);
        holder.config = v.getResources().getConfiguration();
        if (ll_background == null)
            ll_background = holder.tv_time.getBackground();
        v.setTag(holder);
    } else {
        holder = (ViewHolder) v.getTag();
    }
    TaskStatusTaskHistoryListItem o = getItem(position);
    if (o != null) {
        holder.tv_time.setTextColor(Color.WHITE);
        holder.tv_status.setTextColor(Color.WHITE);
        holder.tv_grp.setTextColor(Color.WHITE);
        holder.tv_task.setTextColor(Color.WHITE);
        holder.tv_msg.setTextColor(Color.WHITE);

        if (o.task_name.startsWith("No")) {
            holder.tv_time.setText("No task history");
            holder.tv_status.setText("");
            holder.tv_grp.setText("");
            holder.tv_task.setText("");
            holder.tv_msg.setVisibility(TextView.GONE);
        } else {
            holder.tv_time.setText(o.end_time);
            if (o.task_status.equals(TaskHistoryItem.TASK_HISTORY_TASK_STATUS_STARTED))
                holder.tv_status.setText("A");
            else if (o.task_status.equals(TaskHistoryItem.TASK_HISTORY_TASK_STATUS_QUEUED))
                holder.tv_status.setText("Q");
            else if (o.task_status.equals(TaskHistoryItem.TASK_HISTORY_TASK_STATUS_ENDED))
                holder.tv_status.setText("S");
            if (o.result.equals(TaskResponse.RESP_CHAR_SUCCESS)) {
            } else if (o.result.equals(TaskResponse.RESP_CHAR_ERROR)) {
                holder.tv_status.setText("E");
                holder.tv_time.setTextColor(Color.RED);
                holder.tv_status.setTextColor(Color.RED);
                holder.tv_grp.setTextColor(Color.RED);
                holder.tv_task.setTextColor(Color.RED);
                holder.tv_msg.setTextColor(Color.RED);
            } else if (o.result.equals(TaskResponse.RESP_CHAR_CANCELLED)) {
                holder.tv_status.setText("C");
                holder.tv_time.setTextColor(Color.YELLOW);
                holder.tv_status.setTextColor(Color.YELLOW);
                holder.tv_grp.setTextColor(Color.YELLOW);
                holder.tv_task.setTextColor(Color.YELLOW);
                holder.tv_msg.setTextColor(Color.YELLOW);
            } else if (o.result.equals(NTFY_TO_SVC_TASK_STARTED)) {
                holder.tv_status.setText("A");
            }
            holder.tv_msg.setVisibility(TextView.GONE);
            holder.tv_grp.setText(o.profile_grp);
            holder.tv_task.setText(o.task_name);
            if (!o.msg_text.equals("") && !o.msg_text.equals(" ")) {
                holder.tv_msg.setText(o.msg_text);
                holder.tv_msg.setVisibility(TextView.VISIBLE);
            }
        }
    }
    return v;
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void checkMixedMountPoint(final ArrayList<LocalFileLastModifiedMaintListItem> maint_list) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    if (!prefs.getBoolean(SMBSYNC_SUPPRESS_WARNING_MIXED_MP, false)) {
        boolean mixed_mp = false;
        String mp_name = null;/* w  w w  .  j av  a 2s  . c o  m*/
        for (int i = 0; i < mGp.profileAdapter.getCount(); i++) {
            ProfileListItem s_pli = mGp.profileAdapter.getItem(i);
            if (s_pli.getType().equals(SMBSYNC_PROF_TYPE_SYNC)
                    && s_pli.getActive().equals(SMBSYNC_PROF_ACTIVE)) {
                ProfileListItem o_pli = null;
                if (s_pli.getMasterType().equals(SMBSYNC_PROF_TYPE_LOCAL)) {
                    o_pli = getProfileListItem(SMBSYNC_PROF_TYPE_LOCAL, s_pli.getMasterName());
                } else {
                    o_pli = getProfileListItem(SMBSYNC_PROF_TYPE_LOCAL, s_pli.getTargetName());
                }
                if (o_pli != null) {
                    if (mp_name != null) {
                        //                     Log.v("","mp_name="+o_pli.getLocalMountPoint());
                        if (!o_pli.getLocalMountPoint().equals(mp_name)) {
                            mixed_mp = true;
                            break;
                        }
                    } else {
                        //                     Log.v("","mp_name init ="+mp_name);
                        mp_name = o_pli.getLocalMountPoint();
                    }
                }
            }
        }
        //         Log.v("","mixed_mp="+mixed_mp);
        if (!mixed_mp) {
            checkLastModifiedCorrupted(maint_list);
        } else {
            final Dialog dialog = new Dialog(mContext);//, android.R.style.Theme_Black);
            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialog.setContentView(R.layout.mixed_mount_point_dialog);
            TextView title = (TextView) dialog.findViewById(R.id.mixed_mount_point_dialog_title);
            title.setText(mContext.getString(R.string.msgs_common_dialog_warning));
            title.setTextColor(Color.YELLOW);

            ((TextView) dialog.findViewById(R.id.mixed_mount_point_dialog_subtitle))
                    .setText(mContext.getString(R.string.msgs_local_file_modified_maint_mixed_old_new_title));

            ((TextView) dialog.findViewById(R.id.mixed_mount_point_dialog_msg))
                    .setText(mContext.getString(R.string.msgs_local_file_modified_maint_mixed_old_new_msg));

            final Button btnOk = (Button) dialog.findViewById(R.id.common_dialog_btn_ok);
            final CheckBox cbSuppr = (CheckBox) dialog.findViewById(R.id.mixed_mount_point_dialog_suppress);

            CommonDialog.setDlgBoxSizeCompact(dialog);
            cbSuppr.setChecked(false);
            // OK?
            btnOk.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    dialog.dismiss();
                    if (cbSuppr.isChecked()) {
                        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
                        prefs.edit().putBoolean(SMBSYNC_SUPPRESS_WARNING_MIXED_MP, true).commit();
                    }
                    checkLastModifiedCorrupted(maint_list);
                }
            });
            // Cancel?
            dialog.setOnCancelListener(new Dialog.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface arg0) {
                    btnOk.performClick();
                }
            });
            //            dialog.setOnKeyListener(new DialogOnKeyListener(mContext));
            //            dialog.setCancelable(false);
            dialog.show();
        }
    }
}

From source file:gc.david.dfm.ui.activity.MainActivity.java

private void addLine(final LatLng start, final LatLng end, final boolean isLoadingFromDB) {
    final PolylineOptions lineOptions = new PolylineOptions().add(start).add(end);
    lineOptions.width(getResources().getDimension(R.dimen.map_line_width));
    lineOptions.color(isLoadingFromDB ? Color.YELLOW : Color.GREEN);
    googleMap.addPolyline(lineOptions);/*w w  w .  j  av  a 2s .  co m*/
}