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


Java AppCompatCheckedTextView类代码示例

本文整理汇总了Java中android.support.v7.widget.AppCompatCheckedTextView的典型用法代码示例。如果您正苦于以下问题:Java AppCompatCheckedTextView类的具体用法?Java AppCompatCheckedTextView怎么用?Java AppCompatCheckedTextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onCreate

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
    }
    nightModeSwitch = (AppCompatCheckedTextView) findViewById(R.id.night_mode_switch);
    nightModeSwitch.setOnClickListener(view -> onNightModeCheckChange());
    nightModeSwitch.setChecked(new UserPrefs().isNightMode());
    nightModeSwitch.setEnabled(!new UserPrefs().isDayNightMode());

    dayNightSwitch = (AppCompatCheckedTextView) findViewById(R.id.auto_theme_switch);
    dayNightSwitch.setChecked(new UserPrefs().isDayNightMode());
    dayNightSwitch.setOnClickListener(view -> onAutoThemeChange());

    instructorSwitch = (AppCompatCheckedTextView) findViewById(R.id.instructor_switch);
    instructorSwitch.setChecked(new UserPrefs().isInstructor());
    instructorSwitch.setOnClickListener(view -> onChangeInstructor());
}
 
开发者ID:Mfrenchy77,项目名称:HorseandRidersCompanion,代码行数:23,代码来源:SettingsActivity.java

示例2: onCreateView

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
    // Allow super to try and create a view first
    final View result = super.onCreateView(name, context, attrs);
    if (result != null) {
        return result;
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        switch (name) {
            case "EditText":
                return new AppCompatEditText(this,attrs);
            case "Spinner":
                return new AppCompatSpinner(this,attrs);
            case "CheckBox":
                return new AppCompatCheckBox(this,attrs);
            case "RadioButton":
                return new AppCompatRadioButton(this,attrs);
            case "CheckedTextView":
                return new AppCompatCheckedTextView(this,attrs);
        }
    }

    return null;
}
 
开发者ID:slartus,项目名称:4pdaClient-plus,代码行数:26,代码来源:BasePreferencesActivity.java

示例3: onCreateView

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
    final View result = super.onCreateView(name, context, attrs);
    if (result != null) {
        return result;
    }

    // Provide colorized/tinted widgets on non-Material devices
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        switch (name) {
            case "EditText":
                return new AppCompatEditText(this, attrs);
            case "Spinner":
                return new AppCompatSpinner(this, attrs);
            case "CheckBox":
                return new AppCompatCheckBox(this, attrs);
            case "RadioButton":
                return new AppCompatRadioButton(this, attrs);
            case "CheckedTextView":
                return new AppCompatCheckedTextView(this, attrs);
        }
    }

    return null;
}
 
开发者ID:VersoBit,项目名称:WeatherDoge,代码行数:27,代码来源:OptionsActivity.java

示例4: onCreateView

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
    // Allow super to try and create a view first
    final View result = super.onCreateView(name, context, attrs);
    if (result != null) {
        return result;
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        // If we're running pre-L, we need to 'inject' our tint aware Views in place of the
        // standard framework versions
        switch (name) {
            case "EditText":
                return new AppCompatEditText(this, attrs);
            case "Spinner":
                return new AppCompatSpinner(this, attrs);
            case "CheckBox":
                return new AppCompatCheckBox(this, attrs);
            case "RadioButton":
                return new AppCompatRadioButton(this, attrs);
            case "CheckedTextView":
                return new AppCompatCheckedTextView(this, attrs);
        }
    }

    return null;
}
 
开发者ID:AndroidNewbies,项目名称:Sanxing,代码行数:28,代码来源:SettingsActivity.java

示例5: changeTaskNameState

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
/**
 * Change background color, text color
 */
public void changeTaskNameState(View view, AppCompatCheckedTextView taskNameText, boolean completed) {
    taskNameText.setChecked(completed);
    if (completed) {
        view.setBackgroundColor(ContextCompat.getColor(mContext, R.color.mt_gray5));
        taskNameText.setTextColor(ContextCompat.getColor(mContext, R.color.mt_gray6));
    } else {
        view.setBackgroundColor(ContextCompat.getColor(mContext, android.R.color.white));
        taskNameText.setTextColor(ContextCompat.getColor(mContext, R.color.mt_black));
    }
}
 
开发者ID:eure,项目名称:citrus,代码行数:14,代码来源:ListsTaskListAdapter.java

示例6: onClickRecyclerItem

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public void onClickRecyclerItem(View v, int position) {
    Task task = mListsTaskListAdapter.getItem(position);
    AppCompatCheckedTextView taskNameText = (AppCompatCheckedTextView) v.findViewById(R.id.lists_task_name);
    mListsTaskListAdapter.changeTaskNameState(v, taskNameText, !task.isCompleted());

    TaskRepository.updateByCompleted(mUIThreadRealm, task, !task.isCompleted());
}
 
开发者ID:eure,项目名称:citrus,代码行数:9,代码来源:ListsFragment.java

