Skip to content

Commit

Permalink
add getter for text
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Wild committed Jul 22, 2016
1 parent dfce108 commit c2a073a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ public void setText(CharSequence text) {
requestLayout();
}

public CharSequence getText() {
return text;
}

public void setTextColor(int color) {
textColor = color;
renewPaint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final MarqueeTextView tv = (MarqueeTextView) findViewById(R.id.tv1);
/*final MarqueeTextView tv = (MarqueeTextView) findViewById(R.id.tv1);
Button buttonChangeColour = (Button) findViewById(R.id.button_change_colour);
buttonChangeColour.setOnClickListener(new View.OnClickListener() {
Expand All @@ -31,7 +31,7 @@ public void onClick(View v) {
public void onClick(View v) {
tv.setEdgeEffectEnabled(!tv.isEdgeEffectEnabled());
}
});
});*/


}
Expand Down
27 changes: 26 additions & 1 deletion sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:orientation="vertical"
tools:context="uk.co.deanwild.marqueetextviewsample.MainActivity">

<uk.co.deanwild.marqueetextview.MarqueeTextView
<!-- <uk.co.deanwild.marqueetextview.MarqueeTextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="100dp"
Expand Down Expand Up @@ -96,8 +96,33 @@
android:textSize="24sp" />
</LinearLayout>-->


<LinearLayout
android:layout_width="100px"
android:layout_height="wrap_content"
android:background="#009"
android:orientation="horizontal">

<uk.co.deanwild.marqueetextview.MarqueeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:text="Football"
android:textColor="#fff"

android:textSize="24sp"
app:edgeEffectColor="#fff"
app:edgeEffectWidth="20"
app:pauseDuration="3000"
app:edgeEffectEnabled="true" />


</LinearLayout>



<Button
android:id="@+id/button_change_colour"
android:layout_width="wrap_content"
Expand Down

0 comments on commit c2a073a

Please sign in to comment.