Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
fixed canvas.restore issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ceryle committed May 2, 2017
1 parent 59dfdd6 commit d8e8d40
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ group = 'com.github.ceryle'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
enforceUniquePackageName = false

defaultConfig {
minSdkVersion 11
Expand Down Expand Up @@ -47,5 +46,5 @@ artifacts {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ protected void onDraw(Canvas canvas) {

canvas.restore();
}
canvas.save();

// Bitmap normal
if (hasDrawable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ protected void onDraw(Canvas canvas) {
}
}

@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
}

private void setBackgroundColor(View v, Drawable d, int c) {
if (null != d) {
BackgroundHelper.setBackground(v, d);
Expand Down
5 changes: 2 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
enforceUniquePackageName = false

defaultConfig {
applicationId "co.ceryle.segmentedbutton"
applicationId "co.ceryle.segmentedbutton.sample"
minSdkVersion 11
targetSdkVersion 25
versionCode 1
Expand All @@ -23,6 +22,6 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile project(":library")
}
4 changes: 2 additions & 2 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="co.ceryle.segmentedbutton"
<manifest package="co.ceryle.segmentedbutton.sample"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
Expand All @@ -8,7 +8,7 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="co.ceryle.segmentedbutton.MainActivity">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package co.ceryle.segmentedbutton;
package co.ceryle.segmentedbutton.sample;

import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import co.ceryle.segmentedbutton.SegmentedButtonGroup;

public class MainActivity extends AppCompatActivity {

private Button button;
Expand Down

0 comments on commit d8e8d40

Please sign in to comment.