示例7: getDefaultViewDefStyleAttr

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@SuppressLint({"PrivateResource", "InlinedApi"})
@Override
protected int getDefaultViewDefStyleAttr(View view) {
    if (view instanceof AppCompatRadioButton) {
        return R.attr.radioButtonStyle;
    } else if (view instanceof AppCompatCheckBox) {
        return R.attr.checkboxStyle;
    } else if (view instanceof AppCompatButton) {
        return R.attr.buttonStyle;
    } else if (view instanceof AppCompatMultiAutoCompleteTextView) {
        return R.attr.autoCompleteTextViewStyle;
    } else if (view instanceof AppCompatAutoCompleteTextView) {
        return R.attr.autoCompleteTextViewStyle;
    } else if (view instanceof AppCompatEditText) {
        return R.attr.editTextStyle;
    } else if (view instanceof AppCompatCheckedTextView) {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ?
                android.R.attr.checkedTextViewStyle : 0;
    } else if (view instanceof AppCompatTextView) {
        return android.R.attr.textViewStyle;
    } else if (view instanceof AppCompatSpinner) {
        return R.attr.spinnerStyle;
    } else if (view instanceof AppCompatImageButton) {
        return R.attr.imageButtonStyle;
    } else if (view instanceof AppCompatRatingBar) {
        return R.attr.ratingBarStyle;
    } else if (view instanceof AppCompatSeekBar) {
        return R.attr.seekBarStyle;
    } else {
        return super.getDefaultViewDefStyleAttr(view);
    }
}
 
开发者ID:Leao,项目名称:CodeColors,代码行数:33,代码来源:AppCompatDefStyleHandler.java

示例8: onCreateView

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
    // Allow super to try and create a view first
    final View result = super.onCreateView(name, context, attrs);
    if (result != null) {
        return result;
    }
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        // If we're running pre-L, we need to 'inject' our tint aware Views in place of the
        // standard framework versions
        switch (name) {
            case "EditText":
                return new AppCompatEditText(this, attrs);
            case "Spinner":
                return new AppCompatSpinner(this, attrs);
            case "CheckBox":
                return new AppCompatCheckBox(this, attrs);
            case "RadioButton":
                return new AppCompatRadioButton(this, attrs);
            case "CheckedTextView":
                return new AppCompatCheckedTextView(this, attrs);
            default: // do nothing
                break;
        }
    }

    return null;
}
 
开发者ID:avluis,项目名称:Hentoid,代码行数:29,代码来源:PrefsActivity.java

示例9: changeTaskNameState

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
/**
 * Change background color, text color
 */
public void changeTaskNameState(View view, AppCompatCheckedTextView taskNameText, boolean completed,
        Resources resources) {
    taskNameText.setChecked(completed);
    if (completed) {
        view.setBackgroundColor(resources.getColor(R.color.mt_gray5));
        taskNameText.setTextColor(resources.getColor(R.color.mt_gray6));
    } else {
        view.setBackgroundColor(resources.getColor(android.R.color.white));
        taskNameText.setTextColor(resources.getColor(R.color.mt_black));
    }
}
 
开发者ID:jyubi2003,项目名称:citrus-master,代码行数:15,代码来源:ListsTaskListAdapter.java

示例10: changeTranNameState

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
/**
 * Change background color, text color
 */
public void changeTranNameState(View view, AppCompatCheckedTextView tranNameText, String aTranClass,
        Resources resources) {
    tranNameText.setChecked(aTranClass.equalsIgnoreCase("支払い"));
    if (aTranClass.equalsIgnoreCase("支払い")) {
        tranNameText.setTextColor(resources.getColor(android.R.color.holo_red_light));
        view.setBackgroundColor(resources.getColor(android.R.color.background_light));
    } else if (aTranClass.equalsIgnoreCase("収入")){
        tranNameText.setTextColor(resources.getColor(android.R.color.holo_blue_light));
        view.setBackgroundColor(resources.getColor(android.R.color.background_light));
    } else {
        tranNameText.setTextColor(resources.getColor(android.R.color.holo_orange_dark));
        view.setBackgroundColor(resources.getColor(android.R.color.background_light));
    }
}
 
开发者ID:jyubi2003,项目名称:citrus-master,代码行数:18,代码来源:ListsTranListAdapter.java

示例11: onClickRecyclerItem

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public void onClickRecyclerItem(View v, int position) {
    Tran tran = mListsTranListAdapter.getItem(position);
    AppCompatCheckedTextView tranNameText = (AppCompatCheckedTextView) v.findViewById(R.id.lists_tran_name);
    mListsTranListAdapter.changeTranNameState(v, tranNameText, "収入", getResources());

    TranRepository.update(tran);
}
 
开发者ID:jyubi2003,项目名称:citrus-master,代码行数:9,代码来源:TranListsFragment.java

示例12: onClickRecyclerItem

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
@Override
public void onClickRecyclerItem(View v, int position) {
    Task task = mListsTaskListAdapter.getItem(position);
    AppCompatCheckedTextView taskNameText = (AppCompatCheckedTextView) v.findViewById(R.id.lists_task_name);
    mListsTaskListAdapter.changeTaskNameState(v, taskNameText, !task.isCompleted(), getResources());

    TaskRepository.updateByCompleted(mUIThreadRealm, task, !task.isCompleted());
}
 
开发者ID:jyubi2003,项目名称:citrus-master,代码行数:9,代码来源:ListsFragment.java

示例13: getLeftCtv

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
public AppCompatCheckedTextView getLeftCtv() {
    return mLeftCtv;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:4,代码来源:BGATitlebar.java

示例14: getRightCtv

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
public AppCompatCheckedTextView getRightCtv() {
    return mRightCtv;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:4,代码来源:BGATitlebar.java

示例15: getTitleCtv

import android.support.v7.widget.AppCompatCheckedTextView; //导入依赖的package包/类
public AppCompatCheckedTextView getTitleCtv() {
    return mTitleCtv;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:4,代码来源:BGATitlebar.java


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