Search in sources :

Example 26 with AppCompatTextView

use of android.support.v7.widget.AppCompatTextView in project AndroidDevelop by 7449.

the class ShowAppAdapter method onBind.

@Override
protected void onBind(ViewHolder holder, int position, AppModel appModel) {
    if (appModel.getAppIcon() != null && appModel.getAppLabel() != null) {
        AppCompatTextView textView = holder.getAppCompatTextView(R.id.show_tv_app_name);
        textView.setText(appModel.getAppLabel());
        TextDrawableUtils.setAppDrawable(textView, appModel.getAppIcon());
    }
}
Also used : AppCompatTextView(android.support.v7.widget.AppCompatTextView)

Example 27 with AppCompatTextView

use of android.support.v7.widget.AppCompatTextView in project AndroidDevelop by 7449.

the class EasyCityView method initView.

private void initView() {
    //初始化数据,必须先执行这一步
    JsonDataUtils.get().init(getContext());
    rootView = getActivity().getLayoutInflater().inflate(R.layout.city_easy_view, null);
    AppCompatTextView tvTitle = (AppCompatTextView) rootView.findViewById(R.id.easy_title);
    provinceView = (NumberPickerView) rootView.findViewById(R.id.easy_province);
    cityView = (NumberPickerView) rootView.findViewById(R.id.easy_city);
    areaView = (NumberPickerView) rootView.findViewById(R.id.easy_area);
    rootView.findViewById(R.id.easy_cancel).setOnClickListener(this);
    rootView.findViewById(R.id.easy_next).setOnClickListener(this);
    tvTitle.setText(title);
    initViewData();
}
Also used : AppCompatTextView(android.support.v7.widget.AppCompatTextView)

Example 28 with AppCompatTextView

use of android.support.v7.widget.AppCompatTextView in project AndroidDevelop by 7449.

the class EasyPickerView method initView.

private void initView() {
    rootView = getActivity().getLayoutInflater().inflate(R.layout.picker_easy_view, null);
    AppCompatTextView tvTitle = (AppCompatTextView) rootView.findViewById(R.id.easy_title);
    pickerView = (NumberPickerView) rootView.findViewById(R.id.easy_picker);
    rootView.findViewById(R.id.easy_cancel).setOnClickListener(this);
    rootView.findViewById(R.id.easy_next).setOnClickListener(this);
    tvTitle.setText(title);
    initPickerView();
}
Also used : AppCompatTextView(android.support.v7.widget.AppCompatTextView)

Example 29 with AppCompatTextView

use of android.support.v7.widget.AppCompatTextView in project krypton-android by kryptco.

the class CreateInviteDialogFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_teams_invite_modal, container, false);
    String myEmail = getArguments().getString("myEmail");
    // TODO: filter on common email endings and hide team link in that case
    String[] emailToks = myEmail.split("@");
    AppCompatImageButton teamLinkButton = rootView.findViewById(R.id.teamLinkButton);
    if (emailToks.length == 2) {
        String domain = emailToks[1];
        AppCompatTextView teamLinkDetail = rootView.findViewById(R.id.teamEmailLinkDetail);
        teamLinkDetail.setText("Anyone with an @" + domain + " email address");
        teamLinkButton.setOnClickListener(v -> {
            AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
            builder.setTitle("Create a team-only invite link?").setMessage("This will create a secret invite link that can only be used by people with an @" + domain + " email address.").setPositiveButton("Yes", (dialog, which) -> {
                Sigchain.RequestableTeamOperation request = new Sigchain.RequestableTeamOperation(new Sigchain.IndirectInvitationRestriction(domain));
                EventBus.getDefault().post(new TeamService.RequestTeamOperation(request, TeamService.C.withStatusCallback(getActivity(), this::onCreateInvite)));
                getFragmentManager().beginTransaction().remove(this).commitAllowingStateLoss();
            }).setNegativeButton("No", (dialog, which) -> {
                getFragmentManager().beginTransaction().remove(this).commitAllowingStateLoss();
            }).show();
        });
    } else {
    // TODO: hide teamLinkButton if no domain on email or user has a common domain like gmail
    }
    AppCompatImageButton individualLinkButton = rootView.findViewById(R.id.individualsLinkButton);
    individualLinkButton.setOnClickListener(v -> {
        getFragmentManager().beginTransaction().setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right).replace(R.id.fragmentOverlay, SelectIndividualsFragment.newInstance()).addToBackStack(null).commitAllowingStateLoss();
    });
    AppCompatImageButton inpersonButton = rootView.findViewById(R.id.inPersonButton);
    inpersonButton.setOnClickListener(v -> {
        Transitions.beginFade(this).replace(R.id.fragmentOverlay, new AdminQR()).addToBackStack(null).commitAllowingStateLoss();
    });
    return rootView;
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) Context(android.content.Context) Bundle(android.os.Bundle) LayoutInflater(android.view.LayoutInflater) Fragment(android.support.v4.app.Fragment) AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) Transitions(co.krypt.krypton.uiutils.Transitions) TeamService(co.krypt.krypton.team.TeamService) AdminQR(co.krypt.krypton.team.invite.inperson.admin.AdminQR) AppCompatTextView(android.support.v7.widget.AppCompatTextView) ViewGroup(android.view.ViewGroup) Sigchain(co.krypt.krypton.team.Sigchain) AlertDialog(android.support.v7.app.AlertDialog) EventBus(org.greenrobot.eventbus.EventBus) View(android.view.View) R(co.krypt.krypton.R) Sigchain(co.krypt.krypton.team.Sigchain) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatImageButton(android.support.v7.widget.AppCompatImageButton) AppCompatTextView(android.support.v7.widget.AppCompatTextView) View(android.view.View) TeamService(co.krypt.krypton.team.TeamService) AdminQR(co.krypt.krypton.team.invite.inperson.admin.AdminQR)

