Search in sources :

Example 1 with ZendeskDialogStyled

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));
        }
    });
}
Also used : ZendeskDialogStyled(com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled) User(com.instructure.canvasapi2.models.User) Intent(android.content.Intent) View(android.view.View)

Example 2 with ZendeskDialogStyled

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);
        }
    });
}
Also used : ZendeskDialogStyled(com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled) HelveticaTextView(com.instructure.speedgrader.views.HelveticaTextView) ImageView(android.widget.ImageView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView)

Example 3 with ZendeskDialogStyled

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);
}
Also used : ZendeskDialogStyled(com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled) AccountDomain(com.instructure.canvasapi2.models.AccountDomain) MenuItem(android.view.MenuItem) DomainAdapter(com.instructure.loginapi.login.adapter.DomainAdapter) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) KeyEvent(android.view.KeyEvent) AccessibilityManager(android.view.accessibility.AccessibilityManager) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

View (android.view.View)3 ZendeskDialogStyled (com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled)3 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 Intent (android.content.Intent)1 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 KeyEvent (android.view.KeyEvent)1 MenuItem (android.view.MenuItem)1 AccessibilityManager (android.view.accessibility.AccessibilityManager)1 ScrollView (android.widget.ScrollView)1 AccountDomain (com.instructure.canvasapi2.models.AccountDomain)1 User (com.instructure.canvasapi2.models.User)1 DomainAdapter (com.instructure.loginapi.login.adapter.DomainAdapter)1 HelveticaTextView (com.instructure.speedgrader.views.HelveticaTextView)1 CircleImageView (de.hdodenhof.circleimageview.CircleImageView)1