Java 类android.support.v7.widget.AppCompatCheckedTextView 实例源码

项目:HorseandRidersCompanion    文件:SettingsActivity.java   
@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());
}
项目:4pdaClient-plus    文件:BasePreferencesActivity.java   
@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;
}
项目:WeatherDoge    文件:OptionsActivity.java   
@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;
}
项目:Sanxing    文件:SettingsActivity.java   
@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;
}
项目:Liapp    文件:SettingsActivity.java   
@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;
}
项目:citrus    文件:ListsTaskListAdapter.java   
/**
 * 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));
    }
}
项目:citrus    文件:ListsFragment.java   
@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());
}
项目:Snapmatic-Life    文件:SettingsActivity.java   
@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;
}
项目:Android-Carbon-Forum    文件:AppCompatPreferenceActivity.java   
@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;
}
项目:CodeColors    文件:AppCompatDefStyleHandler.java   
@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);
    }
}
项目:Hentoid    文件:PrefsActivity.java   
@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;
}
项目:citrus-master    文件:ListsTaskListAdapter.java   
/**
 * 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));
    }
}
项目:citrus-master    文件:ListsTranListAdapter.java   
/**
 * 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));
    }
}
项目:citrus-master    文件:TranListsFragment.java   
@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);
}
项目:citrus-master    文件:ListsFragment.java   
@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());
}
项目:Hitalk    文件:BGATitlebar.java   
public AppCompatCheckedTextView getLeftCtv() {
    return mLeftCtv;
}
项目:Hitalk    文件:BGATitlebar.java   
public AppCompatCheckedTextView getRightCtv() {
    return mRightCtv;
}
项目:Hitalk    文件:BGATitlebar.java   
public AppCompatCheckedTextView getTitleCtv() {
    return mTitleCtv;
}
项目:flowzr-android-black    文件:AccountListFragmentTest.java   
@Test
public void testCanOpenFromDrawer() {
    onView(withId(R.id.drawer_V)).perform(DrawerActions.open());
    onView(Matchers.allOf(isAssignableFrom(AppCompatCheckedTextView.class), withText(R.string.accounts))).perform(click());

}