android.support.v7.widget.AppCompatCheckedTextView Java Examples

The following examples show how to use android.support.v7.widget.AppCompatCheckedTextView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasePreferencesActivity.java    From 4pdaClient-plus with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example #2
Source File: SettingsActivity.java    From Liapp with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #3
Source File: ListsTaskListAdapter.java    From citrus with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example #4
Source File: ListsFragment.java    From citrus with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #5
Source File: AppCompatPreferenceActivity.java    From Android-Carbon-Forum with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #6
Source File: AppCompatv7DSL.java    From anvil with MIT License 4 votes vote down vote up
public static BaseDSL.ViewClassResult appCompatCheckedTextView() {
  return BaseDSL.v(AppCompatCheckedTextView.class);
}
 
Example #7
Source File: AppCompatv7DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void appCompatCheckedTextView(Anvil.Renderable r) {
  return BaseDSL.v(AppCompatCheckedTextView.class, r);
}