import org.evergreen_ils.searchCatalog.RecordInfo;
import org.evergreen_ils.searchCatalog.SearchCatalog;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Activity;
}
setContentView(R.layout.bookbagitem_list);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
accountAccess = AccountAccess.getAccountAccess();
bookBag = (BookBag) getIntent().getSerializableExtra("bookBag");
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Activity;
}
setContentView(R.layout.bookbag_list);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
context = this;
accountAccess = AccountAccess.getAccountAccess();
import org.evergreen_ils.accountAccess.ServerErrorMessage;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.searchCatalog.SearchFormat;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.ProgressDialog;
SearchFormat.init(this);
setContentView(R.layout.checkout_list);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
context = this;
itemsNo = (TextView) findViewById(R.id.checkout_items_number);
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Activity;
}
setContentView(R.layout.fines);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
decimalFormater = new DecimalFormat("#0.00");
lv = (ListView) findViewById(R.id.fines_overdue_materials_list);
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.utils.ui.CompatSpinnerAdapter;
import org.evergreen_ils.views.splashscreen.SplashActivity;
}
setContentView(R.layout.hold_details);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
context = this;
globalConfigs = GlobalConfigs.getGlobalConfigs(this);
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.searchCatalog.ImageDownloader;
import org.evergreen_ils.searchCatalog.SearchFormat;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import java.util.ArrayList;
SearchFormat.init(this);
setContentView(R.layout.holds_list);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
holdsNoText = (TextView) findViewById(R.id.holds_number);
import org.evergreen_ils.globals.GlobalConfigs;
import org.evergreen_ils.searchCatalog.Organisation;
import org.evergreen_ils.searchCatalog.RecordInfo;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.utils.ui.CompatSpinnerAdapter;
import org.evergreen_ils.views.splashscreen.SplashActivity;
}
setContentView(R.layout.place_hold);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
globalConfigs = GlobalConfigs.getGlobalConfigs(this);
RecordInfo record = (RecordInfo) getIntent().getSerializableExtra(
import android.view.MenuItem;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Activity;
}
setContentView(R.layout.advanced_search);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
advancedSearchFormattedText = new StringBuilder();
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.content.Context;
}
setContentView(R.layout.copy_information_more);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
globalConfigs = GlobalConfigs.getGlobalConfigs(context);
context = this;
}
setContentView(R.layout.simple_underlines);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
search = SearchCatalog.getInstance();
import org.evergreen_ils.accountAccess.holds.PlaceHold;
import org.evergreen_ils.barcodescan.CaptureActivity;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.utils.ui.CompatSpinnerAdapter;
import org.evergreen_ils.views.splashscreen.SplashActivity;
SearchFormat.init(this);
setContentView(R.layout.search_result_list);
-
- // set up action bar
- ActionBar actionBar = getSupportActionBar();
- actionBar.setSubtitle(AccountAccess.userName);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ ActionBarUtils.initActionBarForActivity(this);
// get bookbags
bookBags = AccountAccess.getAccountAccess().getBookbags();
--- /dev/null
+package org.evergreen_ils.utils.ui;
+
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
+import org.evergreen_ils.accountAccess.AccountAccess;
+import org.evergreen_ils.globals.AppPrefs;
+
+/**
+ * Created by kenstir on 11/21/2015.
+ */
+public class ActionBarUtils {
+ public static void initActionBarForActivity(ActionBarActivity activity, boolean isMainActivity) {
+ ActionBar actionBar = activity.getSupportActionBar();
+ actionBar.setSubtitle(AppPrefs.getString(AppPrefs.LIBRARY_NAME) + " - " + AccountAccess.userName);
+ if (!isMainActivity) {
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ }
+ }
+
+ public static void initActionBarForActivity(ActionBarActivity activity) {
+ initActionBarForActivity(activity, false);
+ }
+}
import org.evergreen_ils.globals.GlobalConfigs;
import org.evergreen_ils.searchCatalog.AdvancedSearchActivity;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
+import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
/**
}
setContentView(R.layout.activity_main);
-
- ActionBar actionBar = getSupportActionBar();
- actionBar.setTitle(AppPrefs.getString(AppPrefs.LIBRARY_NAME));
- actionBar.setSubtitle(AccountAccess.userName);
+ ActionBarUtils.initActionBarForActivity(this, true);
// singleton initialize necessary IDL and Org data
globalConfigs = GlobalConfigs.getGlobalConfigs(this);
android:versionName="1.0">
<uses-sdk
- android:minSdkVersion="10"
+ android:minSdkVersion="15"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />