Extracted string literals into constants.
This commit is contained in:
parent
88661757f6
commit
65f2c0eac7
@ -28,6 +28,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ShareChooserDialog extends BottomSheetDialogFragment {
|
public class ShareChooserDialog extends BottomSheetDialogFragment {
|
||||||
|
private static final String ARG_WIDTH = "width";
|
||||||
|
private static final String ARG_INTENT = "intent";
|
||||||
|
private static final String ARG_SHOW_NEARBY = "showNearby";
|
||||||
|
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private ArrayList<ResolveInfo> mTargets;
|
private ArrayList<ResolveInfo> mTargets;
|
||||||
private int mParentWidth;
|
private int mParentWidth;
|
||||||
@ -51,9 +55,9 @@ public class ShareChooserDialog extends BottomSheetDialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
mParentWidth = getArguments().getInt("width", 640);
|
mParentWidth = getArguments().getInt(ARG_WIDTH, 640);
|
||||||
mShareIntent = getArguments().getParcelable("intent");
|
mShareIntent = getArguments().getParcelable(ARG_INTENT);
|
||||||
mShowNearby = getArguments().getBoolean("showNearby", false);
|
mShowNearby = getArguments().getBoolean(ARG_SHOW_NEARBY, false);
|
||||||
mTargets = new ArrayList<>();
|
mTargets = new ArrayList<>();
|
||||||
List<ResolveInfo> resInfo = getContext().getPackageManager().queryIntentActivities(mShareIntent, 0);
|
List<ResolveInfo> resInfo = getContext().getPackageManager().queryIntentActivities(mShareIntent, 0);
|
||||||
if (resInfo != null && resInfo.size() > 0) {
|
if (resInfo != null && resInfo.size() > 0) {
|
||||||
@ -193,9 +197,9 @@ public class ShareChooserDialog extends BottomSheetDialogFragment {
|
|||||||
ShareChooserDialog d = new ShareChooserDialog();
|
ShareChooserDialog d = new ShareChooserDialog();
|
||||||
d.setListener(listener);
|
d.setListener(listener);
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putInt("width", rootView.getWidth());
|
args.putInt(ARG_WIDTH, rootView.getWidth());
|
||||||
args.putParcelable("intent", shareIntent);
|
args.putParcelable(ARG_INTENT, shareIntent);
|
||||||
args.putBoolean("showNearby", showNearbyItem);
|
args.putBoolean(ARG_SHOW_NEARBY, showNearbyItem);
|
||||||
d.setArguments(args);
|
d.setArguments(args);
|
||||||
d.show(parent.getSupportFragmentManager(), "Share");
|
d.show(parent.getSupportFragmentManager(), "Share");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user