List of usage examples for android.graphics Color DKGRAY
int DKGRAY
To view the source code for android.graphics Color DKGRAY.
Click Source Link
From source file:org.brandroid.openmanager.activities.OpenExplorer.java
private void setupLoggingDb() { FTP.setCommunicationListener(new OnFTPCommunicationListener() { @Override/*from w ww . j a va 2 s. c om*/ public void onDisconnect(FTP file) { sendToLogView("FTP Disconnect " + getFTPString(file), Color.GRAY); } @Override public void onConnectFailure(FTP file) { sendToLogView("FTP Failure " + getFTPString(file), Color.RED); } @Override public void onConnect(FTP file) { sendToLogView("FTP Connect " + getFTPString(file), Color.GREEN); } @Override public void onBeforeConnect(FTP file) { //sendToLogView("FTP Before Connect " + getFTPString(file)); } @Override public void onSendCommand(FTP file, String message) { if (message.startsWith("PASS ")) message = "PASS " + message.substring(6).replaceAll(".", "*"); sendToLogView("Command: " + message.replace("\n", ""), Color.BLACK); // + getFTPString(file), Color.BLACK); } private String getFTPString(FTP file) { if (file != null && file.getSocket() != null && file.getRemoteAddress() != null) return " @ " + file.getRemoteAddress().getHostName(); return ""; } @Override public void onReply(String line) { sendToLogView("Reply: " + line, Color.BLUE); } }); JSch.setLogger(new com.jcraft.jsch.Logger() { @Override public void log(int level, String message) { switch (level) { case com.jcraft.jsch.Logger.DEBUG: sendToLogView("SFTP - " + message, Color.GREEN); break; case com.jcraft.jsch.Logger.INFO: sendToLogView("SFTP - " + message, Color.BLUE); break; case com.jcraft.jsch.Logger.WARN: sendToLogView("SFTP - " + message, Color.YELLOW); break; case com.jcraft.jsch.Logger.ERROR: sendToLogView("SFTP - " + message, Color.RED); break; case com.jcraft.jsch.Logger.FATAL: sendToLogView("SFTP - " + message, Color.MAGENTA); break; default: sendToLogView("SFTP (" + level + ") - " + message, Color.BLACK); break; } } @Override public boolean isEnabled(int level) { return true; } }); if (Logger.isLoggingEnabled()) { if (getPreferences().getBoolean("global", "pref_stats", true)) { if (!Logger.hasDb()) Logger.setDb(new LoggerDbAdapter(getApplicationContext())); } else if (!IS_DEBUG_BUILD) Logger.setLoggingEnabled(false); } SmbFile.setSMBCommunicationListener(new OnSMBCommunicationListener() { @Override public void onBeforeConnect(SmbFile file) { sendToLogView("SMB Connecting: " + file.getPath(), Color.GREEN); } @Override public void onConnect(SmbFile file) { //sendToLogView("SMB Connected: " + file.getPath(), Color.GREEN); } @Override public void onConnectFailure(SmbFile file) { sendToLogView("SMB Connect Failure: " + file.getPath(), Color.RED); } @Override public void onDisconnect(SmbFile file) { sendToLogView("SMB Disconnect: " + file.getPath(), Color.DKGRAY); } @Override public void onSendCommand(SmbFile file, Object... commands) { URL url = file.getURL(); String s = "Command: smb://" + url.getHost() + url.getPath(); for (Object o : commands) { if (o instanceof ServerMessageBlock) { ServerMessageBlock blk = (ServerMessageBlock) o; String tmp = blk.toString(); if (tmp.indexOf("[") > -1) s += " -> " + tmp.substring(0, tmp.indexOf("[")); else s += " -> " + tmp; } else s += " -> " + o.toString(); } sendToLogView(s, Color.BLACK); } }); }
From source file:org.awesomeapp.messenger.ui.ConversationView.java
void updateWarningView() { int visibility = View.GONE; int iconVisibility = View.GONE; String message = null;//ww w . j a v a2s . co m boolean isConnected; try { checkConnection(); isConnected = (mConn == null) ? false : mConn.getState() == ImConnection.LOGGED_IN; } catch (Exception e) { isConnected = false; } if (this.isGroupChat()) { mComposeMessage.setHint(R.string.this_is_a_group_chat); } else if (mCurrentChatSession != null) { IOtrChatSession otrChatSession = null; try { otrChatSession = mCurrentChatSession.getDefaultOtrChatSession(); //check if the chat is otr or not if (otrChatSession != null) { try { mLastSessionStatus = SessionStatus.values()[otrChatSession.getChatStatus()]; } catch (RemoteException e) { Log.w("Gibber", "Unable to call remote OtrChatSession from ChatView", e); } } } catch (RemoteException e) { LogCleaner.error(ImApp.LOG_TAG, "error getting OTR session in ChatView", e); } if (mContactType == Imps.Contacts.TYPE_GROUP) { message = ""; } else if ((mSubscriptionType == Imps.Contacts.SUBSCRIPTION_TYPE_FROM)) { // bindSubscription(mProviderId, mRemoteAddress); visibility = View.VISIBLE; } else { visibility = View.GONE; } if (mLastSessionStatus == SessionStatus.PLAINTEXT) { mSendButton.setImageResource(R.drawable.ic_send_holo_light); mComposeMessage.setHint(R.string.compose_hint); } else if (mLastSessionStatus == SessionStatus.ENCRYPTED) { if (mIsStartingOtr) { mIsStartingOtr = false; //it's started! } if (mSendButton.getVisibility() == View.GONE) { mComposeMessage.setHint(R.string.compose_hint_secure); mSendButton.setImageResource(R.drawable.ic_send_secure); } try { String rFingerprint = otrChatSession.getRemoteFingerprint(); mIsVerified = (OtrChatManager.getInstance().isRemoteKeyVerified(mRemoteAddress, rFingerprint)); } catch (RemoteException re) { } } else if (mLastSessionStatus == SessionStatus.FINISHED) { mSendButton.setImageResource(R.drawable.ic_send_holo_light); mComposeMessage.setHint(R.string.compose_hint); mWarningText.setTextColor(Color.WHITE); mStatusWarningView.setBackgroundColor(Color.DKGRAY); message = mContext.getString(R.string.otr_session_status_finished); visibility = View.VISIBLE; } } mStatusWarningView.setVisibility(visibility); if (visibility == View.VISIBLE) { if (message != null && message.length() > 0) { mWarningText.setText(message); mWarningText.setVisibility(View.VISIBLE); } else { mWarningText.setVisibility(View.GONE); } } }
From source file:com.skytree.epubtest.BookViewActivity.java
public SkyBox(Context context) { super(context); this.setWillNotDraw(false); arrowHeight = 50;/*from ww w . j a v a2 s . com*/ boxColor = Color.YELLOW; strokeColor = Color.DKGRAY; contentView = new RelativeLayout(context); this.addView(contentView); }