Skip to content

Commit 09be4e4

Browse files
committed
set the colors for text fields also with optional delays
1 parent db97a91 commit 09be4e4

11 files changed

Lines changed: 123 additions & 9 deletions

File tree

1.12 MB
Binary file not shown.
1.2 MB
Binary file not shown.
48.8 KB
Loading
40.9 KB
Loading
40.9 KB
Loading
48.8 KB
Loading
40.3 KB
Loading
39.7 KB
Loading

app/src/main/java/com/nasirbashak007gmail/colorchange/MainActivity.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.nasirbashak007gmail.colorchange;
22

3-
import android.graphics.Color;
43
import android.os.Bundle;
54
import android.support.v7.app.AppCompatActivity;
6-
import android.view.View;
5+
import android.widget.Button;
6+
import android.widget.ImageView;
77
import android.widget.TextView;
88
import android.widget.Toast;
99

@@ -26,11 +26,14 @@ protected void onCreate(Bundle savedInstanceState) {
2626

2727
public void test() {
2828

29-
ChangeColor changeColor = new ChangeColor();
29+
ChangeColor changeColor = new ChangeColor(this);
3030

3131

32-
changeColor.changeBackgroundColor(myTextView, "03FBFF", "FF7803");//without delay default is 225ms
33-
changeColor.changeBackgroundColor(myTextView, "03FBFF", "FF7803", 500);// with delay
32+
//changeColor.changeTextColor(myTextView,"03FBFF", "FF7803");//without delay default is 225ms
33+
//changeColor.changeTextColor(myTextView, "03FBFF", "FF7803", 500);//with delay
34+
35+
changeColor.changeBackgroundColor(myTextView, "03FBFF", "FF7803");//without delay default is 225ms
36+
//changeColor.changeBackgroundColor(myTextView, "03FBFF", "FF7803", 500);// with delay
3437

3538

3639
String s = changeColor.generateTheColorCode();

app/src/main/res/layout/activity_main.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
<TextView
1010
android:id="@+id/textView"
11-
android:layout_width="150dp"
12-
android:layout_height="50dp"
11+
android:layout_width="350dp"
12+
android:layout_height="wrap_content"
1313
android:text="Hello World!"
1414
android:textAlignment="center"
15-
android:textSize="25dp"
15+
android:textSize="50dp"
1616
app:layout_constraintBottom_toBottomOf="parent"
1717
app:layout_constraintLeft_toLeftOf="parent"
1818
app:layout_constraintRight_toRightOf="parent"

0 commit comments

Comments
 (0)