use of androidx.appcompat.app.AppCompatActivity in project Signal-Android by WhisperSystems.
the class KbsSplashFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
title = view.findViewById(R.id.kbs_splash_title);
description = view.findViewById(R.id.kbs_splash_description);
primaryAction = view.findViewById(R.id.kbs_splash_primary_action);
secondaryAction = view.findViewById(R.id.kbs_splash_secondary_action);
primaryAction.setOnClickListener(v -> onCreatePin());
secondaryAction.setOnClickListener(v -> onLearnMore());
if (RegistrationLockUtil.userHasRegistrationLock(requireContext())) {
setUpRegLockEnabled();
} else {
setUpRegLockDisabled();
}
description.setMovementMethod(LinkMovementMethod.getInstance());
Toolbar toolbar = view.findViewById(R.id.kbs_splash_toolbar);
((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);
((AppCompatActivity) requireActivity()).getSupportActionBar().setTitle(null);
requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
}
});
}
use of androidx.appcompat.app.AppCompatActivity in project Conversations by siacs.
the class MemorizingTrustManager method init.
void init(final Context m) {
master = m;
masterHandler = new Handler(m.getMainLooper());
notificationManager = (NotificationManager) master.getSystemService(Context.NOTIFICATION_SERVICE);
Application app;
if (m instanceof Application) {
app = (Application) m;
} else if (m instanceof Service) {
app = ((Service) m).getApplication();
} else if (m instanceof AppCompatActivity) {
app = ((AppCompatActivity) m).getApplication();
} else
throw new ClassCastException("MemorizingTrustManager context must be either Activity or Service!");
File dir = app.getDir(KEYSTORE_DIR, Context.MODE_PRIVATE);
keyStoreFile = new File(dir + File.separator + KEYSTORE_FILE);
poshCacheDir = app.getCacheDir().getAbsolutePath() + "/posh_cache/";
appKeyStore = loadAppKeyStore();
}
use of androidx.appcompat.app.AppCompatActivity in project Douya by DreaminginCodeZH.
the class SettingsActivityFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ScalpelHelperFragment.attachToActivity(this);
AppCompatActivity activity = (AppCompatActivity) requireActivity();
activity.setSupportActionBar(mToolbar);
}
use of androidx.appcompat.app.AppCompatActivity in project Douya by DreaminginCodeZH.
the class SendBroadcastFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
CustomTabsHelperFragment.attachTo(this);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(mToolbar);
if (savedInstanceState == null) {
mTextEdit.setText(mExtraText);
}
mTextEdit.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
mChanged = true;
}
});
mAttachmentLayout.setOnRemoveImageListener(this::removeImage);
bindAttachmentLayout();
TooltipUtils.setup(mAddImageButton);
mAddImageButton.setOnClickListener(view -> pickOrCaptureImage());
TooltipUtils.setup(mAddMoreImageButton);
mAddMoreImageButton.setOnClickListener(view -> pickOrCaptureImage());
TooltipUtils.setup(mRemoveAllImagesButton);
mRemoveAllImagesButton.setOnClickListener(view -> onRemoveAllImages());
TooltipUtils.setup(mAddLinkButton);
mAddLinkButton.setOnClickListener(view -> editLink());
TooltipUtils.setup(mEditLinkButton);
mEditLinkButton.setOnClickListener(view -> editLink());
TooltipUtils.setup(mRemoveLinkButton);
mRemoveLinkButton.setOnClickListener(view -> onRemoveLink());
updateBottomBar();
TooltipUtils.setup(mAddMentionButton);
mAddMentionButton.setOnClickListener(view -> addMention());
TooltipUtils.setup(mAddTopicButton);
mAddTopicButton.setOnClickListener(view -> addTopic());
mCounterText.setEditText(mTextEdit, Broadcast.MAX_TEXT_LENGTH);
updateSendStatus();
}
use of androidx.appcompat.app.AppCompatActivity in project Douya by DreaminginCodeZH.
the class BroadcastListActivityFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setTitle(getTitle());
activity.setSupportActionBar(mToolbar);
TransitionUtils.setupTransitionOnActivityCreated(this);
if (savedInstanceState == null) {
FragmentUtils.add(BroadcastListFragment.newInstance(mUserIdOrUid, mTopic), this, R.id.broadcast_list_fragment);
}
}
Aggregations