Skip to content

Instantly share code, notes, and snippets.

@Actine
Created June 30, 2016 13:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Actine/afa083811438482ccc18d2a56ed0e401 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.actinarium.sample.overflow.MainActivity"
android:clipChildren="false">
<FrameLayout
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#40000000"
android:clipToPadding="false"
android:clipChildren="false">
<com.actinarium.sample.overflow.OverflowTextView
android:text="@string/long_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
</FrameLayout>
package com.actinarium.sample.overflow;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
/**
* <p></p>
*
* @author Paul Danyliuk
*/
public class OverflowTextView extends TextView {
public OverflowTextView(Context context) {
super(context);
}
public OverflowTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public OverflowTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment