Java Code Examples for android.graphics.Color.LTGRAY

The following are Jave code examples for showing how to use LTGRAY of the android.graphics.Color class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Eye   File: PersonInfoView.java   View Source Code Vote up 5 votes
public int getRandomColor() {
    Random random = new Random();

    switch (random.nextInt(10)) {
        case 0:
            return Color.WHITE;
        case 1:
            return Color.BLACK;
        case 2:
            return Color.BLUE;
        case 3:
            return Color.CYAN;
        case 4:
            return Color.YELLOW;
        case 5:
            return Color.GREEN;
        case 6:
            return Color.RED;
        case 7:
            return Color.GRAY;
        case 8:
            return Color.LTGRAY;
        case 9:
            return Color.DKGRAY;
        default:
            return Color.MAGENTA;
    }
}
 
Example 2
Project: simple-keyboard   File: Settings.java   View Source Code Vote up 5 votes
public static int readKeyboardDefaultColor(final Context context) {
    final int[] keyboardThemeColors = context.getResources().getIntArray(R.array.keyboard_theme_colors);
    final int[] keyboardThemeIds = context.getResources().getIntArray(R.array.keyboard_theme_ids);
    final int themeId = KeyboardTheme.getKeyboardTheme(context).mThemeId;
    for (int index = 0; index < keyboardThemeIds.length; index++) {
        if (themeId == keyboardThemeIds[index]) {
            return keyboardThemeColors[index];
        }
    }

    return Color.LTGRAY;
}
 
Example 3
Project: DizzyPassword   File: PswInputView.java   View Source Code Vote up 5 votes
/**
     * 初始化相关参数
     */
    void init(AttributeSet attrs) {
        final float dp = getResources().getDisplayMetrics().density;
        this.setFocusable(true);
        this.setFocusableInTouchMode(true);
        input = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        result = new ArrayList<>();
        if (attrs != null) {
            TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.PswInputView);
//            mBorderColor = ta.getColor(R.styleable.PswInputView_border_color, getResources().getColor(R.color.color_13));
            mBorderColor = ta.getColor(R.styleable.PswInputView_border_color, ThemeUtils.getPrimaryColor(AppManager.getAppManager().currentActivity()));
            mDotColor = ta.getColor(R.styleable.PswInputView_dot_color, getResources().getColor(R.color.color_bg));
            count = ta.getInt(R.styleable.PswInputView_count, 6);
            ta.recycle();
        } else {
            mBorderColor = Color.LTGRAY;
            mDotColor = Color.GRAY;
            count = 6;//默认6位密码
        }
        size = (int) (dp * 30);//默认30dp一格
        //color
        mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mBorderPaint.setStrokeWidth(2);
        mBorderPaint.setStyle(Paint.Style.STROKE);
        mBorderPaint.setColor(mBorderColor);
        mDotPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mDotPaint.setStrokeWidth(3);
        mDotPaint.setStyle(Paint.Style.FILL);
        mDotPaint.setColor(mDotColor);
        mRoundRect = new RectF();
        mRoundRadius = (int) (5 * dp);
        mFocusLineLength = 0;
        this.setOnKeyListener(new MyKeyListener());
    }
 
Example 4
Project: SSTVEncoder2   File: GridColorPalette.java   View Source Code Vote up 5 votes
static int[] getStandardColors() {
    return new int[]{
            Color.BLACK,
            Color.GRAY,
            Color.LTGRAY,
            Color.WHITE,
            Color.YELLOW,
            Color.CYAN,
            Color.GREEN,
            Color.MAGENTA,
            Color.RED,
            Color.BLUE
    };
}
 
Example 5
Project: QuizApp-Android   File: QuestionActivity.java   View Source Code Vote up 5 votes
public void nextQuestion(int id) {
//        answer = (TextView) findViewById(R.id.answer);
//        new CountDownTimer(10000, 100) {
//            public void onTick(long millisUntilFinished) {
//                answer.setText("Mai ai "+ millisUntilFinished / 1000+ "."+ (millisUntilFinished / 100)%10+" ");
//            }
//            public void onFinish() {
//                answer.setText("");
//                currentIndexQuestion = randomNr(0, nrOfQuestions);//generate a random index
//                qid = vectorOfIds.get(currentIndexQuestion);
//                nextQuestion(qid);
//                vectorOfIds.remove(currentIndexQuestion);
//                nrOfQuestions--;
//            }
//        }.start();
        scoreText = (TextView) findViewById(R.id.score);
        scoreText.setText(getResources().getString(R.string.score) + " " + score);

        for (int i = 0; i < 4; i++) {
            //create an gradient drawable object and set buttons background
            GradientDrawable btncolor = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM,
                    new int[]{Color.WHITE, Color.LTGRAY, Color.WHITE});
            btncolor.setCornerRadius(5);
            btncolor.setStroke(2, Color.BLACK);
            b[i].setBackground(btncolor);
            b[i].setEnabled(true);
        }
        //update the text of buttons and textview
        question.setText(counter + 1 + ". " + questionsList.get(id).getQtext());
        b[0].setText(questionsList.get(id).getAns1());
        b[1].setText(questionsList.get(id).getAns2());
        b[2].setText(questionsList.get(id).getAns3());
        b[3].setText(questionsList.get(id).getAns4());
        nextQuestionBtn.setEnabled(false);

    }
 
