Skip to content

Commit

Permalink
add font test case
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjun.1 committed Jul 21, 2020
1 parent 9de7663 commit 0145ae4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/me/ele/uetool/sample/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.ele.uetool.sample;

import android.content.Intent;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -44,6 +45,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
updateDraweeView();
updateSpanTextView();
updateCustomView();
updateFontView();
}

public void onClick(View view) {
Expand Down Expand Up @@ -88,4 +90,9 @@ private void updateCustomView() {
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
customView.setCompoundDrawables(null, drawable, null, null);
}

private void updateFontView() {
final TextView fontView = findViewById(R.id.font_test);
fontView.setTypeface(Typeface.create("casual", Typeface.BOLD));
}
}
19 changes: 19 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@
android:layout_height="wrap_content"
/>

<TextView
android:id="@+id/font_test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="32dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:background="#f00"
android:gravity="center"
android:lineSpacingExtra="2dp"
android:padding="12dp"
android:text="Font Test"
android:textColor="#fff"
android:textSize="15dp"
/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="500dp"
Expand Down

0 comments on commit 0145ae4

Please sign in to comment.