Java Code Examples for android.widget.TextView#getPaddingStart()

The following examples show how to use android.widget.TextView#getPaddingStart() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlView.java    From Ruisi with Apache License 2.0 6 votes vote down vote up
public void into(TextView target) {
    if (this.target == null) {
        this.target = new WeakReference<>(target);
    }

    if (imageGetter == null) {
        WindowManager wm = (WindowManager) target.getContext()
                .getSystemService(Context.WINDOW_SERVICE);
        Point p = new Point();
        wm.getDefaultDisplay().getSize(p);
        VIEW_WIDTH = p.x - target.getPaddingStart() - target.getPaddingEnd();
        imageGetter = new DefaultImageGetter(target.getContext(), VIEW_WIDTH);
    }

    if (clickListener == null) {
        clickListener = new DefaultClickHandler(target.getContext());
    }

    FONT_SIZE = target.getTextSize();
    spanned = SpanConverter.convert(source, imageGetter, clickListener, this);
    target.setMovementMethod(LinkMovementMethod.getInstance());
    target.setLinkTextColor(URL_COLOR);
    target.setLineSpacing(0, LINE_HEIGHT);
    target.setText(spanned);
    isViewSet = true;
}
 
Example 2
Source File: TextSharedElementCallback.java    From android-topeka with Apache License 2.0 5 votes vote down vote up
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements,
                                 List<View> sharedElementSnapshots) {
    TextView targetView = getTextView(sharedElements);
    if (targetView == null) {
        Log.w(TAG, "onSharedElementStart: No shared TextView, skipping.");
        return;
    }
        mTargetViewTextSize = targetView.getTextSize();
        mTargetViewPaddingStart = targetView.getPaddingStart();
        // Setup the TextView's start values.
        targetView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mInitialTextSize);
        ViewUtils.setPaddingStart(targetView, mInitialPaddingStart);
}
 
Example 3
Source File: TextSharedElementCallback.java    From CoolSignIn with Apache License 2.0 5 votes vote down vote up
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements,
                                 List<View> sharedElementSnapshots) {
    TextView targetView = getTextView(sharedElements);
    if (targetView == null) {
        Log.w(TAG, "onSharedElementStart: No shared TextView, skipping.");
        return;
    }
    mTargetViewTextSize = targetView.getTextSize();
    mTargetViewPaddingStart = targetView.getPaddingStart();
    // Setup the TextView's start values.
    targetView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mInitialTextSize);
    ViewUtils.setPaddingStart(targetView, mInitialPaddingStart);
}