Skip to content

Commit

Permalink
Merge pull request #99 from hannesa2/CodeFormat
Browse files Browse the repository at this point in the history
Common code format
  • Loading branch information
hannesa2 authored Oct 5, 2021
2 parents a63912c + 097a462 commit 9a780b8
Show file tree
Hide file tree
Showing 22 changed files with 343 additions and 153 deletions.
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,8 @@ proguard/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

## Directory-based project format
.idea/
# if you remove the above rule, at least ignore user-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# and these sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
.idea/*
!.idea/codeStyles/

## File-based project format
*.ipr
Expand Down
215 changes: 215 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<manifest package="com.dd.circular.progress.button">
<application/>

<application />
</manifest>
22 changes: 11 additions & 11 deletions library/src/main/java/com/dd/CircularAnimatedDrawable.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ protected void onBoundsChange(Rect bounds) {
fBounds.bottom = bounds.bottom - mBorderWidth / 2f - .5f;
}

private Property<CircularAnimatedDrawable, Float> mAngleProperty =
private Property<CircularAnimatedDrawable, Float> mAngleProperty =
new Property<CircularAnimatedDrawable, Float>(Float.class, "angle") {
@Override
public Float get(CircularAnimatedDrawable object) {
return object.getCurrentGlobalAngle();
}

@Override
public void set(CircularAnimatedDrawable object, Float value) {
object.setCurrentGlobalAngle(value);
}
};
@Override
public Float get(CircularAnimatedDrawable object) {
return object.getCurrentGlobalAngle();
}

@Override
public void set(CircularAnimatedDrawable object, Float value) {
object.setCurrentGlobalAngle(value);
}
};

private Property<CircularAnimatedDrawable, Float> mSweepProperty
= new Property<CircularAnimatedDrawable, Float>(Float.class, "arc") {
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/com/dd/CircularProgressButton.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.dd;

import com.dd.circular.progress.button.R;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
Expand All @@ -17,6 +15,8 @@
import android.util.StateSet;
import android.widget.Button;

import com.dd.circular.progress.button.R;

public class CircularProgressButton extends Button {

public static final int IDLE_STATE_PROGRESS = 0;
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/java/com/dd/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public int getProgress() {
public void checkState(CircularProgressButton progressButton) {
if (progressButton.getProgress() != getProgress()) {
progressButton.setProgress(progressButton.getProgress());
} else if(progressButton.isEnabled() != isEnabled()) {
} else if (progressButton.isEnabled() != isEnabled()) {
progressButton.setEnabled(progressButton.isEnabled());
}
}
Expand Down
12 changes: 4 additions & 8 deletions library/src/main/res/color/cpb_complete_state_selector.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:color="@color/cpb_green_dark"/>
<item android:state_focused="true"
android:color="@color/cpb_green_dark"/>
<item android:state_enabled="false"
android:color="@color/cpb_grey"/>
<item android:state_enabled="true"
android:color="@color/cpb_green"/>
<item android:state_pressed="true" android:color="@color/cpb_green_dark" />
<item android:state_focused="true" android:color="@color/cpb_green_dark" />
<item android:state_enabled="false" android:color="@color/cpb_grey" />
<item android:state_enabled="true" android:color="@color/cpb_green" />
</selector>
12 changes: 4 additions & 8 deletions library/src/main/res/color/cpb_error_state_selector.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:color="@color/cpb_red_dark"/>
<item android:state_focused="true"
android:color="@color/cpb_red_dark"/>
<item android:state_enabled="false"
android:color="@color/cpb_grey"/>
<item android:state_enabled="true"
android:color="@color/cpb_red"/>
<item android:state_pressed="true" android:color="@color/cpb_red_dark" />
<item android:state_focused="true" android:color="@color/cpb_red_dark" />
<item android:state_enabled="false" android:color="@color/cpb_grey" />
<item android:state_enabled="true" android:color="@color/cpb_red" />
</selector>
12 changes: 4 additions & 8 deletions library/src/main/res/color/cpb_idle_state_selector.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:color="@color/cpb_blue_dark"/>
<item android:state_focused="true"
android:color="@color/cpb_blue_dark"/>
<item android:state_enabled="false"
android:color="@color/cpb_grey"/>
<item android:state_enabled="true"
android:color="@color/cpb_blue"/>
<item android:state_pressed="true" android:color="@color/cpb_blue_dark" />
<item android:state_focused="true" android:color="@color/cpb_blue_dark" />
<item android:state_enabled="false" android:color="@color/cpb_grey" />
<item android:state_enabled="true" android:color="@color/cpb_blue" />
</selector>
8 changes: 4 additions & 4 deletions library/src/main/res/drawable/cpb_background.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
android:shape="rectangle">
<stroke
android:width="@dimen/cpb_stroke_width"
android:color="@color/cpb_blue"/>
<solid android:color="@color/cpb_blue"/>
android:width="@dimen/cpb_stroke_width"
android:color="@color/cpb_blue" />
<solid android:color="@color/cpb_blue" />
</shape>
Loading

0 comments on commit 9a780b8

Please sign in to comment.