Skip to content

Commit

Permalink
Add @nonnull and @nullable annotations
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 264619086
  • Loading branch information
cketcham authored and wcshi committed Aug 26, 2019
1 parent 4b1aa74 commit cdd41a2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.CompoundButtonCompat;
import androidx.appcompat.widget.AppCompatRadioButton;
Expand Down Expand Up @@ -52,15 +53,16 @@ public class MaterialRadioButton extends AppCompatRadioButton {
@Nullable private ColorStateList materialThemeColorsTintList;
private boolean useMaterialThemeColors;

public MaterialRadioButton(Context context) {
public MaterialRadioButton(@NonNull Context context) {
this(context, null);
}

public MaterialRadioButton(Context context, @Nullable AttributeSet attrs) {
public MaterialRadioButton(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, R.attr.radioButtonStyle);
}

public MaterialRadioButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
public MaterialRadioButton(
@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(createThemedContext(context, attrs, defStyleAttr, DEF_STYLE_RES), attrs, defStyleAttr);
// Ensure we are using the correctly themed context rather than the context that was passed in.
context = getContext();
Expand Down

0 comments on commit cdd41a2

Please sign in to comment.