Skip to content

Commit

Permalink
Tidy up resources and add travis.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
hitherejoe committed May 4, 2016
1 parent 0c873fd commit af147bc
Show file tree
Hide file tree
Showing 42 changed files with 102 additions and 129 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
@@ -0,0 +1,19 @@
language: android
android:
components:
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-23.0.3
- android-23
- extra-android-m2repository
- extra-google-m2repository
- extra-android-support
- extra-google-google_play_services

before_script:
- chmod +x gradlew
#Build, and run tests
script: "./gradlew corecommon:testDebugUnitTest"
sudo: false
Expand Up @@ -68,7 +68,8 @@ private void stubBourbonServiceGetShots(Single<List<Shot>> single) {
}

private void stubBourbonServiceGetComments(Single<List<Comment>> single) {
when(mMockBourbonService.getComments(anyInt(), anyString(), anyInt(), anyInt())).thenReturn(single);
when(mMockBourbonService.getComments(anyInt(), anyString(), anyInt(), anyInt()))
.thenReturn(single);
}

}
Expand Up @@ -23,9 +23,6 @@

public class BrowseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private final int VIEW_ITEM = 1;
private final int VIEW_PROG = 0;

private List<Shot> mShots;
private ClickListener mClickListener;

Expand All @@ -47,17 +44,11 @@ public int getItemCount() {
return mShots.size();
}

@Override
public int getItemViewType(int position) {
return mShots.get(position) != null ? VIEW_ITEM : VIEW_PROG;
}

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater
.from(parent.getContext())
.inflate(R.layout.item_shot, parent, false);
return new ShotViewHolder(v);
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_shot, parent, false);
return new ShotViewHolder(view);
}

