当前位置: 首页>>代码示例>>Java>>正文


Java Color.LTGRAY属性代码示例

本文整理汇总了Java中android.graphics.Color.LTGRAY属性的典型用法代码示例。如果您正苦于以下问题:Java Color.LTGRAY属性的具体用法?Java Color.LTGRAY怎么用?Java Color.LTGRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.graphics.Color的用法示例。


在下文中一共展示了Color.LTGRAY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRandomColor

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;
    }
}
 
开发者ID:adk96r,项目名称:Eye,代码行数:28,代码来源:PersonInfoView.java

示例2: readKeyboardDefaultColor

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;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:Settings.java

示例3: init

/**
     * 初始化相关参数
     */
    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());
    }
 
开发者ID:paradoxie,项目名称:DizzyPassword,代码行数:36,代码来源:PswInputView.java

示例4: getStandardColors

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
    };
}
 
开发者ID:olgamiller,项目名称:SSTVEncoder2,代码行数:14,代码来源:GridColorPalette.java

示例5: nextQuestion

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);

    }
 
开发者ID:cristian-cojocaru,项目名称:QuizApp-Android,代码行数:36,代码来源:QuestionActivity.java

示例6: refreshView

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);
    }
}
 
开发者ID:hemantsaini0,项目名称:RecyclerView-Multiselect,代码行数:11,代码来源:MultiSelectManager.java

示例7: cvtStr2Color

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;
	}
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:29,代码来源:OGLChartOperator.java

示例8: cvtStr2Color

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;
	}
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:27,代码来源:XYChartOperator.java

示例9: parseAttrs

/**
 * 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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:65,代码来源:BottomNavigationBar.java

示例10: CircleDecoration

public CircleDecoration(List<CircleDecorationInfo> decorationInfoList) {
    this(Color.LTGRAY, Color.GRAY, 20, decorationInfoList);
}
 
开发者ID:huzenan,项目名称:EasyTableView,代码行数:3,代码来源:CircleDecoration.java

示例11: parseAttrs

/**
 * 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);
    }
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:57,代码来源:BottomNavigationBar.java

示例12: getBackgroundColor

@Override
public int getBackgroundColor() {
    return Color.LTGRAY;
}
 
开发者ID:lanyuanxiaoyao,项目名称:PicKing,代码行数:4,代码来源:JDlingyu.java

示例13: DismissibleDragShadowBuilder

DismissibleDragShadowBuilder(ImageView imageView, Point offset) {
    super(imageView);

    this.offset = offset;
    this.shadow = new ColorDrawable(Color.LTGRAY);
}
 
开发者ID:dmallcott,项目名称:DismissibleImageView,代码行数:6,代码来源:DismissibleDragShadowBuilder.java

示例14: ShimmerSpan

public ShimmerSpan() {
    colors = new int[3];
    colors[0] = Color.WHITE;
    colors[1] = Color.LTGRAY;
    colors[2] = Color.DKGRAY;
}
 
开发者ID:Fueled,项目名称:snippety,代码行数:6,代码来源:ShimmerSpan.java

示例15: RNDominantColorModule

public RNDominantColorModule(ReactApplicationContext reactContext) {
    super(reactContext);

    this.defaultColor = Color.LTGRAY;
}
 
开发者ID:hu9osaez,项目名称:react-native-dominant-color,代码行数:5,代码来源:RNDominantColorModule.java


注:本文中的android.graphics.Color.LTGRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。