Example usage for android.graphics Paint UNDERLINE_TEXT_FLAG

List of usage examples for android.graphics Paint UNDERLINE_TEXT_FLAG

Introduction

In this page you can find the example usage for android.graphics Paint UNDERLINE_TEXT_FLAG.

Prototype

int UNDERLINE_TEXT_FLAG

To view the source code for android.graphics Paint UNDERLINE_TEXT_FLAG.

Click Source Link

Document

Paint flag that applies an underline decoration to drawn text.

Usage

From source file:eu.inmite.apps.smsjizdenka.framework.about.OpenSourceAdapter.java

private void openPlayServices(TextView textView) {
    textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    textView.setOnClickListener(new View.OnClickListener() {

        @Override//from www . j a va 2  s  .c om
        public void onClick(View v) {
            PlayServicesLicenceDialogFragment.show(mFragmentManager);
        }
    });
}

From source file:com.squalala.talkiewalkie.ui.activities.ListRoomsActivity.java

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list_rooms);
    ButterKnife.bind(this);

    viewLoading.setVisibility(View.VISIBLE);
    txtCurrentRooms.setVisibility(View.GONE);
    recyclerView.setVisibility(View.GONE);

    txtCurrentRooms.setPaintFlags(txtCurrentRooms.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

    rooms = new ArrayList<>();
    roomAdapter = new RoomAdapter(rooms, new OnClickRoomListener() {
        @Override/*from  w ww  . j  av  a 2  s  .c  o m*/
        public void onClickRoom(Room room) {
            Answers.getInstance()
                    .logCustom(new CustomEvent("Join Room").putCustomAttribute("room", room.getRoomName()));
            Intent intent = new Intent(ListRoomsActivity.this, JoinActivity.class);
            intent.putExtra(JoinActivity.KEY_ROOM, room.getRoomName());
            startActivity(intent);
        }
    });

    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(roomAdapter);
}

From source file:ru.cityvoicer.golosun.RegistrationFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_registration, container, false);
    mGenderSpinner = (Spinner) view.findViewById(R.id.gender_spinner);
    mAgeTextView = (EditText) view.findViewById(R.id.age_edittext);
    mRegisterButton = view.findViewById(R.id.register_button);
    mLicenseText = (TextView) view.findViewById(R.id.license_text);
    mLicenseCheckBox = (CheckBox) view.findViewById(R.id.license_check_box);
    mRegisterButtonText = (TextView) view.findViewById(R.id.register_button_text);
    mLicenseWebView = (WebView) view.findViewById(R.id.web_view);
    mLicenseCloseButton = view.findViewById(R.id.close_license_button);
    mLicenseFrame = view.findViewById(R.id.license_frame);

    mLicenseFrame.setVisibility(View.INVISIBLE);
    mLicenseCloseButton.setOnClickListener(new View.OnClickListener() {
        @Override// w  w  w  . j a  va 2  s .  c om
        public void onClick(View v) {
            mLicenseFrame.setVisibility(View.INVISIBLE);
        }
    });

    mLicenseWebView.loadUrl("file:///android_asset/license.html");

    mRegisterButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            String sex = mGenderSpinner.getSelectedItemPosition() == 0 ? ESex.MALE.get() : ESex.FEMALE.get();
            Profile.getInstance().updateAgeAndSex(Integer.parseInt(mAgeTextView.getText().toString()), sex);
        }
    });

    mLicenseText.setPaintFlags(mLicenseText.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    mLicenseText.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //getActivity().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.LicenseUrl)));
            mLicenseFrame.setVisibility(View.VISIBLE);
        }
    });

    mAgeTextView.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) {
            updateStatus();
        }
    });
    mLicenseCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            updateStatus();
        }
    });

    return view;
}

From source file:com.anysoftkeyboard.ui.tutorials.ChangeLogFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    LayoutInflater inflater = LayoutInflater.from(getActivity());

    ViewGroup logContainer = (ViewGroup) view.findViewById(getLogItemsContainerId());

    for (VersionChangeLogs.VersionChangeLog change : VersionChangeLogs.createChangeLog()) {
        View logHeader = inflater.inflate(R.layout.changelogentry_header, logContainer, false);
        TextView versionName = (TextView) logHeader.findViewById(R.id.changelog_version_title);
        versionName.setPaintFlags(versionName.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
        setTitleText(versionName, change.versionName);

        logContainer.addView(logHeader);
        for (String changeEntry : change.changes) {
            TextView entryView = (TextView) inflater.inflate(R.layout.changelogentry_item, logContainer, false);
            entryView.setText(getString(R.string.change_log_bullet_point, changeEntry));
            logContainer.addView(entryView);
        }/* www  . ja v  a2s  . com*/
        //TODO: add milestone url
        if (mLogToShow == SHOW_LATEST_CHANGELOG)
            break;//in this case, one is enough.
        //adding a divider between version
        logContainer.addView(inflater.inflate(R.layout.transparent_divider, logContainer, false));
    }
}

