* Splash activity has a share button that is hidden until a failure.
* That creates a text intent with the app Log. Probably I should spawn logcat like others do, but that will require the app to have an extra permission "read sensitive log data" which sounds like I'm doing something scary.
android:layout_centerHorizontal="true"
android:padding="20dip" />
+ <ImageButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/activity_splash_share_button"
+ android:src="@android:drawable/ic_menu_share"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_margin="12dip"
+ android:visibility="visible"/>
+
</RelativeLayout>
\ No newline at end of file
<string name="choose_library_message">Select your Library</string>
<string name="action_choose_library">Select</string>
<string name="evergreen_libraries_url">https://evergreen-ils.org/directory/libraries.json</string>
+ <string name="button_send_log">Share log</string>
</resources>
import android.app.Activity;
import android.text.TextUtils;
-import android.util.Log;
import org.evergreen_ils.accountAccess.bookbags.BookBag;
import org.evergreen_ils.accountAccess.bookbags.BookBagItem;
import org.evergreen_ils.accountAccess.checkout.CircRecord;
import org.evergreen_ils.accountAccess.holds.HoldRecord;
import org.evergreen_ils.auth.Const;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.globals.Utils;
import org.evergreen_ils.searchCatalog.RecordInfo;
import org.opensrf.net.http.HttpConnection;
return false;
return retrieveSession(auth_token);
} catch (Exception e) {
- Log.i(Const.AUTH_TAG, "reauth exception", e);
+ Log.d(Const.AUTH_TAG, "reauth exception", e);
return false;
}
}
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
-import android.util.Log;
import org.evergreen_ils.R;
import org.evergreen_ils.auth.Const;
import org.evergreen_ils.globals.Library;
+import org.evergreen_ils.globals.Log;
import java.io.IOException;
}
public static void addAccount(final Activity activity, final Runnable runnable) {
- Log.i(Const.AUTH_TAG, "addAccount");
+ Log.d(Const.AUTH_TAG, "addAccount");
final AccountManager am = AccountManager.get(activity);
final String accountType = activity.getString(R.string.ou_account_type);
am.addAccount(accountType, Const.AUTHTOKEN_TYPE, null, null, activity, new AccountManagerCallback<Bundle>() {
try {
Bundle bnd = future.getResult();
final String account_name = bnd.getString(AccountManager.KEY_ACCOUNT_NAME);
- Log.i(Const.AUTH_TAG, "added account bnd=" + bnd);
+ Log.d(Const.AUTH_TAG, "added account bnd=" + bnd);
activity.runOnUiThread(runnable);
} catch (Exception e) {
- Log.i(Const.AUTH_TAG, "failed to add account", e);
+ Log.d(Const.AUTH_TAG, "failed to add account", e);
}
}
}, null);
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.RecordInfo;
import org.evergreen_ils.searchCatalog.SearchCatalog;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.os.Bundle;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
public class BookBagDetails extends ActionBarActivity {
- private final static String TAG = BookBagDetails.class.getName();
+ private final static String TAG = BookBagDetails.class.getSimpleName();
public static final int RESULT_CODE_UPDATE = 1;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
public class BookbagsListView extends ActionBarActivity {
- private final static String TAG = BookbagsListView.class.getName();
+ private final static String TAG = BookbagsListView.class.getSimpleName();
private AccountAccess accountAccess = null;
import org.evergreen_ils.accountAccess.MaxRenewalsException;
import org.evergreen_ils.accountAccess.ServerErrorMessage;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.SearchFormat;
import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
public class ItemsCheckOutListView extends ActionBarActivity {
- private final static String TAG = ItemsCheckOutListView.class.getName();
+ private final static String TAG = ItemsCheckOutListView.class.getSimpleName();
private AccountAccess accountAccess = null;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
final FinesRecord record = getItem(position);
if (row == null) {
-
- Log.d(tag, "Starting XML view more infaltion ... ");
LayoutInflater inflater = (LayoutInflater) this.getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflater.inflate(R.layout.fines_list_item, parent, false);
- Log.d(tag, "Successfully completed XML view more Inflation!");
-
}
- // Get reference to TextView - title
- fineTitle = (TextView) row.findViewById(R.id.fines_title);
- // Get reference to TextView author
+ fineTitle = (TextView) row.findViewById(R.id.fines_title);
fineAuthor = (TextView) row.findViewById(R.id.fines_author);
-
- // Get hold status
- fineBalanceOwed = (TextView) row
- .findViewById(R.id.fines_balance_owed);
-
+ fineBalanceOwed = (TextView) row.findViewById(R.id.fines_balance_owed);
fineStatus = (TextView) row.findViewById(R.id.fines_status);
- // set text
- // set raw information
fineTitle.setText(record.title);
fineAuthor.setText(record.author);
fineBalanceOwed.setText(decimalFormater.format(record.balance_owed));
- // status.setText(record.getHoldStatus());
fineStatus.setText(record.getStatus());
return row;
import java.util.Date;
import android.support.v7.app.ActionBarActivity;
-import android.util.Log;
import android.view.MenuItem;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
public class HoldDetails extends ActionBarActivity {
- private final static String TAG = HoldDetails.class.getName();
+ private final static String TAG = HoldDetails.class.getSimpleName();
public static final int RESULT_CODE_DELETE_HOLD = 5;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.ImageDownloader;
import org.evergreen_ils.searchCatalog.SearchFormat;
import org.evergreen_ils.utils.ui.ActionBarUtils;
public class HoldsListView extends ActionBarActivity {
- private final static String TAG = HoldsListView.class.getName();
+ private final static String TAG = HoldsListView.class.getSimpleName();
private AccountAccess accountAccess = null;
}
class HoldsArrayAdapter extends ArrayAdapter<HoldRecord> {
- private final String tag = HoldsArrayAdapter.class.getName();
+ private final String tag = HoldsArrayAdapter.class.getSimpleName();
private TextView holdTitle;
private TextView holdAuthor;
import java.util.Date;
import android.support.v7.app.ActionBarActivity;
-import android.util.Log;
import android.view.MenuItem;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
import org.evergreen_ils.globals.EvergreenConstants;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.Organisation;
import org.evergreen_ils.searchCatalog.RecordInfo;
import org.evergreen_ils.utils.ui.ActionBarUtils;
public class PlaceHold extends ActionBarActivity {
- private static final String TAG = PlaceHold.class.getName();
+ private static final String TAG = PlaceHold.class.getSimpleName();
private TextView title;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
public class AccountAuthenticator extends AbstractAccountAuthenticator {
- private final static String TAG = AccountAuthenticator.class.getName();
+ private final static String TAG = AccountAuthenticator.class.getSimpleName();
private Context context;
public AccountAuthenticator(Context context) {
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
-import android.util.Log;
import android.view.View;
import android.widget.TextView;
import org.evergreen_ils.accountAccess.AccountUtils;
import org.evergreen_ils.globals.AppPrefs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.net.VolleyWrangler;
import org.evergreen_ils.globals.Library;
import org.opensrf.util.JSONException;
public class AuthenticatorActivity extends AccountAuthenticatorActivity {
- private final static String TAG = AuthenticatorActivity.class.getName();
+ private final static String TAG = AuthenticatorActivity.class.getSimpleName();
public final static String ARG_ACCOUNT_TYPE = "ACCOUNT_TYPE";
public final static String ARG_AUTH_TYPE = "AUTH_TYPE";
package org.evergreen_ils.auth;
-import android.util.Log;
import org.evergreen_ils.auth.AccountAuthenticator;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
+import org.evergreen_ils.globals.Log;
public class AuthenticatorService extends Service {
@Override
import java.util.HashMap;
import java.util.Map;
+import org.evergreen_ils.globals.Log;
import org.opensrf.Method;
import org.opensrf.net.http.GatewayRequest;
import org.opensrf.net.http.HttpConnection;
import org.opensrf.net.http.HttpRequest;
import android.text.TextUtils;
-import android.util.Log;
public class EvergreenAuthenticator {
- private final static String TAG = EvergreenAuthenticator.class.getName();
+ private final static String TAG = EvergreenAuthenticator.class.getSimpleName();
public final static String SERVICE_AUTH = "open-ils.auth";
public final static String METHOD_AUTH_INIT = "open-ils.auth.authenticate.init";
public final static String METHOD_AUTH_COMPLETE = "open-ils.auth.authenticate.complete";
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
-import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
+import org.evergreen_ils.globals.Log;
/**
* Created with IntelliJ IDEA.
private static final String STATE_DIALOG = "state_dialog";
private static final String STATE_INVALIDATE = "state_invalidate";
- private static final String TAG = TestAuthActivity.class.getName();
+ private static final String TAG = TestAuthActivity.class.getSimpleName();
private AccountManager mAccountManager;
private String mAccountType;
import org.evergreen_ils.R;
import org.evergreen_ils.barcodescan.camera.CameraManager;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
-import android.util.Log;
import android.view.Menu;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
-import android.util.Log;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
+import org.evergreen_ils.globals.Log;
/**
* This class handles all the messaging which comprises the state machine for capture.
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import android.util.Log;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.common.HybridBinarizer;
+import org.evergreen_ils.globals.Log;
final class DecodeHandler extends Handler {
import android.hardware.Camera;
import android.os.Handler;
import android.os.Message;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
final class AutoFocusCallback implements Camera.AutoFocusCallback {
import android.graphics.Point;
import android.hardware.Camera;
import android.preference.PreferenceManager;
-import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
+import org.evergreen_ils.globals.Log;
/**
* A class which deals with reading, parsing, and setting the camera parameters which are used to
import java.io.IOException;
+import android.util.Log;
import org.evergreen_ils.barcodescan.PlanarYUVLuminanceSource;
import org.evergreen_ils.barcodescan.PreferencesActivity;
import android.hardware.Camera;
import android.os.Handler;
import android.preference.PreferenceManager;
-import android.util.Log;
import android.view.SurfaceHolder;
/**
package org.evergreen_ils.barcodescan.camera;
import android.os.IBinder;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.hardware.Camera;
import android.os.Handler;
import android.os.Message;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
final class PreviewCallback implements Camera.PreviewCallback {
import org.androwrapee.db.DefaultDatabaseHelper;
import org.androwrapee.db.IllegalClassStructureException;
import org.androwrapee.db.ReflectionManager;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.services.NotificationAlert;
import android.content.Context;
-import android.util.Log;
/**
* The Class DatabaseDefaults.
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
-import android.util.Log;
import org.evergreen_ils.R;
import org.evergreen_ils.accountAccess.bookbags.BookBag;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.text.TextUtils;
-import android.util.Log;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
try {
search.getCopyStatuses();
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.d(TAG, "caught exception", e);
}
}
--- /dev/null
+package org.evergreen_ils.globals;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/** private logging class that maintains a queue for potential sharing
+ * Created by kenstir on 12/9/2015.
+ */
+public class Log {
+ private static final int mQueueSize = 200;
+ private static ArrayDeque<String> mEntries = new ArrayDeque<String>(mQueueSize);
+ private static SimpleDateFormat mTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.US);
+
+ // caller is synchronized
+ public static synchronized void push(String TAG, String msg, Throwable tr) {
+ android.util.Log.d(TAG, msg, tr);
+
+ StringBuilder sb = new StringBuilder();
+ String date = mTimeFormat.format(System.currentTimeMillis());
+ sb.append(date).append('\t').append(TAG);
+ String prefix = sb.toString();
+
+ if (msg != null) {
+ mEntries.push(prefix + '\t' + msg);
+ }
+
+ if (tr != null) {
+ mEntries.push(prefix + '\t' + tr.getMessage());
+ StackTraceElement backtrace[] = tr.getStackTrace();
+ for (StackTraceElement elem : backtrace) {
+ mEntries.push(prefix + "\t at " + elem.toString());
+ }
+ }
+
+ while (mEntries.size() > mQueueSize) {
+ mEntries.pop();
+ }
+ }
+
+ public static synchronized String getString() {
+ StringBuilder sb = new StringBuilder(mQueueSize * 120);
+ Iterator<String> it = mEntries.descendingIterator();
+ while (it.hasNext()) {
+ sb.append(it.next()).append('\n');
+ }
+ return sb.toString();
+ }
+
+ public static void d(String TAG, String msg) {
+ push(TAG, msg, null);
+ }
+
+ public static void d(String TAG, String msg, Throwable tr) {
+ push(TAG, msg, tr);
+ }
+
+ public static void i(String TAG, String msg) {
+ push(TAG, msg, null);
+ }
+
+ public static void v(String TAG, String msg) {
+ push(TAG, msg, null);
+ }
+
+ public static void w(String TAG, String msg) {
+ push(TAG, msg, null);
+ }
+
+ public static void w(String TAG, Throwable tr) {
+ push(TAG, null, tr);
+ }
+
+ public static void w(String TAG, String msg, Throwable tr) {
+ push(TAG, msg, tr);
+ }
+}
import org.opensrf.net.http.HttpConnection;
import org.opensrf.net.http.HttpRequest;
-import android.util.Log;
-
public class Utils {
- private static final String TAG = Utils.class.getName();
+ private static final String TAG = Utils.class.getSimpleName();
/**
* Gets the net page content.
public class AdvancedSearchActivity extends ActionBarActivity {
- private final static String TAG = AdvancedSearchActivity.class.getName();
+ private final static String TAG = AdvancedSearchActivity.class.getSimpleName();
private ArrayList<String> searchTerms;
private String advancedSearchFormattedText;
*/
package org.evergreen_ils.searchCatalog;
-import android.util.Log;
+
+import org.evergreen_ils.globals.Log;
import java.io.Serializable;
import java.util.Map;
public class CopyCountInformation implements Serializable {
- private final static String TAG = CopyCountInformation.class.getName();
+ private final static String TAG = CopyCountInformation.class.getSimpleName();
private static final long serialVersionUID = 12343248767867L;
public Integer org_id;
public Integer count;
*/
package org.evergreen_ils.searchCatalog;
-import android.util.Log;
+
+import org.evergreen_ils.globals.Log;
import java.io.Serializable;
import java.util.HashMap;
private static final long serialVersionUID = -7269334218707079463L;
- private final static String TAG = CopyInformation.class.getName();
+ private final static String TAG = CopyInformation.class.getSimpleName();
public Integer org_id = -1;
public String call_number_sufix;
import android.net.http.AndroidHttpClient;
import android.os.AsyncTask;
import android.os.Handler;
-import android.util.Log;
import android.widget.ImageView;
+import org.evergreen_ils.globals.Log;
/**
* This helper class download images from the Internet and binds those with the
import java.util.Map.Entry;
import android.text.TextUtils;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
import org.opensrf.util.OSRFObject;
public class RecordInfo implements Serializable {
private static final long serialVersionUID = 10123L;
- private static final String TAG = RecordInfo.class.getName();
+ private static final String TAG = RecordInfo.class.getSimpleName();
public String title = null;
public String author = null;
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.globals.AppPrefs;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.globals.Utils;
import org.opensrf.Method;
import org.opensrf.net.http.GatewayRequest;
import org.opensrf.util.OSRFObject;
import android.net.ConnectivityManager;
-import android.util.Log;
/**
* The Class SearchCatalog.
public static SearchCatalog searchCatalogSingleton = null;
- public String TAG = SearchCatalog.class.getName();
+ public String TAG = SearchCatalog.class.getSimpleName();
// the org on which the searches will be made
public Organisation selectedOrganization = null;
import org.evergreen_ils.accountAccess.holds.PlaceHold;
import org.evergreen_ils.barcodescan.CaptureActivity;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.net.VolleyWrangler;
import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.util.Log;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
public class SearchCatalogListView extends ActionBarActivity {
- private static final String TAG = SearchCatalogListView.class.getName();
+ private static final String TAG = SearchCatalogListView.class.getSimpleName();
private ArrayList<RecordInfo> recordList;
class SearchArrayAdapter extends ArrayAdapter<RecordInfo> {
- private final String tag = SearchArrayAdapter.class.getName();
+ private final String tag = SearchArrayAdapter.class.getSimpleName();
private Context context;
private NetworkImageView recordImage;
private TextView recordTitle;
package org.evergreen_ils.searchCatalog;
import android.content.Context;
-import android.util.Log;
import org.evergreen_ils.R;
+import org.evergreen_ils.globals.Log;
import org.opensrf.util.JSONException;
import org.opensrf.util.JSONReader;
*/
package org.evergreen_ils.services;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.views.splashscreen.SplashActivity;
import android.app.Notification;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.util.Log;
public class NotificationReceiver extends BroadcastReceiver {
- private static final String TAG = NotificationReceiver.class.getName();
+ private static final String TAG = NotificationReceiver.class.getSimpleName();
public static final int NOTIFICATION_ID = 1;
@Override
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.preference.PreferenceManager;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
public class PeriodicServiceBroadcastReceiver extends BroadcastReceiver {
import org.evergreen_ils.accountAccess.checkout.CircRecord;
import org.evergreen_ils.database.DatabaseManager;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.globals.Utils;
import org.evergreen_ils.auth.Const;
import org.open_ils.idl.IDLParser;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
-import android.util.Log;
public class ScheduledIntentService extends IntentService {
public static Date lastUpdateServiceDate;
- public static String TAG = ScheduledIntentService.class.getName();
+ public static String TAG = ScheduledIntentService.class.getSimpleName();
public static String ACTION = "org.evergreen_ils.updateservice";
import java.util.Map.Entry;
import java.util.Set;
-import android.util.Log;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import org.evergreen_ils.R;
public class BasicDetailsFragment extends Fragment {
- private final static String TAG = BasicDetailsFragment.class.getName();
+ private final static String TAG = BasicDetailsFragment.class.getSimpleName();
private RecordInfo record;
private Integer orgId;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
-import android.util.Log;
+import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import org.evergreen_ils.accountAccess.holds.HoldsListView;
import org.evergreen_ils.auth.Const;
import org.evergreen_ils.globals.GlobalConfigs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.searchCatalog.SearchCatalogListView;
import org.evergreen_ils.utils.ui.ActionBarUtils;
import org.evergreen_ils.views.splashscreen.SplashActivity;
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
+ String url = getString(R.string.ou_feedback_url);
+ if (TextUtils.isEmpty(url))
+ menu.removeItem(R.id.action_feedback);
return super.onCreateOptionsMenu(menu);
}
import android.accounts.AccountManager;
import android.app.Activity;
import android.os.Bundle;
-import android.util.Log;
import org.evergreen_ils.globals.Library;
+import org.evergreen_ils.globals.Log;
/** This is basically the same as an AsyncTask<String,String,String>, except that it uses
* a Thread. Starting with HONEYCOMB, tasks are executed on a single thread and the 2nd
*
*/
public class LoadingTask {
- private final static String TAG = LoadingTask.class.getName();
+ private final static String TAG = LoadingTask.class.getSimpleName();
public static final String TASK_OK = "OK";
*/
package org.evergreen_ils.views.splashscreen;
-import android.content.SharedPreferences;
+import android.widget.ImageButton;
import org.evergreen_ils.R;
-import org.evergreen_ils.globals.GlobalConfigs;
import org.evergreen_ils.globals.AppPrefs;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.views.MainActivity;
import org.evergreen_ils.views.splashscreen.LoadingTask.LoadingTaskListener;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
-import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
private ProgressBar mProgressBar;
private AlertDialog mAlertDialog;
private Button mRetryButton;
+ private ImageButton mShareLogButton;
private LoadingTask mTask;
private static boolean mInitialized;
private boolean restarted = false;
startTask();
}
});
+ mShareLogButton = (ImageButton) findViewById(R.id.activity_splash_share_button);
+ mShareLogButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent i = new Intent();
+ i.setAction(Intent.ACTION_SEND);
+ i.putExtra(Intent.EXTRA_TEXT, Log.getString());
+ i.setType("text/plain");
+ startActivity(i);
+ }
+ });
startTask();
}
@Override
public void onPreExecute() {
mRetryButton.setVisibility(View.GONE);
+ mShareLogButton.setVisibility(View.GONE);
mProgressBar.setVisibility(View.VISIBLE);
}
startApp();
} else {
String extra_text;
- if (!TextUtils.isEmpty(result))
+ if (!TextUtils.isEmpty(result)) {
extra_text = " failed:\n" + result;
- else
+ } else {
extra_text = " cancelled";
- Log.d(TAG, "progresstext += " + extra_text);
+ }
mProgressText.setText(mProgressText.getText() + extra_text);
mRetryButton.setVisibility(View.VISIBLE);
+ mShareLogButton.setVisibility(View.VISIBLE);
}
}
}
\ No newline at end of file
import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
-import android.util.Log;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;
+import org.evergreen_ils.globals.Log;
import org.evergreen_ils.net.VolleyWrangler;
import org.json.JSONArray;
import org.json.JSONObject;
public class VolleyWranglerTest
extends ActivityInstrumentationTestCase2<SimpleTestableActivity> {
- private static final String TAG = VolleyWranglerTest.class.getName();
+ private static final String TAG = VolleyWranglerTest.class.getSimpleName();
private Activity mActivity;
private VolleyWrangler mVolley;
private Response.ErrorListener mVolleyErrorListener;
<string name="ou_library_name">C/W MARS</string>
<string name="ou_activity_subtitle">%2$s</string>
<string name="ou_library_url">https://catalog.cwmars.org</string>
- <string name="ou_feedback_url">https://docs.google.com/forms/d/1RbDW1IRD8-IV4U_HdWqGXCEQOJnl87Z7HH_uVGNWASY/viewform</string>
+ <string name="ou_feedback_url"></string>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.kenstir.apps.hemlock"
android:installLocation="auto"
- android:versionCode="12"
- android:versionName="1.5">
+ android:versionCode="13"
+ android:versionName="1.6">
<uses-sdk
android:minSdkVersion="15"
package org.opensrf.net.http;
-import android.util.Log;
+import org.evergreen_ils.globals.Log;
import org.json.JSONObject;
import org.opensrf.*;
import org.opensrf.util.*;
public class GatewayRequest extends HttpRequest {
private boolean readComplete;
- private String TAG = GatewayRequest.class.getName();
+ private String TAG = GatewayRequest.class.getSimpleName();
public GatewayRequest(HttpConnection conn, String service, Method method) {
super(conn, service, method);