Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added some features, Flurry, and stuff

  • Loading branch information...
commit 58e3076ff041fc3240b0819f64ed492d413054ef 1 parent 50d3385
Ryan Thomas authored
9 AndroidManifest.xml
@@ -2,8 +2,8 @@
2 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3 package="net.neonlotus.lolandroidapp"
4 4 android:installLocation="auto"
5   - android:versionCode="3"
6   - android:versionName="1.06">
  5 + android:versionCode="4"
  6 + android:versionName="1.11">
7 7 <!-- New champ = .01 New feature = .05 New huge = .1-->
8 8 <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7"/>
9 9
@@ -20,8 +20,9 @@
20 20 <activity android:name=".Lore"></activity>
21 21 <activity android:name=".Info"></activity>
22 22 <activity android:name=".Champion"></activity>
  23 + <activity android:name=".Ding"></activity>
23 24 </application>
24   -<!--
  25 +
25 26 <uses-permission android:name="android.permission.INTERNET" />
26   --->
  27 +
27 28 </manifest>
27 League Lore.iml
@@ -50,6 +50,33 @@
50 50 <SOURCES />
51 51 </library>
52 52 </orderEntry>
  53 + <orderEntry type="module-library">
  54 + <library>
  55 + <CLASSES>
  56 + <root url="jar://$MODULE_DIR$/libs/FlurryAgent.jar!/" />
  57 + </CLASSES>
  58 + <JAVADOC />
  59 + <SOURCES />
  60 + </library>
  61 + </orderEntry>
  62 + <orderEntry type="module-library">
  63 + <library>
  64 + <CLASSES>
  65 + <root url="jar://$MODULE_DIR$/libs/CWAC-MergeAdapter.jar!/" />
  66 + </CLASSES>
  67 + <JAVADOC />
  68 + <SOURCES />
  69 + </library>
  70 + </orderEntry>
  71 + <orderEntry type="module-library">
  72 + <library>
  73 + <CLASSES>
  74 + <root url="jar://$MODULE_DIR$/libs/CWAC-SackOfViewsAdapter.jar!/" />
  75 + </CLASSES>
  76 + <JAVADOC />
  77 + <SOURCES />
  78 + </library>
  79 + </orderEntry>
53 80 </component>
54 81 </module>
55 82
BIN  libs/CWAC-MergeAdapter.jar
Binary file not shown
BIN  libs/CWAC-SackOfViewsAdapter.jar
Binary file not shown
BIN  libs/FlurryAgent.jar
Binary file not shown
BIN  res/drawable-hdpi/ali.png
BIN  res/drawable-hdpi/fiddle.png
BIN  res/drawable-hdpi/galio.png
BIN  res/drawable-hdpi/lux.png
BIN  res/drawable-hdpi/malz.png
2  res/values/strings.xml
@@ -2974,4 +2974,6 @@
2974 2974 <item>@drawable/zil_ban</item>
2975 2975 </array>
2976 2976
  2977 + <string name="expandable_list_sample_action">wat</string>
  2978 +
2977 2979 </resources>
21 src/net/neonlotus/lolandroidapp/Champion.java
@@ -13,6 +13,9 @@
13 13 import android.os.Parcelable;
14 14 import android.support.v4.view.PagerAdapter;
15 15 import android.support.v4.view.ViewPager;
  16 +import android.text.Html;
  17 +import android.text.method.LinkMovementMethod;
  18 +import android.text.util.Linkify;
16 19 import android.util.Log;
17 20 import android.view.LayoutInflater;
18 21 import android.view.View;
@@ -20,9 +23,12 @@
20 23 import android.widget.ImageView;
21 24 import android.widget.TextView;
22 25 import android.widget.Toast;
  26 +import com.flurry.android.FlurryAgent;
23 27 import com.viewpagerindicator.TitlePageIndicator;
24 28 import com.viewpagerindicator.TitleProvider;
25 29
  30 +import java.util.regex.Pattern;
  31 +
