Skip to content

Commit

Permalink
added strings and assets
Browse files Browse the repository at this point in the history
  • Loading branch information
seanleavy committed Aug 21, 2017
1 parent 8ce35e7 commit 6530958
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.wii.sean.wiimmfiitus.fragments;

import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
Expand All @@ -16,8 +18,6 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.common.base.Predicate;
Expand Down Expand Up @@ -153,6 +153,13 @@ public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
};
miiItemTouchHelper = new ItemTouchHelper(callback);
miiItemTouchHelper.attachToRecyclerView(wiiCyclerView);
RecyclerItemClickSupport.addTo(wiiCyclerView).setOnItemLongClickListener(new RecyclerItemClickSupport.OnItemLongClickListener() {
@Override
public boolean onItemLongClicked(RecyclerView recyclerView, int position, View v) {
SnackBarHelper.showSnackBar(getContext(), getParentActivity().findViewById(R.id.homescreen_main_layout), getContext().getString(R.string.drag_reorder_message), 2000, null);
return true;
}
});
}

@Override
Expand Down Expand Up @@ -296,4 +303,15 @@ private void processResult(Object result) {
wiiCyclerViewAdapter.notifyDataSetChanged();
setOnBoarding();
}

private Activity getParentActivity() {
Context context = getContext();
while (context instanceof ContextWrapper) {
if (context instanceof Activity) {
return (Activity)context;
}
context = ((ContextWrapper)context).getBaseContext();
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

//create a build pattern
public class SnackBarHelper {

//todo change this to a builder pattern
public static void showSnackBar(Context context, View v, String resource, int length, Drawable d, final View... args) {
Snackbar snackbar = Snackbar.make(v, resource, length);
snackbar.setActionTextColor(context.getResources().getColor(android.R.color.holo_red_dark));
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_lobby.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
android:visibility="gone" />

<ImageView
android:layout_marginTop="@dimen/padding_margin_65dp"
android:alpha="0.6"
android:layout_marginTop="@dimen/padding_margin_60dp"
android:id="@+id/image_lobby"
android:layout_width="@dimen/collapsing_image_Size"
android:layout_height="@dimen/collapsing_image_Size"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dimen name="fab_margin">16dp</dimen>
<dimen name="miis_found_layout_size">35dp</dimen>
<dimen name="padding_margin_10dp">10dp</dimen>
<dimen name="padding_margin_65dp">65dp</dimen>
<dimen name="padding_margin_60dp">60dp</dimen>
<dimen name="padding_margin_8dp">8dp</dimen>
<dimen name="padding_margin_1dp">1dp</dimen>
<dimen name="padding_margin_2dp">2dp</dimen>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<string name="mii">Mii</string>
<string name="dialog_title">Search</string>
<string name="first_run_message">"Hold the SEARCH button if you're from Roscommon"</string>
<string name="drag_reorder_message">Drag to reorder your favourites</string>
<string name="saved_friends">Saved Miis</string>
<string name="search_friends">Mii Search</string>
<string name="history">History</string>
Expand Down

0 comments on commit 6530958

Please sign in to comment.