From source file:com.firesoft.member.Activity.B1_SignupVerifyActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.b1_signup_verify);

    mMobile = (EditText) findViewById(R.id.et_mobile);
    mVerifyCode = (EditText) findViewById(R.id.et_verify_code);
    mNext = (Button) findViewById(R.id.btn_next);
    mLogin = (TextView) findViewById(R.id.tv_login);
    mLogin.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//
    mGetVerifyCodeAgain = (Button) findViewById(R.id.btn_get_verify_code_again);

    mNext.setOnClickListener(this);
    mLogin.setOnClickListener(this);
    mGetVerifyCodeAgain.setOnClickListener(this);
    mUserModel = new UserModel(this);
    mUserModel.addResponseListener(this);
    EventBus.getDefault().register(this);
}

From source file:com.firesoft.member.Activity.B0_SigninActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.b0_signin);/*from  w  w  w  . j  a  v a2  s  .c  om*/
    mMobile = (EditText) findViewById(R.id.et_mobile);
    mPassword = (EditText) findViewById(R.id.et_password);
    mSignup = (TextView) findViewById(R.id.tv_signup);
    mSignup.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//
    mMobile = (EditText) findViewById(R.id.et_mobile);
    mLogin = (Button) findViewById(R.id.btn_login);

    mSignup.setOnClickListener(this);
    mLogin.setOnClickListener(this);
    EventBus.getDefault().register(this);

}

From source file:io.upnext.beaconcontrol.app.LoginActivity.java

private void wireViews() {
    emailEditText = (EditText) findViewById(R.id.email);
    passwordEditText = (EditText) findViewById(R.id.password);
    passwordEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override//  ww w  .j  a  v a2  s.  c o  m
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                logIn();
            }
            return false;
        }
    });
    progressBar = (ProgressBar) findViewById(R.id.progress_bar);

    Button loginButton = (Button) findViewById(R.id.login_btn);
    loginButton.setOnClickListener(loginButtonListener);

    TextView createAccountLink = (TextView) findViewById(R.id.create_account);
    createAccountLink.setPaintFlags(createAccountLink.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    createAccountLink.setOnClickListener(createAccountListener);
}

From source file:com.tatteam.patente.ui.fragment.ChooseTargetFragment.java

