diff --git a/app/build.gradle b/app/build.gradle
index 14fd5f0..2008389 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,14 +1,10 @@
apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
-/*
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-*/
+
defaultConfig {
applicationId "com.hikapro.backpack"
minSdkVersion 17
@@ -18,10 +14,16 @@ android {
}
buildTypes {
release {
- minifyEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ shrinkResources true
+// minifyEnabled true
+// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ minifyEnabled false
}
}
+ lintOptions {
+ checkReleaseBuilds false
+ abortOnError false
+ }
}
repositories {
@@ -41,6 +43,7 @@ dependencies {
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.11.0'
+ compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile files('libs/socialauth-4.4.jar')
compile files('libs/socialauth-android-3.2.jar')
}
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 0000000..a541a36
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,38 @@
+{
+ "project_info": {
+ "project_number": "124365922689",
+ "project_id": "pack-with-me"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:124365922689:android:90ef7fc7743bcbe5",
+ "android_client_info": {
+ "package_name": "com.hikapro.backpack"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "AIzaSyBom_1uKODWi_mTvPAtX8JHGP2-TvNuUpU"
+ }
+ ],
+ "services": {
+ "analytics_service": {
+ "status": 2,
+ "analytics_property": {
+ "tracking_id": "UA-69165220-5"
+ }
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 1
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 60dd98a..6c47b12 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -28,6 +28,18 @@
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/app_name" />
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/hikapro/backpack/App.java b/app/src/main/java/com/hikapro/backpack/App.java
index 5ca45f6..f589fd3 100644
--- a/app/src/main/java/com/hikapro/backpack/App.java
+++ b/app/src/main/java/com/hikapro/backpack/App.java
@@ -4,6 +4,9 @@ import android.app.Application;
import android.content.Context;
import android.graphics.Typeface;
+import com.google.android.gms.analytics.GoogleAnalytics;
+import com.google.android.gms.analytics.Tracker;
+
/**
* Created by tariel on 27/04/16.
*/
@@ -11,12 +14,15 @@ public class App extends Application {
private static Context context;
private static Typeface mainFace;
+ private static Tracker tracker;
@Override
public void onCreate() {
super.onCreate();
App.context = getApplicationContext();
App.mainFace = Typeface.createFromAsset(App.context.getAssets(), "fonts/Ubuntu-B.ttf");
+ GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
+ tracker = analytics.newTracker(R.xml.global_tracker);
}
public static Context getAppContext() {
@@ -26,4 +32,8 @@ public class App extends Application {
public static Typeface getMainFace() {
return App.mainFace;
}
+
+ synchronized public static Tracker getDefaultTracker() {
+ return App.tracker;
+ }
}
diff --git a/app/src/main/java/com/hikapro/backpack/MainActivity.java b/app/src/main/java/com/hikapro/backpack/MainActivity.java
index 3077877..bddcfad 100644
--- a/app/src/main/java/com/hikapro/backpack/MainActivity.java
+++ b/app/src/main/java/com/hikapro/backpack/MainActivity.java
@@ -15,7 +15,6 @@ import com.hikapro.backpack.model.Model;
import com.hikapro.backpack.model.PackedModel;
import com.hikapro.backpack.model.SetModel;
import com.hikapro.backpack.model.ShareModel;
-import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.AddPresenter;
import com.hikapro.backpack.presenter.ItemDetailPresenter;
@@ -138,43 +137,36 @@ public class MainActivity extends Activity implements View.ActivityCallback {
model.setPresenter(presenter);
}
}
- Log.i("On create", "Activity");
}
@Override
protected void onStart() {
super.onStart();
- Log.i("onStart", "Activity");
}
@Override
protected void onRestart() {
super.onRestart();
- Log.i("onRestart", "Activity");
}
@Override
protected void onResume() {
super.onResume();
- Log.i("onResume", "Activity");
}
@Override
protected void onPause() {
super.onPause();
- Log.i("onPause", "Activity");
}
@Override
protected void onStop() {
super.onStop();
- Log.i("onStop", "Activity");
}
@Override
protected void onDestroy() {
super.onDestroy();
- Log.i("onDestroy", "Activity");
}
@Override
diff --git a/app/src/main/java/com/hikapro/backpack/StateMaintainer.java b/app/src/main/java/com/hikapro/backpack/StateMaintainer.java
index 4e626d6..efb31a2 100644
--- a/app/src/main/java/com/hikapro/backpack/StateMaintainer.java
+++ b/app/src/main/java/com/hikapro/backpack/StateMaintainer.java
@@ -3,7 +3,6 @@ package com.hikapro.backpack;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
-import android.util.Log;
import java.lang.ref.WeakReference;
import java.util.HashMap;
diff --git a/app/src/main/java/com/hikapro/backpack/model/Api.java b/app/src/main/java/com/hikapro/backpack/model/Api.java
index 7f9d1b8..54b6066 100644
--- a/app/src/main/java/com/hikapro/backpack/model/Api.java
+++ b/app/src/main/java/com/hikapro/backpack/model/Api.java
@@ -1,15 +1,14 @@
package com.hikapro.backpack.model;
-import java.util.List;
-
-import com.hikapro.backpack.model.dao.Db;
import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.model.entities.Set;
-
import com.hikapro.backpack.model.entities.SharingPicture;
import com.hikapro.backpack.model.entities.Timestamp;
import com.hikapro.backpack.model.entities.Updates;
+
+import java.util.List;
+
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
diff --git a/app/src/main/java/com/hikapro/backpack/model/DetailModel.java b/app/src/main/java/com/hikapro/backpack/model/DetailModel.java
index d3a8437..c23567c 100644
--- a/app/src/main/java/com/hikapro/backpack/model/DetailModel.java
+++ b/app/src/main/java/com/hikapro/backpack/model/DetailModel.java
@@ -11,8 +11,6 @@ import com.hikapro.backpack.model.dao.Event;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
-import java.util.Collections;
-
/**
* Created by tariel on 23/04/16.
*/
diff --git a/app/src/main/java/com/hikapro/backpack/model/ItemModel.java b/app/src/main/java/com/hikapro/backpack/model/ItemModel.java
index ae066cb..d42ceac 100644
--- a/app/src/main/java/com/hikapro/backpack/model/ItemModel.java
+++ b/app/src/main/java/com/hikapro/backpack/model/ItemModel.java
@@ -4,11 +4,6 @@ package com.hikapro.backpack.model;
import android.os.Message;
import android.widget.Toast;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
import com.hikapro.backpack.App;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.dao.Command;
@@ -17,7 +12,11 @@ import com.hikapro.backpack.model.dao.Event;
import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
-import com.hikapro.backpack.presenter.adapters.helper.AppRater;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
/**
* Created by tariel on 22/04/16.
@@ -121,6 +120,8 @@ public class ItemModel implements Model.Item {
break;
case Event.ITEM_PACKED :
executeQuery();
+ if (getPackedQty() == getActiveItemsCount())
+ NetworkUtil.sendGoogleAnalyticsEvent("SET PACKED", String.format("Set #%d", currentSet));
break;
case Event.ITEM_UNPACKED :
executeQuery();
diff --git a/app/src/main/java/com/hikapro/backpack/model/Model.java b/app/src/main/java/com/hikapro/backpack/model/Model.java
index 162bc99..f1968fa 100644
--- a/app/src/main/java/com/hikapro/backpack/model/Model.java
+++ b/app/src/main/java/com/hikapro/backpack/model/Model.java
@@ -3,12 +3,11 @@ package com.hikapro.backpack.model;
import android.graphics.Bitmap;
import android.os.Message;
-import java.util.List;
-
import com.hikapro.backpack.model.entities.Category;
-import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
+import java.util.List;
+
/**
* Created by tariel on 19/04/16.
*/
diff --git a/app/src/main/java/com/hikapro/backpack/model/NetworkUtil.java b/app/src/main/java/com/hikapro/backpack/model/NetworkUtil.java
index 23c76c2..767f98d 100644
--- a/app/src/main/java/com/hikapro/backpack/model/NetworkUtil.java
+++ b/app/src/main/java/com/hikapro/backpack/model/NetworkUtil.java
@@ -5,6 +5,11 @@ import android.content.Context;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
+import android.util.Log;
+
+import com.google.android.gms.analytics.HitBuilders;
+import com.google.android.gms.analytics.Tracker;
+import com.hikapro.backpack.App;
import java.net.InetAddress;
@@ -54,4 +59,29 @@ public class NetworkUtil {
NetworkInfo netInfo = connMgr.getActiveNetworkInfo();
return netInfo != null && netInfo.isConnected();
}
+
+ public static void sendGoogleAnalyticsEvent(String category, String message) {
+ try {
+ Tracker tracker = App.getDefaultTracker();
+ tracker.send(new HitBuilders.EventBuilder()
+ .setCategory(category)
+ .setAction(message)
+ .build());
+
+ } catch (Exception e) {
+// Log.e("Google Analytics Error", e.getMessage());
+ }
+
+ }
+
+ public static void sendGoogleAnalyticsScreen(String screen) {
+ try {
+ Tracker tracker = App.getDefaultTracker();
+ tracker.setScreenName(screen);
+ tracker.send(new HitBuilders.ScreenViewBuilder().build());
+ } catch (Exception e) {
+// Log.e("Google Analytics Error", e.getMessage());
+ }
+
+ }
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/PackedModel.java b/app/src/main/java/com/hikapro/backpack/model/PackedModel.java
index 7cd6259..15611e1 100644
--- a/app/src/main/java/com/hikapro/backpack/model/PackedModel.java
+++ b/app/src/main/java/com/hikapro/backpack/model/PackedModel.java
@@ -3,17 +3,16 @@ package com.hikapro.backpack.model;
import android.os.Message;
import android.widget.Toast;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
import com.hikapro.backpack.App;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.dao.Command;
import com.hikapro.backpack.model.dao.Event;
import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
-import com.hikapro.backpack.presenter.adapters.helper.AppRater;
+
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
/**
* Created by tariel on 12/05/16.
diff --git a/app/src/main/java/com/hikapro/backpack/model/SetModel.java b/app/src/main/java/com/hikapro/backpack/model/SetModel.java
index 223c615..79ae1ba 100644
--- a/app/src/main/java/com/hikapro/backpack/model/SetModel.java
+++ b/app/src/main/java/com/hikapro/backpack/model/SetModel.java
@@ -3,9 +3,6 @@ package com.hikapro.backpack.model;
import android.os.Message;
import android.widget.Toast;
-import java.util.ArrayList;
-import java.util.List;
-
import com.hikapro.backpack.App;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.dao.Command;
@@ -14,6 +11,9 @@ import com.hikapro.backpack.model.dao.Event;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.Presenter;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Created by tariel on 20/04/16.
@@ -102,7 +102,7 @@ public class SetModel implements Model.Set {
case Event.SYNC_FAILED :
if (presenter != null)
presenter.stopProgress();
- Toast.makeText(App.getAppContext(), "SYNC FAILED", Toast.LENGTH_SHORT).show();
+ Toast.makeText(App.getAppContext(), R.string.sync_failed, Toast.LENGTH_SHORT).show();
break;
case Event.SET_LOAD_ERROR :
if (presenter != null)
diff --git a/app/src/main/java/com/hikapro/backpack/model/ShareModel.java b/app/src/main/java/com/hikapro/backpack/model/ShareModel.java
index 59634f5..05ddc62 100644
--- a/app/src/main/java/com/hikapro/backpack/model/ShareModel.java
+++ b/app/src/main/java/com/hikapro/backpack/model/ShareModel.java
@@ -9,14 +9,8 @@ import com.hikapro.backpack.R;
import com.hikapro.backpack.model.dao.Command;
import com.hikapro.backpack.model.dao.DAO;
import com.hikapro.backpack.model.dao.Event;
-import com.hikapro.backpack.model.entities.Category;
-import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
/**
* Created by tariel on 16/05/16.
*/
diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java b/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java
index 94d15bc..b8f11fd 100644
--- a/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java
+++ b/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java
@@ -4,7 +4,6 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
@@ -12,7 +11,22 @@ import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.text.TextUtils;
-import android.util.Log;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.hikapro.backpack.App;
+import com.hikapro.backpack.R;
+import com.hikapro.backpack.model.Api;
+import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
+import com.hikapro.backpack.model.RestClient;
+import com.hikapro.backpack.model.entities.Category;
+import com.hikapro.backpack.model.entities.Item;
+import com.hikapro.backpack.model.entities.Set;
+import com.hikapro.backpack.model.entities.SharingPicture;
+import com.hikapro.backpack.model.entities.Timestamp;
+import com.hikapro.backpack.model.entities.UpdateLog;
+import com.hikapro.backpack.presenter.adapters.helper.AppRater;
import java.io.IOException;
import java.io.InputStream;
@@ -29,23 +43,6 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.hikapro.backpack.App;
-import com.hikapro.backpack.R;
-import com.hikapro.backpack.model.Api;
-import com.hikapro.backpack.model.Model;
-import com.hikapro.backpack.model.NetworkUtil;
-import com.hikapro.backpack.model.RestClient;
-import com.hikapro.backpack.model.SetModel;
-import com.hikapro.backpack.model.entities.Category;
-import com.hikapro.backpack.model.entities.Item;
-import com.hikapro.backpack.model.entities.Set;
-import com.hikapro.backpack.model.entities.SharingPicture;
-import com.hikapro.backpack.model.entities.Timestamp;
-import com.hikapro.backpack.model.entities.UpdateLog;
-import com.hikapro.backpack.presenter.adapters.helper.AppRater;
-
import retrofit2.Response;
/**
@@ -324,7 +321,7 @@ public class DAO {
db.insert(Db.LogTable.TABLE_NAME, null, values);
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Timestamp", ex.getMessage());
+// Log.e("Insert Timestamp", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -342,7 +339,7 @@ public class DAO {
db.insert(Db.SharingPicsTable.TABLE_NAME, null, values);
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Inserting sharing photo", ex.getMessage());
+// Log.e("Inserting sharing photo", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -362,7 +359,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Items", ex.getMessage());
+// Log.e("Insert Items", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -407,7 +404,7 @@ public class DAO {
ret = item.getId();
}
} catch (Exception ex) {
- Log.e("Insert Item", ex.getMessage());
+// Log.e("Insert Item", ex.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -433,7 +430,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Categories", ex.getMessage());
+// Log.e("Insert Categories", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -457,7 +454,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Sets", ex.getMessage());
+// Log.e("Insert Sets", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -478,7 +475,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Set Items", ex.getMessage());
+// Log.e("Insert Set Items", ex.getMessage());
} finally {
db.endTransaction();
}
@@ -496,7 +493,7 @@ public class DAO {
ret = db.insert(Db.SetItemsTable.TABLE_NAME, null, values);
db.setTransactionSuccessful();
} catch (Exception ex) {
- Log.e("Insert Set Item", ex.getMessage());
+// Log.e("Insert Set Item", ex.getMessage());
} finally {
db.endTransaction();
db.close();
@@ -528,7 +525,7 @@ public class DAO {
if (cursor.moveToNext())
ret = Db.LogTable.parseCursor(cursor);
} catch (Exception ex) {
- Log.e("Update Log", ex.getMessage());
+// Log.e("Update Log", ex.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -550,7 +547,7 @@ public class DAO {
if (cursor.moveToNext())
ret = Db.SharingPicsTable.parseCursor(cursor);
} catch (Exception e) {
- Log.e("Reading sharing pic", e.getMessage());
+// Log.e("Reading sharing pic", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -573,7 +570,7 @@ public class DAO {
ret = Db.ItemsTable.parseCursor(cursor);
}
} catch (Exception e) {
- Log.e("Find item", e.getMessage());
+// Log.e("Find item", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -615,7 +612,7 @@ public class DAO {
ret = Db.ItemsTable.parseCursor(cursor);
}
} catch (Exception e) {
- Log.e("Read item", e.getMessage());
+// Log.e("Read item", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -657,7 +654,7 @@ public class DAO {
ret = Db.ItemsTable.parseCursor(cursor);
}
} catch (Exception e) {
- Log.e("Read item", e.getMessage());
+// Log.e("Read item", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -704,7 +701,7 @@ public class DAO {
ret.add(item);
}
} catch (Exception e) {
- Log.e("Read items", e.getMessage());
+// Log.e("Read items", e.getMessage());
ret = null;
} finally {
if (cursor != null)
@@ -754,7 +751,7 @@ public class DAO {
ret.add(item);
}
} catch (Exception e) {
- Log.e("Read items like", e.getMessage());
+// Log.e("Read items like", e.getMessage());
ret = null;
} finally {
if (cursor != null)
@@ -793,7 +790,7 @@ public class DAO {
ret.add(item);
}
} catch (Exception e) {
- Log.e("Read items like", e.getMessage());
+// Log.e("Read items like", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -821,7 +818,7 @@ public class DAO {
ret.put(category.getId(), category);
}
} catch (Exception e) {
- Log.e("Read categories", e.getMessage());
+// Log.e("Read categories", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -856,7 +853,7 @@ public class DAO {
if (cursor.moveToNext())
ret = Db.SetsTable.parseCursor(cursor);
} catch (Exception e) {
- Log.e("Read set", e.getMessage());
+// Log.e("Read set", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -881,7 +878,7 @@ public class DAO {
}
Collections.sort(ret);
} catch (Exception e) {
- Log.e("Read sets", e.getMessage());
+// Log.e("Read sets", e.getMessage());
} finally {
if (cursor != null)
cursor.close();
@@ -905,7 +902,7 @@ public class DAO {
new String[]{String.valueOf(id)});
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update local pic", e.getMessage());
+// Log.e("Update local pic", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -933,7 +930,7 @@ public class DAO {
new String[]{String.valueOf(id)});
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update sharing pic path", e.getMessage());
+// Log.e("Update sharing pic path", e.getMessage());
ret = -1;
} finally {
if (db != null) {
@@ -960,7 +957,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update sets order", e.getMessage());
+// Log.e("Update sets order", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1003,7 +1000,7 @@ public class DAO {
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update pending removal", e.getMessage());
+// Log.e("Update pending removal", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1047,7 +1044,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update item deleted", e.getMessage());
+// Log.e("Update item deleted", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1077,7 +1074,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update set active", e.getMessage());
+// Log.e("Update set active", e.getMessage());
ret = -1;
} finally {
if (db != null) {
@@ -1104,7 +1101,7 @@ public class DAO {
db.setTransactionSuccessful();
} catch (Exception e) {
ret = -1;
- Log.e("Clean packed", e.getMessage());
+// Log.e("Clean packed", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1138,7 +1135,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update item packed", e.getMessage());
+// Log.e("Update item packed", e.getMessage());
ret = -1;
} finally {
if (db != null) {
@@ -1187,7 +1184,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update item packed", e.getMessage());
+// Log.e("Update item packed", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1229,7 +1226,7 @@ public class DAO {
new String[]{String.valueOf(setId), String.valueOf(1)});
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Restore defaults", e.getMessage());
+// Log.e("Restore defaults", e.getMessage());
ret = -1;
} finally {
if (db != null) {
@@ -1257,7 +1254,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update set names", e.getMessage());
+// Log.e("Update set names", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1284,7 +1281,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update category names", e.getMessage());
+// Log.e("Update category names", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1312,7 +1309,7 @@ public class DAO {
}
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update item names", e.getMessage());
+// Log.e("Update item names", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1340,7 +1337,7 @@ public class DAO {
db.setTransactionSuccessful();
} catch (Exception e) {
- Log.e("Update log locale", e.getMessage());
+// Log.e("Update log locale", e.getMessage());
} finally {
if (db != null) {
db.endTransaction();
@@ -1385,6 +1382,7 @@ public class DAO {
message.what = Event.ITEM_READ_ERROR;
message.arg1 = setId;
message.arg2 = itemId;
+ NetworkUtil.sendGoogleAnalyticsEvent("ITEM DETAILS CLICK", String.format("Set #%d Item #%d", setId, itemId));
break;
case Command.ITEM_DELETE_FROM_SET :
@@ -1393,6 +1391,7 @@ public class DAO {
message.what = Event.ITEM_FROM_SET_DELETED;
else
message.what = Event.ITEM_FROM_SET_ERROR;
+ NetworkUtil.sendGoogleAnalyticsEvent("ITEM DELETED", String.format("Set #%d Item #%d", setId, itemId));
break;
case Command.ITEM_PENDING_REMOVAL:
@@ -1432,6 +1431,7 @@ public class DAO {
} else {
message.what = Event.ITEM_INSERT_ERROR;
}
+ NetworkUtil.sendGoogleAnalyticsEvent("ITEM ADDED", String.format("Set #%d Item #%d", setId, item.getId()));
break;
case Command.ITEM_PACK :
@@ -1572,6 +1572,7 @@ public class DAO {
message.what = Event.SET_UNPACK_COMPLETED;
else
message.what = Event.SET_UNPACK_ERROR;
+ NetworkUtil.sendGoogleAnalyticsEvent("SET UNPACK", String.format("Set #%d", setId));
break;
case Command.SET_RESTORE_DEFAULT :
@@ -1627,7 +1628,7 @@ public class DAO {
message.what = Event.SYNC_COMPLETED;
else {
if (!NetworkUtil.isInternetAvailable()) {
- message.what = Event.SYNC_FAILED;
+ message.what = Event.SYNC_NO_CONNECTION;
} else {
Response> response0 = api.getSets(locale).execute();
updateSetNames(response0.body());
@@ -1711,7 +1712,7 @@ public class DAO {
message.what = Event.SYNC_FAILED;
}
} catch (Exception ex) {
- Log.e("Read from file", ex.getMessage());
+// Log.e("Read from file", ex.getMessage());
message.what = Event.SYNC_FAILED;
} finally {
message.arg1 = 200;
@@ -1906,7 +1907,7 @@ public class DAO {
is.close();
sets = new String(buffer, "UTF-8");
} catch (IOException ex) {
- Log.e("Reading json", ex.getMessage());
+// Log.e("Reading json", ex.getMessage());
}
return sets;
}
@@ -1921,7 +1922,7 @@ public class DAO {
is.close();
categories = new String(buffer, "UTF-8");
} catch (IOException ex) {
- Log.e("Reading json", ex.getMessage());
+// Log.e("Reading json", ex.getMessage());
}
return categories;
}
@@ -1936,7 +1937,7 @@ public class DAO {
is.close();
items = new String(buffer, "UTF-8");
} catch (IOException ex) {
- Log.e("Reading json", ex.getMessage());
+// Log.e("Reading json", ex.getMessage());
}
return items;
}
@@ -1951,8 +1952,9 @@ public class DAO {
is.close();
sharingPic = new String(buffer, "UTF-8");
} catch (IOException ex) {
- Log.e("Reading json", ex.getMessage());
+// Log.e("Reading json", ex.getMessage());
}
return sharingPic;
}
+
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/Db.java b/app/src/main/java/com/hikapro/backpack/model/dao/Db.java
index c53e84b..4905369 100644
--- a/app/src/main/java/com/hikapro/backpack/model/dao/Db.java
+++ b/app/src/main/java/com/hikapro/backpack/model/dao/Db.java
@@ -5,11 +5,6 @@ import android.database.Cursor;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
-
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Locale;
-
import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.model.entities.Set;
@@ -17,6 +12,10 @@ import com.hikapro.backpack.model.entities.SharingPicture;
import com.hikapro.backpack.model.entities.Timestamp;
import com.hikapro.backpack.model.entities.UpdateLog;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Locale;
+
/**
* Created by tariel on 20/04/16.
*/
diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/ImageDownloadHelper.java b/app/src/main/java/com/hikapro/backpack/model/dao/ImageDownloadHelper.java
index 5a8b4f6..884daed 100644
--- a/app/src/main/java/com/hikapro/backpack/model/dao/ImageDownloadHelper.java
+++ b/app/src/main/java/com/hikapro/backpack/model/dao/ImageDownloadHelper.java
@@ -6,8 +6,9 @@ import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Environment;
import android.support.v4.content.ContextCompat;
-import android.util.Log;
-import android.widget.Toast;
+
+import com.hikapro.backpack.App;
+import com.hikapro.backpack.model.NetworkUtil;
import java.io.File;
import java.io.FileOutputStream;
@@ -16,10 +17,6 @@ import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
-import com.hikapro.backpack.App;
-import com.hikapro.backpack.R;
-import com.hikapro.backpack.model.NetworkUtil;
-
/**
* Created by tariel on 04/05/16.
*/
@@ -43,9 +40,9 @@ public class ImageDownloadHelper {
bitmap = BitmapFactory.decodeStream(conn.getInputStream());
} catch (SocketTimeoutException ex) {
bitmap = null;
- Log.e(IMAGE_DOWNLOAD_TAG, " Timeout elapsed.");
+// Log.e(IMAGE_DOWNLOAD_TAG, " Timeout elapsed.");
} catch (Exception ex) {
- Log.e(IMAGE_DOWNLOAD_TAG, " File cannot be downloaded due to exception.");
+// Log.e(IMAGE_DOWNLOAD_TAG, " File cannot be downloaded due to exception.");
}
}
@@ -75,7 +72,7 @@ public class ImageDownloadHelper {
try {
file = File.createTempFile(fileName, null, context.getCacheDir());
} catch (IOException e) {
- Log.e(IMAGE_DOWNLOAD_TAG, " Cannot obtain temp file");
+// Log.e(IMAGE_DOWNLOAD_TAG, " Cannot obtain temp file");
}
return file;
@@ -99,7 +96,7 @@ public class ImageDownloadHelper {
outputStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
} catch (Exception e) {
- Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (Internal): " + e);
+// Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (Internal): " + e);
} finally {
if (outputStream != null) {
@@ -128,10 +125,10 @@ public class ImageDownloadHelper {
outputStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
} else {
- Log.e(IMAGE_DOWNLOAD_TAG, "Saving failed (External): directory unavailable.");
+// Log.e(IMAGE_DOWNLOAD_TAG, "Saving failed (External): directory unavailable.");
}
} catch (Exception e) {
- Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (External): " + e);
+// Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (External): " + e);
} finally {
@@ -154,10 +151,7 @@ public class ImageDownloadHelper {
public boolean isExternalStorageWritable() {
boolean ret;
String state = Environment.getExternalStorageState();
- if (Environment.MEDIA_MOUNTED.equals(state)) {
- ret = true;
- } else
- ret = false;
+ ret = Environment.MEDIA_MOUNTED.equals(state);
return ret;
}
@@ -166,32 +160,33 @@ public class ImageDownloadHelper {
public boolean isExternalStorageReadable() {
boolean ret;
String state = Environment.getExternalStorageState();
- if (Environment.MEDIA_MOUNTED.equals(state) ||
- Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
- ret = true;
- } else
- ret = false;
+ ret = Environment.MEDIA_MOUNTED.equals(state) ||
+ Environment.MEDIA_MOUNTED_READ_ONLY.equals(state);
return ret;
}
private File getDir() {
File ret = null;
- // Get available SD cards
- File[] dirs = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_PICTURES);
- if (dirs != null) {
- switch (dirs.length) {
- case 1:
- ret = new File(dirs[0], IMAGE_DIRECTORY_NAME); // can be emulated SD card
- break;
- case 2:
- ret = new File(dirs[1], IMAGE_DIRECTORY_NAME);// real SD card
- break;
+ try {
+ // Get available SD cards
+ File[] dirs = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_PICTURES);
+ if (dirs != null) {
+ switch (dirs.length) {
+ case 1:
+ ret = new File(dirs[0], IMAGE_DIRECTORY_NAME); // can be emulated SD card
+ break;
+ case 2:
+ ret = new File(dirs[1], IMAGE_DIRECTORY_NAME);// real SD card
+ break;
+ }
}
- }
- if (!ret.mkdirs()) {
- Log.e(IMAGE_DOWNLOAD_TAG, "Directory was not created or already exists.");
+ if (!ret.mkdirs()) {
+// Log.e(IMAGE_DOWNLOAD_TAG, "Directory was not created or already exists.");
+ }
+ } catch (Exception ex) {
+
}
return ret;
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/entities/Category.java b/app/src/main/java/com/hikapro/backpack/model/entities/Category.java
index 6655b82..a1f79ee 100644
--- a/app/src/main/java/com/hikapro/backpack/model/entities/Category.java
+++ b/app/src/main/java/com/hikapro/backpack/model/entities/Category.java
@@ -53,9 +53,7 @@ public class Category implements Serializable {
Category that = (Category) o;
- if (id != that.id)
- return false;
- return true;
+ return id == that.id;
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/entities/Item.java b/app/src/main/java/com/hikapro/backpack/model/entities/Item.java
index 591cd71..fc25bce 100644
--- a/app/src/main/java/com/hikapro/backpack/model/entities/Item.java
+++ b/app/src/main/java/com/hikapro/backpack/model/entities/Item.java
@@ -166,19 +166,17 @@ public class Item implements Comparable- , Serializable {
Item that = (Item) o;
- if (id != that.id)
- return false;
- return true;
+ return id == that.id;
}
@Override
public int compareTo(Item another) {
- int cmp = Integer.valueOf(category).compareTo(Integer.valueOf(another.category));
+ int cmp = Integer.valueOf(category).compareTo(another.category);
if (cmp != 0)
return cmp;
else {
- cmp = Boolean.valueOf(pendingRemoval).compareTo(Boolean.valueOf(another.pendingRemoval));
+ cmp = Boolean.valueOf(pendingRemoval).compareTo(another.pendingRemoval);
return (cmp != 0 ? cmp : name.compareTo(another.name));
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/entities/Set.java b/app/src/main/java/com/hikapro/backpack/model/entities/Set.java
index 1ecb529..583a8d4 100644
--- a/app/src/main/java/com/hikapro/backpack/model/entities/Set.java
+++ b/app/src/main/java/com/hikapro/backpack/model/entities/Set.java
@@ -133,14 +133,12 @@ public class Set implements Comparable, Serializable {
Set that = (Set) o;
- if (id != that.id)
- return false;
- return true;
+ return id == that.id;
}
@Override
public int compareTo(Set another) {
- int cmp = Integer.valueOf(lineNumber).compareTo(Integer.valueOf(another.lineNumber));
+ int cmp = Integer.valueOf(lineNumber).compareTo(another.lineNumber);
return (cmp != 0 ? cmp : name.compareTo(another.name));
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/model/entities/SharingPicture.java b/app/src/main/java/com/hikapro/backpack/model/entities/SharingPicture.java
index 68b6f6f..2d1f7a6 100644
--- a/app/src/main/java/com/hikapro/backpack/model/entities/SharingPicture.java
+++ b/app/src/main/java/com/hikapro/backpack/model/entities/SharingPicture.java
@@ -75,9 +75,7 @@ public class SharingPicture {
SharingPicture that = (SharingPicture) o;
- if (id != that.id)
- return false;
- return true;
+ return id == that.id;
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java
index e363fca..b4597cd 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java
@@ -12,12 +12,9 @@ import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
-import android.text.Editable;
-import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.Button;
-import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SearchView;
@@ -25,12 +22,12 @@ import android.widget.Toast;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.adapters.AddListAdapter;
import com.hikapro.backpack.presenter.adapters.helper.FlowLayout;
import com.hikapro.backpack.presenter.adapters.helper.Util;
-import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
import com.hikapro.backpack.view.View;
@@ -41,6 +38,8 @@ import java.lang.ref.WeakReference;
*/
public class AddPresenter implements Presenter.Add {
+ private static final String TAG = "Add New Item";
+
private WeakReference view;
private Model.Add model;
@@ -49,15 +48,12 @@ public class AddPresenter implements Presenter.Add {
private FlowLayout categoryContainer;
private ViewGroup categoryContainerMain;
private boolean isContainerAlreadyInitialised;
- private Item newItem;
private Item selectedItem;
private Button currentCategoryButton;
- private Button cancelButton;
private Button saveButton;
private SearchView searchView;
private boolean canSave;
-
public AddPresenter() {
this.adapter = new AddListAdapter(this);
}
@@ -116,7 +112,7 @@ public class AddPresenter implements Presenter.Add {
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setCustomView(custActionBarView);
- cancelButton = (Button) custActionBarView.findViewById(R.id.action_add_cancel);
+ Button cancelButton = (Button) custActionBarView.findViewById(R.id.action_add_cancel);
saveButton = (Button) custActionBarView.findViewById(R.id.action_add_save);
android.view.View.OnClickListener listener = new ActionBarButtonClickListener();
cancelButton.setOnClickListener(listener);
@@ -136,6 +132,7 @@ public class AddPresenter implements Presenter.Add {
magImage.setLayoutParams(new LinearLayout.LayoutParams(0, 0));
searchView.setMinimumHeight(40);
searchView.setOnQueryTextListener(new SearchTextListener());
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return view;
}
@@ -182,11 +179,8 @@ public class AddPresenter implements Presenter.Add {
private void setSaveButtonAccess() {
- if (searchView.getQuery().length() > 0 && currentCategoryButton != null
- || selectedItem != null)
- canSave = true;
- else
- canSave = false;
+ canSave = searchView.getQuery().length() > 0 && currentCategoryButton != null
+ || selectedItem != null;
if (canSave)
saveButton.setTextColor(saveButton.getResources().getColor(R.color.save_green));
@@ -280,7 +274,7 @@ public class AddPresenter implements Presenter.Add {
if (selectedItem != null) {
model.add(selectedItem, getView().getSet().getId());
} else {
- newItem = new Item(searchView.getQuery().toString(), currentCategoryButton.getId());
+ Item newItem = new Item(searchView.getQuery().toString(), currentCategoryButton.getId());
newItem.setUserDefined(true);
model.add(newItem, getView().getSet().getId());
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/ItemDetailPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/ItemDetailPresenter.java
index 5281430..da65b71 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/ItemDetailPresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/ItemDetailPresenter.java
@@ -16,23 +16,25 @@ import android.webkit.URLUtil;
import android.widget.ImageView;
import android.widget.TextView;
-import java.lang.ref.WeakReference;
-
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.adapters.ItemDetailAdapter;
import com.hikapro.backpack.presenter.adapters.helper.OnSwipeTouchListener;
import com.hikapro.backpack.presenter.adapters.helper.Util;
-import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
import com.hikapro.backpack.view.View;
+import java.lang.ref.WeakReference;
+
/**
* Created by tariel on 23/04/16.
*/
public class ItemDetailPresenter implements Presenter.ItemDetail {
+ private static final String TAG = "Item Details";
+
private WeakReference view;
private Model.Detail model;
private Model.Item exModel;
@@ -110,6 +112,7 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return view;
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java
index ba9be4a..2cdd29a 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java
@@ -19,24 +19,26 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
-import java.lang.ref.WeakReference;
-
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.model.entities.Set;
+import com.hikapro.backpack.presenter.adapters.ItemListAdapter;
import com.hikapro.backpack.presenter.adapters.helper.AppRater;
import com.hikapro.backpack.presenter.adapters.helper.Util;
-import com.hikapro.backpack.presenter.adapters.ItemListAdapter;
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecoration;
import com.hikapro.backpack.view.View;
+import java.lang.ref.WeakReference;
+
/**
* Created by tariel on 20/04/16.
*/
public class ItemListPresenter implements Presenter.ItemList {
protected static final String BUNDLE_SET_LIST_KEY = "BUNDLE_SET_LIST_KEY";
+ private static final String TAG = "Item List";
protected WeakReference view;
protected Model.Item model;
@@ -103,6 +105,7 @@ public class ItemListPresenter implements Presenter.ItemList {
android.view.View con = view.findViewById(R.id.item_list_container);
applyBackground(con, set.getId());
}
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return view;
}
@@ -168,7 +171,7 @@ public class ItemListPresenter implements Presenter.ItemList {
LinearLayoutManager llm = (LinearLayoutManager)recycler.getLayoutManager();
int pos = llm.findFirstVisibleItemPosition();
model.setLastVisiblePosition(pos);
- Log.i("Last position remember", String.valueOf(pos));
+// Log.i("Last position remember", String.valueOf(pos));
}
@Override
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java
index ab07ae9..7648ac4 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java
@@ -6,7 +6,6 @@ import android.app.Fragment;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.helper.ItemTouchHelper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -14,12 +13,11 @@ import android.widget.Button;
import android.widget.TextView;
import com.hikapro.backpack.R;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.adapters.PackedListAdapter;
import com.hikapro.backpack.presenter.adapters.helper.Util;
-import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
-import com.hikapro.backpack.presenter.adapters.helper.items.ItemSwipeCallback;
import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecoration;
/**
@@ -27,6 +25,8 @@ import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecorati
*/
public class PackedListPresenter extends ItemListPresenter {
+ private static final String TAG = "Packed items";
+
private TextView backToList;
private Button unpackButton;
@@ -97,6 +97,7 @@ public class PackedListPresenter extends ItemListPresenter {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return view;
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/Presenter.java b/app/src/main/java/com/hikapro/backpack/presenter/Presenter.java
index 443ee71..31662d3 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/Presenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/Presenter.java
@@ -1,7 +1,6 @@
package com.hikapro.backpack.presenter;
import android.content.Context;
-import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/SetListPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/SetListPresenter.java
index 62c9e55..8c35414 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/SetListPresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/SetListPresenter.java
@@ -12,11 +12,9 @@ import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.Toast;
-import java.lang.ref.WeakReference;
-import java.util.Collections;
-
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.adapters.SetListAdapter;
import com.hikapro.backpack.presenter.adapters.helper.sets.OnStartDragListener;
@@ -24,11 +22,16 @@ import com.hikapro.backpack.presenter.adapters.helper.sets.SimpleItemTouchHelper
import com.hikapro.backpack.view.View;
import com.hikapro.backpack.view.recycler.SetViewHolder;
+import java.lang.ref.WeakReference;
+import java.util.Collections;
+
/**
* Created by tariel on 20/04/16.
*/
public class SetListPresenter implements Presenter.SetList {
+ private static final String TAG = "Set List";
+
private WeakReference view;
private Model.Set model;
private SetListAdapter adapter;
@@ -94,6 +97,7 @@ public class SetListPresenter implements Presenter.SetList {
if (activity != null)
activity.getActionBar().hide();
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return view;
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java
index 9e2ba5d..20247dc 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java
@@ -4,7 +4,6 @@ import android.app.ActionBar;
import android.app.Activity;
import android.app.Dialog;
import android.app.Fragment;
-import android.content.ContentResolver;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
@@ -33,6 +32,7 @@ import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.ShareDialog;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
+import com.hikapro.backpack.model.NetworkUtil;
import com.hikapro.backpack.view.View;
import org.brickred.socialauth.Profile;
@@ -41,7 +41,6 @@ import org.brickred.socialauth.android.SocialAuthAdapter;
import org.brickred.socialauth.android.SocialAuthError;
import org.brickred.socialauth.android.SocialAuthListener;
-import java.io.File;
import java.lang.ref.WeakReference;
/**
@@ -49,6 +48,8 @@ import java.lang.ref.WeakReference;
*/
public class SharePresenter implements Presenter.Share {
+ private static final String TAG = "Share";
+
private ShareDialog shareDialog;
private CallbackManager callbackManager;
@@ -155,7 +156,7 @@ public class SharePresenter implements Presenter.Share {
public void onError(FacebookException error) {
Toast.makeText(getActivityContext(), R.string.fb_error,
Toast.LENGTH_SHORT).show();
- Log.e("Share", "Facebook error", error);
+// Log.e("Share", "Facebook error", error);
}
});
facebookButton.setOnClickListener(new android.view.View.OnClickListener() {
@@ -181,7 +182,7 @@ public class SharePresenter implements Presenter.Share {
} catch (Exception e) {
Toast.makeText(getActivityContext(), R.string.fb_error,
Toast.LENGTH_SHORT).show();
- Log.e("Sharing", "Facebook error", e);
+// Log.e("Sharing", "Facebook error", e);
}
}
}
@@ -224,6 +225,7 @@ public class SharePresenter implements Presenter.Share {
}
twitterLogin = (TextView) v.findViewById(R.id.twitter_login);
setVisibility();
+ NetworkUtil.sendGoogleAnalyticsScreen(TAG);
return v;
}
@@ -251,22 +253,22 @@ public class SharePresenter implements Presenter.Share {
socialAuthAdapter.uploadImageAsync(message, "PackWithMe.png",
bitmap, 0, new UploadImageListener());
} catch (Exception e) {
- Log.e("ShareTwitter", e.getMessage());
+// Log.e("ShareTwitter", e.getMessage());
}
}
@Override
public void onError(SocialAuthError error) {
- Log.d("ShareTwitter", "Authentication Error: " + error.getMessage());
+// Log.d("ShareTwitter", "Authentication Error: " + error.getMessage());
}
@Override
public void onCancel() {
- Log.d("ShareTwitter", "Authentication Cancelled");
+// Log.d("ShareTwitter", "Authentication Cancelled");
}
@Override
public void onBack() {
- Log.d("ShareTwitter", "Dialog Closed by pressing Back Key");
+// Log.d("ShareTwitter", "Dialog Closed by pressing Back Key");
}
}
@@ -279,16 +281,16 @@ public class SharePresenter implements Presenter.Share {
|| status.intValue() == 204) {
Toast.makeText(getActivityContext(), R.string.twitter_posted,
Toast.LENGTH_SHORT).show();
- Log.d("ShareTwitter", "Posting completed");
+// Log.d("ShareTwitter", "Posting completed");
} else {
Toast.makeText(getActivityContext(), R.string.twitter_error2,
Toast.LENGTH_SHORT).show();
- Log.d("ShareTwitter", "Posting failed");
+// Log.d("ShareTwitter", "Posting failed");
}
} catch (NullPointerException e) {
Toast.makeText(getActivityContext(), R.string.twitter_error2,
Toast.LENGTH_SHORT).show();
- Log.e("ShareTwitter", e.getMessage());
+// Log.e("ShareTwitter", e.getMessage());
}
}
@@ -296,7 +298,7 @@ public class SharePresenter implements Presenter.Share {
public void onError(SocialAuthError e) {
Toast.makeText(getActivityContext(), "Posting to twitter failed!",
Toast.LENGTH_SHORT).show();
- Log.e("ShareTwitter", e.getMessage());
+// Log.e("ShareTwitter", e.getMessage());
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/AddListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/AddListAdapter.java
index 8b45761..710485c 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/AddListAdapter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/AddListAdapter.java
@@ -4,13 +4,11 @@ import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.EditText;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
import com.hikapro.backpack.view.recycler.AddItemViewHolder;
-import com.hikapro.backpack.view.recycler.ItemViewHolder;
/**
* Created by tariel on 18/05/16.
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java
index 2087d92..a470487 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java
@@ -1,13 +1,11 @@
package com.hikapro.backpack.presenter.adapters;
-import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.CheckBox;
import android.widget.LinearLayout;
import com.hikapro.backpack.R;
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java
index 861b848..2cab6e9 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java
@@ -2,13 +2,11 @@ package com.hikapro.backpack.presenter.adapters;
import android.graphics.Color;
import android.graphics.Paint;
-import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-import android.widget.Toast;
import com.hikapro.backpack.App;
import com.hikapro.backpack.R;
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java
index ebeb18c..4399e1e 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java
@@ -3,7 +3,6 @@ package com.hikapro.backpack.presenter.adapters;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;
-import android.widget.Toast;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.entities.Item;
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java
index bc9aa5f..6fdafda 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java
@@ -1,8 +1,5 @@
package com.hikapro.backpack.presenter.adapters;
-import android.graphics.Typeface;
-import android.graphics.drawable.Drawable;
-import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AppRater.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AppRater.java
index 40964a2..bb45caf 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AppRater.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AppRater.java
@@ -9,7 +9,6 @@ import android.net.Uri;
import android.util.Log;
import android.view.Window;
import android.widget.Button;
-import android.widget.Toast;
import com.hikapro.backpack.App;
import com.hikapro.backpack.R;
@@ -80,7 +79,7 @@ public class AppRater {
later();
dialog.dismiss();
} catch (Exception e) {
- Log.e("Rate dialog", "Error while closing", e);
+// Log.e("Rate dialog", "Error while closing", e);
}
}
});
@@ -92,7 +91,7 @@ public class AppRater {
sure();
dialog.dismiss();
} catch (Exception e) {
- Log.e("Rate dialog", "Error while rating", e);
+// Log.e("Rate dialog", "Error while rating", e);
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java
index dbf43e7..da73d17 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java
@@ -25,7 +25,7 @@ public class AutoResizeTextView extends TextView {
* text, it takes less space than {@code availableSpace}, > 0
* otherwise
*/
- public int onTestSize(int suggestedSize, RectF availableSpace);
+ int onTestSize(int suggestedSize, RectF availableSpace);
}
private RectF mTextRect = new RectF();
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/DividerDecoration.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/DividerDecoration.java
index a290c5d..4f66cf5 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/DividerDecoration.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/DividerDecoration.java
@@ -9,8 +9,6 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
-import com.hikapro.backpack.presenter.adapters.helper.Util;
-
public class DividerDecoration extends RecyclerView.ItemDecoration {
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java
index bf9f687..42537a9 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java
@@ -318,10 +318,6 @@ public class SwipableElement extends LinearLayout {
public boolean isMenuVisible() {
Rect bounds = new Rect();
this.getHitRect(bounds);
- if (mMenuView.getLocalVisibleRect(bounds)) {
- return true;
- } else {
- return false;
- }
+ return mMenuView.getLocalVisibleRect(bounds);
}
}
diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java
index ab16488..78d5333 100644
--- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java
+++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java
@@ -177,10 +177,7 @@ public class SwipableRecycler extends RecyclerView {
view.getLocationOnScreen(location);
int x = location[0];
int y = location[1];
- if (ev.getRawX() < x || ev.getRawX() > (x + view.getWidth()) || ev.getRawY() < y || ev.getRawY() > (y + view.getHeight())) {
- return false;
- }
- return true;
+ return !(ev.getRawX() < x || ev.getRawX() > (x + view.getWidth()) || ev.getRawY() < y || ev.getRawY() > (y + view.getHeight()));
}
private void init() {
diff --git a/app/src/main/java/com/hikapro/backpack/view/View.java b/app/src/main/java/com/hikapro/backpack/view/View.java
index 1bb35d5..c193e11 100644
--- a/app/src/main/java/com/hikapro/backpack/view/View.java
+++ b/app/src/main/java/com/hikapro/backpack/view/View.java
@@ -21,7 +21,6 @@ public interface View {
void showItemList(Set set);
void setPresenter(Presenter.SetList presenter);
- //GLM_add_resources_SetList
OnStartDragListener getOnStartDragListener();
}
diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/AddFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/AddFragment.java
index 933d47b..8ba8ea5 100644
--- a/app/src/main/java/com/hikapro/backpack/view/fragments/AddFragment.java
+++ b/app/src/main/java/com/hikapro/backpack/view/fragments/AddFragment.java
@@ -2,19 +2,14 @@ package com.hikapro.backpack.view.fragments;
import android.app.Activity;
+import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
-import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.SearchView;
-import com.hikapro.backpack.R;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.Presenter;
@@ -64,14 +59,11 @@ public class AddFragment extends Fragment implements com.hikapro.backpack.view.V
throw new ClassCastException(activity.toString()
+ " must implement activityCallback");
}
- Log.i(this.toString(), " onAttach");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // setHasOptionsMenu(true);
- Log.i(this.toString(), " onCreate");
}
@Override
@@ -79,50 +71,42 @@ public class AddFragment extends Fragment implements com.hikapro.backpack.view.V
Bundle savedInstanceState) {
presenter.setView(this);
View view = presenter.onCreateView(inflater, container, savedInstanceState);
- Log.i(this.toString(), " onCreateView");
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- Log.i(this.toString(), " onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
- Log.i(this.toString(), " onStart");
}
@Override
public void onResume() {
super.onResume();
- Log.i(this.toString(), " onResume");
}
@Override
public void onStop() {
super.onStop();
- Log.i(this.toString(), " onStop");
}
@Override
public void onDestroyView() {
super.onDestroyView();
- presenter.onDestroy(true); // TODO isChangingConfigurations
- Log.i(this.toString(), " onDestroyView");
+ presenter.onDestroy(true);
}
@Override
public void onDestroy() {
super.onDestroy();
- presenter.onDestroy(false); // TODO isChangingConfigurations
- Log.i(this.toString(), " onDestroy");
+ presenter.onDestroy(false);
}
@Override
public void onDetach() {
super.onDetach();
- Log.i(this.toString(), " onDetach");
}
@Override
diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/ItemDetailFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/ItemDetailFragment.java
index 7a88f67..58b48e6 100644
--- a/app/src/main/java/com/hikapro/backpack/view/fragments/ItemDetailFragment.java
+++ b/app/src/main/java/com/hikapro/backpack/view/fragments/ItemDetailFragment.java
@@ -2,19 +2,14 @@ package com.hikapro.backpack.view.fragments;
import android.app.Activity;
+import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
-import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import com.hikapro.backpack.R;
-import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;
/**
@@ -64,62 +59,51 @@ public class ItemDetailFragment extends Fragment implements com.hikapro.backpack
throw new ClassCastException(activity.toString()
+ " must implement activityCallback");
}
- Log.i(this.toString(), "onAttach");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- Log.i(this.toString(), "onCreate");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
presenter.setView(this);
View view = presenter.onCreateView(inflater, container, savedInstanceState);
- Log.i(this.toString(), " onCreateView");
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- Log.i(this.toString(), " onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
- Log.i(this.toString(), " onStart");
}
@Override
public void onResume() {
super.onResume();
- Log.i(this.toString(), " onResume");
}
@Override
public void onStop() {
super.onStop();
- Log.i(this.toString(), " onStop");
}
@Override
public void onDestroyView() {
super.onDestroyView();
presenter.onDestroy(true);
- Log.i(this.toString(), " onDestroyView");
}
@Override
public void onDestroy() {
super.onDestroy();
presenter.onDestroy(false);
- Log.i(this.toString(), " onDestroy");
}
@Override
public void onDetach() {
super.onDetach();
- Log.i(this.toString(), " onDetach");
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
- Log.i(this.toString(), " onSaveInstanceState");
}
@Override
diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/ItemListFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/ItemListFragment.java
index 9235b19..a028a62 100644
--- a/app/src/main/java/com/hikapro/backpack/view/fragments/ItemListFragment.java
+++ b/app/src/main/java/com/hikapro/backpack/view/fragments/ItemListFragment.java
@@ -5,7 +5,6 @@ import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
-import android.support.v4.app.NavUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -14,11 +13,9 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SearchView;
-import android.widget.Toast;
import com.hikapro.backpack.R;
import com.hikapro.backpack.model.Model;
-import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.model.entities.Set;
import com.hikapro.backpack.presenter.Presenter;
@@ -55,7 +52,6 @@ public class ItemListFragment extends Fragment implements com.hikapro.backpack.v
final MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) item.getActionView();
searchView.setOnQueryTextListener(this);
- Log.i(this.getClass().getName(), " onCreateOptionsMenu");
}
@Override
@@ -119,66 +115,55 @@ public class ItemListFragment extends Fragment implements com.hikapro.backpack.v
throw new ClassCastException(activity.toString()
+ " must implement activityCallback");
}
- Log.i(this.getClass().getName(), " onAttach");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
- Log.i(this.getClass().getName(), " onCreate");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
presenter.setView(this);
View view = presenter.onCreateView(inflater, container, savedInstanceState);
- Log.i(this.getClass().getName(), " onCreateView");
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- Log.i(this.getClass().getName(), " onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
- Log.i(this.getClass().getName(), " onStart");
}
@Override
public void onResume() {
super.onResume();
presenter.onResume();
- Log.i(this.getClass().getName(), " onResume");
}
@Override
public void onStop() {
super.onStop();
- Log.i(this.getClass().getName(), " onStop");
}
@Override
public void onDestroyView() {
super.onDestroyView();
- presenter.onDestroy(true); // TODO isChangingConfigurations
+ presenter.onDestroy(true);
hz = false;
- Log.i(this.getClass().getName(), " onDestroyView");
}
@Override
public void onDestroy() {
super.onDestroy();
- presenter.onDestroy(false); // TODO isChangingConfigurations
- Log.i(this.getClass().getName(), " onDestroy");
+ presenter.onDestroy(false);
}
@Override
public void onDetach() {
super.onDetach();
- Log.i(this.getClass().getName(), " onDetach");
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
presenter.onSaveInstanceState(outState);
- Log.i(this.getClass().getName(), " onSaveInstanceState");
}
@Override
diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java
index af8e622..4d9ba20 100644
--- a/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java
+++ b/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java
@@ -48,17 +48,14 @@ public class SetListFragment extends Fragment implements com.hikapro.backpack.vi
throw new ClassCastException(activity.toString()
+ " must implement activityCallback");
}
- Log.i(this.toString(), "onAttach");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- Log.i(this.toString(), "onCreate");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- Log.i(this.toString(), "onCreateView");
presenter.setView(this);
View view = presenter.onCreateView(inflater, container, savedInstanceState);
@@ -68,44 +65,36 @@ public class SetListFragment extends Fragment implements com.hikapro.backpack.vi
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- Log.i(this.toString(), "onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
- Log.i(this.toString(), "onStart");
}
@Override
public void onResume() {
super.onResume();
- Log.i(this.toString(), "onResume");
}
@Override
public void onPause() {
super.onPause();
- Log.i(this.toString(), "onPause");
}
@Override
public void onStop() {
super.onStop();
- Log.i(this.toString(), "onStop");
}
@Override
public void onDestroyView() {
super.onDestroyView();
- presenter.onDestroy(true); // TODO isChangingConfigurations
- Log.i(this.toString(), "onDestroyView");
+ presenter.onDestroy(true);
}
@Override
public void onDestroy() {
super.onDestroy();
- presenter.onDestroy(false); // TODO isChangingConfigurations
- Log.i(this.toString(), "onDestroy");
+ presenter.onDestroy(false);
}
@Override
public void onDetach() {
super.onDetach();
- Log.i(this.toString(), "onDetach");
}
@Override
@@ -133,13 +122,11 @@ public class SetListFragment extends Fragment implements com.hikapro.backpack.vi
}
- //GLM_add_resources_SetList
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder) {
presenter.onStartDrag(viewHolder);
}
- //GLM_add_resources_SetList
@Override
public OnStartDragListener getOnStartDragListener() {
return this;
diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/ShareFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/ShareFragment.java
index 4d59cbb..7e6e33d 100644
--- a/app/src/main/java/com/hikapro/backpack/view/fragments/ShareFragment.java
+++ b/app/src/main/java/com/hikapro/backpack/view/fragments/ShareFragment.java
@@ -2,15 +2,14 @@ package com.hikapro.backpack.view.fragments;
import android.app.Activity;
+import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
-import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import com.hikapro.backpack.R;
import com.hikapro.backpack.presenter.Presenter;
/**
@@ -50,7 +49,6 @@ public class ShareFragment extends Fragment implements com.hikapro.backpack.view
throw new ClassCastException(activity.toString()
+ " must implement activityCallback");
}
- Log.i(this.toString(), "onAttach");
}
diff --git a/app/src/main/java/com/hikapro/backpack/view/recycler/AddItemViewHolder.java b/app/src/main/java/com/hikapro/backpack/view/recycler/AddItemViewHolder.java
index a36abe5..3b2a979 100644
--- a/app/src/main/java/com/hikapro/backpack/view/recycler/AddItemViewHolder.java
+++ b/app/src/main/java/com/hikapro/backpack/view/recycler/AddItemViewHolder.java
@@ -2,7 +2,6 @@ package com.hikapro.backpack.view.recycler;
import android.support.v7.widget.RecyclerView;
import android.view.View;
-
import android.widget.RelativeLayout;
import android.widget.TextView;
diff --git a/app/src/main/java/com/hikapro/backpack/view/recycler/ItemViewHolder.java b/app/src/main/java/com/hikapro/backpack/view/recycler/ItemViewHolder.java
index 40e6a50..5ee5650 100644
--- a/app/src/main/java/com/hikapro/backpack/view/recycler/ItemViewHolder.java
+++ b/app/src/main/java/com/hikapro/backpack/view/recycler/ItemViewHolder.java
@@ -3,13 +3,11 @@ package com.hikapro.backpack.view.recycler;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.TextView;
import com.hikapro.backpack.R;
-import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipableElement;
/**
diff --git a/app/src/main/java/com/hikapro/backpack/view/recycler/SetViewHolder.java b/app/src/main/java/com/hikapro/backpack/view/recycler/SetViewHolder.java
index 47c5a0e..23d132a 100644
--- a/app/src/main/java/com/hikapro/backpack/view/recycler/SetViewHolder.java
+++ b/app/src/main/java/com/hikapro/backpack/view/recycler/SetViewHolder.java
@@ -38,7 +38,6 @@ public class SetViewHolder extends RecyclerView.ViewHolder implements ItemTouchH
cardContent = (ViewGroup) view.findViewById(R.id.card_content);
}
- //GLM_add_resources_SetList
@Override
public void onItemClear() {
cardContent.setBackgroundColor(cardView.getResources().getColor(R.color.colorListBackground));
@@ -48,7 +47,6 @@ public class SetViewHolder extends RecyclerView.ViewHolder implements ItemTouchH
drawable = null;
}
- //GLM_add_resources_SetList
@Override
public void onItemSelected() {
this.drawable = cardContent.getBackground();
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
index 0291e14..00d211a 100644
--- a/app/src/main/res/menu/menu_main.xml
+++ b/app/src/main/res/menu/menu_main.xml
@@ -31,6 +31,7 @@
android:actionViewClass="android.widget.SearchView"
android:visible="true"
android:title="@string/menu_search"/>
+
-
+
Собрано
Показать вещи в рюкзаке ↓
@@ -41,6 +42,7 @@
Пожалуйста, подождите
Постинг недоступен. Пожалуйста, проверьте Ваше соединение с Интернетом.
Загрузка...
+ Ошибка синхронизации
Восстановить список
Уверены, что хотите восстановить список? Удалённые Вами предметы будут восстановлены, а добавленные удалены.
diff --git a/app/src/main/res/values/locale.xml b/app/src/main/res/values/locale.xml
index 7646673..9311400 100644
--- a/app/src/main/res/values/locale.xml
+++ b/app/src/main/res/values/locale.xml
@@ -15,7 +15,7 @@
LEAVE AT HOME
ADD TO BAG
RETURN TO LIST
- Restore completed
+ Restoring completed
Cannot post to twitter!
Posting to twitter failed!
Posted to twitter!
@@ -41,6 +41,7 @@
Please, wait for a while
Posting is not available. Please, check your internet connection.
Loading...
+ Sync failed
Restore To Default
Do you want to restore this list? Items you have added will be removed, while deleted items will be added back.
diff --git a/app/src/main/res/values/params.xml b/app/src/main/res/values/params.xml
index f465715..de3cd5a 100644
--- a/app/src/main/res/values/params.xml
+++ b/app/src/main/res/values/params.xml
@@ -1,8 +1,8 @@
200
- 768
- -768
+ 720
+ -720
1024
-1024
diff --git a/build.gradle b/build.gradle
index aff4f41..e8778b9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
+ classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files