Skip to content

Commit

Permalink
Merge pull request #12 from write-only-memory/custom-names
Browse files Browse the repository at this point in the history
Merged pull request #12. Custom names are now supported - some small bugs may exist.
  • Loading branch information
rb28z2 committed Jan 26, 2015
2 parents 899a2c2 + c03c022 commit 040a6d1
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 203 deletions.
46 changes: 32 additions & 14 deletions app/src/main/java/ca/currybox/yaya/Anime.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import java.io.Serializable;

/**
* Created by write_only_memory on 10/3/2014.
* Created by write-only-memory on 10/3/2014.
*/
public class Anime implements Serializable{
public class Anime implements Serializable {

private static final long serialVersionUID = 1L;
private String title;
private String synonyms;
private String custom_synonyms;
private int episodes;
private int watched;
private int status;
Expand All @@ -33,6 +35,14 @@ public void setSynonyms(String synonyms) {
this.synonyms = synonyms;
}

public String getCustom_synonyms() {
return custom_synonyms;
}

public void setCustom_synonyms(String synonyms) {
this.custom_synonyms = synonyms;
}

public int getEpisodes() {
return episodes;
}
Expand Down Expand Up @@ -65,31 +75,39 @@ public void setUpdated(int updated) {
this.updated = updated;
}

public void setId(int id) {
this.id = id;
}

public int getId() {
return id;
}

public String getDateFinished()
{
public void setId(int id) {
this.id = id;
}

public String getDateFinished() {
return dateFinished;
}

public void setDateFinished(String date)
{
public void setDateFinished(String date) {
dateFinished = date;
}

public String getDateStarted()
{
public String getDateStarted() {
return dateStarted;
}

public void setDateStarted(String date)
{
public void setDateStarted(String date) {
dateStarted = date;
}

public void copy(Anime show) {
this.title = show.title;
this.synonyms = show.synonyms;
this.episodes = show.episodes;
this.watched = show.watched;
this.status = show.status;
this.updated = show.updated;
this.id = show.id;
this.dateStarted = show.dateStarted;
this.dateFinished = show.dateFinished;
}
}
23 changes: 10 additions & 13 deletions app/src/main/java/ca/currybox/yaya/ListViewAdapter.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
package ca.currybox.yaya;

import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
Expand All @@ -39,14 +35,6 @@ public ListViewAdapter(Context context, List<Anime> animeList) {
this.arraylist.addAll(animeList);
}

public class ViewHolder {
TextView title;
TextView episodes;
TextView watched;
TextView updated;
TextView status;
}

@Override
public int getCount() {
return animeList.size();
Expand Down Expand Up @@ -89,7 +77,6 @@ public void onClick(View arg0) {
Intent intent = new Intent(context, SingleItemView.class);



//Pass all data title
intent.putExtra("title", (animeList.get(position).getTitle()));
//Pass all data episodes
Expand All @@ -101,6 +88,8 @@ public void onClick(View arg0) {
//Pass all data updated
intent.putExtra("updated", (animeList.get(position).getUpdated()));

intent.putExtra("show", animeList.get(position));

//Start activity
context.startActivity(intent);

Expand Down Expand Up @@ -134,5 +123,13 @@ public int compare(Anime anime, Anime anime2) {
notifyDataSetChanged();
}

public class ViewHolder {
TextView title;
TextView episodes;
TextView watched;
TextView updated;
TextView status;
}


}
14 changes: 4 additions & 10 deletions app/src/main/java/ca/currybox/yaya/NavigationDrawerFragment.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package ca.currybox.yaya;


import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -20,7 +17,6 @@
public class NavigationDrawerFragment extends android.support.v4.app.Fragment {



private ActionBarDrawerToggle mDrawerToggle;
private DrawerLayout mDrawerLayout;

Expand All @@ -47,21 +43,19 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
public void setUp(int fragmentId, DrawerLayout drawerLayout, final Toolbar toolbar, boolean firstLaunch) {
containerView = getActivity().findViewById(fragmentId);
mDrawerLayout = drawerLayout;
mDrawerToggle = new ActionBarDrawerToggle(getActivity(), drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close)
{
mDrawerToggle = new ActionBarDrawerToggle(getActivity(), drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close) {


@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
if (slideOffset<0.6) {
if (slideOffset < 0.6) {
toolbar.setAlpha(1 - slideOffset);
}
}
};

if (!firstLaunch)
{
if (!firstLaunch) {
mDrawerLayout.openDrawer(containerView);
}

Expand Down
Loading

0 comments on commit 040a6d1

Please sign in to comment.