26 32 public class Champion extends Activity implements View.OnClickListener {
27 33
28 34 private ChampObj mChampData;
@@ -43,6 +49,10 @@
43 49 @Override
44 50 public void onCreate(Bundle savedInstanceState) {
45 51 super.onCreate(savedInstanceState);
  52 +
  53 + //Flurry
  54 + FlurryAgent.onStartSession(this, " ");
  55 +
46 56 setContentView(R.layout.othermain);
47 57
48 58 Bundle b = getIntent().getExtras();
@@ -237,7 +247,9 @@ public void onClick(View view) {
237 247 });
238 248 ((Button) view.findViewById(R.id.itemButton12)).setOnClickListener(new View.OnClickListener() {
239 249 public void onClick(View view) {
240   - showOptionsMenu(11);
  250 + // **DOING TESTS** showOptionsMenu(11);
  251 + Intent fish=new Intent(Champion.this, Ding.class);
  252 + startActivity(fish);
241 253 }
242 254 });
243 255 ((Button) view.findViewById(R.id.emailButton)).setOnClickListener(new View.OnClickListener() {
@@ -419,4 +431,11 @@ private void LoadPreferences() {
419 431 String s12 = mPrefs.getString(mPrefPrefix + "item12", "Item 12");
420 432 b12.setText(s12);
421 433 }
  434 +
  435 + public void onStop()
  436 + {
  437 + super.onStop();
  438 + FlurryAgent.onEndSession(this);
  439 + // your code
  440 + }
422 441 }
134 src/net/neonlotus/lolandroidapp/Ding.java
... ... @@ -0,0 +1,134 @@
  1 +package net.neonlotus.lolandroidapp;
  2 +
  3 +
  4 +import android.app.ExpandableListActivity;
  5 +import android.os.Bundle;
  6 +import android.view.*;
  7 +import android.widget.*;
  8 +
  9 +public class Ding extends ExpandableListActivity {
  10 +
  11 + ExpandableListAdapter mAdapter;
  12 +
  13 + @Override
  14 + public void onCreate(Bundle savedInstanceState) {
  15 + super.onCreate(savedInstanceState);
  16 +
  17 + // Set up our adapter
  18 + mAdapter = new MyExpandableListAdapter();
  19 + setListAdapter(mAdapter);
  20 + registerForContextMenu(getExpandableListView());
  21 +
  22 +
  23 + }
  24 +
  25 + @Override
  26 + public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
  27 + menu.setHeaderTitle("Sample menu");
  28 + menu.add(0, 0, 0, R.string.expandable_list_sample_action);
  29 + }
  30 +
  31 + @Override
  32 + public boolean onContextItemSelected(MenuItem item) {
  33 + ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) item.getMenuInfo();
  34 +
  35 + String title = ((TextView) info.targetView).getText().toString();
  36 +
  37 + int type = ExpandableListView.getPackedPositionType(info.packedPosition);
  38 + if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
  39 + int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);
  40 + int childPos = ExpandableListView.getPackedPositionChild(info.packedPosition);
  41 + Toast.makeText(this, title + ": Child " + childPos + " clicked in group " + groupPos,
  42 + Toast.LENGTH_SHORT).show();
  43 + //Selecting a child item (group is down there)
  44 + //Champion.derp
  45 + return true;
  46 + } else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
  47 + int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);
  48 + Toast.makeText(this, title + ": Group " + groupPos + " clicked", Toast.LENGTH_SHORT).show();
  49 + return true;
  50 + }
  51 +
  52 + return false;
  53 + }
  54 +
  55 + /**
  56 + * A simple adapter which maintains an ArrayList of photo resource Ids.
  57 + * Each photo is displayed as an image. This adapter supports clearing the
  58 + * list of photos and adding a new photo.
  59 + *
  60 + */
  61 +
  62 +
  63 + public class MyExpandableListAdapter extends BaseExpandableListAdapter {
  64 + // Sample data set. children[i] contains the children (String[]) for groups[i].
  65 + private String[] groups = { "People Names", "Dog Names", "Cat Names", "Fish Names" };
  66 + private String[][] children = {
  67 + { "Arnold", "Barry", "Chuck", "David" },
  68 + { "Ace", "Bandit", "Cha-Cha", "Deuce" },
  69 + { "Fluffy", "Snuggles" },
  70 + { "Goldy", "Bubbles" }
  71 + };
  72 +
  73 + public Object getChild(int groupPosition, int childPosition) {
  74 + return children[groupPosition][childPosition];
  75 + }
  76 +
  77 + public long getChildId(int groupPosition, int childPosition) {
  78 + return childPosition;
  79 + }
  80 +
  81 + public int getChildrenCount(int groupPosition) {
  82 + return children[groupPosition].length;
  83 + }
  84 +
  85 + public TextView getGenericView() {
  86 + // Layout parameters for the ExpandableListView
  87 + AbsListView.LayoutParams lp = new AbsListView.LayoutParams(
  88 + ViewGroup.LayoutParams.MATCH_PARENT, 64);
  89 +
  90 + TextView textView = new TextView(Ding.this);
  91 + textView.setLayoutParams(lp);
  92 + // Center the text vertically
  93 + textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
  94 + // Set the text starting position
  95 + textView.setPadding(36, 0, 0, 0);
  96 + return textView;
  97 + }
  98 +
  99 + public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
  100 + View convertView, ViewGroup parent) {
  101 + TextView textView = getGenericView();
  102 + textView.setText(getChild(groupPosition, childPosition).toString());
  103 + return textView;
  104 + }
  105 +
  106 + public Object getGroup(int groupPosition) {
  107 + return groups[groupPosition];
  108 + }
  109 +
  110 + public int getGroupCount() {
  111 + return groups.length;
  112 + }
  113 +
  114 + public long getGroupId(int groupPosition) {
  115 + return groupPosition;
  116 + }
  117 +
  118 + public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
  119 + ViewGroup parent) {
  120 + TextView textView = getGenericView();
  121 + textView.setText(getGroup(groupPosition).toString());
  122 + return textView;
  123 + }
  124 +
  125 + public boolean isChildSelectable(int groupPosition, int childPosition) {
  126 + return true;
  127 + }
  128 +
  129 + public boolean hasStableIds() {
  130 + return true;
  131 + }
  132 +
  133 + }
  134 +}
