Skip to content

Commit

Permalink
Remove butterknife dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Baiget committed Mar 23, 2017
1 parent 101883b commit aaaa99e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 38 deletions.
3 changes: 0 additions & 3 deletions library/build.gradle
Expand Up @@ -36,7 +36,4 @@ dependencies {
compile supportDependencies.appCompat
compile supportDependencies.percent
compile supportDependencies.grid

compile butterknifeDependencies.butterknife
annotationProcessor butterknifeDependencies.butterknifeCompiler
}
Expand Up @@ -82,12 +82,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
setCancelable(false);
}

@Override
public void onStart() {
super.onStart();
onNumberChanged();
}

@SuppressLint("SetTextI18n")
@NonNull
@Override
Expand Down Expand Up @@ -206,6 +200,12 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
return dialog;
}

@Override
public void onStart() {
super.onStart();
onNumberChanged();
}

@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Expand All @@ -216,17 +216,6 @@ public void onSaveInstanceState(Bundle outState) {
outState.putString(ARG_SAVED_VALUE, numberTextView.getText().toString());
}

private void assignArguments(Bundle args) {
if (args.containsKey(ARG_REFERENCE))
reference = args.getInt(ARG_REFERENCE);
if (args.containsKey(ARG_RELATIVE))
relative = args.getBoolean(ARG_RELATIVE);
if (args.containsKey(ARG_NATURAL))
natural = args.getBoolean(ARG_NATURAL);
if (args.containsKey(ARG_THEME))
theme = args.getInt(ARG_THEME);
}

private void onNumberChanged() {
backspaceButton.setEnabled(0 != numberTextView.length());
if (0 == numberTextView.getText().length()) {
Expand All @@ -239,6 +228,17 @@ private void onNumberChanged() {
}
}

private void assignArguments(Bundle args) {
if (args.containsKey(ARG_REFERENCE))
reference = args.getInt(ARG_REFERENCE);
if (args.containsKey(ARG_RELATIVE))
relative = args.getBoolean(ARG_RELATIVE);
if (args.containsKey(ARG_NATURAL))
natural = args.getBoolean(ARG_NATURAL);
if (args.containsKey(ARG_THEME))
theme = args.getInt(ARG_THEME);
}

public static class Builder {

private int reference = DEFAULT_REFERENCE;
Expand Down
Expand Up @@ -50,7 +50,7 @@ public class HexaPickerDialog extends DialogFragment {
private static final int NO_MIN_LENGTH = -1;
private static final int NO_MAX_LENGTH = -1;

AlertDialog dialog;
private AlertDialog dialog;
private TextView numberTextView;
private ImageButton backspaceButton;

Expand Down Expand Up @@ -84,12 +84,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
setCancelable(false);
}

@Override
public void onStart() {
super.onStart();
onNumberChanged();
}

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Expand Down Expand Up @@ -174,6 +168,12 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
return dialog;
}

@Override
public void onStart() {
super.onStart();
onNumberChanged();
}

@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Expand All @@ -184,17 +184,6 @@ public void onSaveInstanceState(Bundle outState) {
outState.putString(ARG_SAVED_VALUE, numberTextView.getText().toString());
}

private void assignArguments(Bundle args) {
if (args.containsKey(ARG_REFERENCE))
reference = args.getInt(ARG_REFERENCE);
if (args.containsKey(ARG_MIN_LENGTH))
minLength = args.getInt(ARG_MIN_LENGTH);
if (args.containsKey(ARG_MAX_LENGTH))
maxLength = args.getInt(ARG_MAX_LENGTH);
if (args.containsKey(ARG_THEME))
theme = args.getInt(ARG_THEME);
}

private void onNumberChanged() {
backspaceButton.setEnabled(0 != numberTextView.length());
if (0 == numberTextView.getText().length()) {
Expand All @@ -206,6 +195,17 @@ private void onNumberChanged() {
}
}

private void assignArguments(Bundle args) {
if (args.containsKey(ARG_REFERENCE))
reference = args.getInt(ARG_REFERENCE);
if (args.containsKey(ARG_MIN_LENGTH))
minLength = args.getInt(ARG_MIN_LENGTH);
if (args.containsKey(ARG_MAX_LENGTH))
maxLength = args.getInt(ARG_MAX_LENGTH);
if (args.containsKey(ARG_THEME))
theme = args.getInt(ARG_THEME);
}

public static class Builder {

private int reference = DEFAULT_REFERENCE;
Expand Down

0 comments on commit aaaa99e

Please sign in to comment.