--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="lib" path="lib/org.opensrf.jar"/>
+ <classpathentry kind="lib" path="lib/simple-xml-2.6.4.jar"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>EvergreenApp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
android:label="@string/app_name"
android:theme="@style/EvergreenTheme"
>
+
<activity
- android:name=".searchCatalog.SearchCatalogListView"
- android:label="@string/app_name" >
+ android:name=".views.MainScreenDashboard"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Light.NoTitleBar"
+ >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <activity
+ android:name=".searchCatalog.SearchCatalogListView"
+ android:label="@string/app_name" >
+ </activity>
+
<activity android:name=".searchCatalog.RecordDetails_Info"></activity>
<activity android:name=".searchCatalog.RecordDetails_Content"></activity>
<activity android:name=".searchCatalog.RecordDetails_Details"></activity>
public static final int title_text_alt=0x7f040002;
public static final int white=0x7f04000c;
}
+ public static final class dimen {
+ public static final int text_size_large=0x7f050003;
+ public static final int text_size_medium=0x7f050002;
+ public static final int text_size_small=0x7f050001;
+ public static final int title_height=0x7f050000;
+ }
public static final class drawable {
- public static final int action_search=0x7f020000;
- public static final int address_book=0x7f020001;
- public static final int ic_launcher=0x7f020002;
+ public static final int account_pref=0x7f020000;
+ public static final int action_search=0x7f020001;
+ public static final int address_book=0x7f020002;
+ public static final int book_bag=0x7f020003;
+ public static final int check_out=0x7f020004;
+ public static final int find_96=0x7f020005;
+ public static final int fines=0x7f020006;
+ public static final int holds=0x7f020007;
+ public static final int ic_launcher=0x7f020008;
}
public static final class id {
- public static final int chose_organisation=0x7f070011;
- public static final int record_details_info_author=0x7f070001;
- public static final int record_details_info_publisher=0x7f070002;
- public static final int record_details_info_title=0x7f070000;
- public static final int record_details_simple_author=0x7f070004;
- public static final int record_details_simple_isbn=0x7f070009;
- public static final int record_details_simple_publisher=0x7f070005;
- public static final int record_details_simple_series=0x7f070007;
- public static final int record_details_simple_subject=0x7f070006;
- public static final int record_details_simple_synopsis=0x7f070008;
- public static final int record_details_simple_title=0x7f070003;
- public static final int searchButton=0x7f07000f;
- public static final int searchText=0x7f07000e;
- public static final int search_record_author=0x7f07000c;
- public static final int search_record_img=0x7f07000a;
- public static final int search_record_publishing=0x7f07000d;
- public static final int search_record_title=0x7f07000b;
- public static final int search_results_list=0x7f070010;
+ public static final int chose_organisation=0x7f080017;
+ public static final int home_btn_feature1=0x7f080000;
+ public static final int home_btn_feature2=0x7f080001;
+ public static final int home_btn_feature3=0x7f080002;
+ public static final int home_btn_feature4=0x7f080003;
+ public static final int home_btn_feature5=0x7f080004;
+ public static final int home_btn_feature6=0x7f080005;
+ public static final int record_details_info_author=0x7f080007;
+ public static final int record_details_info_publisher=0x7f080008;
+ public static final int record_details_info_title=0x7f080006;
+ public static final int record_details_simple_author=0x7f08000a;
+ public static final int record_details_simple_isbn=0x7f08000f;
+ public static final int record_details_simple_publisher=0x7f08000b;
+ public static final int record_details_simple_series=0x7f08000d;
+ public static final int record_details_simple_subject=0x7f08000c;
+ public static final int record_details_simple_synopsis=0x7f08000e;
+ public static final int record_details_simple_title=0x7f080009;
+ public static final int searchButton=0x7f080015;
+ public static final int searchText=0x7f080014;
+ public static final int search_record_author=0x7f080012;
+ public static final int search_record_img=0x7f080010;
+ public static final int search_record_publishing=0x7f080013;
+ public static final int search_record_title=0x7f080011;
+ public static final int search_results_list=0x7f080016;
}
public static final class layout {
- public static final int main=0x7f030000;
- public static final int record_details_info=0x7f030001;
- public static final int record_details_simple=0x7f030002;
- public static final int search_result_item=0x7f030003;
- public static final int search_result_list=0x7f030004;
+ public static final int dashbord_main=0x7f030000;
+ public static final int main=0x7f030001;
+ public static final int record_details_info=0x7f030002;
+ public static final int record_details_simple=0x7f030003;
+ public static final int search_result_item=0x7f030004;
+ public static final int search_result_list=0x7f030005;
}
public static final class string {
- public static final int app_name=0x7f050001;
- public static final int hello=0x7f050000;
+ public static final int app_name=0x7f060001;
+ public static final int hello=0x7f060000;
+ public static final int title_feature1=0x7f060002;
+ public static final int title_feature2=0x7f060003;
+ public static final int title_feature3=0x7f060004;
+ public static final int title_feature4=0x7f060005;
+ public static final int title_feature5=0x7f060006;
+ public static final int title_feature6=0x7f060007;
}
public static final class style {
- public static final int EvergreenTheme=0x7f060004;
- public static final int sectionHeader=0x7f060000;
- public static final int spacer=0x7f060003;
- public static final int textLarge=0x7f060002;
- public static final int textSmall=0x7f060001;
+ public static final int EvergreenTheme=0x7f070004;
+ public static final int HomeButton=0x7f070005;
+ public static final int sectionHeader=0x7f070000;
+ public static final int spacer=0x7f070003;
+ public static final int textLarge=0x7f070002;
+ public static final int textSmall=0x7f070001;
}
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="6dip"
+ android:layout_weight="1"
+ >
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <Button android:id="@+id/home_btn_feature1"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature1"
+ android:drawableTop="@drawable/find_96"/>
+ <Button android:id="@+id/home_btn_feature2"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature2"
+ android:drawableTop="@drawable/account_pref"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <Button android:id="@+id/home_btn_feature3"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature3"
+ android:drawableTop="@drawable/check_out"/>
+ <Button android:id="@+id/home_btn_feature4"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature4"
+ android:drawableTop="@drawable/holds"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <Button android:id="@+id/home_btn_feature5"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature5"
+ android:drawableTop="@drawable/fines"/>
+ <Button android:id="@+id/home_btn_feature6"
+ style="@style/HomeButton"
+ android:onClick="onClickFeature"
+ android:text="@string/title_feature6"
+ android:drawableTop="@drawable/book_bag"/>
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2011 Wglxy.com
+
+ 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.
+-->
+<resources>
+ <dimen name="title_height">45dip</dimen>
+ <dimen name="text_size_small">14sp</dimen>
+ <dimen name="text_size_medium">18sp</dimen>
+ <dimen name="text_size_large">22sp</dimen>
+</resources>
<string name="hello">Hello World, EvergreenAppActivity!</string>
<string name="app_name">EvergreenApp</string>
+ <string name="title_feature1">Search</string>
+ <string name="title_feature2">Account</string>
+ <string name="title_feature3">Check out items</string>
+ <string name="title_feature4">Holds</string>
+ <string name="title_feature5">Fines</string>
+ <string name="title_feature6">Book bags</string>
+
</resources>
\ No newline at end of file
<style name="EvergreenTheme" parent="android:Theme.Black.NoTitleBar">
</style>
+ <style name="HomeButton">
+ <item name="android:layout_gravity">center_vertical</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:gravity">center_horizontal</item>
+ <item name="android:textSize">@dimen/text_size_medium</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">@color/foreground1</item>
+ <item name="android:background">@null</item>
+ </style>
+
</resources>
package org.evergreen.android.globals;
+import java.io.InputStream;
+import java.security.KeyStore.LoadStoreParameter;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.evergreen.android.searchCatalog.Organisation;
+import org.open_ils.idl.IDLParser;
+
+import android.util.Log;
+
public class GlobalConfigs {
- //public static String httpAddress = "http://ulysses.calvin.edu";
+ public static String httpAddress = "http://ulysses.calvin.edu";
+
+ private boolean init = false;
+
+ private static String TAG = "GlobalConfigs";
+
+ /** The locale. */
+ public String locale = "en-US";
+
+ private static GlobalConfigs globalConfigSingleton = null;
+ /** The organisations. */
+ public ArrayList<Organisation> organisations;
+
+ /** The collections request. */
+ private String collectionsRequest = "/opac/common/js/";
+
+
+ private GlobalConfigs(){
+
+ initialize();
+ }
+
+ public static GlobalConfigs getGlobalConfigs(){
+
+ if(globalConfigSingleton == null)
+ {
+ globalConfigSingleton = new GlobalConfigs();
+ }
+
+ return globalConfigSingleton;
+ }
+
+ /* Initialize function that retrieves IDL file and Orgs file
+ */
+ private boolean initialize(){
+
+ if(init == false){
+
+ collectionsRequest += locale + "/OrgTree.js";
+ init = true;
+ loadIDLFile();
+ getOrganisations();
+ return true;
+ }
+ return false;
+ }
+
+ private static void loadIDLFile(){
+
+ String idlFile = "/reports/fm_IDL.xml";
+ try{
+ Log.d("debug","Read fm");
+ InputStream in_IDL = Utils.getNetInputStream(httpAddress + idlFile);
+ IDLParser parser = new IDLParser(in_IDL);
+ parser.parse();
+ }catch(Exception e){
+ System.err.println("Error in parsing IDL file " + idlFile + " " + e.getMessage());
+ };
+
+ }
+
+ /**
+ * Gets the organisations get's OrgTree.js from server, parses the input and recovers the organisations
+ *
+ * @return the organisations
+ */
+ private void getOrganisations(){
+
+ String orgFile = null;
+ try{
+ orgFile = Utils.getNetPageContent(httpAddress+collectionsRequest);
+ System.out.println("Request org " + httpAddress + collectionsRequest );
+ }catch(Exception e){};
+
+
+ if(orgFile != null){
+ System.out.println("Page content " + orgFile);
+
+ String orgArray = orgFile.substring( orgFile.indexOf("=")+1, orgFile.indexOf(";"));
+
+ String arrayContent = orgArray.substring(orgArray.indexOf("[")+1,orgArray.lastIndexOf("]"));
+
+
+ Log.d(TAG,"Array to pe parsed " + arrayContent);
+
+ //parser for list
+
+ //format [104,2,1,"Curriculum Center",1,"CURRICULUM"] : [id,level,parent,name,can_have_volumes_bool,short_name]
+
+ int index = 0;
+ while(true){
+
+ if(index >= arrayContent.length())
+ break;
+
+ int start = arrayContent.indexOf("[", index)+1;
+ int stop = arrayContent.indexOf("]", index);
+
+ Log.d(TAG," start stop length index" + start+ " " + stop + " " + arrayContent.length() + " " + index);
+ if(start == -1 || stop == -1)
+ break;
+
+ index = stop+1;
+
+ String content = arrayContent.substring(start,stop);
+
+ System.out.println("Content " + content);
+
+ StringTokenizer tokenizer = new StringTokenizer(content,",");
+
+ Organisation org = new Organisation();
+
+ //first is ID
+ String element = (String)tokenizer.nextElement();
+ System.out.println("Element " + element);
+ try{
+ org.id = Integer.parseInt(element);
+ }catch(Exception e){};
+
+ //level
+ element = (String)tokenizer.nextElement();
+ System.out.println("Element " + element);
+ try{
+ org.level = Integer.parseInt(element);
+ }catch(Exception e){};
+
+ //parent
+ element = (String)tokenizer.nextElement();
+ System.out.println("Element " + element);
+ try{
+ org.parent = Integer.parseInt(element);
+ }catch(Exception e){};
+
+ //name
+ element = (String)tokenizer.nextToken("\",");
+ System.out.println("Element " + element);
+ org.name = element;
+
+ //can_have_volume_boo.
+ element = (String)tokenizer.nextElement();
+ System.out.println("Element " + element);
+ try{
+ org.canHaveVolumesBool = Integer.parseInt(element);
+ }catch(Exception e){};
+
+ //short name
+ element = (String)tokenizer.nextToken("\",");
+ System.out.println("Element " + element);
+ org.shortName = element;
+
+ organisations.add(org);
+ }
+
+ }
+ }
}
package org.evergreen.android.globals;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+
public class Utils {
+
+ /**
+ * Gets the net page content.
+ *
+ * @param url the url of the page to be retrieved
+ * @return the net page content
+ */
+ public static String getNetPageContent(String url){
+
+ String result = "";
+
+ HttpResponse response = null;
+
+ try{
+ HttpClient client = new DefaultHttpClient();
+ HttpGet request = new HttpGet(url);
+ response = client.execute(request);
+ }catch(Exception e){
+ System.out.println("Exception to GET page " + url);
+ }
+ StringBuilder str = null;
+
+ try{
+ InputStream in = response.getEntity().getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ str = new StringBuilder();
+ String line = null;
+ while((line = reader.readLine()) != null)
+ {
+ str.append(line);
+ }
+ in.close();
+ }catch(Exception e){
+ System.err.println("Error in retrieving response " + e.getMessage());
+ }
+
+ result = str.toString();
+
+
+ return result;
+ }
+
+ public static InputStream getNetInputStream(String url){
+
+ InputStream in = null;
+
+ HttpResponse response = null;
+
+ try{
+ HttpClient client = new DefaultHttpClient();
+ HttpGet request = new HttpGet(url);
+ response = client.execute(request);
+ }catch(Exception e){
+ System.out.println("Exception to GET page " + url);
+ }
+ StringBuilder str = null;
+
+ try{
+ in = response.getEntity().getContent();
+
+ return in;
+ }catch(Exception e){
+ System.err.println("Error in retrieving response " + e.getMessage());
+ }
+
+ return in;
+ }
}
package org.evergreen.android.searchCatalog;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.evergreen.android.globals.Utils;
import org.open_ils.idl.IDLParser;
import org.opensrf.Method;
import org.opensrf.net.http.GatewayRequest;
/** The conn. */
public HttpConnection conn;
- /** The collections request. */
- public static String collectionsRequest = "/opac/common/js/";
-
- /** The locale. */
- public String locale = "en-US";
-
/** The http address. */
public String httpAddress = "http://ulysses.calvin.edu";
/** The TAG. */
public String TAG = "SearchCatalog";
- /** The organisations. */
- public ArrayList<Organisation> organisations;
-
//the org on witch the searches will be made
/** The selected organization. */
private Organisation selectedOrganization = null;
* @param httpAddress the http address
* @param locale the locale
*/
- public SearchCatalog(String httpAddress, String locale, Context context) {
+ public SearchCatalog(String httpAddress, Context context) {
super();
this.context = context;
this.httpAddress = httpAddress;
try{
// configure the connection
conn = new HttpConnection(httpAddress+"/osrf-gateway-v1");
- this.locale = locale;
- collectionsRequest += locale + "/OrgTree.js";
+
}catch(Exception e){
System.err.println("Exception in establishing connection " + e.getMessage());
}
//registering classes so no longer necessary to register object classes manually
- readIDLFile();
- this.organisations = new ArrayList<Organisation>();
- getOrganisations();
}
- /**
- * Gets the organisations get's OrgTree.js from server, parses the input and recovers the organisations
- *
- * @return the organisations
- */
- private void getOrganisations(){
-
- String orgFile = null;
- try{
- orgFile = getNetPageContent(httpAddress+collectionsRequest);
- System.out.println("Request org " + httpAddress + collectionsRequest );
- }catch(Exception e){};
-
-
- if(orgFile != null){
- System.out.println("Page content " + orgFile);
-
- String orgArray = orgFile.substring( orgFile.indexOf("=")+1, orgFile.indexOf(";"));
-
- String arrayContent = orgArray.substring(orgArray.indexOf("[")+1,orgArray.lastIndexOf("]"));
-
-
- Log.d(TAG,"Array to pe parsed " + arrayContent);
-
- //parser for list
-
- //format [104,2,1,"Curriculum Center",1,"CURRICULUM"] : [id,level,parent,name,can_have_volumes_bool,short_name]
-
- int index = 0;
- while(true){
-
- if(index >= arrayContent.length())
- break;
-
- int start = arrayContent.indexOf("[", index)+1;
- int stop = arrayContent.indexOf("]", index);
-
- Log.d(TAG," start stop length index" + start+ " " + stop + " " + arrayContent.length() + " " + index);
- if(start == -1 || stop == -1)
- break;
-
- index = stop+1;
-
- String content = arrayContent.substring(start,stop);
-
- System.out.println("Content " + content);
-
- StringTokenizer tokenizer = new StringTokenizer(content,",");
-
- Organisation org = new Organisation();
-
- //first is ID
- String element = (String)tokenizer.nextElement();
- System.out.println("Element " + element);
- try{
- org.id = Integer.parseInt(element);
- }catch(Exception e){};
-
- //level
- element = (String)tokenizer.nextElement();
- System.out.println("Element " + element);
- try{
- org.level = Integer.parseInt(element);
- }catch(Exception e){};
-
- //parent
- element = (String)tokenizer.nextElement();
- System.out.println("Element " + element);
- try{
- org.parent = Integer.parseInt(element);
- }catch(Exception e){};
-
- //name
- element = (String)tokenizer.nextToken("\",");
- System.out.println("Element " + element);
- org.name = element;
-
- //can_have_volume_boo.
- element = (String)tokenizer.nextElement();
- System.out.println("Element " + element);
- try{
- org.canHaveVolumesBool = Integer.parseInt(element);
- }catch(Exception e){};
-
- //short name
- element = (String)tokenizer.nextToken("\",");
- System.out.println("Element " + element);
- org.shortName = element;
-
- organisations.add(org);
- }
-
- }
- }
-
-
- /**
- * Gets the net page content.
- *
- * @param url the url of the page to be retrieved
- * @return the net page content
- */
- private String getNetPageContent(String url){
-
- String result = "";
-
- HttpResponse response = null;
-
- try{
- HttpClient client = new DefaultHttpClient();
- HttpGet request = new HttpGet(url);
- response = client.execute(request);
- }catch(Exception e){
- System.out.println("Exception to GET page " + url);
- }
- StringBuilder str = null;
-
- try{
- InputStream in = response.getEntity().getContent();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- str = new StringBuilder();
- String line = null;
- while((line = reader.readLine()) != null)
- {
- str.append(line);
- }
- in.close();
- }catch(Exception e){
- System.err.println("Error in retrieving response " + e.getMessage());
- }
-
- result = str.toString();
-
-
- return result;
- }
/**
* Gets the search results
}
- private void readIDLFile(){
-
- String idlFile = "fm_IDL.xml";
- try{
- Log.d("debug","Read fm");
- IDLParser parser = new IDLParser(context.getAssets().open(idlFile));
- parser.parse();
- }catch(Exception e){
- System.err.println("Error in parsing IDL file " + idlFile + " " + e.getMessage());
- };
-
- }
+
}
import java.util.List;
import org.evergreen.android.R;
+import org.evergreen.android.globals.GlobalConfigs;
import org.open_ils.idl.IDLParser;
import android.app.Activity;
private Spinner choseOrganisation;
+ private GlobalConfigs globalConfigs;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_result_list);
+ //singleton initialize necessary IDL and Org data
+ globalConfigs = GlobalConfigs.getGlobalConfigs();
context = this;
- search = new SearchCatalog("http://ulysses.calvin.edu","en-US",this);
+ search = new SearchCatalog("http://ulysses.calvin.edu",this);
recordList= new ArrayList<RecordInfo>();
int selectedPos = 0;
ArrayList<String> list = new ArrayList<String>();
- for(int i=0;i<search.organisations.size();i++){
- list.add(search.organisations.get(i).name);
+ for(int i=0;i<globalConfigs.organisations.size();i++){
+ list.add(globalConfigs.organisations.get(i).name);
- if(search.organisations.get(i).level -1 == 0)
+ if(globalConfigs.organisations.get(i).level -1 == 0)
selectedPos = i;
}
public void onItemSelected(AdapterView<?> arg0, View arg1,
int ID, long arg3) {
//select the specific organization
- search.selectOrganisation(search.organisations.get(ID));
+ search.selectOrganisation(globalConfigs.organisations.get(ID));
}
--- /dev/null
+
+package org.evergreen.android.views;
+
+import org.evergreen.android.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+
+
+public class MainScreenDashboard extends Activity {
+
+ /**
+ * onCreate - called when the activity is first created.
+ *
+ * Called when the activity is first created. This is where you should do
+ * all of your normal static set up: create views, bind data to lists, etc.
+ * This method also provides you with a Bundle containing the activity's
+ * previously frozen state, if there was one.
+ *
+ * Always followed by onStart().
+ *
+ */
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.dashbord_main);
+ }
+
+ /**
+ * onDestroy The final call you receive before your activity is destroyed.
+ * This can happen either because the activity is finishing (someone called
+ * finish() on it, or because the system is temporarily destroying this
+ * instance of the activity to save space. You can distinguish between these
+ * two scenarios with the isFinishing() method.
+ *
+ */
+
+ protected void onDestroy() {
+ super.onDestroy();
+ }
+
+ /**
+ * onPause Called when the system is about to start resuming a previous
+ * activity. This is typically used to commit unsaved changes to persistent
+ * data, stop animations and other things that may be consuming CPU, etc.
+ * Implementations of this method must be very quick because the next
+ * activity will not be resumed until this method returns. Followed by
+ * either onResume() if the activity returns back to the front, or onStop()
+ * if it becomes invisible to the user.
+ *
+ */
+
+ protected void onPause() {
+ super.onPause();
+ }
+
+ /**
+ * onRestart Called after your activity has been stopped, prior to it being
+ * started again. Always followed by onStart().
+ *
+ */
+
+ protected void onRestart() {
+ super.onRestart();
+ }
+
+ /**
+ * onResume Called when the activity will start interacting with the user.
+ * At this point your activity is at the top of the activity stack, with
+ * user input going to it. Always followed by onPause().
+ *
+ */
+
+ protected void onResume() {
+ super.onResume();
+ }
+
+ /**
+ * onStart Called when the activity is becoming visible to the user.
+ * Followed by onResume() if the activity comes to the foreground, or
+ * onStop() if it becomes hidden.
+ *
+ */
+
+ protected void onStart() {
+ super.onStart();
+ }
+
+ /**
+ * onStop Called when the activity is no longer visible to the user because
+ * another activity has been resumed and is covering this one. This may
+ * happen either because a new activity is being started, an existing one is
+ * being brought in front of this one, or this one is being destroyed.
+ *
+ * Followed by either onRestart() if this activity is coming back to
+ * interact with the user, or onDestroy() if this activity is going away.
+ */
+
+ protected void onStop() {
+ super.onStop();
+ }
+
+ public void onClickFeature (View v)
+ {
+ int id = v.getId ();
+ switch (id) {
+ /*
+ case R.id.home_btn_feature1 :
+ startActivity (new Intent(getApplicationContext(), F1Activity.class));
+ break;
+ case R.id.home_btn_feature2 :
+ startActivity (new Intent(getApplicationContext(), F2Activity.class));
+ break;
+ case R.id.home_btn_feature3 :
+ startActivity (new Intent(getApplicationContext(), F3Activity.class));
+ break;
+ case R.id.home_btn_feature4 :
+ startActivity (new Intent(getApplicationContext(), F4Activity.class));
+ break;
+ case R.id.home_btn_feature5 :
+ startActivity (new Intent(getApplicationContext(), F5Activity.class));
+ break;
+ case R.id.home_btn_feature6 :
+ startActivity (new Intent(getApplicationContext(), F6Activity.class));
+ break;
+ default:
+ break;
+ */
+ }
+
+ }
+
+}