11 src/net/neonlotus/lolandroidapp/Info.java
@@ -9,6 +9,7 @@
9 9 import android.view.View;
10 10 import android.view.ViewGroup;
11 11 import android.widget.*;
  12 +import com.flurry.android.FlurryAgent;
12 13
13 14 /**
14 15 * Created by IntelliJ IDEA.
@@ -25,6 +26,9 @@
25 26 public void onCreate(Bundle savedInstanceState) {
26 27 super.onCreate(savedInstanceState);
27 28
  29 + //Flurry
  30 + FlurryAgent.onStartSession(this, " ");
  31 +
28 32 //===========================
29 33 //==== GRID VIEW TESTING ====
30 34 setContentView(R.layout.champ_grid);
@@ -132,4 +136,11 @@ public View getView(int position, View convertView, ViewGroup parent) {
132 136 R.drawable.yorik, R.drawable.zil
133 137 };
134 138 }
  139 +
  140 + public void onStop()
  141 + {
  142 + super.onStop();
  143 + FlurryAgent.onEndSession(this);
  144 + // your code
  145 + }
135 146 }
241 src/net/neonlotus/lolandroidapp/Lore.java
@@ -2,12 +2,15 @@
2 2
3 3 import android.app.AlertDialog;
4 4 import android.app.ListActivity;
  5 +import android.content.Intent;
  6 +import android.net.Uri;
5 7 import android.os.Bundle;
  8 +import android.util.Log;
  9 +import android.view.Gravity;
6 10 import android.view.View;
7   -import android.widget.AdapterView;
8   -import android.widget.ArrayAdapter;
9   -import android.widget.ListView;
10   -import android.widget.TextView;
  11 +import android.widget.*;
  12 +import com.commonsware.cwac.merge.MergeAdapter;
  13 +import com.flurry.android.FlurryAgent;
11 14
12 15 /**
13 16 * Created by IntelliJ IDEA.
@@ -18,36 +21,222 @@
18 21 */
19 22 public class Lore extends ListActivity {
20 23
  24 + private static final String[] LoreList = new String[]{
  25 + "Demacia", "Noxus", "The League of Legends"
  26 + };
  27 + private static final String[] JOJList = new String[]{
  28 + "Issue 01", "Issue 02","Issue 03","Issue 04","Issue 05","Issue 06","Issue 07","Issue 08","Issue 09",
  29 + "Issue 10","Issue 11","Issue 12","Issue 13","Issue 14","Issue 15","Issue 16","Issue 17","Issue 18",
  30 + "Issue 19","Issue 20","Issue 21","Issue 22","Issue 23","Issue 24","Issue 25","BREAKING NEWS!",
  31 + "Issue 26","Issue 27","Issue 28","Issue 29"
  32 + };
  33 +
  34 + private MergeAdapter adapter=null;
  35 + private ArrayAdapter<String> arrayAdapter=null;
  36 +
  37 +
21 38 @Override
22 39 public void onCreate(Bundle savedInstanceState) {
23 40 super.onCreate(savedInstanceState);
24 41
25   - setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, LoreList));
26   -
27   - ListView lv = getListView();
28   - lv.setTextFilterEnabled(true);
  42 + //Flurry
  43 + FlurryAgent.onStartSession(this, " ");
