From 95a7a4869fb3af44a5f0923fd08e9b6286e5b2fd Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Wed, 2 May 2012 11:00:28 -0400 Subject: [PATCH] Removed Exception Report Viewer Signed-off-by: Ricky Barrette --- ExceptionReportViewer/.classpath | 9 - ExceptionReportViewer/.gitignore | 2 - ExceptionReportViewer/.project | 33 - ExceptionReportViewer/AndroidManifest.xml | 33 - .../assets/exceptionhandler.properties | 22 - ExceptionReportViewer/lint.xml | 3 - ExceptionReportViewer/proguard.cfg | 40 -- ExceptionReportViewer/project.properties | 12 - .../res/drawable-hdpi/ic_launcher.png | Bin 4570 -> 0 bytes .../res/drawable-ldpi/ic_launcher.png | Bin 1932 -> 0 bytes .../res/drawable-mdpi/ic_launcher.png | Bin 2791 -> 0 bytes .../res/drawable-xhdpi/ic_launcher.png | Bin 6529 -> 0 bytes .../res/layout/list_item.xml | 52 -- ExceptionReportViewer/res/layout/main.xml | 20 - ExceptionReportViewer/res/values/array.xml | 9 - ExceptionReportViewer/res/values/attrs.xml | 43 -- ExceptionReportViewer/res/values/defaults.xml | 41 -- ExceptionReportViewer/res/values/strings.xml | 8 - ExceptionReportViewer/res/values/styles.xml | 62 -- .../ExceptionReportViewer/JSONLoader.java | 153 ----- .../android/ExceptionReportViewer/Main.java | 61 -- .../ExceptionReportViewer/ReportAdapter.java | 155 ----- .../ReportListFragment.java | 111 --- .../viewpagerindicator/FragmentAdapter.java | 45 -- .../viewpagerindicator/PageIndicator.java | 58 -- .../TitlePageIndicator.java | 640 ------------------ .../viewpagerindicator/TitleProvider.java | 36 - .../TitledFragmentAdapter.java | 46 -- 28 files changed, 1694 deletions(-) delete mode 100644 ExceptionReportViewer/.classpath delete mode 100644 ExceptionReportViewer/.gitignore delete mode 100644 ExceptionReportViewer/.project delete mode 100644 ExceptionReportViewer/AndroidManifest.xml delete mode 100644 ExceptionReportViewer/assets/exceptionhandler.properties delete mode 100644 ExceptionReportViewer/lint.xml delete mode 100644 ExceptionReportViewer/proguard.cfg delete mode 100644 ExceptionReportViewer/project.properties delete mode 100644 ExceptionReportViewer/res/drawable-hdpi/ic_launcher.png delete mode 100644 ExceptionReportViewer/res/drawable-ldpi/ic_launcher.png delete mode 100644 ExceptionReportViewer/res/drawable-mdpi/ic_launcher.png delete mode 100644 ExceptionReportViewer/res/drawable-xhdpi/ic_launcher.png delete mode 100644 ExceptionReportViewer/res/layout/list_item.xml delete mode 100644 ExceptionReportViewer/res/layout/main.xml delete mode 100644 ExceptionReportViewer/res/values/array.xml delete mode 100644 ExceptionReportViewer/res/values/attrs.xml delete mode 100644 ExceptionReportViewer/res/values/defaults.xml delete mode 100644 ExceptionReportViewer/res/values/strings.xml delete mode 100644 ExceptionReportViewer/res/values/styles.xml delete mode 100644 ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/JSONLoader.java delete mode 100644 ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/Main.java delete mode 100644 ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportAdapter.java delete mode 100644 ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportListFragment.java delete mode 100644 ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/FragmentAdapter.java delete mode 100644 ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/PageIndicator.java delete mode 100644 ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitlePageIndicator.java delete mode 100644 ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitleProvider.java delete mode 100644 ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitledFragmentAdapter.java diff --git a/ExceptionReportViewer/.classpath b/ExceptionReportViewer/.classpath deleted file mode 100644 index 6cdaec2..0000000 --- a/ExceptionReportViewer/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ExceptionReportViewer/.gitignore b/ExceptionReportViewer/.gitignore deleted file mode 100644 index a02fbbe..0000000 --- a/ExceptionReportViewer/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/gen -/bin diff --git a/ExceptionReportViewer/.project b/ExceptionReportViewer/.project deleted file mode 100644 index 1c6635e..0000000 --- a/ExceptionReportViewer/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - ExceptionReportViewer - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/ExceptionReportViewer/AndroidManifest.xml b/ExceptionReportViewer/AndroidManifest.xml deleted file mode 100644 index 70881ab..0000000 --- a/ExceptionReportViewer/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExceptionReportViewer/assets/exceptionhandler.properties b/ExceptionReportViewer/assets/exceptionhandler.properties deleted file mode 100644 index 160b9d9..0000000 --- a/ExceptionReportViewer/assets/exceptionhandler.properties +++ /dev/null @@ -1,22 +0,0 @@ -# exceptionhandler.properties -# @author ricky barrette -# @author twenty codes - -# This file is used to tell the Exception Handler LIbrary how to file -# new exception reports -# HTTP ONLY -# -# Place this file in you project's assets folder and edit as needed -# -# server is the physical web address for your server -# file is the path to your filing script -# get is the path to your json retrieval script -# app is the redmine project name -# tracker is the redmine tracker -server = http://rickbarrette.dyndns.org:8080/redmine/exceptionhandler -app = test -tracker = Bug - -# uncomment the following if you want your application to use email to file reports. -# if this is uncommented, email will always be used. -#email = twentycodes@gmail.com \ No newline at end of file diff --git a/ExceptionReportViewer/lint.xml b/ExceptionReportViewer/lint.xml deleted file mode 100644 index ee0eead..0000000 --- a/ExceptionReportViewer/lint.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/ExceptionReportViewer/proguard.cfg b/ExceptionReportViewer/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/ExceptionReportViewer/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/ExceptionReportViewer/project.properties b/ExceptionReportViewer/project.properties deleted file mode 100644 index 5f64550..0000000 --- a/ExceptionReportViewer/project.properties +++ /dev/null @@ -1,12 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-9 -android.library.reference.1=../ExceptionHandlerLib diff --git a/ExceptionReportViewer/res/drawable-hdpi/ic_launcher.png b/ExceptionReportViewer/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 362f19fff5c57dc0ebc7d27fa56fcdbaa210bfa8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4570 zcmV<05hd=4P)K~#90&6|0U99MnEKks$-%VQ`sHMN%X{LBbKLVj!uC1B5_0Qe}dP%@CY20auV6ZX0BSY>+qd zrNg!)ywd90)gCk5@BQ*ezwYUoJ+!M`IsQ#e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|U?0q&n|zC2y|KO)S2Sc5u|y8r+H07*qoM6N<$ Ef{`TA{r~^~ diff --git a/ExceptionReportViewer/res/drawable-ldpi/ic_launcher.png b/ExceptionReportViewer/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 0f365f6166d882b9a50827a7655355f12f6dba1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1932 zcmV;72Xpv|P)=Z@00004b3#c}2nYxW zd;J9wt@YnaRF#Fu&abR{xUs42%XyRUGnG=i z7dGT=F-%=P9F3_C&iErg|I_zJ4lKl$TnqI6$NHXXDYZY@TJB!#d%3HgOI^%FVfcKd zF#5eiKREis>jJ&=;hUDPT($DGW!3fTL}UT?&&0Zv3oXar8U6Rz&esnNomnvGjxY6m za%s@>N-Lek1*2Ue6aH}doH@4r)gKSPc}>u5kFDF(mEZ99CcE_Nv0R```e&ly%6lLG z>+{D4=B}H$lkOeeK}Y_U*KPzLKufy3(Am87k2{_b|Ei!HHn$yYwJVx$1mLVJuHL$& zXm2}sMbHPnwQ~ESv7Vhb60i<@_KpW0`sUiY?K)`FO!xDF%y-h5d4afY322h0^6D4n zfo^+z&7Su1Evx4p3<64}5`{wHh5)yQt2(zme)A)B(8a~huNm>`2MUD(g+hTK2v{g% zT}wRU)7G%$DFDB_yF0k^-t~Qh4CYKgUK(if7So#RpxIjtDC6;e$w>iU3V4#k!^ab!3#ThA>MCM2 z#gdY`m{cPYjY(WJQ;mos^Ze96^4_9aKbSn^UNB|$JK4ks2zil-h{JVZT2JVZ15wQ-XX zWUU|wre-uxP6{XvONzl@#KY9W`o{hft`AI{dszKwQ%>7O&602Y4$~&ueFpj;&JdhgFLinGd-VbV>-RSOHT~ayQ7P(pYO#a zIU0fziB^eRg+vWj6P%_v9M)N0eePX4`igvd@6D{auf+bZo@CP#B?uG+)M#LwYN9xt zI^H=nfwM~Ix^_Z4gCpgG!{e;Dy&0{YV z#$j2#wZvzBvK+5Laq3VU>TH9rXzJAB#PY!#)0FZpf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A6*2)oxuv@P_qY_kk(jOaaU7cKK0PP@HCX(sI1 z5V8Hm2%A`rxyWMneWBaX+oPS3y+dTS0$2u0tPzd#lx3GUlQ)f6n)smd28Mu0<8+d! zoVyQH7WLdwQ?RPs*EUG5 zA)pVK>xxg&X{KnJ$eRXorpTtsS}Jxpory^{YsDZ^pYHVcSz5YGEn8K!J{)N>KH&Ff zn?`ahcxt`|wU`5VYQ6>n*8^!bWdR>%8QJC?l|7l(;xf(F>QW}QX_i*o(hLr>Y1Gv3 zyaG2?!6v`~^!D%&@Cr~5csoX*WgPJ+nx;t|Q6H@91NT1fe^cAK?j9Z(-!K7AQAM~K z2%~HePn8=Zv}GEcR>r^E9zv^Nx#UK4LfY>0b*8slUlzCm$dpTKUSLOwiSbSTkdrA~ z*}F(z+q-?zPe%{;=zRjeu_T0=x;4hH*x2NtNu2Z4cYC>Sg zs3aqdCjA6<^pJsx^5CwIxpx1@KjF)fAo8uZ_?aj-@+pFCpbwfq-Jb%Aa8qx$-ttK& zeWH&P)knJZW`y&A;ZN1=)HbGY(Nthl!d0!eTc04|1QqTD;)6mG5{2cCOXnj!`q0!D z9K;`U7xu~AB;h*X5+FDJ*nZqPB=D3dw>)&5u0N2z4j8U#-`^@ diff --git a/ExceptionReportViewer/res/drawable-xhdpi/ic_launcher.png b/ExceptionReportViewer/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index ebe985c52f33cff3e3b54a6786cd44f4e0c3f61f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6529 zcmV-{8Gh!8P)l2&FCzRtTpD58MqOE+G#PTJER%BT+{gDxQVluKL%C>Avq9j`) zNa7MG8*iDdtHqgKwb-eHd`IL}g0N*|IBY*NTGgZbhR+Ot@ASy2ukQXs z8Mva22Go@R?#6qTJQ2X*n?^6*rMf4&058^xWD#d(P8sL;Y)Jdj0BB-s?o=U^G%Z_VVE$pM2s+-`e;5 zrM%ZA18&1ROF!4Ur1R4=!UZc^^V2TLJtmTB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#;8MQP4T6u&7C^U#-y5Gae;7BGqFe@!<{WeEc6ZXY7i-8O4{J7-5Gv7Jyr#1I3 zEArz_0RuZjhV}_9v!T6DF>4LV?jooM($-*QRz08hKe(n;W&$zuBoq)JGYnf_d-o07)2Qccu5tf?dQ-O{YDB=@Rj zGQnA2FZLAU`qCNyDF6-NcgiI>*675!zL?|*;9mkWVh}GzN_$oLnDeTU9l(R2erxgVoZ-~@$dq`e<&r!F+yxwOR`v?Y84SxV8Z?+9 z-~h@cc>(iz^;f2<&MB1FF!t;lQ&r)V#zWuz zZrrJs0=GD?)zr8$O@KQH{0#=Izb%(8|F2(O5#VZN<4)BA+=u~j0Wf~xdAjER3~vBq nz_@)M1vZyUvg?X9*2@0}a0%Bda=eDA00000NkvXXu0mjfu@lXc diff --git a/ExceptionReportViewer/res/layout/list_item.xml b/ExceptionReportViewer/res/layout/list_item.xml deleted file mode 100644 index 89133a2..0000000 --- a/ExceptionReportViewer/res/layout/list_item.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/layout/main.xml b/ExceptionReportViewer/res/layout/main.xml deleted file mode 100644 index 6856db2..0000000 --- a/ExceptionReportViewer/res/layout/main.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/values/array.xml b/ExceptionReportViewer/res/values/array.xml deleted file mode 100644 index 17cae17..0000000 --- a/ExceptionReportViewer/res/values/array.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - Production - Testing - - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/values/attrs.xml b/ExceptionReportViewer/res/values/attrs.xml deleted file mode 100644 index 75afbe5..0000000 --- a/ExceptionReportViewer/res/values/attrs.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/values/defaults.xml b/ExceptionReportViewer/res/values/defaults.xml deleted file mode 100644 index 1493c40..0000000 --- a/ExceptionReportViewer/res/values/defaults.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 0dp - - #FFFFFFFF - - 1px - - 1 - - 7dp - 5dp - 10dp - - #FF99CC00 - - true - - #FFFFFFFF - - 18dp - 5dp - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/values/strings.xml b/ExceptionReportViewer/res/values/strings.xml deleted file mode 100644 index ccb9433..0000000 --- a/ExceptionReportViewer/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Hello World, Main! - ExceptionReportViewer - There was an error... - - \ No newline at end of file diff --git a/ExceptionReportViewer/res/values/styles.xml b/ExceptionReportViewer/res/values/styles.xml deleted file mode 100644 index 92d1f85..0000000 --- a/ExceptionReportViewer/res/values/styles.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/JSONLoader.java b/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/JSONLoader.java deleted file mode 100644 index a49f534..0000000 --- a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/JSONLoader.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * JSONLoader.java - * @date Dec 28, 2011 - * @author ricky barrette - * @author Twenty Codes, LLC - */ -package com.TwentyCodes.android.ExceptionReportViewer; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.json.JSONException; -import org.json.JSONObject; - -import android.content.Context; -import android.support.v4.app.LoaderManager; -import android.support.v4.app.LoaderManager.LoaderCallbacks; -import android.support.v4.content.Loader; - -/** - * This Loader will be used to download and parse a JSON object from the internet - * @author ricky barrette - */ -public class JSONLoader extends Loader { - - private LoaderCallbacks mListener; - private String mUrl; - private InputStream mContent; - - /** - * Creates an new JSONLoader - * @param url - * @param listener - * @param context - * @author ricky barrette - */ - public JSONLoader(String url, LoaderManager.LoaderCallbacks listener, Context context) { - super(context); - mListener = listener; - mUrl = url; - } - - /** - * (non-Javadoc) - * @see android.support.v4.content.Loader#onAbandon() - */ - @Override - protected void onAbandon() { - super.onAbandon(); - if(mContent != null) - try { - mContent.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * (non-Javadoc) - * @see android.support.v4.content.Loader#onForceLoad() - */ - @Override - protected void onForceLoad() { - // TODO Auto-generated method stub - super.onForceLoad(); - } - - /** - * (non-Javadoc) - * @see android.support.v4.content.Loader#onReset() - */ - @Override - protected void onReset() { - super.onReset(); - if(mContent != null) - try { - mContent.close(); - } catch (IOException e) { - e.printStackTrace(); - } - if(mListener != null) - mListener.onLoaderReset(this); - } - - /** - * (non-Javadoc) - * @see android.support.v4.content.Loader#onStartLoading() - */ - @Override - protected void onStartLoading() { - super.onStartLoading(); - if(mListener != null) - try { - mListener.onLoadFinished(this, new JSONObject(downloadJSON(mUrl))); - } catch (IllegalStateException e) { - mListener.onLoadFinished(this, null); - } catch (ClientProtocolException e) { - mListener.onLoadFinished(this, null); - } catch (JSONException e) { - mListener.onLoadFinished(this, null); - } catch (IOException e) { - mListener.onLoadFinished(this, null); - } catch (NullPointerException e) { - mListener.onLoadFinished(this, null); - } - - } - - /** - * (non-Javadoc) - * @see android.support.v4.content.Loader#onStopLoading() - */ - @Override - protected void onStopLoading() { - super.onStopLoading(); - if(mContent != null) - try { - mContent.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Downloads exception report JSON from the Internet - * @param url - * @return - * @throws IllegalStateException - * @throws ClientProtocolException - * @throws IOException - * @author ricky barrette - */ - private String downloadJSON(String url) throws IllegalStateException, ClientProtocolException, IOException { - if(url == null) - throw new NullPointerException(); - - StringBuffer response = new StringBuffer(); - mContent = new DefaultHttpClient().execute(new HttpGet(url)).getEntity().getContent(); - BufferedReader br = new BufferedReader(new InputStreamReader(mContent)); - String buff = null; - while ((buff = br.readLine()) != null){ - System.out.print(buff); - response.append(buff); - } - return response.toString(); - } - -} diff --git a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/Main.java b/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/Main.java deleted file mode 100644 index 0a10b62..0000000 --- a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/Main.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.TwentyCodes.android.ExceptionReportViewer; - -import java.util.ArrayList; - -import com.TwentyCodes.android.exception.ExceptionHandler; -import com.jakewharton.android.viewpagerindicator.TitlePageIndicator; -import com.jakewharton.android.viewpagerindicator.TitledFragmentAdapter; - -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.view.ViewPager; - -/** - * This is the main activity of this application. - * This application will be used to download and display the exception reports from a server. - * - * TODO Create settings activity and implement the following settings - * + production url - * + testing url - * + version preference - * - * TODO Create icons for titled view pager - * - * TODO Update ReportListFragment to a dynamically load 10 reports, and retrieve more when necessary. - * This will probably also entail server side changes - * - * @author ricky barrette - */ -public class Main extends FragmentActivity { - - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this)); - setContentView(R.layout.main); - - Integer.parseInt("poop"); - - ArrayList fragments = new ArrayList(); - fragments.add(new ReportListFragment("http://powers.doesntexist.com:666/?get=1")); - fragments.add(new ReportListFragment("http://powers.doesntexist.com:666/testing/?get=1")); - - //the icons for the pages go here - int[] icons = new int[]{ - //TODO create icons and update - android.R.drawable.stat_sys_warning, - android.R.drawable.stat_sys_warning - }; - - //display the pages - ViewPager pager = (ViewPager) findViewById(R.id.pager); - pager.setAdapter(new TitledFragmentAdapter(this.getSupportFragmentManager(), fragments, this.getResources().getStringArray(R.array.titles), icons)); - - //display the titles - TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator); - indicator.setViewPager(pager); - } -} \ No newline at end of file diff --git a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportAdapter.java b/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportAdapter.java deleted file mode 100644 index 780943e..0000000 --- a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportAdapter.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * ReportAdapter.java - * @date Dec 19, 2011 - * @author ricky barrette - * @author Twenty Codes, LLC - */ -package com.TwentyCodes.android.ExceptionReportViewer; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.content.Context; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -/** - * This adaptor will be used to populate a listview with report titles provided - * a JSONArray - * - * @author ricky barrette - */ -public class ReportAdapter extends BaseAdapter { - - private static final String TAG = "ReportAdapter"; - private JSONArray mReports; - private LayoutInflater mInflater; - - /** - * Creates a new ReportAdator - * - * @author ricky barrette - */ - public ReportAdapter(Context context, JSONArray reports) { - mReports = reports; - mInflater = LayoutInflater.from(context); - } - - /** - * returns the amount of reports in the reports JSONArray (non-Javadoc) - * - * @see android.widget.Adapter#getCount() - */ - @Override - public int getCount() { - return mReports.length(); - } - - /** - * returns the report at index - * - * @param index - * (non-Javadoc) - * @see android.widget.Adapter#getItem(int) - */ - @Override - public JSONObject getItem(int position) { - try { - return mReports.getJSONObject(position); - } catch (JSONException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - /** - * (non-Javadoc) - * - * @see android.widget.Adapter#getItemId(int) - */ - @Override - public long getItemId(int position) { - return position; - } - - /** - * this method will be used to populate the views (non-Javadoc) - * - * @see android.widget.Adapter#getView(int, android.view.View, - * android.view.ViewGroup) - */ - @Override - public View getView(int position, View convertView, ViewGroup parent) { - /* - * here we will only create new views when needed, and recycle old ones - * when provided - */ - Holder holder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.list_item, null); - holder = new Holder(); - holder.id = (TextView) convertView.findViewById(R.id.id); - holder.msg = (TextView) convertView.findViewById(R.id.msg); - holder.status = (TextView) convertView.findViewById(R.id.status); - holder.app = (TextView) convertView.findViewById(R.id.app); - - convertView.setTag(holder); - } else { - holder = (Holder) convertView.getTag(); - } - - /* - * here we will populate the views - */ - JSONObject report = null; - try { - report = getItem(position).getJSONObject("report"); - } catch (JSONException e1) { - e1.printStackTrace(); - } - - Log.d(TAG, report.toString()); - - try { - holder.id.setText(report.getString("id")); - } catch (JSONException e) { - holder.id.setText(e.getMessage()); - } - try { - holder.msg.setText(report.getString("msg")); - } catch (JSONException e) { - holder.msg.setText(e.getMessage()); - } - try { - holder.status.setText(report.getString("status")); - } catch (JSONException e) { - holder.status.setText(e.getMessage()); - } - try { - holder.app.setText(report.getString("app")); - } catch (JSONException e) { - holder.app.setText(e.getMessage()); - } - - return convertView; - } - - /** - * This simple class will be used to hold views, so they can be recycled - * - * @author ricky barrette - */ - class Holder { - TextView id; - TextView status; - TextView msg; - TextView app; - } - -} diff --git a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportListFragment.java b/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportListFragment.java deleted file mode 100644 index 43c48b2..0000000 --- a/ExceptionReportViewer/src/com/TwentyCodes/android/ExceptionReportViewer/ReportListFragment.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ReportListFragment.java - * @date Dec 19, 2011 - * @author ricky barrette - * @author Twenty Codes, LLC - */ -package com.TwentyCodes.android.ExceptionReportViewer; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.content.Intent; -import android.graphics.Color; -import android.os.Bundle; -import android.support.v4.app.ListFragment; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.Loader; -import android.view.View; -import android.widget.ListView; -import android.widget.Toast; - -import com.TwentyCodes.android.exception.ExceptionReportActivity; -import com.TwentyCodes.android.exception.Report; - -/** - * This fragment will be used to display a list of exception reports to the user - * @author ricky barrette - */ -public class ReportListFragment extends ListFragment implements LoaderManager.LoaderCallbacks { - - private JSONArray mReports; - private String mUrl; - - /** - * Creates a new ReportListFragment - * @param url of server - * @author ricky barrette - */ - public ReportListFragment(final String url) { - super(); - mUrl = url; - } - - /** - * (non-Javadoc) - * @see android.support.v4.app.Fragment#onActivityCreated(android.os.Bundle) - */ - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - this.setListShown(false); - this.getListView().setCacheColorHint(Color.TRANSPARENT); - getLoaderManager().initLoader(0, null, this); - } - - /** - * Called when the user selects a report to display - * (non-Javadoc) - * @see android.support.v4.app.ListFragment#onListItemClick(android.widget.ListView, android.view.View, int, long) - */ - @Override - public void onListItemClick(ListView l, View v, int position, long id) { - try { - this.startActivity(new Intent(this.getActivity(), ExceptionReportActivity.class) - .putExtra("display", true) - .putExtra("report", new Report("").generateReport(mReports.getJSONObject(position).getJSONObject("report")))); - } catch (JSONException e) { - Toast.makeText(this.getActivity().getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show(); - } - } - - /** - * Called when the loader is created - * (non-Javadoc) - * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onCreateLoader(int, android.os.Bundle) - */ - @Override - public Loader onCreateLoader(int id, Bundle args) { - return new JSONLoader(mUrl, this, this.getActivity()); - } - - /** - * Called when the loader has finished - * (non-Javadoc) - * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onLoadFinished(android.support.v4.content.Loader, java.lang.Object) - */ - @Override - public void onLoadFinished(Loader loader, JSONObject jsonObject) { - if(jsonObject != null){ - try { - mReports = jsonObject.getJSONArray("reports"); - this.setListAdapter(new ReportAdapter(this.getActivity(), mReports)); - } catch (JSONException e) { - this.setEmptyText(getText(R.string.there_was_an_error)); - } - this.setEmptyText(getText(R.string.there_was_an_error)); - } - - } - - /** - * Called when the loader has been reset - * (non-Javadoc) - * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onLoaderReset(android.support.v4.content.Loader) - */ - @Override - public void onLoaderReset(Loader loader) { - //not Needed - } -} \ No newline at end of file diff --git a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/FragmentAdapter.java b/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/FragmentAdapter.java deleted file mode 100644 index 451924b..0000000 --- a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/FragmentAdapter.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * FragmentAdapter.java - * @date Aug 6, 2011 - * @author Twenty Codes, LLC - * @author ricky barrette - */ -package com.jakewharton.android.viewpagerindicator; - -import java.util.ArrayList; - -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; - -/** - * This adaptor maintains the How and What fragments - * @author ricky - */ -class FragmentAdapter extends FragmentPagerAdapter { - - private ArrayList mFragments; - - /** - * Creates a new FragmentAdaptor - * @param fm - * @param fragments to be displayed - * @author ricky barrette - */ - public FragmentAdapter(FragmentManager fm, ArrayList fragments) { - super(fm); - this.mFragments = fragments; - } - - @Override - public Fragment getItem(int position) { - return this.mFragments.get(position); - } - - @Override - public int getCount() { - return this.mFragments.size(); - } - - -} \ No newline at end of file diff --git a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/PageIndicator.java b/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/PageIndicator.java deleted file mode 100644 index f965233..0000000 --- a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/PageIndicator.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 Patrik Akerfeldt - * Copyright (C) 2011 Jake Wharton - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.jakewharton.android.viewpagerindicator; - -import android.support.v4.view.ViewPager; - -/** - * A PageIndicator is responsible to show an visual indicator on the total views - * number and the current visible view. - */ -public interface PageIndicator extends ViewPager.OnPageChangeListener { - /** - * Bind the indicator to a ViewPager. - * - * @param view - */ - public void setViewPager(ViewPager view); - - /** - * Bind the indicator to a ViewPager. - * - * @param view - * @param initialPosition - */ - public void setViewPager(ViewPager view, int initialPosition); - - /** - *