Example 30 with AppCompatTextView

use of android.support.v7.widget.AppCompatTextView in project krypton-android by kryptco.

the class AdminVerify method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View v = inflater.inflate(R.layout.fragment_teams_invite_inperson_admin_confirm_email, container, false);
    Sigchain.MemberQRPayload qr = AdminScan.lastScannedPayload.get();
    if (qr != null) {
        AppCompatTextView email = v.findViewById(R.id.confirmEmailLabel);
        email.setText(qr.email);
        AppCompatButton confirmButton = v.findViewById(R.id.confirmMember);
        confirmButton.setOnClickListener(b -> {
            EventBus.getDefault().post(new TeamService.RequestTeamOperation(new Sigchain.RequestableTeamOperation(new Sigchain.DirectInvitation(qr.publicKey, qr.email)), C.withStatusCallback(getActivity(), this::onInviteCreated)));
        });
        AppCompatButton cancelButton = v.findViewById(R.id.cancelButton);
        cancelButton.setOnClickListener(b -> {
            getFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        });
    } else {
        Error.shortToast(getContext(), "Please scan the new member's QR code again.");
        getFragmentManager().popBackStack();
    }
    return v;
}
Also used : Sigchain(co.krypt.krypton.team.Sigchain) TeamService(co.krypt.krypton.team.TeamService) AppCompatTextView(android.support.v7.widget.AppCompatTextView) AppCompatTextView(android.support.v7.widget.AppCompatTextView) View(android.view.View) AppCompatButton(android.support.v7.widget.AppCompatButton) Nullable(android.support.annotation.Nullable)

Aggregations

AppCompatTextView (android.support.v7.widget.AppCompatTextView)45 View (android.view.View)26 AppCompatButton (android.support.v7.widget.AppCompatButton)9 AppCompatImageView (android.support.v7.widget.AppCompatImageView)7 ProgressBar (android.widget.ProgressBar)7 Sigchain (co.krypt.krypton.team.Sigchain)7 AlertDialog (android.support.v7.app.AlertDialog)6 Button (android.widget.Button)6 DialogInterface (android.content.DialogInterface)4 ConstraintLayout (android.support.constraint.ConstraintLayout)4 ViewGroup (android.view.ViewGroup)4 TextView (android.widget.TextView)4 Context (android.content.Context)3 Handler (android.os.Handler)3 Nullable (android.support.annotation.Nullable)3 Espresso.onView (android.support.test.espresso.Espresso.onView)3 MediumTest (android.support.test.filters.MediumTest)3 AppCompatEditText (android.support.v7.widget.AppCompatEditText)3 SuppressLint (android.annotation.SuppressLint)2 Intent (android.content.Intent)2