Skip to content

Commit

Permalink
added prefixes to all project resources. Fixes #12 and #14
Browse files Browse the repository at this point in the history
  • Loading branch information
William Mora committed Nov 18, 2014
1 parent f8e88c7 commit 6c7da0d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions lib/src/main/java/com/nispok/snackbar/Snackbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ public Snackbar duration(long duration) {

private void init(Activity parent) {
RelativeLayout layout = (RelativeLayout) LayoutInflater.from(parent)
.inflate(R.layout.snackbar, this, true);
.inflate(R.layout.sb__template, this, true);

layout.setBackgroundColor(mColor != -1 ? mColor :
getResources().getColor(R.color.snackbar_background));
getResources().getColor(R.color.sb__background));

int height = mType.getHeightInPx(getResources().getDisplayMetrics().density);

Expand All @@ -223,7 +223,7 @@ private void init(Activity parent) {

layout.setLayoutParams(params);

TextView snackbarText = (TextView) layout.findViewById(R.id.snackbar_text);
TextView snackbarText = (TextView) layout.findViewById(R.id.sb__text);
snackbarText.setText(mText);

if (mTextColor != -1) {
Expand All @@ -232,7 +232,7 @@ private void init(Activity parent) {

snackbarText.setMaxLines(mType.getMaxLines());

TextView snackbarAction = (TextView) layout.findViewById(R.id.snackbar_action);
TextView snackbarAction = (TextView) layout.findViewById(R.id.sb__action);
if (!TextUtils.isEmpty(mActionLabel)) {
requestLayout();
snackbarAction.setText(mActionLabel);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/snackbar_action_bg_color" />
android:color="@color/sb__action_bg_color" />
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:drawable="@color/snackbar_action_bg_color" />
<item android:state_focused="true" android:drawable="@color/snackbar_action_bg_color" />
<item android:state_pressed="true" android:drawable="@color/sb__action_bg_color" />
<item android:state_focused="true" android:drawable="@color/sb__action_bg_color" />
<item android:drawable="@android:color/transparent" />

</selector>
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
android:layout_height="match_parent" >

<TextView
android:id="@+id/snackbar_action"
android:id="@+id/sb__action"
style="@style/Snackbar.Text.Action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />

<TextView
android:id="@+id/snackbar_text"
android:id="@+id/sb__text"
style="@style/Snackbar.Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/snackbar_action"
android:layout_toLeftOf="@id/sb__action"
android:ellipsize="end" />

</merge>
4 changes: 2 additions & 2 deletions lib/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<style name="Snackbar.Text.Action">
<item name="android:textAllCaps">true</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textColor">@color/snackbar_action_text_color</item>
<item name="android:background">@drawable/snackbar_btn_bg</item>
<item name="android:textColor">@color/sb__action_text_color</item>
<item name="android:background">@drawable/sb__btn_bg</item>
</style>

</resources>
8 changes: 4 additions & 4 deletions lib/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="snackbar_background">#ff323232</color>
<color name="snackbar_text_color">#ffffffff</color>
<color name="snackbar_action_text_color">#ffffffff</color>
<color name="snackbar_action_bg_color">#1affffff</color>
<color name="sb__background">#ff323232</color>
<color name="sb__text_color">#ffffffff</color>
<color name="sb__action_text_color">#ffffffff</color>
<color name="sb__action_bg_color">#1affffff</color>

</resources>
6 changes: 3 additions & 3 deletions lib/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<item name="android:paddingTop">18dp</item>
<item name="android:paddingRight">24dp</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/snackbar_text_color</item>
<item name="android:textColor">@color/sb__text_color</item>
</style>

<style name="Snackbar.Text.Action">
<item name="android:textAllCaps">true</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/snackbar_action_text_color</item>
<item name="android:background">@drawable/snackbar_btn_bg</item>
<item name="android:textColor">@color/sb__action_text_color</item>
<item name="android:background">@drawable/sb__btn_bg</item>
</style>
</resources>

0 comments on commit 6c7da0d

Please sign in to comment.