Skip to content

fix android lint errors #19743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions RNTester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ android {
signingConfig signingConfigs.release
}
}

lintOptions {
abortOnError false
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ public class AlertFragment extends DialogFragment implements DialogInterface.OnC
/* package */ static final String ARG_BUTTON_NEUTRAL = "button_neutral";
/* package */ static final String ARG_ITEMS = "items";

private final @Nullable DialogModule.AlertFragmentListener mListener;

public AlertFragment() {
mListener = null;
}

public AlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {
mListener = listener;
setArguments(arguments);
}
private @Nullable DialogModule.AlertFragmentListener mListener;

public static Dialog createDialog(
Context activityContext, Bundle arguments, DialogInterface.OnClickListener fragment) {
Expand Down Expand Up @@ -84,4 +75,8 @@ public void onDismiss(DialogInterface dialog) {
mListener.onDismiss(dialog);
}
}

/*package*/ void setAlertFragmentListener(@Nullable DialogModule.AlertFragmentListener alertFragmentListener) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i haven't worked with java that much. is /*package*/ required? @hramos @gengjiawen

mListener = alertFragmentListener;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ public void showNewAlert(boolean isInForeground, Bundle arguments, Callback acti
actionCallback != null ? new AlertFragmentListener(actionCallback) : null;

if (isUsingSupportLibrary()) {
SupportAlertFragment alertFragment = new SupportAlertFragment(actionListener, arguments);
SupportAlertFragment alertFragment = new SupportAlertFragment();
alertFragment.setArguments(arguments);
alertFragment.setAlertFragmentListener(actionListener);
if (isInForeground) {
if (arguments.containsKey(KEY_CANCELABLE)) {
alertFragment.setCancelable(arguments.getBoolean(KEY_CANCELABLE));
Expand All @@ -141,7 +143,10 @@ public void showNewAlert(boolean isInForeground, Bundle arguments, Callback acti
mFragmentToShow = alertFragment;
}
} else {
AlertFragment alertFragment = new AlertFragment(actionListener, arguments);
AlertFragment alertFragment = new AlertFragment();
alertFragment.setArguments(arguments);
alertFragment.setAlertFragmentListener(actionListener);

if (isInForeground) {
if (arguments.containsKey(KEY_CANCELABLE)) {
alertFragment.setCancelable(arguments.getBoolean(KEY_CANCELABLE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@
*/
public class SupportAlertFragment extends DialogFragment implements DialogInterface.OnClickListener {

private final @Nullable DialogModule.AlertFragmentListener mListener;

public SupportAlertFragment() {
mListener = null;
}

public SupportAlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {
mListener = listener;
setArguments(arguments);
}
private @Nullable DialogModule.AlertFragmentListener mListener;

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Expand All @@ -51,4 +42,8 @@ public void onDismiss(DialogInterface dialog) {
mListener.onDismiss(dialog);
}
}

/*package*/ void setAlertFragmentListener(@Nullable DialogModule.AlertFragmentListener alertFragmentListener) {
mListener = alertFragmentListener;
}
}
8 changes: 0 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,4 @@ allprojects {
url "$androidSdk/extras/m2repository/"
}
}

project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.facebook.soloader') {
details.useVersion "0.3.0"
}
}
}
}