Created
June 30, 2016 13:39
-
-
Save Actine/afa083811438482ccc18d2a56ed0e401 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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