<commit_before>package com.vondear.rxtools.view.tooltips;

import android.content.Context;
import android.support.annotation.IntDef;
import android.text.Spannable;
import android.view.View;
import android.view.ViewGroup;

import com.vondear.rxtools.R;

public class RxToolTip {

    @IntDef({POSITION_ABOVE, POSITION_BELOW, POSITION_LEFT_TO, POSITION_RIGHT_TO})
    public @interface Position {}
    public static final int POSITION_ABOVE = 0;
    public static final int POSITION_BELOW = 1;
    public static final int POSITION_LEFT_TO = 3;
    public static final int POSITION_RIGHT_TO = 4;

    @IntDef({ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT})
    public @interface Align {}
    public static final int ALIGN_CENTER = 0;
    public static final int ALIGN_LEFT = 1;
    public static final int ALIGN_RIGHT = 2;

    @IntDef({GRAVITY_CENTER, GRAVITY_LEFT, GRAVITY_RIGHT})
    public @interface Gravity {}
    public static final int GRAVITY_CENTER = 0;
    public static final int GRAVITY_LEFT = 1;
    public static final int GRAVITY_RIGHT = 2;

    private Context mContext;
    private View mAnchorView;
    private ViewGroup mRootViewGroup;
    private String mMessage;
    private @Position int mPosition;
    private @Align int mAlign;
    private int mOffsetX;
    private int mOffsetY;
    private boolean mArrow;
    private int mBackgroundColor;
    private int mTextColor;
    private float mElevation;
    private @Gravity int mTextGravity;
    private Spannable mSpannableMessage;
    private int mTextSize;

    public RxToolTip(Builder builder){
        mContext = builder.mContext;
        mAnchorView = builder.mAnchorView;
        mRootViewGroup = builder.mRootViewGroup;
        mMessage = builder.mMessage;
        mPosition = builder.mPosition;
        mAlign = builder.mAlign;
        mOffsetX = builder.mOffsetX;
        mOffsetX = builder.mOffsetX;
        mOffsetY = builder.mOffsetY;
        mArrow = builder.mArrow;
        mBackgroundColor = builder.mBackgroundColor;
        mTextColor = builder.mTextColor;
        mElevation = builder.mElevation;
        mTextGravity = builder.mTextGravity;
        mSpannableMessage = builder.mSpannableMessage;
        mTextSize = builder.mTextSize;
    }

    public Context getContext() {
        return mContext;
    }

    public View getAnchorView() {
        return mAnchorView;
    }

    public ViewGroup getRootView() {
        return mRootViewGroup;
    }

    public String getMessage() {
        return mMessage;
    }

    public int getPosition() {
        return mPosition;
    }

    public int getAlign() {
        return mAlign;
    }

    public int getOffsetX() {
        return mOffsetX;
    }

    public int getOffsetY() {
        return mOffsetY;
    }

    public boolean hideArrow() {
        return !mArrow;
    }

    public int getBackgroundColor() {
        return mBackgroundColor;
    }

    public int getTextColor() {
        return mTextColor;
    }

    public boolean positionedLeftTo(){
        return POSITION_LEFT_TO == mPosition;
    }

    public boolean positionedRightTo(){
        return POSITION_RIGHT_TO == mPosition;
    }

    public boolean positionedAbove(){
        return POSITION_ABOVE == mPosition;
    }

    public boolean positionedBelow(){
        return POSITION_BELOW == mPosition;
    }

    public boolean alignedCenter(){
        return ALIGN_CENTER == mAlign;
    }

    public boolean alignedLeft(){
        return ALIGN_LEFT == mAlign;
    }

    public boolean alignedRight(){
        return ALIGN_RIGHT == mAlign;
    }

    public void setPosition(@Position int position){
        mPosition = position;
    }

    public float getElevation() {
        return mElevation;
    }

    public int getTextSize() {
        return mTextSize;
    }

    public int getTextGravity(){
        int gravity;
        switch (mTextGravity){
            case GRAVITY_CENTER:
                gravity = android.view.Gravity.CENTER;
                break;
            case GRAVITY_LEFT:
                gravity = android.view.Gravity.START;
                break;
            case GRAVITY_RIGHT:
                gravity = android.view.Gravity.END;
                break;
            default:
                gravity = android.view.Gravity.CENTER;
        }
        return gravity;
    }

