Skip to content

Commit

Permalink
Prefix all resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Gresse committed Aug 16, 2016
1 parent 48ac18f commit 35d736a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 35 deletions.
9 changes: 8 additions & 1 deletion .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
android:paddingRight="20dp"
android:paddingBottom="40dp"
android:id="@+id/vumeter"
vumeter:stopSize="5dp"
vumeter:speed="10"
vumeter:blockNumber="5"
vumeter:blockSpacing="20dp"
vumeter:backgroundColor="#33b5e5"/>
vumeter:vumeter_stopSize="5dp"
vumeter:vumeter_speed="10"
vumeter:vumeter_blockNumber="5"
vumeter:vumeter_blockSpacing="20dp"
vumeter:vumeter_backgroundColor="#33b5e5"/>

<Switch
android:layout_width="wrap_content"
Expand Down
2 changes: 2 additions & 0 deletions vumeterlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

resourcePrefix "vumeter_"

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public VuMeterView(Context context, AttributeSet attrs, int defStyle) {

private void init(AttributeSet attrs, int defStyle) {
// Load attributes
final TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.VuMeterView, defStyle, 0);
mColor = a.getColor(R.styleable.VuMeterView_backgroundColor, Color.BLACK);
mBlockNumber = a.getInt(R.styleable.VuMeterView_blockNumber, DEFAULT_NUMBER_BLOCK);
mBlockSpacing = a.getDimension(R.styleable.VuMeterView_blockSpacing, DEFAULT_BLOCK_SPACING);
mSpeed = a.getInt(R.styleable.VuMeterView_speed, DEFAULT_SPEED);
mStopSize = a.getDimension(R.styleable.VuMeterView_stopSize, DEFAULT_STOP_SIZE);
boolean startOff = a.getBoolean(R.styleable.VuMeterView_startOff, DEFAULT_START_OFF);
final TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.vumeter_VuMeterView, defStyle, 0);
mColor = a.getColor(R.styleable.vumeter_VuMeterView_vumeter_backgroundColor, Color.BLACK);
mBlockNumber = a.getInt(R.styleable.vumeter_VuMeterView_vumeter_blockNumber, DEFAULT_NUMBER_BLOCK);
mBlockSpacing = a.getDimension(R.styleable.vumeter_VuMeterView_vumeter_blockSpacing, DEFAULT_BLOCK_SPACING);
mSpeed = a.getInt(R.styleable.vumeter_VuMeterView_vumeter_speed, DEFAULT_SPEED);
mStopSize = a.getDimension(R.styleable.vumeter_VuMeterView_vumeter_stopSize, DEFAULT_STOP_SIZE);
boolean startOff = a.getBoolean(R.styleable.vumeter_VuMeterView_vumeter_startOff, DEFAULT_START_OFF);
a.recycle();

// Init
Expand Down
14 changes: 0 additions & 14 deletions vumeterlibrary/src/main/res/layout/sample_vu_meter_view.xml

This file was deleted.

14 changes: 7 additions & 7 deletions vumeterlibrary/src/main/res/values/attrs_vu_meter_view.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<resources>
<declare-styleable name="VuMeterView">
<attr name="backgroundColor" format="color"/>
<attr name="blockNumber" format="integer"/>
<attr name="blockSpacing" format="dimension"/>
<attr name="speed" format="integer"/>
<attr name="stopSize" format="dimension"/>
<attr name="startOff" format="boolean"/>
<declare-styleable name="vumeter_VuMeterView">
<attr name="vumeter_backgroundColor" format="color"/>
<attr name="vumeter_blockNumber" format="integer"/>
<attr name="vumeter_blockSpacing" format="dimension"/>
<attr name="vumeter_speed" format="integer"/>
<attr name="vumeter_stopSize" format="dimension"/>
<attr name="vumeter_startOff" format="boolean"/>
</declare-styleable>
</resources>

0 comments on commit 35d736a

Please sign in to comment.