Example 6
Project: RecyclerView-Multiselect   File: MultiSelectManager.java   View Source Code Vote up 5 votes
public void refreshView(int position, View view) {
    if (isSelected(position)) {
        if (mActiveCellColor == 0)
            mActiveCellColor = Color.LTGRAY;
        view.setBackgroundColor(mActiveCellColor);
    } else {
        if (mInactiveCellColor == 0)
            mInactiveCellColor = Color.WHITE;
        view.setBackgroundColor(mInactiveCellColor);
    }
}
 
Example 7
Project: SmartMath   File: OGLChartOperator.java   View Source Code Vote up 5 votes
public static int cvtStr2Color(String str)	{
	if (str.trim().toLowerCase(Locale.US).equals("blue"))	{
		return Color.BLUE; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("cyan"))	{
		return Color.CYAN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("dkgray"))	{
		return Color.DKGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("gray"))	{
		return Color.GRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("green"))	{
		return Color.GREEN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("ltgray"))	{
		return Color.LTGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("magenta"))	{
		return Color.MAGENTA; 	
	/*} else if (str.trim().toLowerCase(Locale.US).equals("orange"))	{
		return Color.ORANGE; 	// Pink and orange are not predefined colors in Android
	} else if (str.trim().toLowerCase(Locale.US).equals("pink"))	{
		return Color.PINK; 	*/
	} else if (str.trim().toLowerCase(Locale.US).equals("red"))	{
		return Color.RED; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("white"))	{
		return Color.WHITE;
	} else if (str.trim().toLowerCase(Locale.US).equals("yellow"))	{
		return Color.YELLOW;
	} else	{
		return Color.BLACK;
	}
}
 
Example 8
Project: SmartMath   File: XYChartOperator.java   View Source Code Vote up 5 votes
public static int cvtStr2Color(String str)	{
	if (str.trim().toLowerCase(Locale.US).equals("blue"))	{
		return Color.BLUE; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("cyan"))	{
		return Color.CYAN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("dkgray"))	{
		return Color.DKGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("gray"))	{
		return Color.GRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("green"))	{
		return Color.GREEN; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("ltgray"))	{
		return Color.LTGRAY; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("magenta"))	{
		return Color.MAGENTA; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("red"))	{
		return Color.RED; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("transparent"))	{
		return Color.TRANSPARENT; 	
	} else if (str.trim().toLowerCase(Locale.US).equals("white"))	{
		return Color.WHITE;
	} else if (str.trim().toLowerCase(Locale.US).equals("yellow"))	{
		return Color.YELLOW;
	} else	{
		return Color.BLACK;
	}
}
 
Example 9
Project: GitHub   File: BottomNavigationBar.java   View Source Code Vote up 4 votes
/**
 * This method initiates the bottomNavigationBar properties,
 * Tries to get them form XML if not preset sets them to their default values.
 *
 * @param context context of the bottomNavigationBar
 * @param attrs   attributes mentioned in the layout XML by user
 */
private void parseAttrs(Context context, AttributeSet attrs) {
    if (attrs != null) {
        TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomNavigationBar, 0, 0);

        mActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbActiveColor, Utils.fetchContextColor(context, R.attr.colorAccent));
        mInActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbInactiveColor, Color.LTGRAY);
        mBackgroundColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbBackgroundColor, Color.WHITE);
        mAutoHideEnabled = typedArray.getBoolean(R.styleable.BottomNavigationBar_bnbAutoHideEnabled, true);
        mElevation = typedArray.getDimension(R.styleable.BottomNavigationBar_bnbElevation, getResources().getDimension(R.dimen.bottom_navigation_elevation));

        setAnimationDuration(typedArray.getInt(R.styleable.BottomNavigationBar_bnbAnimationDuration, DEFAULT_ANIMATION_DURATION));

        switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbMode, MODE_DEFAULT)) {
            case MODE_FIXED:
                mMode = MODE_FIXED;
                break;

            case MODE_SHIFTING:
                mMode = MODE_SHIFTING;
                break;

            case MODE_FIXED_NO_TITLE:
                mMode = MODE_FIXED_NO_TITLE;
                break;

            case MODE_SHIFTING_NO_TITLE:
                mMode = MODE_SHIFTING_NO_TITLE;
                break;

            case MODE_DEFAULT:
            default:
                mMode = MODE_DEFAULT;
                break;
        }

        switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbBackgroundStyle, BACKGROUND_STYLE_DEFAULT)) {
            case BACKGROUND_STYLE_STATIC:
                mBackgroundStyle = BACKGROUND_STYLE_STATIC;
                break;

            case BACKGROUND_STYLE_RIPPLE:
                mBackgroundStyle = BACKGROUND_STYLE_RIPPLE;
                break;

            case BACKGROUND_STYLE_DEFAULT:
            default:
                mBackgroundStyle = BACKGROUND_STYLE_DEFAULT;
                break;
        }

        typedArray.recycle();
    } else {
        mActiveColor = Utils.fetchContextColor(context, R.attr.colorAccent);
        mInActiveColor = Color.LTGRAY;
        mBackgroundColor = Color.WHITE;
        mElevation = getResources().getDimension(R.dimen.bottom_navigation_elevation);
    }
}
 
