Skip to content

Commit

Permalink
Merge pull request #80 from lewismcgeary/rename-resources-for-clarity
Browse files Browse the repository at this point in the history
rename-resources-for-clarity
  • Loading branch information
lewismcgeary committed Mar 5, 2016
2 parents 9b1f499 + 8ea905c commit ac9c96d
Show file tree
Hide file tree
Showing 43 changed files with 78 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import android.widget.LinearLayout;
import android.widget.TextView;

public class CustomAppIntroFragment extends Fragment {
public class CustomRulesPageFragment extends Fragment {

private static final String ARG_TITLE = "title";
private static final String ARG_DESC = "desc";
Expand All @@ -24,13 +24,13 @@ public class CustomAppIntroFragment extends Fragment {
private static final String ARG_TITLE_COLOR = "title_color";
private static final String ARG_DESC_COLOR = "desc_color";

public static CustomAppIntroFragment newInstance(CharSequence title, CharSequence description, int imageDrawable, int bgColor) {
public static CustomRulesPageFragment newInstance(CharSequence title, CharSequence description, int imageDrawable, int bgColor) {
return newInstance(title, description, imageDrawable, bgColor, 0, 0);
}


public static CustomAppIntroFragment newInstance(CharSequence title, CharSequence description, int imageDrawable, int bgColor, int titleColor, int descColor) {
CustomAppIntroFragment sampleSlide = new CustomAppIntroFragment();
public static CustomRulesPageFragment newInstance(CharSequence title, CharSequence description, int imageDrawable, int bgColor, int titleColor, int descColor) {
CustomRulesPageFragment sampleSlide = new CustomRulesPageFragment();

Bundle args = new Bundle();
args.putCharSequence(ARG_TITLE, title);
Expand All @@ -47,7 +47,7 @@ public static CustomAppIntroFragment newInstance(CharSequence title, CharSequenc
private int drawable, bgColor, titleColor, descColor;
private CharSequence title, description;

public CustomAppIntroFragment() {
public CustomRulesPageFragment() {
}

@Override
Expand All @@ -67,7 +67,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_intro_custom, container, false);
View v = inflater.inflate(R.layout.fragment_rules_custom, container, false);
TextView t = (TextView) v.findViewById(R.id.title);
TextView d = (TextView) v.findViewById(R.id.description);
ImageView i = (ImageView) v.findViewById(R.id.image);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ExplainRulesActivity extends AppIntro2 {

@Override
public void init(@Nullable Bundle savedInstanceState) {
CustomAppIntroFragment summaryFragment = CustomAppIntroFragment.newInstance(getString(R.string.rules_summary_title), getString(R.string.rules_summary_text), R.drawable.life_logo_no_shadow_368, ContextCompat.getColor(getApplicationContext(), R.color.rulesViewPagerBackground));
CustomRulesPageFragment summaryFragment = CustomRulesPageFragment.newInstance(getString(R.string.rules_summary_title), getString(R.string.rules_summary_text), R.drawable.life_logo_no_shadow_368, ContextCompat.getColor(getApplicationContext(), R.color.rulesViewPagerBackground));
addSlide(summaryFragment);
addSlide(AppIntroFragment.newInstance(getString(R.string.rules_fewer_than_two_title), getString(R.string.rules_fewer_than_two_text), R.drawable.rules_fewer_than_two_neighbours, ContextCompat.getColor(getApplicationContext(), R.color.rulesViewPagerBackground)));
addSlide(AppIntroFragment.newInstance(getString(R.string.rules_two_or_three_title), getString(R.string.rules_two_or_three_text), R.drawable.rules_two_or_three_neighbours, ContextCompat.getColor(getApplicationContext(), R.color.rulesViewPagerBackground)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public LifeCellView(Context context, AttributeSet attrs) {
}

private void initialiseDrawables(Context context){
setImageResource(R.drawable.life_cell_vector_dead);
animatedCellDrawableBorn = AnimatedVectorDrawableCompat.create(context, R.drawable.life_cell_animated_vector);
animatedCellDrawableDie = AnimatedVectorDrawableCompat.create(context, R.drawable.life_cell_animated_vector_die);
setImageResource(R.drawable.cell_vector_drawable_dead);
animatedCellDrawableBorn = AnimatedVectorDrawableCompat.create(context, R.drawable.cell_animated_vector_born);
animatedCellDrawableDie = AnimatedVectorDrawableCompat.create(context, R.drawable.cell_animated_vector_die);
}

public void makeCellViewLive() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onGlobalLayout() {
//wait until layout is drawn before running setup calculations on its measurements
worldGridLayout.getViewTreeObserver().addOnGlobalLayoutListener(listener);
ImageView touchIcon = (ImageView)view.findViewById(R.id.touch_icon);
AnimatedVectorDrawableCompat touchAnimation = AnimatedVectorDrawableCompat.create(getContext(), R.drawable.touch_animated_vector);
AnimatedVectorDrawableCompat touchAnimation = AnimatedVectorDrawableCompat.create(getContext(), R.drawable.hand_animated_vector);
touchIcon.setImageDrawable(touchAnimation);
touchAnimation.start();
return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ private void initialiseButton(){
startResetFab = (FloatingActionButton)findViewById(R.id.start_reset_fab);
startButtonText = getString(R.string.start_button_text);
resetButtonText = getString(R.string.reset_button_text);
playIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_reset_to_play_animated_vector);
resetIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_play_to_reset_animated_vector);
playIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_animated_vector_reset_to_play);
resetIcon = AnimatedVectorDrawableCompat.create(this, R.drawable.fab_animated_vector_play_to_reset);
startResetFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/animator/cell_die_animator.xml

This file was deleted.

File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions app/src/main/res/animator/fab_arrowhead_to_play.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
android:ordering="together"
>
<objectAnimator
android:startOffset="@string/fab_anim_time"
android:startOffset="@integer/fab_anim_time"
android:propertyName="rotation"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="-180"
android:valueTo="-360"
android:interpolator="@android:interpolator/decelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleX"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0.45"
android:valueTo="1"
android:interpolator="@android:interpolator/decelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleY"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0.71"
android:valueTo="1"
android:interpolator="@android:interpolator/decelerate_cubic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
>
<objectAnimator
android:propertyName="rotation"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="-180"
android:valueTo="-180"
android:interpolator="@android:interpolator/decelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleX"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0.45"
android:valueTo="0.45"
android:interpolator="@android:interpolator/decelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleY"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0.71"
android:valueTo="0.71"
android:interpolator="@android:interpolator/decelerate_cubic"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/animator/fab_play_to_arrowhead.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
android:ordering="together">
<objectAnimator
android:propertyName="rotation"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0"
android:valueTo="-180"
android:interpolator="@android:interpolator/accelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleX"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="1"
android:valueTo="0.45"
android:interpolator="@android:interpolator/accelerate_cubic"
/>
<objectAnimator
android:propertyName="scaleY"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="1"
android:valueTo="0.71"
android:interpolator="@android:interpolator/accelerate_cubic"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/animator/fab_rotate_reset_arrow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:propertyName="rotation"
android:startOffset="@string/fab_anim_time"
android:duration="@string/fab_anim_time"
android:startOffset="@integer/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:valueFrom="0"
android:valueTo="-360"
android:interpolator="@android:interpolator/decelerate_cubic"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/animator/fab_tail_grow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
android:valueFrom="0"
android:valueTo="0"
android:valueType="floatType"
android:duration="@string/fab_anim_time" />
android:duration="@integer/fab_anim_time" />
<objectAnimator android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:interpolator="@android:interpolator/decelerate_cubic"/>
</set>
2 changes: 1 addition & 1 deletion app/src/main/res/animator/fab_tail_shrink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"
android:duration="@string/fab_anim_time"
android:duration="@integer/fab_anim_time"
android:interpolator="@android:interpolator/accelerate_cubic"/>
</set>
File renamed without changes.
9 changes: 0 additions & 9 deletions app/src/main/res/animator/rotate_90_anticlockwise.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/animator/rotate_90_clockwise.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/life_cell_vector_dead">
android:drawable="@drawable/cell_vector_drawable_dead">
<target
android:animation="@animator/cell_born_animator"
android:animation="@animator/cell_grow"
android:name="@string/scale_group_name"/>
</animated-vector>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/life_cell_vector">
android:drawable="@drawable/cell_vector_drawable">
<target
android:animation="@animator/fade_out"
android:animation="@animator/cell_fade_out"
android:name="@string/cell_name"/>
</animated-vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:name="whole cell alpha"
android:width="@dimen/cell_size"
android:height="@dimen/cell_size"
android:alpha="1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector
android:drawable="@drawable/fab_ic_play_arrow_24dp"
android:drawable="@drawable/fab_icon_play"
xmlns:android="http://schemas.android.com/apk/res/android" >

<target
android:animation="@animator/fab_play_to_arrowhead"
android:name="arrow head group"/>
android:name="@string/arrowhead_groupname"/>
<target
android:animation="@animator/fab_rotate_reset_arrow"
android:name="rotation group"/>
android:name="@string/whole_icon_rotation_group"/>
<target
android:animation="@animator/fab_tail_grow"
android:name="arrow tail"/>
android:name="@string/arrow_tail_pathname"/>

</animated-vector>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/fab_ic_replay_24dp">
android:drawable="@drawable/fab_icon_reset">
<target
android:animation="@animator/fab_tail_shrink"
android:name="arrow tail"/>
android:name="@string/arrow_tail_pathname"/>
<target
android:animation="@animator/fab_arrowhead_to_play_startoffset"
android:name="arrow head group"/>
android:name="@string/arrowhead_groupname"/>
<target
android:animation="@animator/fab_arrowhead_to_play"
android:name="arrow head group"/>
android:name="@string/arrowhead_groupname"/>

</animated-vector>
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<group android:name="rotation group"
<group android:name="@string/whole_icon_rotation_group"
android:pivotX="12"
android:pivotY="12">

<path
android:name="arrow tail"
android:name="@string/arrow_tail_pathname"
android:strokeColor="#000000"
android:strokeWidth="2"
android:trimPathEnd="0"
android:pathData=
"M12,6 c3.9,0 7,3.135 7,7 s-3.135,7 -7,7 -7,-3.135 -7,-7"
/>
<group
android:name="arrow head group"
android:name="@string/arrowhead_groupname"
android:rotation="0"
android:pivotX="10.75"
android:pivotY="8.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
android:pivotY="12">

<path
android:name="arrow tail"
android:name="@string/arrow_tail_pathname"
android:strokeColor="#000000"
android:strokeWidth="2"
android:pathData=
"M12,6 c3.9,0 7,3.135 7,7 s-3.135,7 -7,7 -7,-3.135 -7,-7"
/>
<group
android:name="arrow head group"
android:name="@string/arrowhead_groupname"
android:rotation="180"
android:pivotX="10.75"
android:pivotY="8.5"
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/hand_animated_vector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/hand_icon">
<target
android:animation="@animator/hand_fade_in_fade_out"
android:name="@string/hand_icon_pathname"/>
<target
android:animation="@animator/hand_move_right"
android:name="@string/hand_icon_move_group"/>
<target
android:animation="@animator/hand_move_up"
android:name="@string/hand_icon_move_group"/>

</animated-vector>
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
android:height="288dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0">
<group android:name="move hand"
<group android:name="@string/hand_icon_move_group"
android:translateX="0"
android:translateY="24">
<path
android:name="touch icon"
android:name="@string/hand_icon_pathname"
android:fillAlpha="0"
android:fillColor="#FF000000"
android:pathData="M9,11.24L9,7.5C9,6.12 10.12,5 11.5,5S14,6.12 14,7.5v3.74c1.21,-0.81 2,-2.18 2,-3.74C16,5.01 13.99,3 11.5,3S7,5.01 7,7.5c0,1.56 0.79,2.93 2,3.74zM18.84,15.87l-4.54,-2.26c-0.17,-0.07 -0.35,-0.11 -0.54,-0.11L13,13.5v-6c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,6.67 10,7.5v10.74l-3.43,-0.72c-0.08,-0.01 -0.15,-0.03 -0.24,-0.03 -0.31,0 -0.59,0.13 -0.79,0.33l-0.79,0.8 4.94,4.94c0.27,0.27 0.65,0.44 1.06,0.44h6.79c0.75,0 1.33,-0.55 1.44,-1.28l0.75,-5.27c0.01,-0.07 0.02,-0.14 0.02,-0.2 0,-0.62 -0.38,-1.16 -0.91,-1.38z"/>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_done_24dp.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_play_arrow_24dp.xml

This file was deleted.

Loading

0 comments on commit ac9c96d

Please sign in to comment.