use of androidx.annotation.IdRes in project FirebaseUI-Android by firebase.
the class AuthMethodPickerActivity method populateIdpListCustomLayout.
private void populateIdpListCustomLayout(List<IdpConfig> providerConfigs) {
Map<String, Integer> providerButtonIds = customLayout.getProvidersButton();
for (IdpConfig idpConfig : providerConfigs) {
final String providerId = providerOrEmailLinkProvider(idpConfig.getProviderId());
Integer buttonResId = providerButtonIds.get(providerId);
if (buttonResId == null) {
throw new IllegalStateException("No button found for auth provider: " + idpConfig.getProviderId());
}
@IdRes int buttonId = buttonResId;
View loginButton = findViewById(buttonId);
handleSignInOperation(idpConfig, loginButton);
}
// hide custom layout buttons that don't have their identity provider set
for (String providerBtnId : providerButtonIds.keySet()) {
if (providerBtnId == null) {
continue;
}
boolean hasProvider = false;
for (IdpConfig idpConfig : providerConfigs) {
String providerId = providerOrEmailLinkProvider(idpConfig.getProviderId());
if (providerBtnId.equals(providerId)) {
hasProvider = true;
break;
}
}
if (!hasProvider) {
Integer resId = providerButtonIds.get(providerBtnId);
if (resId == null) {
continue;
}
@IdRes int buttonId = resId;
findViewById(buttonId).setVisibility(View.GONE);
}
}
}
use of androidx.annotation.IdRes in project Conversations by siacs.
the class ConversationsActivity method onBackendConnected.
@Override
void onBackendConnected() {
if (performRedirectIfNecessary(true)) {
return;
}
xmppConnectionService.getNotificationService().setIsInForeground(true);
Intent intent = pendingViewIntent.pop();
if (intent != null) {
if (processViewIntent(intent)) {
if (binding.secondaryFragment != null) {
notifyFragmentOfBackendConnected(R.id.main_fragment);
}
invalidateActionBarTitle();
return;
}
}
for (@IdRes int id : FRAGMENT_ID_NOTIFICATION_ORDER) {
notifyFragmentOfBackendConnected(id);
}
ActivityResult activityResult = postponedActivityResult.pop();
if (activityResult != null) {
handleActivityResult(activityResult);
}
invalidateActionBarTitle();
if (binding.secondaryFragment != null && ConversationFragment.getConversation(this) == null) {
Conversation conversation = ConversationsOverviewFragment.getSuggestion(this);
if (conversation != null) {
openConversation(conversation, null);
}
}
showDialogsIfMainIsOverview();
}
use of androidx.annotation.IdRes in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryTip method updatePreference.
public void updatePreference(Preference preference) {
final Context context = preference.getContext();
preference.setTitle(getTitle(context));
preference.setSummary(getSummary(context));
preference.setIcon(getIconId());
@IdRes int iconTintColorId = getIconTintColorId();
if (iconTintColorId != View.NO_ID) {
preference.getIcon().setTint(context.getColor(iconTintColorId));
}
}
Aggregations