code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
} | Class responsible of loading Flipper inside your React Native application. This is the debug
flavor of it. Here you can add your own plugins and customize the Flipper setup. | apply | java | a7medev/react-native-ml-kit | example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | MIT |
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
p... | Class responsible of loading Flipper inside your React Native application. This is the debug
flavor of it. Here you can add your own plugins and customize the Flipper setup. | onReactContextInitialized | java | a7medev/react-native-ml-kit | example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | MIT |
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
} | Class responsible of loading Flipper inside your React Native application. This is the debug
flavor of it. Here you can add your own plugins and customize the Flipper setup. | run | java | a7medev/react-native-ml-kit | example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/debug/java/com/rnmlkitexample/ReactNativeFlipper.java | MIT |
@Override
protected String getMainComponentName() {
return "RNMLKitExample";
} | Returns the name of the main component registered from JavaScript. This is used to schedule
rendering of the component. | getMainComponentName | java | a7medev/react-native-ml-kit | example/android/app/src/main/java/com/rnmlkitexample/MainActivity.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/main/java/com/rnmlkitexample/MainActivity.java | MIT |
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric... | Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
(aka React 18) with two boolean flags. | createReactActivityDelegate | java | a7medev/react-native-ml-kit | example/android/app/src/main/java/com/rnmlkitexample/MainActivity.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/main/java/com/rnmlkitexample/MainActivity.java | MIT |
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
} | Class responsible of loading Flipper inside your React Native application. This is the release
flavor of it so it's empty as we don't want to load Flipper. | initializeFlipper | java | a7medev/react-native-ml-kit | example/android/app/src/release/java/com/rnmlkitexample/ReactNativeFlipper.java | https://github.com/a7medev/react-native-ml-kit/blob/master/example/android/app/src/release/java/com/rnmlkitexample/ReactNativeFlipper.java | MIT |
@Override
protected String getMainComponentName() {
return "example";
} | Returns the name of the main component registered from JavaScript. This is used to schedule
rendering of the component. | getMainComponentName | java | a7medev/react-native-ml-kit | identify-languages/example/android/app/src/main/java/com/example/MainActivity.java | https://github.com/a7medev/react-native-ml-kit/blob/master/identify-languages/example/android/app/src/main/java/com/example/MainActivity.java | MIT |
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
... | Loads Flipper in React Native templates. Call this in the onCreate method with something like
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
@param context
@param reactInstanceManager | initializeFlipper | java | a7medev/react-native-ml-kit | identify-languages/example/android/app/src/main/java/com/example/MainApplication.java | https://github.com/a7medev/react-native-ml-kit/blob/master/identify-languages/example/android/app/src/main/java/com/example/MainApplication.java | MIT |
@Override
protected String getMainComponentName() {
return "example";
} | Returns the name of the main component registered from JavaScript. This is used to schedule
rendering of the component. | getMainComponentName | java | a7medev/react-native-ml-kit | translate-text/example/android/app/src/main/java/com/example/MainActivity.java | https://github.com/a7medev/react-native-ml-kit/blob/master/translate-text/example/android/app/src/main/java/com/example/MainActivity.java | MIT |
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
... | Loads Flipper in React Native templates. Call this in the onCreate method with something like
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
@param context
@param reactInstanceManager | initializeFlipper | java | a7medev/react-native-ml-kit | translate-text/example/android/app/src/main/java/com/example/MainApplication.java | https://github.com/a7medev/react-native-ml-kit/blob/master/translate-text/example/android/app/src/main/java/com/example/MainApplication.java | MIT |
public int getCurrentPosition() {
return mCurrentViewIndex - getChildCount();
} | Returns the current adapter position.
@return The current position. | getCurrentPosition | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public Adapter getAdapter() {
return mAdapter;
} | Returns the adapter currently in use in this SwipeStack.
@return The adapter currently used to display data in this SwipeStack. | getAdapter | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void setAdapter(Adapter adapter) {
if (mAdapter != null) mAdapter.unregisterDataSetObserver(mDataObserver);
mAdapter = adapter;
mAdapter.registerDataSetObserver(mDataObserver);
} | Sets the data behind this SwipeView.
@param adapter The Adapter which is responsible for maintaining the
data backing this list and for producing a view to represent an
item in that data set.
@see #getAdapter() | setAdapter | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public int getAllowedSwipeDirections() {
return mAllowedSwipeDirections;
} | Returns the allowed swipe directions.
@return The currently allowed swipe directions. | getAllowedSwipeDirections | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void setAllowedSwipeDirections(int directions) {
mAllowedSwipeDirections = directions;
} | Sets the allowed swipe directions.
@param directions One of {@link #SWIPE_DIRECTION_BOTH},
{@link #SWIPE_DIRECTION_ONLY_LEFT}, or {@link #SWIPE_DIRECTION_ONLY_RIGHT}. | setAllowedSwipeDirections | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void setListener(@Nullable SwipeStackListener listener) {
mListener = listener;
} | Register a callback to be invoked when the user has swiped the top view
left / right or when the stack gets empty.
@param listener The callback that will run | setListener | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void setSwipeProgressListener(@Nullable SwipeProgressListener listener) {
mProgressListener = listener;
} | Register a callback to be invoked when the user starts / stops interacting
with the top view of the stack.
@param listener The callback that will run | setSwipeProgressListener | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public View getTopView() {
return mTopView;
} | Get the view from the top of the stack.
@return The view if the stack is not empty or null otherwise. | getTopView | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void swipeTopViewToRight() {
if (getChildCount() == 0) return;
mSwipeHelper.swipeViewToRight();
} | Programmatically dismiss the top view to the right. | swipeTopViewToRight | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void swipeTopViewToLeft() {
if (getChildCount() == 0) return;
mSwipeHelper.swipeViewToLeft();
} | Programmatically dismiss the top view to the left. | swipeTopViewToLeft | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
public void resetStack() {
mCurrentViewIndex = 0;
removeAllViewsInLayout();
requestLayout();
} | Resets the current adapter position and repopulates the stack. | resetStack | java | flschweiger/SwipeStack | library/src/main/java/link/fls/swipestack/SwipeStack.java | https://github.com/flschweiger/SwipeStack/blob/master/library/src/main/java/link/fls/swipestack/SwipeStack.java | Apache-2.0 |
@Override
public @NotNull PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) {
return new JavaElementVisitor() {
@Override
public void visitNewExpression(PsiNewExpression expression) {
if ("j... | ref: https://rules.sonarsource.com/java/type/Security%20Hotspot/RSPEC-2245 | buildVisitor | java | fuzhengwei/guide-idea-plugin | guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | https://github.com/fuzhengwei/guide-idea-plugin/blob/master/guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | Apache-2.0 |
@Override
public void visitNewExpression(PsiNewExpression expression) {
if ("java.util.Random".equals(Objects.requireNonNull(expression.getClassReference()).getQualifiedName())) {
holder.registerProblem(expression,
"Unsafe pseudorandom generato... | ref: https://rules.sonarsource.com/java/type/Security%20Hotspot/RSPEC-2245 | visitNewExpression | java | fuzhengwei/guide-idea-plugin | guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | https://github.com/fuzhengwei/guide-idea-plugin/blob/master/guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | Apache-2.0 |
@Override
protected void bindReference(PsiReference ref, PsiClass targetClass) {
ref.bindToElement(targetClass);
} | ref: https://rules.sonarsource.com/java/type/Security%20Hotspot/RSPEC-2245 | bindReference | java | fuzhengwei/guide-idea-plugin | guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | https://github.com/fuzhengwei/guide-idea-plugin/blob/master/guide-idea-plugin-pmd/src/main/java/cn/bugstack/guide/idea/plugin/rule/RandomRule.java | Apache-2.0 |
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = ActivityChatBinding.inflate(getLayoutInflater());
setContentView(mBinding.getRoot());
LinearLayoutManager manager = new LinearLayoutManager(this);
manager.... | Get the last 50 chat messages ordered by timestamp . | onCreate | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
public void onStart() {
super.onStart();
if (isSignedIn()) {
attachRecyclerViewAdapter();
}
FirebaseAuth.getInstance().addAuthStateListener(this);
} | Get the last 50 chat messages ordered by timestamp . | onStart | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
protected void onStop() {
super.onStop();
FirebaseAuth.getInstance().removeAuthStateListener(this);
} | Get the last 50 chat messages ordered by timestamp . | onStop | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth auth) {
mBinding.sendButton.setEnabled(isSignedIn());
mBinding.messageEdit.setEnabled(isSignedIn());
if (isSignedIn()) {
attachRecyclerViewAdapter();
} else {
Toast.makeText(this, R.string.signing... | Get the last 50 chat messages ordered by timestamp . | onAuthStateChanged | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
private boolean isSignedIn() {
return FirebaseAuth.getInstance().getCurrentUser() != null;
} | Get the last 50 chat messages ordered by timestamp . | isSignedIn | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
private void attachRecyclerViewAdapter() {
final RecyclerView.Adapter adapter = newAdapter();
// Scroll to bottom on new messages
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onItemRangeInserted(int positionStart, int... | Get the last 50 chat messages ordered by timestamp . | attachRecyclerViewAdapter | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
mBinding.messagesList.smoothScrollToPosition(0);
} | Get the last 50 chat messages ordered by timestamp . | onItemRangeInserted | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
public void onSendClick() {
String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();
String name = "User " + uid.substring(0, 6);
onAddMessage(new Chat(name, mBinding.messageEdit.getText().toString(), uid));
mBinding.messageEdit.setText("");
} | Get the last 50 chat messages ordered by timestamp . | onSendClick | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@NonNull
private RecyclerView.Adapter newAdapter() {
FirestoreRecyclerOptions<Chat> options =
new FirestoreRecyclerOptions.Builder<Chat>()
.setQuery(sChatQuery, Chat.class)
.setLifecycleOwner(this)
.build();
ret... | Get the last 50 chat messages ordered by timestamp . | newAdapter | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@NonNull
@Override
public ChatHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ChatHolder(LayoutInflater.from(parent.getContext())
.inflate(R.layout.message, parent, false));
} | Get the last 50 chat messages ordered by timestamp . | onCreateViewHolder | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
protected void onBindViewHolder(@NonNull ChatHolder holder, int position, @NonNull Chat model) {
holder.bind(model);
} | Get the last 50 chat messages ordered by timestamp . | onBindViewHolder | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
public void onDataChanged() {
// If there are no chat messages, show a view that invites the user to add a message.
mBinding.emptyTextView.setVisibility(getItemCount() == 0 ? View.VISIBLE : View.GONE);
} | Get the last 50 chat messages ordered by timestamp . | onDataChanged | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
private void onAddMessage(@NonNull Chat chat) {
sChatCollection.add(chat).addOnFailureListener(this,
e -> Log.e(TAG, "Failed to write message", e));
} | Get the last 50 chat messages ordered by timestamp . | onAddMessage | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/database/firestore/FirestoreChatActivity.java | Apache-2.0 |
@Override
public void registerComponents(@NonNull Context context,
@NonNull Glide glide,
@NonNull Registry registry) {
// Register FirebaseImageLoader to handle StorageReference
registry.append(StorageReference.class, InputStream.... | Glide module to register {@link com.firebase.ui.storage.images.FirebaseImageLoader}.
See: http://bumptech.github.io/glide/doc/generatedapi.html | registerComponents | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/storage/MyAppGlideModule.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/storage/MyAppGlideModule.java | Apache-2.0 |
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Toast.makeText(mContext, R.string.signed_in, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mContext, R.string.anonymous_auth_failed_msg, Toast.LENGTH_LONG).show();
}
... | Notifies the user of sign in successes or failures beyond the lifecycle of an activity. | onComplete | java | firebase/FirebaseUI-Android | app/src/main/java/com/firebase/uidemo/util/SignInResultNotifier.java | https://github.com/firebase/FirebaseUI-Android/blob/master/app/src/main/java/com/firebase/uidemo/util/SignInResultNotifier.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setGoogleButtonId(@IdRes int googleBtn) {
providersMapping.put(GoogleAuthProvider.PROVIDER_ID, googleBtn);
return this;
} | Set the ID of the Google sign in button in the custom layout. | setGoogleButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setFacebookButtonId(@IdRes int facebookBtn) {
providersMapping.put(FacebookAuthProvider.PROVIDER_ID, facebookBtn);
return this;
} | Set the ID of the Facebook sign in button in the custom layout. | setFacebookButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setTwitterButtonId(@IdRes int twitterBtn) {
providersMapping.put(TwitterAuthProvider.PROVIDER_ID, twitterBtn);
return this;
} | Set the ID of the Twitter sign in button in the custom layout. | setTwitterButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setEmailButtonId(@IdRes int emailButton) {
providersMapping.put(EmailAuthProvider.PROVIDER_ID, emailButton);
return this;
} | Set the ID of the Email sign in button in the custom layout. | setEmailButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setPhoneButtonId(@IdRes int phoneButton) {
providersMapping.put(PhoneAuthProvider.PROVIDER_ID, phoneButton);
return this;
} | Set the ID of the Phone Number sign in button in the custom layout. | setPhoneButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setAnonymousButtonId(@IdRes int anonymousButton) {
providersMapping.put(AuthUI.ANONYMOUS_PROVIDER, anonymousButton);
return this;
} | Set the ID of the Anonymous sign in button in the custom layout. | setAnonymousButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setGithubButtonId(
@IdRes int githubButtonId) {
providersMapping.put(GithubAuthProvider.PROVIDER_ID, githubButtonId);
return this;
} | Set the ID of the Anonymous sign in button in the custom layout. | setGithubButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setMicrosoftButtonId(
@IdRes int microsoftButtonId) {
providersMapping.put(AuthUI.MICROSOFT_PROVIDER, microsoftButtonId);
return this;
} | Set the ID of the Anonymous sign in button in the custom layout. | setMicrosoftButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setAppleButtonId(
@IdRes int appleButtonId) {
providersMapping.put(AuthUI.APPLE_PROVIDER, appleButtonId);
return this;
} | Set the ID of the Anonymous sign in button in the custom layout. | setAppleButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setYahooButtonId(
@IdRes int yahooButtonId) {
providersMapping.put(AuthUI.YAHOO_PROVIDER, yahooButtonId);
return this;
} | Set the ID of the Anonymous sign in button in the custom layout. | setYahooButtonId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout.Builder setTosAndPrivacyPolicyId(@IdRes int tosPpView) {
instance.tosPpView = tosPpView;
return this;
} | Set the ID of a TextView where terms of service and privacy policy should be
displayed. | setTosAndPrivacyPolicyId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
public AuthMethodPickerLayout build() {
if (providersMapping.isEmpty()) {
throw new IllegalArgumentException("Must configure at least one button.");
}
for (String key : providersMapping.keySet()) {
if (!AuthUI.SUPPORTED_PROVIDERS.contains(key)
... | Set the ID of a TextView where terms of service and privacy policy should be
displayed. | build | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthMethodPickerLayout.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
public static Context getApplicationContext() {
return sApplicationContext;
} | The set of social authentication providers supported in Firebase Auth UI using their SDK. | getApplicationContext | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static void setApplicationContext(@NonNull Context context) {
sApplicationContext = Preconditions.checkNotNull(context, "App context cannot be null.")
.getApplicationContext();
} | The set of social authentication providers supported in Firebase Auth UI using their SDK. | setApplicationContext | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public static AuthUI getInstance() {
return getInstance(FirebaseApp.getInstance());
} | Retrieves the {@link AuthUI} instance associated with the default app, as returned by {@code
FirebaseApp.getInstance()}.
@throws IllegalStateException if the default app is not initialized. | getInstance | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public static AuthUI getInstance(@NonNull String appName) {
return getInstance(FirebaseApp.getInstance(appName));
} | Retrieves the {@link AuthUI} instance associated the the specified app name.
@throws IllegalStateException if the app is not initialized. | getInstance | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public static AuthUI getInstance(@NonNull FirebaseApp app) {
String releaseUrl = "https://github.com/firebase/FirebaseUI-Android/releases/tag/6.2.0";
String devWarning = "Beginning with FirebaseUI 6.2.0 you no longer need to include %s to " +
"sign in with %s. Go to %s for m... | Retrieves the {@link AuthUI} instance associated the the specified app. | getInstance | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public FirebaseApp getApp() {
return mApp;
} | Retrieves the {@link AuthUI} instance associated the the specified app. | getApp | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public FirebaseAuth getAuth() {
return mAuth;
} | Retrieves the {@link AuthUI} instance associated the the specified app. | getAuth | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
public static boolean canHandleIntent(@NonNull Intent intent) {
if (intent == null || intent.getData() == null) {
return false;
}
String link = intent.getData().toString();
return FirebaseAuth.getInstance().isSignInWithEmailLink(link);
} | Returns true if AuthUI can handle the intent.
<p>
AuthUI handle the intent when the embedded data is an email link. If it is, you can then
specify the link in {@link SignInIntentBuilder#setEmailLink(String)} before starting AuthUI
and it will be handled immediately. | canHandleIntent | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@StyleRes
public static int getDefaultTheme() {
return R.style.FirebaseUI_DefaultMaterialTheme;
} | Default theme used by {@link SignInIntentBuilder#setTheme(int)} if no theme customization is
required. | getDefaultTheme | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public Task<Void> signOut(@NonNull Context context) {
boolean playServicesAvailable = GoogleApiUtils.isPlayServicesAvailable(context);
if (!playServicesAvailable) {
Log.w(TAG, "Google Play services not available during signOut");
}
signOutIdps(context);
E... | Signs the current user out, if one is signed in.
@param context the context requesting the user be signed out
@return A task which, upon completion, signals that the user has been signed out ({@link
Task#isSuccessful()}, or that the sign-out attempt failed unexpectedly !{@link
Task#isSuccessful()}). | signOut | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public Task<Void> delete(@NonNull final Context context) {
final FirebaseUser currentUser = mAuth.getCurrentUser();
if (currentUser == null) {
return Tasks.forException(new FirebaseAuthInvalidUserException(
String.valueOf(CommonStatusCodes.SIGN_IN_REQUIRED),
... | Delete the user from FirebaseAuth.
<p>Any associated saved credentials are not explicitly deleted with the new APIs.
@param context the calling {@link Context}. | delete | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
public void useEmulator(@NonNull String host, int port) {
Preconditions.checkArgument(port >= 0, "Port must be >= 0");
Preconditions.checkArgument(port <= 65535, "Port must be <= 65535");
mEmulatorHost = host;
mEmulatorPort = port;
mAuth.useEmulator(host, port);
} | Connect to the Firebase Authentication emulator.
@see FirebaseAuth#useEmulator(String, int) | useEmulator | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public boolean isUseEmulator() {
return mEmulatorHost != null && mEmulatorPort >= 0;
} | Connect to the Firebase Authentication emulator.
@see FirebaseAuth#useEmulator(String, int) | isUseEmulator | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public String getEmulatorHost() {
return mEmulatorHost;
} | Connect to the Firebase Authentication emulator.
@see FirebaseAuth#useEmulator(String, int) | getEmulatorHost | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public int getEmulatorPort() {
return mEmulatorPort;
} | Connect to the Firebase Authentication emulator.
@see FirebaseAuth#useEmulator(String, int) | getEmulatorPort | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void signOutIdps(@NonNull Context context) {
if (ProviderAvailability.IS_FACEBOOK_AVAILABLE) {
LoginManager.getInstance().logOut();
}
} | Connect to the Firebase Authentication emulator.
@see FirebaseAuth#useEmulator(String, int) | signOutIdps | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private Task<Void> clearCredentialState(
@NonNull Context context,
@NonNull Executor executor
) {
TaskCompletionSource<Void> completionSource = new TaskCompletionSource<>();
ClearCredentialStateRequest clearRequest = new ClearCredentialStateRequest();
GoogleApiUtils.... | A Task to clear the credential state in Credential Manager.
@param context
@param executor
@return | clearCredentialState | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@Override
public void onResult(Void unused) {
completionSource.setResult(unused);
} | A Task to clear the credential state in Credential Manager.
@param context
@param executor
@return | onResult | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@Override
public void onError(@NonNull ClearCredentialException e) {
completionSource.setException(e);
} | A Task to clear the credential state in Credential Manager.
@param context
@param executor
@return | onError | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public SignInIntentBuilder createSignInIntentBuilder() {
return new SignInIntentBuilder();
} | Starts the process of creating a sign in intent, with the mandatory application context
parameter. | createSignInIntentBuilder | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
protected final Bundle getParams() {
return mParams;
} | Base builder for all authentication providers.
@see SignInIntentBuilder#setAvailableProviders(List) | getParams | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
protected void setProviderId(@NonNull String providerId) {
mProviderId = providerId;
} | Base builder for all authentication providers.
@see SignInIntentBuilder#setAvailableProviders(List) | setProviderId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@CallSuper
@NonNull
public IdpConfig build() {
return new IdpConfig(mProviderId, mParams);
} | Base builder for all authentication providers.
@see SignInIntentBuilder#setAvailableProviders(List) | build | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder setAllowNewAccounts(boolean allow) {
getParams().putBoolean(ExtraConstants.ALLOW_NEW_EMAILS, allow);
return this;
} | Enables or disables creating new accounts in the email sign in flows.
<p>
Account creation is enabled by default. | setAllowNewAccounts | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder setRequireName(boolean requireName) {
getParams().putBoolean(ExtraConstants.REQUIRE_NAME, requireName);
return this;
} | Configures the requirement for the user to enter first and last name in the email
sign up flow.
<p>
Name is required by default. | setRequireName | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder enableEmailLinkSignIn() {
setProviderId(EMAIL_LINK_PROVIDER);
return this;
} | Enables email link sign in instead of password based sign in. Once enabled, you must
pass a valid {@link ActionCodeSettings} object using
{@link #setActionCodeSettings(ActionCodeSettings)}
<p>
You must enable Firebase Dynamic Links in the Firebase Console to use email link
sign in.
@throws IllegalStateException if {@l... | enableEmailLinkSignIn | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder setActionCodeSettings(ActionCodeSettings actionCodeSettings) {
getParams().putParcelable(ExtraConstants.ACTION_CODE_SETTINGS, actionCodeSettings);
return this;
} | Sets the {@link ActionCodeSettings} object to be used for email link sign in.
<p>
{@link ActionCodeSettings#canHandleCodeInApp()} must be set to true, and a valid
continueUrl must be passed via {@link ActionCodeSettings.Builder#setUrl(String)}.
This URL must be allowlisted in the Firebase Console.
@throws IllegalState... | setActionCodeSettings | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder setForceSameDevice() {
getParams().putBoolean(ExtraConstants.FORCE_SAME_DEVICE, true);
return this;
} | Disables allowing email link sign in to occur across different devices.
<p>
This cannot be disabled with anonymous upgrade. | setForceSameDevice | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public EmailBuilder setDefaultEmail(String email) {
getParams().putString(ExtraConstants.DEFAULT_EMAIL, email);
return this;
} | Sets a default sign in email, if the given email has been registered before, then
it will ask the user for password, if the given email it's not registered, then
it starts signing up the default email. | setDefaultEmail | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@Override
public IdpConfig build() {
if (super.mProviderId.equals(EMAIL_LINK_PROVIDER)) {
ActionCodeSettings actionCodeSettings =
getParams().getParcelable(ExtraConstants.ACTION_CODE_SETTINGS);
Preconditions.checkNotNull(act... | Sets a default sign in email, if the given email has been registered before, then
it will ask the user for password, if the given email it's not registered, then
it starts signing up the default email. | build | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public PhoneBuilder setDefaultNumber(@NonNull String number) {
Preconditions.checkUnset(getParams(),
"Cannot overwrite previously set phone number",
ExtraConstants.PHONE,
ExtraConstants.COUNTRY_ISO,
... | @param number the phone number in international format
@see #setDefaultNumber(String, String) | setDefaultNumber | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public PhoneBuilder setDefaultNumber(@NonNull String iso, @NonNull String number) {
Preconditions.checkUnset(getParams(),
"Cannot overwrite previously set phone number",
ExtraConstants.PHONE,
ExtraConstants.COUN... | Set the default phone number that will be used to populate the phone verification
sign-in flow.
@param iso the phone number's country code
@param number the phone number in local format | setDefaultNumber | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public PhoneBuilder setDefaultCountryIso(@NonNull String iso) {
Preconditions.checkUnset(getParams(),
"Cannot overwrite previously set phone number",
ExtraConstants.PHONE,
ExtraConstants.COUNTRY_ISO,
... | Set the default country code that will be used in the phone verification sign-in
flow.
@param iso country iso | setDefaultCountryIso | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
public PhoneBuilder setAllowedCountries(
@NonNull List<String> countries) {
if (getParams().containsKey(ExtraConstants.BLOCKLISTED_COUNTRIES)) {
throw new IllegalStateException(
"You can either allowlist or blocklist country codes for p... | Sets the country codes available in the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setBlockedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include al... | setAllowedCountries | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
public PhoneBuilder setBlockedCountries(
@NonNull List<String> countries) {
if (getParams().containsKey(ExtraConstants.ALLOWLISTED_COUNTRIES)) {
throw new IllegalStateException(
"You can either allowlist or blocklist country codes for p... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | setBlockedCountries | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@Override
public IdpConfig build() {
validateInputs();
return super.build();
} | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | build | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void addCountriesToBundle(List<String> CountryIsos, String CountryIsoType) {
ArrayList<String> uppercaseCodes = new ArrayList<>();
for (String code : CountryIsos) {
uppercaseCodes.add(code.toUpperCase(Locale.getDefault()));
}
g... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | addCountriesToBundle | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void validateInputs() {
List<String> allowedCountries = getParams().getStringArrayList(
ExtraConstants.ALLOWLISTED_COUNTRIES);
List<String> blockedCountries = getParams().getStringArrayList(
ExtraConstants.BLOCKLISTED_COUNTRIES);
... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateInputs | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void validateInputs(List<String> countries, boolean allowed) {
validateCountryInput(countries);
validateDefaultCountryInput(countries, allowed);
} | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateInputs | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void validateCountryInput(List<String> codes) {
for (String code : codes) {
if (!PhoneNumberUtils.isValidIso(code) && !PhoneNumberUtils.isValid(code)) {
throw new IllegalArgumentException("Invalid input: You must provide a " +
... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateCountryInput | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void validateDefaultCountryInput(List<String> codes, boolean allowed) {
// A default iso/code can be set via #setDefaultCountryIso() or #setDefaultNumber()
if (getParams().containsKey(ExtraConstants.COUNTRY_ISO) ||
getParams().containsKey(ExtraConstants.PH... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateDefaultCountryInput | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private boolean validateDefaultCountryIso(List<String> codes, boolean allowed) {
String defaultIso = getDefaultIso();
return isValidDefaultIso(codes, defaultIso, allowed);
} | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateDefaultCountryIso | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private boolean validateDefaultPhoneIsos(List<String> codes, boolean allowed) {
List<String> phoneIsos = getPhoneIsosFromCode();
for (String iso : phoneIsos) {
if (isValidDefaultIso(codes, iso, allowed)) {
return true;
}
... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | validateDefaultPhoneIsos | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private boolean isValidDefaultIso(List<String> codes, String iso, boolean allowed) {
if (iso == null) return true;
boolean containsIso = containsCountryIso(codes, iso);
return containsIso && allowed || !containsIso && !allowed;
} | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | isValidDefaultIso | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private boolean containsCountryIso(List<String> codes, String iso) {
iso = iso.toUpperCase(Locale.getDefault());
for (String code : codes) {
if (PhoneNumberUtils.isValidIso(code)) {
if (code.equals(iso)) {
return tru... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | containsCountryIso | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private List<String> getPhoneIsosFromCode() {
List<String> isos = new ArrayList<>();
String phone = getParams().getString(ExtraConstants.PHONE);
if (phone != null && phone.startsWith("+")) {
String countryCode = "+" + PhoneNumberUtils.getPhoneNumber(ph... | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | getPhoneIsosFromCode | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private String getDefaultIso() {
return getParams().containsKey(ExtraConstants.COUNTRY_ISO) ?
getParams().getString(ExtraConstants.COUNTRY_ISO) : null;
} | Sets the countries to be removed from the country code selector for phone
authentication. Takes as input a List of both country isos and codes.
This is not to be called with
{@link #setAllowedCountries(List)}.
If both are called, an exception will be thrown.
<p>
Inputting an e-164 country code (e.g. '+1') will include ... | getDefaultIso | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
private void validateWebClientId() {
Preconditions.checkConfigured(getApplicationContext(),
"Check your google-services plugin configuration, the" +
" default_web_client_id string wasn't populated.",
R.string.default_web_cli... | {@link IdpConfig} builder for the Google provider. | validateWebClientId | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
@NonNull
public GoogleBuilder setScopes(@NonNull List<String> scopes) {
GoogleSignInOptions.Builder builder =
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail();
for (String scope : scop... | Set the scopes that your app will request when using Google sign-in. See all <a
href="https://developers.google.com/identity/protocols/googlescopes">available
scopes</a>.
@param scopes additional scopes to be requested | setScopes | java | firebase/FirebaseUI-Android | auth/src/main/java/com/firebase/ui/auth/AuthUI.java | https://github.com/firebase/FirebaseUI-Android/blob/master/auth/src/main/java/com/firebase/ui/auth/AuthUI.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.