diff --git a/app/src/main/java/ca/currybox/yaya/Anime.java b/app/src/main/java/ca/currybox/yaya/Anime.java index 3783b50..d826409 100644 --- a/app/src/main/java/ca/currybox/yaya/Anime.java +++ b/app/src/main/java/ca/currybox/yaya/Anime.java @@ -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; @@ -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; } @@ -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; + } } diff --git a/app/src/main/java/ca/currybox/yaya/ListViewAdapter.java b/app/src/main/java/ca/currybox/yaya/ListViewAdapter.java index e14a972..ddf44cf 100644 --- a/app/src/main/java/ca/currybox/yaya/ListViewAdapter.java +++ b/app/src/main/java/ca/currybox/yaya/ListViewAdapter.java @@ -1,14 +1,11 @@ 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; @@ -16,7 +13,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.Date; -import java.util.HashMap; import java.util.List; /** @@ -39,14 +35,6 @@ public ListViewAdapter(Context context, List 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(); @@ -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 @@ -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); @@ -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; + } + } diff --git a/app/src/main/java/ca/currybox/yaya/NavigationDrawerFragment.java b/app/src/main/java/ca/currybox/yaya/NavigationDrawerFragment.java index fd7765c..5c9221c 100644 --- a/app/src/main/java/ca/currybox/yaya/NavigationDrawerFragment.java +++ b/app/src/main/java/ca/currybox/yaya/NavigationDrawerFragment.java @@ -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; @@ -20,7 +17,6 @@ public class NavigationDrawerFragment extends android.support.v4.app.Fragment { - private ActionBarDrawerToggle mDrawerToggle; private DrawerLayout mDrawerLayout; @@ -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); } diff --git a/app/src/main/java/ca/currybox/yaya/SingleItemView.java b/app/src/main/java/ca/currybox/yaya/SingleItemView.java index 1b1c15a..e522073 100644 --- a/app/src/main/java/ca/currybox/yaya/SingleItemView.java +++ b/app/src/main/java/ca/currybox/yaya/SingleItemView.java @@ -1,6 +1,5 @@ package ca.currybox.yaya; -import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; @@ -13,11 +12,6 @@ import android.widget.RelativeLayout; import android.widget.TextView; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutput; -import java.io.ObjectOutputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -35,15 +29,18 @@ public class SingleItemView extends ActionBarActivity implements View.OnClickLis private int watched; private int status_id; private int updated; + private Anime intentShow; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - Intent i = getIntent(); - title = i.getStringExtra("title"); + + intentShow = (Anime) i.getSerializableExtra("show"); + + title = intentShow.getTitle(); //Get the view from singleitemview.xml setContentView(R.layout.singleitemview); @@ -57,19 +54,20 @@ public void onCreate(Bundle savedInstanceState) { read.setOnClickListener(this); write.setOnClickListener(this); + read(); + Log.i("INFO", title); - synonyms = i.getStringExtra("synonyms"); -// Log.i("INFO",synonyms); - episodes = i.getIntExtra("episodes", 0); + synonyms = intentShow.getSynonyms(); - watched = i.getIntExtra("watched", 0); - status_id = i.getIntExtra("status", 0); - updated = i.getIntExtra("updated", 0); + episodes = intentShow.getEpisodes(); + watched = intentShow.getWatched(); + + status_id = intentShow.getStatus(); + updated = intentShow.getUpdated(); String date = new SimpleDateFormat("MMM dd yyyy 'at' KK:mm:ss a").format(new Date(updated * 1000L)); - String status; - switch (status_id) - { + String status = String.valueOf(status_id); + switch (status_id) { case 1: status = "Currently watching"; break; @@ -86,6 +84,7 @@ public void onCreate(Bundle savedInstanceState) { status = "Plan to watch"; break; default: + Log.e("status unknown", status); status = "Unknown... wot"; break; } @@ -107,43 +106,71 @@ public void onCreate(Bundle savedInstanceState) { } @Override - public void onClick(View v) - { - List shows = new ArrayList(); - switch (v.getId()) - { + public void onClick(View v) { + + switch (v.getId()) { case R.id.read: - TextView test = (TextView) findViewById(R.id.test_field); - shows = getCustomList(); - String out = ""; - Log.i("list size", "lel"); - for (int i = 0; i < shows.size(); i++) - { - out = out + shows.get(i).getTitle() + ":" + shows.get(i).getSynonyms(); - } - test.setText(out); + read(); break; case R.id.write: - shows = getCustomList(); - if (shows == null) - { - Log.i("shows","is null"); - shows = new ArrayList(); - } - Anime show = new Anime(); - show.setTitle(title); - EditText syn = (EditText) findViewById(R.id.synonyms); - show.setSynonyms(String.valueOf(syn.getText())); - shows.add(show); - write(shows); + write(); break; } } + public void read() { + List shows; + customNames customList = new customNames(); + + TextView customNamesList = (TextView) findViewById(R.id.list_custom_names); + customNamesList.setText("No custom titles set"); + + shows = customList.getCustomList(getApplicationContext()); + String out; + Log.i("list size", "lel"); + boolean found = false; + if (shows != null) { + for (int i = 0; i < shows.size() && found != true; i++) { + if (intentShow.getTitle().equalsIgnoreCase(shows.get(i).getTitle())) { + out = shows.get(i).getCustom_synonyms(); + found = true; + customNamesList.setText(out); + EditText editor = (EditText) findViewById(R.id.synonyms); + editor.setText(out); + } + } + } + + } + + public void write() { + List shows; + customNames customList = new customNames(); + + shows = customList.getCustomList(getApplicationContext()); + if (shows == null) { + Log.i("shows", "is null"); + shows = new ArrayList<>(); + } + Anime show = new Anime(); + show.copy(intentShow); + EditText syn = (EditText) findViewById(R.id.synonyms); + + for (int i = 0; i < shows.size(); i++) { + if (intentShow.getTitle().equalsIgnoreCase(shows.get(i).getTitle())) { + shows.remove(i); + } + } + + show.setCustom_synonyms(String.valueOf(syn.getText())); + shows.add(show); + customList.write(shows, getApplicationContext()); + read(); + } + @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) - { + switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; @@ -154,39 +181,5 @@ public boolean onOptionsItemSelected(MenuItem item) { } - public void write (List shows) - { - try - { - FileOutputStream fos = getApplicationContext().openFileOutput("custom-names.dat", Context.MODE_PRIVATE); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(shows); - oos.close(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public List getCustomList () - { - List customList; - try - { - FileInputStream fis = openFileInput("custom-names.dat"); - ObjectInputStream ois = new ObjectInputStream(fis); - customList = (List) ois.readObject(); - ois.close(); - } - catch (Exception e) - { - customList = null; - e.printStackTrace(); - } - Log.i("reader", "done"); - return customList; - - } } diff --git a/app/src/main/java/ca/currybox/yaya/XMLParser.java b/app/src/main/java/ca/currybox/yaya/XMLParser.java index 1a10b97..8d54b64 100644 --- a/app/src/main/java/ca/currybox/yaya/XMLParser.java +++ b/app/src/main/java/ca/currybox/yaya/XMLParser.java @@ -3,7 +3,6 @@ import android.content.Context; import android.util.Log; -import android.widget.Toast; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -34,6 +33,17 @@ public class XMLParser { String xml = null; + private static void save(String filename, String data, Context ctx) { + FileOutputStream outputStream; + try { + outputStream = ctx.openFileOutput(filename, Context.MODE_PRIVATE); + outputStream.write(data.getBytes()); + outputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + public void getXmlFromUrl(String url) { @@ -64,7 +74,7 @@ public void write(String filename, Context ctx) { } public String read(String filename, Context ctx) { - return readfile(filename, ctx); + return readfile(filename, ctx); } public Document getDomElement(String xml) { @@ -111,17 +121,6 @@ public final String getElementValue(Node elem) { return ""; } - private static void save(String filename, String data, Context ctx) { - FileOutputStream outputStream; - try { - outputStream = ctx.openFileOutput(filename, Context.MODE_PRIVATE); - outputStream.write(data.getBytes()); - outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - private String readfile(String filename, Context ctx) { StringBuffer datax = new StringBuffer(""); try { diff --git a/app/src/main/java/ca/currybox/yaya/animeListView.java b/app/src/main/java/ca/currybox/yaya/animeListView.java index 52bacda..5951a26 100644 --- a/app/src/main/java/ca/currybox/yaya/animeListView.java +++ b/app/src/main/java/ca/currybox/yaya/animeListView.java @@ -11,7 +11,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ListView; -import android.widget.TextView; import org.w3c.dom.Document; @@ -24,10 +23,10 @@ public class animeListView extends Fragment { - private List animeList = null; ListView listview; ListViewAdapter adapter; SwipeRefreshLayout swipeRefreshLayout; + private List animeList = null; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.anime_list, container, false); @@ -64,6 +63,18 @@ public void onRefresh() { return view; } + public void updateListView() { + listview = (ListView) getActivity().findViewById(R.id.shows); + + + adapter = new ListViewAdapter(getActivity(), animeList); + + listview.setAdapter(adapter); + + adapter.filter(1); //type 1 is currently watching + adapter.sortByUpdated(); //sorts the list by last updated + } + private class PopulateList extends AsyncTask { protected Void doInBackground(Void... params) { @@ -78,16 +89,8 @@ protected Void doInBackground(Void... params) { @Override protected void onPostExecute(Void result) { - listview = (ListView) getActivity().findViewById(R.id.shows); - - - adapter = new ListViewAdapter(getActivity(), animeList); - - listview.setAdapter(adapter); - - adapter.filter(1); //type 1 is currently watching - adapter.sortByUpdated(); //sorts the list by last updated + updateListView(); swipeRefreshLayout.setRefreshing(false); @@ -96,7 +99,6 @@ protected void onPostExecute(Void result) { } - private class DownloadUser extends AsyncTask { protected Void doInBackground(String... urls) { diff --git a/app/src/main/java/ca/currybox/yaya/customNames.java b/app/src/main/java/ca/currybox/yaya/customNames.java new file mode 100644 index 0000000..583b116 --- /dev/null +++ b/app/src/main/java/ca/currybox/yaya/customNames.java @@ -0,0 +1,46 @@ +package ca.currybox.yaya; + +import android.content.Context; +import android.util.Log; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; + +/** + * Created by Kanchana on 1/25/2015. + */ +public class customNames { + + public void write(List shows, Context ctx) { + try { + FileOutputStream fos = ctx.openFileOutput("custom-names.dat", Context.MODE_PRIVATE); + ObjectOutputStream oos = new ObjectOutputStream(fos); + oos.writeObject(shows); + oos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public List getCustomList(Context ctx) { + List customList; + try { + FileInputStream fis = ctx.openFileInput("custom-names.dat"); + ObjectInputStream ois = new ObjectInputStream(fis); + customList = (List) ois.readObject(); + ois.close(); + } catch (Exception e) { + customList = null; + e.printStackTrace(); + } + Log.i("reader", "done"); + if (customList == null) { + //customList = + } + return customList; + + } +} diff --git a/app/src/main/java/ca/currybox/yaya/main.java b/app/src/main/java/ca/currybox/yaya/main.java index c1bb399..3e85154 100644 --- a/app/src/main/java/ca/currybox/yaya/main.java +++ b/app/src/main/java/ca/currybox/yaya/main.java @@ -3,30 +3,17 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.os.AsyncTask; import android.os.Bundle; -import android.preference.PreferenceManager; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.Menu; import android.view.MenuItem; -import android.view.View; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -import org.w3c.dom.Document; - -import java.io.File; -import java.util.List; public class main extends ActionBarActivity { - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -54,17 +41,14 @@ protected void onCreate(Bundle savedInstanceState) { * otherwise launch the main app view */ - if (i.getAction() == "android.intent.action.VIEW") - { + if (i.getAction() == "android.intent.action.VIEW") { Bundle bundle = new Bundle(); bundle.putString("uri", i.getDataString()); playMatch play = new playMatch(); play.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.body, play).commit(); - } - else - { + } else { getSupportFragmentManager().beginTransaction().replace(R.id.body, new mainFragment()).commit(); } @@ -95,6 +79,4 @@ public boolean onOptionsItemSelected(MenuItem item) { } - - } diff --git a/app/src/main/java/ca/currybox/yaya/mainFragment.java b/app/src/main/java/ca/currybox/yaya/mainFragment.java index 621dc67..b24bcdc 100644 --- a/app/src/main/java/ca/currybox/yaya/mainFragment.java +++ b/app/src/main/java/ca/currybox/yaya/mainFragment.java @@ -1,39 +1,24 @@ package ca.currybox.yaya; -import android.app.FragmentManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.os.AsyncTask; import android.os.Bundle; -import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -import org.w3c.dom.Document; import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStreamWriter; -import java.util.List; /** * Created by Kanchana on 12/19/2014. */ -public class mainFragment extends Fragment{ - +public class mainFragment extends Fragment { - - public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) - { + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.main_layout, container, false); super.getFragmentManager().beginTransaction().replace(R.id.main_list, new animeListView()).commit(); @@ -45,9 +30,7 @@ public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle s File file = new File(getActivity().getApplicationContext().getFilesDir(), "custom-names.dat"); try { file.createNewFile(); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); } Intent intent = new Intent(super.getActivity(), SettingsActivity.class); //intent for the default drop-down menu Settings button diff --git a/app/src/main/java/ca/currybox/yaya/playMatch.java b/app/src/main/java/ca/currybox/yaya/playMatch.java index 06a0c08..bfd43d6 100644 --- a/app/src/main/java/ca/currybox/yaya/playMatch.java +++ b/app/src/main/java/ca/currybox/yaya/playMatch.java @@ -20,9 +20,7 @@ import android.view.ViewGroup; import android.view.animation.AnimationUtils; import android.widget.Button; -import android.widget.RelativeLayout; import android.widget.TextView; -import android.widget.Toast; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -46,6 +44,7 @@ public class playMatch extends Fragment implements View.OnClickListener { private Anime show; private String uri; + private View view; public playMatch() { @@ -53,7 +52,7 @@ public playMatch() { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.play_match, container, false); + view = inflater.inflate(R.layout.play_match, container, false); /** * Following block is required for onclick handlers for buttons and such @@ -75,6 +74,16 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa } + return view; + } + + @Override + public void onResume() { + super.onResume(); + parseInfo(); + } + + public void parseInfo() { uri = getArguments().getString("uri"); TextView filename = (TextView) view.findViewById(R.id.filename); //id of the textview used to show the cleaned up filename @@ -115,7 +124,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa String xml = parser.read("user.xml", super.getActivity()); Document doc = parser.getDomElement(xml); List animeList = new animeList().getList(doc); //reads the user xml file into memory - title = title.replaceAll("[^!~'A-z]", ""); //gets rid of whitespaces and special characters that are not !, ~, or ' + title = title.replaceAll("[^!~'A-z0-9]", ""); //gets rid of whitespaces and special characters that are not !, ~, or ' Log.i("Detected title", title); Button updateButton = (Button) view.findViewById(R.id.update_button); @@ -124,7 +133,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa boolean found = false; for (int i = 0; i < animeList.size() && !found; i++) { String[] synonyms = animeList.get(i).getSynonyms().split(";"); - String listTitle = animeList.get(i).getTitle().replaceAll("[^!~'A-z]", ""); + String listTitle = animeList.get(i).getTitle().replaceAll("[^!~'A-z0-9]", ""); if (title.equalsIgnoreCase(listTitle)) { show = animeList.get(i); TextView match = (TextView) view.findViewById(R.id.match_title); @@ -143,7 +152,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa found = true; } else { for (String synonym : synonyms) { - synonym = synonym.replaceAll("[^!~'A-z]", ""); + synonym = synonym.replaceAll("[^!~'A-z0-9]", ""); if (title.equalsIgnoreCase(synonym)) { show = animeList.get(i); TextView match = (TextView) view.findViewById(R.id.match_title); @@ -167,15 +176,48 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa } if (!found) { - RelativeLayout custom_name_layout = (RelativeLayout) view.findViewById(R.id.custom_naming_container); - //custom_name_layout.setVisibility(View.VISIBLE); - super.getFragmentManager().beginTransaction().replace(R.id.custom_holder, new animeListView()).commit(); - } + customNames customList = new customNames(); + List customTitles = customList.getCustomList(view.getContext()); + if (customTitles != null) { + for (int i = 0; i < customTitles.size(); i++) { + String[] synonyms = customTitles.get(i).getCustom_synonyms().replaceAll("[^!~;'A-z0-9]", "").split(";"); + for (String synonym : synonyms) { + if (title.equalsIgnoreCase(synonym)) { + String tempTitle = customTitles.get(i).getTitle(); + boolean found1 = false; + for (int j = 0; j < animeList.size() && found1 != true; j++) { + if (tempTitle.equalsIgnoreCase(animeList.get(j).getTitle())) { + show = animeList.get(j); + found1 = true; + } + } + + + TextView match = (TextView) view.findViewById(R.id.match_title); + match.setText("Match found: " + show.getTitle()); + updateButton.setEnabled(true); + + ((ActionBarActivity) getActivity()).getSupportActionBar().setTitle(show.getTitle()); + + TextView mal_ep = (TextView) view.findViewById(R.id.mal_last_ep); + mal_ep.setText(String.valueOf(show.getWatched())); + + TextView mal_updated = (TextView) view.findViewById(R.id.mal_last_update); + String date = new SimpleDateFormat("MMM dd yyyy 'at' KK:mm:ss a").format(new Date(show.getUpdated() * 1000L)); + mal_updated.setText(date); + + found = true; + } + } + } + } - return view; - } + + } + super.getFragmentManager().beginTransaction().replace(R.id.custom_holder, new animeListView()).commit(); + } @Override @@ -188,6 +230,7 @@ public void onClick(View V) { switch (V.getId()) { case R.id.update_button: update(); + break; case R.id.play_button: playFile(); diff --git a/app/src/main/res/layout/singleitemview.xml b/app/src/main/res/layout/singleitemview.xml index c25dc37..05a0b9b 100644 --- a/app/src/main/res/layout/singleitemview.xml +++ b/app/src/main/res/layout/singleitemview.xml @@ -86,38 +86,46 @@ android:layout_below="@id/status_label"/> + android:id="@+id/list_custom_names"/>