29 44
30   - lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
31   - public void onItemClick(AdapterView<?> parent, View view,
32   - int position, long id) {
33   - AlertDialog.Builder builder = new AlertDialog.Builder(Lore.this);
  45 + //Merge Adapter thing...
  46 + adapter=new MergeAdapter();
  47 + adapter.addView(buildTop());
  48 + arrayAdapter=buildFirstList();
  49 + adapter.addAdapter(arrayAdapter);
  50 + adapter.addView(buildLabel());
  51 + adapter.addAdapter(buildSecondList());
34 52
35   - builder.setTitle(((TextView) view).getText());
36   - if (((TextView) view).getText().equals("Demacia")) {
37   - builder.setMessage(R.string.dem_story);
38   - } else if (((TextView) view).getText().equals("Noxus")) {
39   - builder.setMessage(R.string.noxus_story);
40   - } else if (((TextView) view).getText().equals("The League of Legends")) {
41   - builder.setMessage(R.string.league_story);
42   - }
  53 + setListAdapter(adapter);
  54 + }
43 55
44   - final AlertDialog alert = builder.create();
  56 + @Override
  57 + public void onListItemClick(ListView parent, View v, int position,long id) {
  58 + //Log.d("MergeAdapterDemo", String.valueOf(position));
  59 + AlertDialog.Builder builder = new AlertDialog.Builder(Lore.this);
  60 + String urlPartOne="http://leagueoflegends.wikia.com/wiki/The_Journal_of_Justice:_Volume_1,_Issue_";
  61 + Intent intent = new Intent();
  62 + final AlertDialog alert;
  63 +
  64 + switch (position) {
  65 + case 1:
  66 + builder.setTitle("Demacia");
  67 + builder.setMessage(R.string.dem_story);
  68 + alert=builder.create();
  69 + alert.show();
  70 + break;
  71 + case 2:
  72 + builder.setTitle("Noxus");
  73 + builder.setMessage(R.string.noxus_story);
  74 + alert=builder.create();
45 75 alert.show();
46   - }
47   - });
  76 + break;
  77 + case 3:
  78 + builder.setTitle("The League of Legends");
  79 + builder.setMessage(R.string.league_story);
  80 + alert=builder.create();
  81 + alert.show();
  82 + break;
  83 + case 5: //Episode 1
  84 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  85 + startActivity(intent);
  86 + break;
  87 + case 6:
  88 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  89 + startActivity(intent);
  90 + break;
  91 + case 7:
  92 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  93 + startActivity(intent);
  94 + break;
  95 + case 8:
  96 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  97 + startActivity(intent);
  98 + break;
  99 + case 9: //Episode 5
  100 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  101 + startActivity(intent);
  102 + break;
  103 + case 10:
  104 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  105 + startActivity(intent);
  106 + break;
  107 + case 11:
  108 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  109 + startActivity(intent);
  110 + break;
  111 + case 12:
  112 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  113 + startActivity(intent);
  114 + break;
  115 + case 13:
  116 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  117 + startActivity(intent);
  118 + break;
  119 + case 14: //Episode 10
  120 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  121 + startActivity(intent);
  122 + break;
  123 + case 15:
  124 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  125 + startActivity(intent);
  126 + break;
  127 + case 16:
  128 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  129 + startActivity(intent);
  130 + break;
  131 + case 17:
  132 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  133 + startActivity(intent);
  134 + break;
  135 + case 18:
  136 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  137 + startActivity(intent);
  138 + break;
  139 + case 19: //Episode 15
  140 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  141 + startActivity(intent);
  142 + break;
  143 + case 20:
  144 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  145 + startActivity(intent);
  146 + break;
  147 + case 21:
  148 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  149 + startActivity(intent);
  150 + break;
  151 + case 22:
  152 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  153 + startActivity(intent);
  154 + break;
  155 + case 23:
  156 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  157 + startActivity(intent);
  158 + break;
  159 + case 24: //Episode 20
  160 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  161 + startActivity(intent);
  162 + break;
  163 + case 25:
  164 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  165 + startActivity(intent);
  166 + break;
  167 + case 26:
  168 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  169 + startActivity(intent);
  170 + break;
  171 + case 27:
  172 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  173 + startActivity(intent);
  174 + break;
  175 + case 28:
  176 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  177 + startActivity(intent);
  178 + break;
  179 + case 29: //Episode 25
  180 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-4)));
  181 + startActivity(intent);
  182 + break;
  183 + case 30: //Breaking news
  184 + intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://leagueoflegends.wikia.com/wiki/The_Journal_of_Justice:_BREAKING_NEWS_01"));
  185 + startActivity(intent);
  186 + break;
  187 + case 31:
  188 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-5)));
  189 + startActivity(intent);
  190 + break;
  191 + case 32:
  192 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-5)));
  193 + startActivity(intent);
  194 + break;
  195 + case 33:
  196 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-5)));
  197 + startActivity(intent);
  198 + break;
  199 + case 34:
  200 + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlPartOne+(position-5)));
  201 + startActivity(intent);
  202 + break;
  203 +
  204 + }
  205 + }
  206 +
  207 + //Merge Adapter First List
  208 + private ArrayAdapter<String> buildFirstList() {
  209 + return(new ArrayAdapter<String>(this,R.layout.list_item,LoreList));
  210 + }
  211 + //Merge Adapter Second List
  212 + private ArrayAdapter<String> buildSecondList() {
  213 + return (new ArrayAdapter<String>(this,R.layout.list_item,JOJList));
48 214 }
49 215
50   - static final String[] LoreList = new String[]{
51   - "Demacia", "Noxus", "The League of Legends"
52   - };
  216 + //Merge thing label JOJ
  217 + private View buildLabel() {
  218 + TextView result=new TextView(this);
  219 + result.setText("Journals of Justice, Volume 1");
  220 + result.setTextSize(30);
  221 + result.setWidth(LinearLayout.LayoutParams.FILL_PARENT);
  222 + result.setGravity(Gravity.CENTER_HORIZONTAL);
  223 + result.setPadding(0,10,0,0);
  224 + return(result);
  225 + }
  226 + //Merge label top section
  227 + private View buildTop() {
  228 + TextView res2 = new TextView(this);
  229 + res2.setText("Game Lore");
  230 + res2.setTextSize(30);
  231 + res2.setWidth(LinearLayout.LayoutParams.FILL_PARENT);
  232 + res2.setGravity(Gravity.CENTER_HORIZONTAL);
  233 + return(res2);
  234 + }
  235 +
  236 + public void onStop()
  237 + {
  238 + super.onStop();
  239 + FlurryAgent.onEndSession(this);
  240 + // your code
  241 + }
53 242 }
12 src/net/neonlotus/lolandroidapp/Main.java
@@ -6,11 +6,16 @@
6 6 import android.content.res.Resources;
7 7 import android.os.Bundle;
8 8 import android.widget.TabHost;
  9 +import com.flurry.android.FlurryAgent;
9 10
10 11 public class Main extends TabActivity {
11 12 @Override
12 13 public void onCreate(Bundle savedInstanceState) {
13 14 super.onCreate(savedInstanceState);
  15 +
  16 + //Flurry
  17 + FlurryAgent.onStartSession(this, " ");
  18 +
14 19 setContentView(R.layout.main);
15 20
16 21 Resources res = getResources(); // Resource object to get Drawables
@@ -32,4 +37,11 @@ public void onCreate(Bundle savedInstanceState) {
32 37 .setContent(intent);
33 38 tabHost.addTab(spec);
34 39 }
  40 +
  41 + public void onStop()
  42 + {
  43 + super.onStop();
  44 + FlurryAgent.onEndSession(this);
  45 + // your code
  46 + }
35 47 }

0 comments on commit 58e3076

Please sign in to comment.
Something went wrong with that request. Please try again.