Set the current page of both the ViewPager and indicator.

- * - *

This must be used if you need to set the page before - * the views are drawn on screen (e.g., default start page).

- * - * @param item - */ - public void setCurrentItem(int item); - - /** - * Set a page change listener which will receive forwarded events. - * - * @param listener - */ - public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener); -} diff --git a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitlePageIndicator.java b/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitlePageIndicator.java deleted file mode 100644 index f08c314..0000000 --- a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitlePageIndicator.java +++ /dev/null @@ -1,640 +0,0 @@ -/* - * Copyright (C) 2011 Patrik Akerfeldt - * Copyright (C) 2011 Francisco Figueiredo Jr. - * Copyright (C) 2011 Jake Wharton - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.jakewharton.android.viewpagerindicator; - -import java.util.ArrayList; - -import android.content.Context; -import android.content.res.Resources; -import android.content.res.TypedArray; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.Path; -import android.graphics.Rect; -import android.os.Parcel; -import android.os.Parcelable; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import android.widget.TextView; - -import com.TwentyCodes.android.exception.R; - -/** - * A TitlePageIndicator is a PageIndicator which displays the title of left view - * (if exist), the title of the current select view (centered) and the title of - * the right view (if exist). When the user scrolls the ViewPager then titles are - * also scrolled. - */ -public class TitlePageIndicator extends TextView implements PageIndicator, View.OnTouchListener { - private static final float UNDERLINE_FADE_PERCENTAGE = 0.25f; - - public enum IndicatorStyle { - None(0), Triangle(1), Underline(2); - - public final int value; - - private IndicatorStyle(int value) { - this.value = value; - } - - public static IndicatorStyle fromValue(int value) { - for (IndicatorStyle style : IndicatorStyle.values()) { - if (style.value == value) { - return style; - } - } - return null; - } - } - - private ViewPager mViewPager; - private ViewPager.OnPageChangeListener mListener; - private TitleProvider mTitleProvider; - private int mCurrentPage; - private int mCurrentOffset; - private final Paint mPaintText; - private final Paint mPaintSelected; - private Path mPath; - private final Paint mPaintFooterLine; - private IndicatorStyle mFooterIndicatorStyle; - private final Paint mPaintFooterIndicator; - private float mFooterIndicatorHeight; - private float mFooterIndicatorPadding; - private float mFooterIndicatorUnderlinePadding; - private float mTitlePadding; - /** Left and right side padding for not active view titles. */ - private float mClipPadding; - private float mFooterLineHeight; - - - public TitlePageIndicator(Context context) { - this(context, null); - } - - public TitlePageIndicator(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.titlePageIndicatorStyle); - } - - public TitlePageIndicator(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - super.setOnTouchListener(this); - - //Load defaults from resources - final Resources res = getResources(); - final int defaultFooterColor = res.getColor(R.color.default_title_indicator_footer_color); - final float defaultFooterLineHeight = res.getDimension(R.dimen.default_title_indicator_footer_line_height); - final int defaultFooterIndicatorStyle = res.getInteger(R.integer.default_title_indicator_footer_indicator_style); - final float defaultFooterIndicatorHeight = res.getDimension(R.dimen.default_title_indicator_footer_indicator_height); - final float defaultFooterIndicatorPadding = res.getDimension(R.dimen.default_title_indicator_footer_indicator_padding); - final float defaultFooterIndicatorUnderlinePadding = res.getDimension(R.dimen.default_title_indicator_footer_indicator_underline_padding); - final int defaultSelectedColor = res.getColor(R.color.default_title_indicator_selected_color); - final boolean defaultSelectedBold = res.getBoolean(R.bool.default_title_indicator_selected_bold); - final int defaultTextColor = res.getColor(R.color.default_title_indicator_text_color); - final float defaultTextSize = res.getDimension(R.dimen.default_title_indicator_text_size); - final float defaultTitlePadding = res.getDimension(R.dimen.default_title_indicator_title_padding); - final float defaultClipPadding = res.getDimension(R.dimen.default_title_indicator_clip_padding); - - //Retrieve styles attributes - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TitlePageIndicator, defStyle, R.style.Widget_TitlePageIndicator); - - //Retrieve the colors to be used for this view and apply them. - mFooterLineHeight = a.getDimension(R.styleable.TitlePageIndicator_footerLineHeight, defaultFooterLineHeight); - mFooterIndicatorStyle = IndicatorStyle.fromValue(a.getInteger(R.styleable.TitlePageIndicator_footerIndicatorStyle, defaultFooterIndicatorStyle)); - mFooterIndicatorHeight = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorHeight, defaultFooterIndicatorHeight); - mFooterIndicatorPadding = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorPadding, defaultFooterIndicatorPadding); - mFooterIndicatorUnderlinePadding = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorUnderlinePadding, defaultFooterIndicatorUnderlinePadding); - mTitlePadding = a.getDimension(R.styleable.TitlePageIndicator_titlePadding, defaultTitlePadding); - mClipPadding = a.getDimension(R.styleable.TitlePageIndicator_clipPadding, defaultClipPadding); - - final float textSize = a.getDimension(R.styleable.TitlePageIndicator_textSize, defaultTextSize); - final int footerColor = a.getColor(R.styleable.TitlePageIndicator_footerColor, defaultFooterColor); - mPaintText = new Paint(); - mPaintText.setColor(a.getColor(R.styleable.TitlePageIndicator_textColor, defaultTextColor)); - mPaintText.setTextSize(textSize); - mPaintText.setAntiAlias(true); - mPaintSelected = new Paint(); - mPaintSelected.setColor(a.getColor(R.styleable.TitlePageIndicator_selectedColor, defaultSelectedColor)); - mPaintSelected.setTextSize(textSize); - mPaintSelected.setFakeBoldText(a.getBoolean(R.styleable.TitlePageIndicator_selectedBold, defaultSelectedBold)); - mPaintSelected.setAntiAlias(true); - mPaintFooterLine = new Paint(); - mPaintFooterLine.setStyle(Paint.Style.FILL_AND_STROKE); - mPaintFooterLine.setStrokeWidth(mFooterLineHeight); - mPaintFooterLine.setColor(footerColor); - mPaintFooterIndicator = new Paint(); - mPaintFooterIndicator.setStyle(Paint.Style.FILL_AND_STROKE); - mPaintFooterIndicator.setColor(footerColor); - - a.recycle(); - } - - - public int getFooterColor() { - return mPaintFooterLine.getColor(); - } - - public void setFooterColor(int footerColor) { - mPaintFooterLine.setColor(footerColor); - invalidate(); - } - - public float getFooterLineHeight() { - return mFooterLineHeight; - } - - public void setFooterLineHeight(float footerLineHeight) { - mFooterLineHeight = footerLineHeight; - invalidate(); - } - - public float getFooterIndicatorHeight() { - return mFooterIndicatorHeight; - } - - public void setFooterIndicatorHeight(float footerTriangleHeight) { - mFooterIndicatorHeight = footerTriangleHeight; - invalidate(); - } - - public IndicatorStyle getFooterIndicatorStyle() { - return mFooterIndicatorStyle; - } - - public void setFooterIndicatorStyle(IndicatorStyle indicatorStyle) { - mFooterIndicatorStyle = indicatorStyle; - invalidate(); - } - - public int getSelectedColor() { - return mPaintSelected.getColor(); - } - - public void setSelectedColor(int selectedColor) { - mPaintSelected.setColor(selectedColor); - invalidate(); - } - - public boolean isSelectedBold() { - return mPaintSelected.isFakeBoldText(); - } - - public void setSelectedBold(boolean selectedBold) { - mPaintSelected.setFakeBoldText(selectedBold); - invalidate(); - } - - public int getTextColor() { - return mPaintText.getColor(); - } - - public void setTextColor(int textColor) { - mPaintText.setColor(textColor); - invalidate(); - } - - public float getTextSize() { - return mPaintText.getTextSize(); - } - - public void setTextSize(float textSize) { - mPaintText.setTextSize(textSize); - invalidate(); - } - - public float getTitlePadding() { - return this.mTitlePadding; - } - - public void setTitlePadding(float titlePadding) { - mTitlePadding = titlePadding; - invalidate(); - } - - public float getClipPadding() { - return this.mClipPadding; - } - - public void setClipPadding(float clipPadding) { - mClipPadding = clipPadding; - invalidate(); - } - - /* - * (non-Javadoc) - * - * @see android.view.View#onDraw(android.graphics.Canvas) - */ - @Override - protected void onDraw(Canvas canvas) { - super.onDraw(canvas); - - //Calculate views bounds - ArrayList bounds = calculateAllBounds(mPaintText); - - final int count = mViewPager.getAdapter().getCount(); - final int countMinusOne = count - 1; - final int halfWidth = getWidth() / 2; - final int left = getLeft(); - final int width = getWidth(); - final int height = getHeight(); - final int leftPlusWidth = left + width; - - //Verify if the current view must be clipped to the screen - Rect curViewBound = bounds.get(mCurrentPage); - int curViewWidth = curViewBound.right - curViewBound.left; - if (curViewBound.left < 0) { - //Try to clip to the screen (left side) - clipViewOnTheLeft(curViewBound, curViewWidth); - } - if (curViewBound.right > leftPlusWidth) { - //Try to clip to the screen (right side) - clipViewOnTheRight(curViewBound, curViewWidth, leftPlusWidth); - } - - //Left views starting from the current position - if (mCurrentPage > 0) { - for (int i = mCurrentPage - 1; i >= 0; i--) { - Rect bound = bounds.get(i); - int w = bound.right - bound.left; - //Is left side is outside the screen - if (bound.left < 0) { - //Try to clip to the screen (left side) - clipViewOnTheLeft(bound, w); - //Except if there's an intersection with the right view - if (i < countMinusOne && mCurrentPage != i) { - Rect rightBound = bounds.get(i + 1); - //Intersection - if (bound.right + (int)mTitlePadding > rightBound.left) { - bound.left = rightBound.left - (w + (int)mTitlePadding); - } - } - } - } - } - //Right views starting from the current position - if (mCurrentPage < countMinusOne) { - for (int i = mCurrentPage + 1 ; i < count; i++) { - Rect bound = bounds.get(i); - int w = bound.right - bound.left; - //If right side is outside the screen - if (bound.right > leftPlusWidth) { - //Try to clip to the screen (right side) - clipViewOnTheRight(bound, w, leftPlusWidth); - //Except if there's an intersection with the left view - if (i > 0 && mCurrentPage != i) { - Rect leftBound = bounds.get(i - 1); - //Intersection - if (bound.left - (int)mTitlePadding < leftBound.right) { - bound.left = leftBound.right + (int)mTitlePadding; - } - } - } - } - } - - Bitmap icon = null; - //Now draw views - for (int i = 0; i < count; i++) { - //Get the title - Rect bound = bounds.get(i); - //Only if one side is visible - if ((bound.left > left && bound.left < leftPlusWidth) || (bound.right > left && bound.right < leftPlusWidth)) { - Paint paint = mPaintText; - //Change the color is the title is closed to the center - int middle = (bound.left + bound.right) / 2; - if (Math.abs(middle - halfWidth) < 20) { - paint = mPaintSelected; - } - - /* - * Draw the icons - * @author ricky barrette - */ - icon = BitmapFactory.decodeResource( getResources(), mTitleProvider.getIcon(i));; - canvas.drawBitmap(icon, bound.left - (icon.getWidth() + 4), (bound.bottom - (icon.getHeight() / 2) )-mFooterIndicatorHeight , paint); - canvas.drawText(mTitleProvider.getTitle(i), bound.left, bound.bottom, paint); - } - } - - //Draw the footer line - mPath = new Path(); - mPath.moveTo(0, height - mFooterLineHeight); - mPath.lineTo(width, height - mFooterLineHeight); - mPath.close(); - canvas.drawPath(mPath, mPaintFooterLine); - - switch (mFooterIndicatorStyle) { - case Triangle: - mPath = new Path(); - mPath.moveTo(halfWidth, height - mFooterLineHeight - mFooterIndicatorHeight); - mPath.lineTo(halfWidth + mFooterIndicatorHeight, height - mFooterLineHeight); - mPath.lineTo(halfWidth - mFooterIndicatorHeight, height - mFooterLineHeight); - mPath.close(); - canvas.drawPath(mPath, mPaintFooterIndicator); - break; - - case Underline: - float deltaPercentage = mCurrentOffset * 1.0f / width; - int alpha = 0xFF; - int page = mCurrentPage; - if (deltaPercentage <= UNDERLINE_FADE_PERCENTAGE) { - alpha = (int)(0xFF * ((UNDERLINE_FADE_PERCENTAGE - deltaPercentage) / UNDERLINE_FADE_PERCENTAGE)); - } else if (deltaPercentage >= (1 - UNDERLINE_FADE_PERCENTAGE)) { - alpha = (int)(0xFF * ((deltaPercentage - (1 - UNDERLINE_FADE_PERCENTAGE)) / UNDERLINE_FADE_PERCENTAGE)); - page += 1; //We are coming into the next page - } else if (mCurrentOffset != 0) { - break; //Not in underline scope - } - - Rect underlineBounds = bounds.get(page); - mPath = new Path(); - mPath.moveTo(underlineBounds.left - mFooterIndicatorUnderlinePadding, height - mFooterLineHeight); - mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight); - mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight - mFooterIndicatorHeight); - mPath.lineTo(underlineBounds.left - mFooterIndicatorUnderlinePadding, height - mFooterLineHeight - mFooterIndicatorHeight); - mPath.close(); - - mPaintFooterIndicator.setAlpha(alpha); - canvas.drawPath(mPath, mPaintFooterIndicator); - mPaintFooterIndicator.setAlpha(0xFF); - break; - } - } - - @Override - public final boolean onTouch(View view, MotionEvent event) { - if ((view != this) || (event.getAction() != MotionEvent.ACTION_DOWN)) { - return false; - } - - final int count = mViewPager.getAdapter().getCount(); - final float halfWidth = getWidth() / 2; - final float sixthWidth = getWidth() / 6; - - if ((mCurrentPage > 0) && (event.getX() < halfWidth - sixthWidth)) { - mViewPager.setCurrentItem(mCurrentPage - 1); - return true; - } else if ((mCurrentPage < count - 1) && (event.getX() > halfWidth + sixthWidth)) { - mViewPager.setCurrentItem(mCurrentPage + 1); - return true; - } - - return false; - } - - @Override - public final void setOnTouchListener(OnTouchListener listener) { - throw new UnsupportedOperationException("This view does not support listening to its touch events."); - } - - /** - * Set bounds for the right textView including clip padding. - * - * @param curViewBound - * current bounds. - * @param curViewWidth - * width of the view. - */ - private void clipViewOnTheRight(Rect curViewBound, int curViewWidth, int leftPlusWidth) { - curViewBound.right = leftPlusWidth - (int)mClipPadding; - curViewBound.left = curViewBound.right - curViewWidth; - } - - /** - * Set bounds for the left textView including clip padding. - * - * @param curViewBound - * current bounds. - * @param curViewWidth - * width of the view. - */ - private void clipViewOnTheLeft(Rect curViewBound, int curViewWidth) { - curViewBound.left = 0 + (int)mClipPadding; - curViewBound.right = curViewWidth; - } - - /** - * Calculate views bounds and scroll them according to the current index - * - * @param paint - * @param currentIndex - * @return - */ - private ArrayList calculateAllBounds(Paint paint) { - ArrayList list = new ArrayList(); - //For each views (If no values then add a fake one) - final int count = mViewPager.getAdapter().getCount(); - final int width = getWidth(); - final int halfWidth = width / 2; - for (int i = 0; i < count; i++) { - Rect bounds = calcBounds(i, paint); - int w = (bounds.right - bounds.left); - int h = (bounds.bottom - bounds.top); - bounds.left = (halfWidth) - (w / 2) - mCurrentOffset + ((i - mCurrentPage) * width); - bounds.right = bounds.left + w; - bounds.top = 0; - bounds.bottom = h; - list.add(bounds); - } - - return list; - } - - /** - * Calculate the bounds for a view's title - * - * @param index - * @param paint - * @return - */ - private Rect calcBounds(int index, Paint paint) { - //Calculate the text bounds - Rect bounds = new Rect(); - bounds.right = (int)paint.measureText(mTitleProvider.getTitle(index)); - bounds.bottom = (int)(paint.descent() - paint.ascent()); - return bounds; - } - - @Override - public void setViewPager(ViewPager view) { - if (view.getAdapter() == null) { - throw new IllegalStateException("ViewPager does not have adapter instance."); - } - if (!(view.getAdapter() instanceof TitleProvider)) { - throw new IllegalStateException("ViewPager adapter must implement TitleProvider to be used with TitlePageIndicator."); - } - mViewPager = view; - mViewPager.setOnPageChangeListener(this); - mTitleProvider = (TitleProvider)mViewPager.getAdapter(); - invalidate(); - } - - @Override - public void setViewPager(ViewPager view, int initialPosition) { - setViewPager(view); - setCurrentItem(initialPosition); - } - - @Override - public void setCurrentItem(int item) { - if (mViewPager == null) { - throw new IllegalStateException("ViewPager has not been bound."); - } - mViewPager.setCurrentItem(item); - mCurrentPage = item; - invalidate(); - } - - @Override - public void onPageScrollStateChanged(int state) { - if (mListener != null) { - mListener.onPageScrollStateChanged(state); - } - } - - @Override - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - mCurrentPage = position; - mCurrentOffset = positionOffsetPixels; - invalidate(); - - if (mListener != null) { - mListener.onPageScrolled(position, positionOffset, positionOffsetPixels); - } - } - - @Override - public void onPageSelected(int position) { - if (mListener != null) { - mListener.onPageSelected(position); - } - } - - @Override - public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) { - mListener = listener; - } - - /* - * (non-Javadoc) - * - * @see android.view.View#onMeasure(int, int) - */ - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec)); - } - - /** - * Determines the width of this view - * - * @param measureSpec - * A measureSpec packed into an int - * @return The width of the view, honoring constraints from measureSpec - */ - private int measureWidth(int measureSpec) { - int result = 0; - int specMode = MeasureSpec.getMode(measureSpec); - int specSize = MeasureSpec.getSize(measureSpec); - - if (specMode != MeasureSpec.EXACTLY) { - throw new IllegalStateException(getClass().getSimpleName() + " can only be used in EXACTLY mode."); - } - result = specSize; - return result; - } - - /** - * Determines the height of this view - * - * @param measureSpec - * A measureSpec packed into an int - * @return The height of the view, honoring constraints from measureSpec - */ - private int measureHeight(int measureSpec) { - float result = 0; - int specMode = MeasureSpec.getMode(measureSpec); - int specSize = MeasureSpec.getSize(measureSpec); - - if (specMode == MeasureSpec.EXACTLY) { - //We were told how big to be - result = specSize; - } else { - //Calculate the text bounds - Rect bounds = new Rect(); - bounds.bottom = (int) (mPaintText.descent()-mPaintText.ascent()); - result = bounds.bottom - bounds.top + mFooterLineHeight; - if (mFooterIndicatorStyle != IndicatorStyle.None) { - result += mFooterIndicatorHeight + mFooterIndicatorPadding; - } - } - return (int)result; - } - - @Override - public void onRestoreInstanceState(Parcelable state) { - SavedState savedState = (SavedState)state; - super.onRestoreInstanceState(savedState.getSuperState()); - mCurrentPage = savedState.currentPage; - requestLayout(); - } - - @Override - public Parcelable onSaveInstanceState() { - setFreezesText(true); - Parcelable superState = super.onSaveInstanceState(); - SavedState savedState = new SavedState(superState); - savedState.currentPage = mCurrentPage; - return savedState; - } - - static class SavedState extends BaseSavedState { - int currentPage; - - public SavedState(Parcelable superState) { - super(superState); - } - - private SavedState(Parcel in) { - super(in); - currentPage = in.readInt(); - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - super.writeToParcel(dest, flags); - dest.writeInt(currentPage); - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override - public SavedState createFromParcel(Parcel in) { - return new SavedState(in); - } - - @Override - public SavedState[] newArray(int size) { - return new SavedState[size]; - } - }; - } -} diff --git a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitleProvider.java b/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitleProvider.java deleted file mode 100644 index 7891ca5..0000000 --- a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitleProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2011 Patrik Akerfeldt - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.jakewharton.android.viewpagerindicator; - -/** - * A TitleProvider provides the title to display according to a view. - */ -public interface TitleProvider { - /** - * Returns the title of the view at position - * @param position - * @return - */ - public String getTitle(int position); - - /** - * returns the icon res id of the view at position - * @param postion - * @return - * @author ricky barrette - */ - public int getIcon(int postion); -} diff --git a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitledFragmentAdapter.java b/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitledFragmentAdapter.java deleted file mode 100644 index 65db188..0000000 --- a/ExceptionReportViewer/src/com/jakewharton/android/viewpagerindicator/TitledFragmentAdapter.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * TitleFragmentAdapter.java - * @date Aug 6, 2011 - * @author Twenty Codes, LLC - * @author ricky barrette - */ -package com.jakewharton.android.viewpagerindicator; - -import java.util.ArrayList; - -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; - - -/** - * This adaptor maintains a ViewPager title indicator. - * @author ricky - */ -public class TitledFragmentAdapter extends FragmentAdapter implements TitleProvider { - - private String[] mTitles; - private int[] mIcons; - - /** - * Creates a new TitleFragmentAdapter - * @param fm - * @param fragments to be displayed - * @param titles for the fragments - * @author ricky barrette - */ - public TitledFragmentAdapter(FragmentManager fm, ArrayList fragments, String[] titles, int[] icons) { - super(fm, fragments); - this.mTitles = titles; - this.mIcons = icons; - } - - @Override - public String getTitle(int position) { - return this.mTitles[position]; - } - - @Override - public int getIcon(int position) { - return this.mIcons[position]; - } -} \ No newline at end of file