use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.
the class BookmarksActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bokmarks);
final Intent intent = getIntent();
AccountJid account = getAccount(intent);
if (account == null) {
finish();
return;
}
accountItem = AccountManager.getInstance().getAccount(account);
if (accountItem == null) {
Application.getInstance().onError(R.string.NO_SUCH_ACCOUNT);
finish();
return;
}
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbar.setTitle(R.string.account_bookmarks);
toolbar.inflateMenu(R.menu.toolbar_bookmark_list);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
barPainter.updateWithAccountName(account);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.server_info_recycler_view);
bookmarksAdapter = new BookmarkAdapter(this);
bookmarksAdapter.setListener(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(bookmarksAdapter);
progressBar = findViewById(R.id.server_info_progress_bar);
tvNotSupport = (TextView) findViewById(R.id.tvNotSupport);
requestBookmarks(false);
}
use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.
the class XAccountLinksFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
tvStatusGoogle = view.findViewById(R.id.tvStatusGoogle);
ivGoogle = view.findViewById(R.id.ivGoogle);
tvNameGoogle = view.findViewById(R.id.tvNameGoogle);
tvActionGoogle = view.findViewById(R.id.tvActionGoogle);
itemGoogle = view.findViewById(R.id.itemGoogle);
itemGoogle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tvActionGoogle.getText().equals(getString(R.string.action_connect)))
bindListener.onBindClick(AuthManager.PROVIDER_GOOGLE);
else
onSocialUnlinkClick(AuthManager.PROVIDER_GOOGLE);
}
});
tvStatusFacebook = view.findViewById(R.id.tvStatusFacebook);
ivFacebook = view.findViewById(R.id.ivFacebook);
tvNameFacebook = view.findViewById(R.id.tvNameFacebook);
tvActionFacebook = view.findViewById(R.id.tvActionFacebook);
itemFacebook = view.findViewById(R.id.itemFacebook);
itemFacebook.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tvActionFacebook.getText().equals(getString(R.string.action_connect)))
bindListener.onBindClick(AuthManager.PROVIDER_FACEBOOK);
else
onSocialUnlinkClick(AuthManager.PROVIDER_FACEBOOK);
}
});
tvStatusTwitter = view.findViewById(R.id.tvStatusTwitter);
ivTwitter = view.findViewById(R.id.ivTwitter);
tvNameTwitter = view.findViewById(R.id.tvNameTwitter);
tvActionTwitter = view.findViewById(R.id.tvActionTwitter);
itemTwitter = view.findViewById(R.id.itemTwitter);
itemTwitter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tvActionTwitter.getText().equals(getString(R.string.action_connect)))
bindListener.onBindClick(AuthManager.PROVIDER_TWITTER);
else
onSocialUnlinkClick(AuthManager.PROVIDER_TWITTER);
}
});
rvEmails = view.findViewById(R.id.rvEmails);
rvEmails.setLayoutManager(new LinearLayoutManager(getActivity()));
emailAdapter = new EmailAdapter(this);
rvEmails.setAdapter(emailAdapter);
viewAddEmail = view.findViewById(R.id.viewAddEmail);
viewAddEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AddEmailDialogFragment.newInstance().show(getFragmentManager(), AddEmailDialogFragment.class.getSimpleName());
}
});
}
use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.
the class AccountSyncFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
tvLastSyncDate = (TextView) view.findViewById(R.id.tvLastSyncDate);
switchSyncAll = (Switch) view.findViewById(R.id.switchSyncAll);
switchSyncAll.setChecked(SettingsManager.isSyncAllAccounts());
switchSyncAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (adapter != null)
adapter.setAllChecked(b);
saveSyncSettings();
}
});
if (AccountManager.getInstance().haveNotAllowedSyncAccounts())
switchSyncAll.setEnabled(false);
setXmppAccounts(XabberAccountManager.getInstance().getXmppAccountsForSync());
adapter = new XMPPAccountAdapter(getActivity(), this);
adapter.setItems(xmppAccounts);
if (adapter != null && SettingsManager.isSyncAllAccounts())
adapter.setAllChecked(true);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
}
use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.
the class BaseSettingsFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
BaseSettingsAdapter adapter = new BaseSettingsAdapter();
recycler.setLayoutManager(new LinearLayoutManager(requireContext()));
recycler.setAdapter(adapter);
Configuration configuration = (Configuration) Objects.requireNonNull(requireArguments().getSerializable(CONFIGURATION_ARGUMENT));
configuration.configure(requireActivity(), adapter);
configuration.setArguments(getArguments());
configuration.configureAdapter(adapter);
adapter.submitList(configuration.getSettings());
}
use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.
the class OnboardingMegaphoneView method present.
public void present(@NonNull Megaphone megaphone, @NonNull MegaphoneActionController listener) {
this.cardList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
this.cardList.setAdapter(new CardAdapter(getContext(), listener));
}
Aggregations