    public Spannable getSpannableMessage() {
        return mSpannableMessage;
    }
<commit_msg>完善RxToolTip<commit_after>package com.vondear.rxtools.view.tooltips;

import android.content.Context;
import android.support.annotation.IntDef;
import android.text.Spannable;
import android.view.View;
import android.view.ViewGroup;

import com.vondear.rxtools.R;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class RxToolTip {

    public static final int POSITION_ABOVE = 0;
    public static final int POSITION_BELOW = 1;
    public static final int POSITION_LEFT_TO = 3;
    public static final int POSITION_RIGHT_TO = 4;
    public static final int ALIGN_CENTER = 0;
    public static final int ALIGN_LEFT = 1;
    public static final int ALIGN_RIGHT = 2;
    public static final int GRAVITY_CENTER = 0;
    public static final int GRAVITY_LEFT = 1;
    public static final int GRAVITY_RIGHT = 2;
    private Context mContext;
    private View mAnchorView;
    private ViewGroup mRootViewGroup;
    private String mMessage;
    private @Position int mPosition;
    private @Align int mAlign;
    private int mOffsetX;
    private int mOffsetY;
    private boolean mArrow;
    private int mBackgroundColor;
    private int mTextColor;
    private float mElevation;
    private @Gravity int mTextGravity;
    private Spannable mSpannableMessage;
    private int mTextSize;
    public RxToolTip(Builder builder){
        mContext = builder.mContext;
        mAnchorView = builder.mAnchorView;
        mRootViewGroup = builder.mRootViewGroup;
        mMessage = builder.mMessage;
        mPosition = builder.mPosition;
        mAlign = builder.mAlign;
        mOffsetX = builder.mOffsetX;
        mOffsetX = builder.mOffsetX;
        mOffsetY = builder.mOffsetY;
        mArrow = builder.mArrow;
        mBackgroundColor = builder.mBackgroundColor;
        mTextColor = builder.mTextColor;
        mElevation = builder.mElevation;
        mTextGravity = builder.mTextGravity;
        mSpannableMessage = builder.mSpannableMessage;
        mTextSize = builder.mTextSize;
    }

    public Context getContext() {
        return mContext;
    }

    public View getAnchorView() {
        return mAnchorView;
    }

    public ViewGroup getRootView() {
        return mRootViewGroup;
    }

    public String getMessage() {
        return mMessage;
    }

    public int getPosition() {
        return mPosition;
    }

    public void setPosition(@Position int position) {
        mPosition = position;
    }

    public int getAlign() {
        return mAlign;
    }

    public int getOffsetX() {
        return mOffsetX;
    }

    public int getOffsetY() {
        return mOffsetY;
    }

    public boolean hideArrow() {
        return !mArrow;
    }

    public int getBackgroundColor() {
        return mBackgroundColor;
    }

    public int getTextColor() {
        return mTextColor;
    }

    public boolean positionedLeftTo(){
        return POSITION_LEFT_TO == mPosition;
    }

    public boolean positionedRightTo(){
        return POSITION_RIGHT_TO == mPosition;
    }

    public boolean positionedAbove(){
        return POSITION_ABOVE == mPosition;
    }

    public boolean positionedBelow(){
        return POSITION_BELOW == mPosition;
    }

    public boolean alignedCenter(){
        return ALIGN_CENTER == mAlign;
    }

    public boolean alignedLeft(){
        return ALIGN_LEFT == mAlign;
    }

    public boolean alignedRight(){
        return ALIGN_RIGHT == mAlign;
    }

    public float getElevation() {
        return mElevation;
    }

    public int getTextSize() {
        return mTextSize;
    }

    public int getTextGravity(){
        int gravity;
        switch (mTextGravity){
            case GRAVITY_CENTER:
                gravity = android.view.Gravity.CENTER;
                break;
            case GRAVITY_LEFT:
                gravity = android.view.Gravity.START;
                break;
            case GRAVITY_RIGHT:
                gravity = android.view.Gravity.END;
                break;
            default:
                gravity = android.view.Gravity.CENTER;
        }
        return gravity;
    }

    public Spannable getSpannableMessage() {
        return mSpannableMessage;
    }

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({POSITION_ABOVE, POSITION_BELOW, POSITION_LEFT_TO, POSITION_RIGHT_TO})
    public @interface Position {
    }

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT})
    public @interface Align {
    }

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({GRAVITY_CENTER, GRAVITY_LEFT, GRAVITY_RIGHT})
    public @interface Gravity {
    }

{'fraction_non_alphanumeric': 0.0718005540166205, 'fraction_numerical': 0.00221606648199446, 'mean_word_length': 2.425426944971537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3838217', 'n_tokens_mistral': 2716, 'n_tokens_neox': 2597, 'n_words': 657}