private void findViews(View contentView) {
    viewPager = (ViewPager) contentView.findViewById(R.id.viewPager);
    textViewTarget = (TextView) contentView.findViewById(R.id.textView_target);
    layoutIndicator = (LinearLayout) contentView.findViewById(R.id.layout_indicator);
    textViewRateUs = (TextView) contentView.findViewById(R.id.textView_rateUs);
    textViewFeedback = (TextView) contentView.findViewById(R.id.textView_Feedback);
    textViewRemoveAds = (TextView) contentView.findViewById(R.id.textView_removeAds);
    buttonShareFB = (ImageButton) contentView.findViewById(R.id.button_shareFB);
    buttonShareTT = (ImageButton) contentView.findViewById(R.id.button_shareTT);
    layoutRemoveAds = contentView.findViewById(R.id.layout_removeAds);
    layoutFeedBack = contentView.findViewById(R.id.layout_Feedback);
    layoutMoreApp = contentView.findViewById(R.id.layout_MoreApp);

    buttonShareFB.setOnClickListener(this);
    buttonShareTT.setOnClickListener(this);
    //        textViewRateUs.setOnClickListener(this);
    //        textViewFeedback.setOnClickListener(this);
    layoutRemoveAds.setOnClickListener(this);
    layoutFeedBack.setOnClickListener(this);
    layoutMoreApp.setOnClickListener(this);

    //set underline text
    textViewRateUs.setPaintFlags(textViewRateUs.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    textViewFeedback.setPaintFlags(textViewFeedback.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    textViewRemoveAds.setPaintFlags(textViewFeedback.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

    if (LocalSharedPreferManager.getInstance().isPurchased()) {
        layoutRemoveAds.setVisibility(View.GONE);
    } else {//from ww w. j a  v  a 2  s.  c om
        layoutRemoveAds.setVisibility(View.VISIBLE);
    }
}

From source file:com.tiancaicc.springfloatingactionmenu.MenuItemView.java

private void init(Context context, boolean hasMargin) {

    Resources resources = getResources();
    int diameterPX = Utils.dpToPx(mMenuItem.getDiameter(), resources);
    this.mDiameter = diameterPX;
    mBtn = new ImageButton(context);
    mBtn.setScaleType(ImageView.ScaleType.FIT_CENTER);
    if (hasMargin) {
        int p = Util.dpToPx(12, getResources());
        mBtn.setPadding(p, p, p, p);//  ww  w  .  j a va 2s.  c om
    }
    LayoutParams btnLp = new LayoutParams(diameterPX, diameterPX);
    btnLp.gravity = Gravity.CENTER_HORIZONTAL;
    btnLp.bottomMargin = Util.dpToPx(mGapSize, resources);
    mBtn.setLayoutParams(btnLp);
    OvalShape ovalShape = new OvalShape();
    ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
    shapeDrawable.getPaint().setColor(resources.getColor(mMenuItem.getBgColor()));
    mBtn.setBackgroundDrawable(shapeDrawable);
    if (TextUtils.isEmpty(mMenuItem.getIconFilePath())) {
        mBtn.setImageResource(mMenuItem.getIcon());
    } else {
        mBtn.setImageURI(Uri.fromFile(new File(mMenuItem.getIconFilePath())));
    }
    mBtn.setClickable(false);
    addView(mBtn);

    mLabel = (com.github.omadahealth.typefaceview.TypefaceTextView) View.inflate(getContext(),
            R.layout.c_text_view, null);
    mLabel.setPaintFlags(mLabel.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    mLabel.setTextIsSelectable(false);
    LayoutParams labelLp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    labelLp.gravity = Gravity.CENTER_HORIZONTAL;
    mLabel.setLayoutParams(labelLp);
    if (!TextUtils.isEmpty(mMenuItem.getLabel())) {
        mLabel.setPadding(0, Util.dpToPx(70, getResources()), 0, 0);
        Drawable bottomArrow = ContextCompat.getDrawable(getContext(), R.drawable.ic_arrow);
        mLabel.setCompoundDrawablesWithIntrinsicBounds(null, null, null, bottomArrow);
    }
    mLabel.setText(mMenuItem.getLabel());
    mLabel.setTextColor(resources.getColor(mMenuItem.getTextColor()));
    //        mLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTextSize);
    addView(mLabel);

    setOrientation(LinearLayout.VERTICAL);
    if (mAlphaAnimation) {
        setAlpha(0);
    }

    getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            getViewTreeObserver().removeGlobalOnLayoutListener(this);
            applyPressAnimation();
            ViewGroup parent = (ViewGroup) getParent();
            parent.setClipChildren(false);
            parent.setClipToPadding(false);
            setClipChildren(false);
            setClipToPadding(false);
        }
    });

}

From source file:online.privacy.SetupActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setup);

    connectivityWarning = findViewById(R.id.warning_connectivity);
    connectivityWarningHeight = (int) getResources().getDimension(R.dimen.warning_connectivity_height);

    SharedPreferences preferences = getSharedPreferences(getString(R.string.privacyonline_preferences),
            MODE_PRIVATE);//from w w  w.  j av a 2 s .co  m
    defaultVPNLocationUpdate = defaultVPNLocationStart = preferences.getString("default_vpn_location", "");

    final EditText usernameInput = (EditText) findViewById(R.id.input_text_username);
    final EditText passwordInput = (EditText) findViewById(R.id.input_password_password);

    usernameInput.setText(preferences.getString("username", ""));
    usernameInput.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
                usernameInput.clearFocus();
                passwordInput.requestFocus();
                return true;
            }
            return false;
        }
    });

    passwordInput.setText(preferences.getString("password", ""));

    // Ugh, apparently we can't define text on buttons to have the underlined property from
    // within the XML, so we'll do it here we have to set the intent chooser here anyway.
    Button buttonSignUp = (Button) findViewById(R.id.button_cta_signup);
    buttonSignUp.setPaintFlags(buttonSignUp.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    buttonSignUp.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent ctaIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse(getString(R.string.privacy_online_signup)));
            startActivity(ctaIntent);
        }
    });

    final Button buttonSave = (Button) findViewById(R.id.button_save);
    buttonSave.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            EditText inputTextUsername = (EditText) findViewById(R.id.input_text_username);
            EditText inputTextPassword = (EditText) findViewById(R.id.input_password_password);
            clearErrorState(inputTextUsername);
            clearErrorState(inputTextPassword);
            setErrorInfoVisibility(View.INVISIBLE);

            setWorkingState(true);

            Intent apiIntent = new Intent(contextSetup, PrivacyOnlineAPIService.class);
            apiIntent.putExtra(PrivacyOnlineAPIService.PARAM_USERNAME, inputTextUsername.getText().toString());
            apiIntent.putExtra(PrivacyOnlineAPIService.PARAM_PASSWORD, inputTextPassword.getText().toString());
            apiIntent.setAction(PrivacyOnlineAPIService.ACTION_VERIFY_USERNAME);
            startService(apiIntent);
        }
    });

}