Example 10
Project: EasyTableView   File: CircleDecoration.java   View Source Code Vote up 4 votes
public CircleDecoration(List<CircleDecorationInfo> decorationInfoList) {
    this(Color.LTGRAY, Color.GRAY, 20, decorationInfoList);
}
 
Example 11
Project: JD-Test   File: BottomNavigationBar.java   View Source Code Vote up 4 votes
/**
 * This method initiates the bottomNavigationBar properties,
 * Tries to get them form XML if not preset sets them to their default values.
 *
 * @param context context of the bottomNavigationBar
 * @param attrs   attributes mentioned in the layout XML by user
 */
private void parseAttrs(Context context, AttributeSet attrs) {
    if (attrs != null) {
        TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomNavigationBar, 0, 0);

        mActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbActiveColor, Utils.fetchContextColor(context, R.attr.colorAccent));
        mInActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbInactiveColor, Color.LTGRAY);
        mBackgroundColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbBackgroundColor, Color.WHITE);
        mAutoHideEnabled = typedArray.getBoolean(R.styleable.BottomNavigationBar_bnbAutoHideEnabled, true);
        mElevation = typedArray.getDimension(R.styleable.BottomNavigationBar_bnbElevation, getResources().getDimension(R.dimen.bottom_navigation_elevation));

        setAnimationDuration(typedArray.getInt(R.styleable.BottomNavigationBar_bnbAnimationDuration, DEFAULT_ANIMATION_DURATION));

        switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbMode, MODE_DEFAULT)) {
            case MODE_FIXED:
                mMode = MODE_FIXED;
                break;

            case MODE_SHIFTING:
                mMode = MODE_SHIFTING;
                break;

            case MODE_DEFAULT:
            default:
                mMode = MODE_DEFAULT;
                break;
        }

        switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbBackgroundStyle, BACKGROUND_STYLE_DEFAULT)) {
            case BACKGROUND_STYLE_STATIC:
                mBackgroundStyle = BACKGROUND_STYLE_STATIC;
                break;

            case BACKGROUND_STYLE_RIPPLE:
                mBackgroundStyle = BACKGROUND_STYLE_RIPPLE;
                break;

            case BACKGROUND_STYLE_DEFAULT:
            default:
                mBackgroundStyle = BACKGROUND_STYLE_DEFAULT;
                break;
        }

        typedArray.recycle();
    } else {
        mActiveColor = Utils.fetchContextColor(context, R.attr.colorAccent);
        mInActiveColor = Color.LTGRAY;
        mBackgroundColor = Color.WHITE;
        mElevation = getResources().getDimension(R.dimen.bottom_navigation_elevation);
    }
}
 
Example 12
Project: PicKing   File: JDlingyu.java   View Source Code Vote up 4 votes
@Override
public int getBackgroundColor() {
    return Color.LTGRAY;
}
 
Example 13
Project: DismissibleImageView   File: DismissibleDragShadowBuilder.java   View Source Code Vote up 4 votes
DismissibleDragShadowBuilder(ImageView imageView, Point offset) {
    super(imageView);

    this.offset = offset;
    this.shadow = new ColorDrawable(Color.LTGRAY);
}
 
Example 14
Project: snippety   File: ShimmerSpan.java   View Source Code Vote up 4 votes
public ShimmerSpan() {
    colors = new int[3];
    colors[0] = Color.WHITE;
    colors[1] = Color.LTGRAY;
    colors[2] = Color.DKGRAY;
}
 
Example 15
Project: react-native-dominant-color   File: RNDominantColorModule.java   View Source Code Vote up 4 votes
public RNDominantColorModule(ReactApplicationContext reactContext) {
    super(reactContext);

    this.defaultColor = Color.LTGRAY;
}
 
Example 16
Project: richeditor   File: DarkTheme.java   View Source Code Vote up 4 votes
@Override
public int getNormalColor() {
    return Color.LTGRAY;
}