@Override
Expand Down
Expand Up @@ -159,7 +159,7 @@ public void showShots(final List<Shot> shots) {
@Override
public void showError() {
mShotRecycler.setVisibility(View.GONE);
mMessageImage.setImageResource(R.drawable.ic_sentiment_very_dissatisfied_black_120dp);
mMessageImage.setImageResource(R.drawable.ic_sentiment_very_dissatisfied_gray_120dp);
mMessageText.setText(getString(R.string.text_error_loading_shots));
mMessageButton.setText(getString(R.string.text_reload));
showMessageLayout(true);
Expand All @@ -168,7 +168,7 @@ public void showError() {
@Override
public void showEmpty() {
mShotRecycler.setVisibility(View.GONE);
mMessageImage.setImageResource(R.drawable.ic_empty_glass_120dp);
mMessageImage.setImageResource(R.drawable.ic_empty_glass_gray_120dp);
mMessageText.setText(getString(R.string.text_no_shots));
mMessageButton.setText(getString(R.string.text_check_again));
showMessageLayout(true);
Expand Down
Expand Up @@ -66,14 +66,10 @@ public int getItemCount() {

class CommentViewHolder extends RecyclerView.ViewHolder {

@Bind(R.id.image_avatar)
ImageView userImage;
@Bind(R.id.text_user_name)
TextView userNameText;
@Bind(R.id.text_time)
TextView timeText;
@Bind(R.id.text_comment)
TextView commentText;
@Bind(R.id.image_avatar) ImageView userImage;
@Bind(R.id.text_user_name) TextView userNameText;
@Bind(R.id.text_time) TextView timeText;
@Bind(R.id.text_comment) TextView commentText;

public Comment mComment;

Expand Down
Expand Up @@ -26,25 +26,13 @@ protected void onCreate(Bundle savedInstanceState) {
if (shot == null) {
throw new IllegalArgumentException("Shot activity requires a shot instance!");
}

activityComponent().inject(this);
setContentView(R.layout.activity_shot);
// Slide slide = new Slide();
// slide.setDuration(1000);
// getWindow().setReturnTransition(slide);

ShotFragment shotFragment = ShotFragment.newInstance(shot);
// postponeEnterTransition();

getSupportFragmentManager().beginTransaction()
.add(R.id.frame_container, shotFragment)
.commit();
// getSupportFragmentManager().executePendingTransactions();
}

@Override
protected void onDestroy() {
super.onDestroy();
// supportFinishAfterTransition();
}
}
Expand Up @@ -9,6 +9,8 @@

public abstract class TextViewLinkHandler extends LinkMovementMethod {

abstract public void onLinkClick(String url);

public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
if (event.getAction() != MotionEvent.ACTION_UP)
return super.onTouchEvent(widget, buffer, event);
Expand All @@ -33,5 +35,4 @@ public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event
return true;
}

abstract public void onLinkClick(String url);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,11 @@
<vector android:height="120dp" android:viewportHeight="254.0"
android:viewportWidth="250.0" android:width="120dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/mid_gray"
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="120dp"
android:height="120dp"
android:viewportHeight="254.0"
android:viewportWidth="250.0">
<path
android:fillColor="@color/mid_gray"
android:pathData="M217.2,187.75C206.8,190.8 176.99,197.88 124.47,197.79C72.04,197.7 42.53,190.55 32.19,187.45L17.9,17.41L232.07,17.78L217.2,187.75L217.2,187.75L217.2,187.75ZM247.16,3.98C245.6,2.27 243.39,1.3 241.08,1.3L8.94,0.9L8.93,0.9C6.63,0.9 4.43,1.87 2.86,3.56C1.3,5.26 0.52,7.54 0.71,9.84L20.5,245.21C20.85,249.48 24.42,252.76 28.7,252.77L220.47,253.1L220.48,253.1C224.76,253.1 228.33,249.83 228.7,245.57L249.29,10.27C249.49,7.97 248.72,5.68 247.16,3.98L247.16,3.98L247.16,3.98Z"
android:strokeColor="#00000000" android:strokeWidth="1"/>
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
9 changes: 0 additions & 9 deletions mobile/src/main/res/drawable/ic_eye.xml

This file was deleted.

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@color/colorAccent"
android:pathData="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"/>
android:pathData="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" />
</vector>

This file was deleted.

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
android:width="120dp"
android:height="120dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:pathData="M11.99,2C6.47,2 2,6.47 2,12s4.47,10 9.99,10S22,17.53 22,12 17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM16.18,7.76l-1.06,1.06 -1.06,-1.06L13,8.82l1.06,1.06L13,10.94 14.06,12l1.06,-1.06L16.18,12l1.06,-1.06 -1.06,-1.06 1.06,-1.06zM7.82,12l1.06,-1.06L9.94,12 11,10.94 9.94,9.88 11,8.82 9.94,7.76 8.88,8.82 7.82,7.76 6.76,8.82l1.06,1.06 -1.06,1.06zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z"
android:fillColor="@color/mid_gray"/>
android:fillColor="@color/mid_gray"
android:pathData="M11.99,2C6.47,2 2,6.47 2,12s4.47,10 9.99,10S22,17.53 22,12 17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM16.18,7.76l-1.06,1.06 -1.06,-1.06L13,8.82l1.06,1.06L13,10.94 14.06,12l1.06,-1.06L16.18,12l1.06,-1.06 -1.06,-1.06 1.06,-1.06zM7.82,12l1.06,-1.06L9.94,12 11,10.94 9.94,9.88 11,8.82 9.94,7.76 8.88,8.82 7.82,7.76 6.76,8.82l1.06,1.06 -1.06,1.06zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z" />
</vector>
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/fragment_browse.xml
Expand Up @@ -62,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
tools:src="@drawable/ic_sentiment_very_dissatisfied_black_120dp" />
tools:src="@drawable/ic_sentiment_very_dissatisfied_gray_120dp" />

<TextView
android:id="@+id/text_message"
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/fragment_shot.xml
Expand Up @@ -80,7 +80,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/text_like_count"
android:src="@drawable/ic_heart_accent_24dp"
android:src="@drawable/ic_heart_accent_accent_24dp"
android:transitionName="@string/transition_shot_like_image" />

<TextView
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/item_shot.xml
Expand Up @@ -48,7 +48,7 @@
android:id="@+id/image_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_heart_accent_24dp"
android:src="@drawable/ic_heart_accent_accent_24dp"
android:transitionName="@string/transition_shot_like_image" />

<TextView
Expand Down
4 changes: 0 additions & 4 deletions mobile/src/main/res/values-land/dimens.xml

This file was deleted.

7 changes: 1 addition & 6 deletions mobile/src/main/res/values/strings.xml
@@ -1,8 +1,3 @@
<resources>
<!-- Transitions -->
<string name="transition_shot_image" translatable="false">shot_image_transition</string>
<string name="transition_shot_title" translatable="false">shot_title_transition</string>
<string name="transition_shot_like_image" translatable="false">shot_likes_image_transition</string>
<string name="transition_shot_like_text" translatable="false">shot_likes_text_transition</string>
<string name="transition_shot_header" translatable="false">shot_header_transition</string>

</resources>
Expand Up @@ -74,7 +74,7 @@ public void showMessage() {
getString(R.string.text_no_shots) : getString(R.string.text_error_loading_shots));
mMessageButton.setText(mType == TYPE_EMPTY ?
getString(R.string.text_check_again) : getString(R.string.text_reload));
mMessageImage.setImageResource(mType == TYPE_EMPTY ? R.drawable.ic_empty_glass_120dp :
R.drawable.ic_sentiment_very_dissatisfied_black_120dp);
mMessageImage.setImageResource(mType == TYPE_EMPTY ? R.drawable.ic_empty_glass_accent_120dp :
R.drawable.ic_sentiment_very_dissatisfied_accent_120dp);
}
}
9 changes: 0 additions & 9 deletions tv/src/main/res/drawable/ic_eye.xml

This file was deleted.

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
android:width="32dp"
android:height="32dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@color/white"
android:pathData="M12,9A3,3 0,0 0,9 12A3,3 0,0 0,12 15A3,3 0,0 0,15 12A3,3 0,0 0,12 9M12,17A5,5 0,0 1,7 12A5,5 0,0 1,12 7A5,5 0,0 1,17 12A5,5 0,0 1,12 17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"/>
android:pathData="M12,9A3,3 0,0 0,9 12A3,3 0,0 0,12 15A3,3 0,0 0,15 12A3,3 0,0 0,12 9M12,17A5,5 0,0 1,7 12A5,5 0,0 1,12 7A5,5 0,0 1,17 12A5,5 0,0 1,12 17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" />
</vector>
9 changes: 0 additions & 9 deletions tv/src/main/res/drawable/ic_heart.xml

This file was deleted.

Binary file removed tv/src/main/res/drawable/ic_heart_grey600_24dp.png
Binary file not shown.
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
android:width="32dp"
android:height="32dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@color/white"
android:pathData="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"/>
android:pathData="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="120dp"
android:height="120dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@color/colorAccent"
android:pathData="M11.99,2C6.47,2 2,6.47 2,12s4.47,10 9.99,10S22,17.53 22,12 17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM16.18,7.76l-1.06,1.06 -1.06,-1.06L13,8.82l1.06,1.06L13,10.94 14.06,12l1.06,-1.06L16.18,12l1.06,-1.06 -1.06,-1.06 1.06,-1.06zM7.82,12l1.06,-1.06L9.94,12 11,10.94 9.94,9.88 11,8.82 9.94,7.76 8.88,8.82 7.82,7.76 6.76,8.82l1.06,1.06 -1.06,1.06zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z" />
</vector>

This file was deleted.

5 changes: 3 additions & 2 deletions tv/src/main/res/drawable/rectangle_accent.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorAccent"/>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorAccent" />
</shape>
5 changes: 3 additions & 2 deletions tv/src/main/res/drawable/rectangle_primary_dark.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorPrimaryDark"/>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorPrimaryDark" />
</shape>
4 changes: 2 additions & 2 deletions tv/src/main/res/layout/view_shot_detail.xml
Expand Up @@ -46,7 +46,7 @@
android:layout_marginTop="4dp"
android:layout_toStartOf="@+id/view_separator"
android:drawablePadding="4dp"
android:drawableTop="@drawable/ic_eye_40dp"
android:drawableTop="@drawable/ic_eye_white_40dp"
android:ellipsize="end"
android:gravity="center_horizontal"
android:maxLines="1"
Expand All @@ -72,7 +72,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:drawablePadding="4dp"
android:drawableTop="@drawable/ic_heart_32dp"
android:drawableTop="@drawable/ic_heart_white_32dp"
android:ellipsize="end"
android:gravity="center_horizontal"
android:maxLines="1"
Expand Down
2 changes: 1 addition & 1 deletion tv/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Bourbon</string>

</resources>
13 changes: 9 additions & 4 deletions wear/src/main/res/drawable/ic_empty_glass_gray_48dp.xml
@@ -1,6 +1,11 @@
<vector android:height="48dp" android:viewportHeight="254.0"
android:viewportWidth="250.0" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/mid_gray"
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="254.0"
android:viewportWidth="250.0">
<path
android:fillColor="@color/mid_gray"
android:pathData="M217.2,187.75C206.8,190.8 176.99,197.88 124.47,197.79C72.04,197.7 42.53,190.55 32.19,187.45L17.9,17.41L232.07,17.78L217.2,187.75L217.2,187.75L217.2,187.75ZM247.16,3.98C245.6,2.27 243.39,1.3 241.08,1.3L8.94,0.9L8.93,0.9C6.63,0.9 4.43,1.87 2.86,3.56C1.3,5.26 0.52,7.54 0.71,9.84L20.5,245.21C20.85,249.48 24.42,252.76 28.7,252.77L220.47,253.1L220.48,253.1C224.76,253.1 228.33,249.83 228.7,245.57L249.29,10.27C249.49,7.97 248.72,5.68 247.16,3.98L247.16,3.98L247.16,3.98Z"
android:strokeColor="#00000000" android:strokeWidth="1"/>
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

0 comments on commit af147bc

Please sign in to comment.