use of com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled in project instructure-android by instructure.
the class HelpActivity method setupListeners.
private void setupListeners() {
mSearchGuides.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Search guides
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(Const.CANVAS_USER_GUIDES));
startActivity(intent);
}
});
mReportProblem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ZendeskDialogStyled dialog = new ZendeskDialogStyled();
// set the cached user so the dialog can use the cached user's email address
User user = new User();
user.setPrimaryEmail(mEmailAddress);
ApiPrefs.setUser(user);
dialog.setArguments(ZendeskDialogStyled.createBundle(false, true));
dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
}
});
mRequestFeature.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// let the user open their favorite mail client
Intent intent = populateMailIntent(getString(R.string.featureSubject), getString(R.string.understandRequest), false);
startActivity(Intent.createChooser(intent, getString(R.string.sendMail)));
}
});
mShowLove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Utils.goToAppStore(AppType.PARENT, HelpActivity.this);
}
});
mOpenSource.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HelpActivity.this, OssLicensesMenuActivity.class));
}
});
}
use of com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled in project instructure-android by instructure.
the class HomeActivity method initNavigationDrawer.
public void initNavigationDrawer() {
// User Data
avatar = (CircleImageView) findViewById(R.id.profile_image);
userName = (HelveticaTextView) findViewById(R.id.userName);
aboutButton = (RelativeLayout) findViewById(R.id.aboutButton);
helpButton = (RelativeLayout) findViewById(R.id.helpButton);
reportProblemButton = (RelativeLayout) findViewById(R.id.reportProblemButton);
navigationHeader = (LinearLayout) findViewById(R.id.navigationHeader);
UserAPI.getSelf(userCallback);
intAboutPage();
initSettingsListeners();
initLogoutButton();
initMasquerading();
// Help Button
helpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(InternalWebviewActivity.createIntent(getContext(), com.instructure.pandautils.utils.Const.CANVAS_USER_GUIDES, false));
overridePendingTransition(R.anim.slide_down, 0);
}
});
reportProblemButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ZendeskDialogStyled dialog = new ZendeskDialogStyled();
dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
}
});
}
use of com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled in project instructure-android by instructure.
the class BaseLoginFindSchoolActivity method bindViews.
private void bindViews() {
mToolbar = findViewById(R.id.toolbar);
mDomainInput = findViewById(R.id.domainInput);
mWhatsYourSchoolName = findViewById(R.id.whatsYourSchoolName);
mLoginFlowLogout = findViewById(R.id.loginFlowLogout);
mToolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.drawable.ic_action_arrow_back));
mToolbar.setNavigationContentDescription(R.string.close);
mToolbar.inflateMenu(R.menu.menu_next);
mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.next) {
validateDomain(new AccountDomain(mDomainInput.getText().toString()));
return true;
}
return false;
}
});
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
AccessibilityManager a11yManager = ((AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE));
if (a11yManager != null && (a11yManager.isEnabled() || a11yManager.isTouchExplorationEnabled())) {
mToolbar.setFocusable(true);
mToolbar.setFocusableInTouchMode(true);
mToolbar.postDelayed(new Runnable() {
@Override
public void run() {
mToolbar.requestFocus();
mToolbar.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
}
}, 500);
}
mNextActionButton = findViewById(R.id.next);
mNextActionButton.setEnabled(false);
mNextActionButton.setTextColor(ContextCompat.getColor(BaseLoginFindSchoolActivity.this, R.color.login_grayCanvasLogo));
mDomainInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
validateDomain(new AccountDomain(mDomainInput.getText().toString()));
return true;
}
});
mDomainInput.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) {
if (mDomainAdapter != null) {
mDomainAdapter.getFilter().filter(s);
fetchAccountDomains();
}
if (mNextActionButton != null) {
if (TextUtils.isEmpty(s.toString())) {
mNextActionButton.setEnabled(false);
mNextActionButton.setTextColor(ContextCompat.getColor(BaseLoginFindSchoolActivity.this, R.color.login_grayCanvasLogo));
} else {
mNextActionButton.setEnabled(true);
mNextActionButton.setTextColor(ContextCompat.getColor(BaseLoginFindSchoolActivity.this, R.color.login_loginFlowBlue));
}
}
}
});
mDomainAdapter = new DomainAdapter(new DomainAdapter.DomainEvents() {
@Override
public void onDomainClick(AccountDomain account) {
mDomainInput.setText(account.getDomain());
mDomainInput.setSelection(mDomainInput.getText().length());
validateDomain(account);
}
@Override
public void onHelpClick() {
ZendeskDialogStyled dialog = new ZendeskDialogStyled();
dialog.setArguments(ZendeskDialogStyled.createBundle(true, true));
dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
}
});
RecyclerView recyclerView = findViewById(R.id.findSchoolRecyclerView);
recyclerView.addItemDecoration(new DividerItemDecoration(this, RecyclerView.VERTICAL));
recyclerView.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
recyclerView.setAdapter(mDomainAdapter);
}
Aggregations