Skip to content

Commit

Permalink
add setTypface
Browse files Browse the repository at this point in the history
ex.) numberProgressBar.setTypeface(typeface)
fix daimajia#57 daimajia#60
  • Loading branch information
xpwmaosldk committed May 15, 2018
1 parent c63171b commit 773b079
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

allprojects {
repositories {
jcenter()
google()
}
}
8 changes: 4 additions & 4 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 9
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
Expand All @@ -20,6 +20,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:appcompat-v7:27.1.1'
compile project(':library')
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.daimajia.numberprogressbar.example;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
Expand All @@ -13,7 +13,7 @@
import java.util.TimerTask;


public class MainActivity extends ActionBarActivity implements OnProgressBarListener {
public class MainActivity extends AppCompatActivity implements OnProgressBarListener {
private Timer timer;

private NumberProgressBar bnp;
Expand All @@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

bnp = (NumberProgressBar)findViewById(R.id.numberbar1);
bnp = (NumberProgressBar) findViewById(R.id.numberbar1);
bnp.setOnProgressBarListener(this);
timer = new Timer();
timer.schedule(new TimerTask() {
Expand Down Expand Up @@ -66,7 +66,7 @@ protected void onDestroy() {

@Override
public void onProgressChange(int current, int max) {
if(current == max) {
if (current == max) {
Toast.makeText(getApplicationContext(), getString(R.string.finish), Toast.LENGTH_SHORT).show();
bnp.setProgress(0);
}
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Feb 16 20:38:04 CST 2017
#Tue May 15 17:53:13 KST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
Expand Down Expand Up @@ -327,6 +328,10 @@ public int getTextColor() {
return mTextColor;
}

public void setTypeFace(Typeface typeFace){
mTextPaint.setTypeface(typeFace);
}

/**
* Get progress text size.
*
Expand Down

0 comments on commit 773b079

Please sign in to comment.