DT @18.12.2015: Änderungen an IncidentObject und weitere Anpassungen vervollständigt
This commit is contained in:
@@ -73,10 +73,11 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/multidex/1.0.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.beardedhen/androidbootstrap/2.0.1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.beardedhen/androidbootstrap/2.0.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.1.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.8.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.3.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.3.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/jars" />
|
||||||
@@ -107,6 +108,8 @@
|
|||||||
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
|
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="materialize-0.5.1" level="project" />
|
<orderEntry type="library" exported="" name="materialize-0.5.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="facebook-android-sdk-4.8.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
|
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="androidbootstrap-2.0.1" level="project" />
|
<orderEntry type="library" exported="" name="androidbootstrap-2.0.1" level="project" />
|
||||||
@@ -120,12 +123,11 @@
|
|||||||
<orderEntry type="library" exported="" name="play-services-location-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-location-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="twitter-core-1.4.1" level="project" />
|
<orderEntry type="library" exported="" name="twitter-core-1.4.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="play-services-plus-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-plus-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="bolts-android-1.2.0" level="project" />
|
<orderEntry type="library" exported="" name="bolts-android-1.2.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="play-services-maps-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-maps-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="google-material-typeface-2.1.0.1.original" level="project" />
|
<orderEntry type="library" exported="" name="google-material-typeface-2.1.0.1.original" level="project" />
|
||||||
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
|
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
|
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="facebook-android-sdk-4.1.0" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="play-services-gcm-8.3.0" level="project" />
|
<orderEntry type="library" exported="" name="play-services-gcm-8.3.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="iconics-core-2.5.1" level="project" />
|
<orderEntry type="library" exported="" name="iconics-core-2.5.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
|
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ dependencies {
|
|||||||
compile 'com.google.android.gms:play-services-plus:8.3.0'
|
compile 'com.google.android.gms:play-services-plus:8.3.0'
|
||||||
compile 'com.google.android.gms:play-services-location:8.3.0'
|
compile 'com.google.android.gms:play-services-location:8.3.0'
|
||||||
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
||||||
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
|
compile 'com.facebook.android:facebook-android-sdk:4.8.1'
|
||||||
compile 'com.beardedhen:androidbootstrap:2.0.1'
|
compile 'com.beardedhen:androidbootstrap:2.0.1'
|
||||||
compile 'com.mcxiaoke.volley:library:1.0.19'
|
compile 'com.mcxiaoke.volley:library:1.0.19'
|
||||||
compile 'com.android.support:design:23.1.1'
|
compile 'com.android.support:design:23.1.1'
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<uses-feature
|
<uses-feature
|
||||||
android:glEsVersion="0x00020000"
|
android:glEsVersion="0x00020000"
|
||||||
android:required="true" />
|
android:required="true" />
|
||||||
|
|
||||||
<!-- Protect the map component of the application using application signature -->
|
<!-- Protect the map component of the application using application signature -->
|
||||||
<permission
|
<permission
|
||||||
android:name="org.deke.risk.riskahead.permission.MAPS_RECEIVE"
|
android:name="org.deke.risk.riskahead.permission.MAPS_RECEIVE"
|
||||||
@@ -104,10 +105,6 @@
|
|||||||
android:label="@string/title_activity_user_config"
|
android:label="@string/title_activity_user_config"
|
||||||
android:parentActivityName=".MainActivity"
|
android:parentActivityName=".MainActivity"
|
||||||
android:screenOrientation="portrait"></activity>
|
android:screenOrientation="portrait"></activity>
|
||||||
<activity
|
|
||||||
android:name=".ReportActivity"
|
|
||||||
android:label="@string/title_activity_report"
|
|
||||||
android:screenOrientation="portrait"></activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".SettingsActivity"
|
android:name=".SettingsActivity"
|
||||||
android:label="@string/title_activity_settings"
|
android:label="@string/title_activity_settings"
|
||||||
|
|||||||
@@ -170,17 +170,24 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
if (requestCode == GooglePlusButtonFragment.RC_SIGN_IN) {
|
if (requestCode == GooglePlusButtonFragment.RC_SIGN_IN) {
|
||||||
GooglePlusButtonFragment fragment = (GooglePlusButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnGP);
|
GooglePlusButtonFragment fragment = (GooglePlusButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnGP);
|
||||||
fragment.onActivityResult(requestCode, resultCode, data);
|
fragment.onActivityResult(requestCode, resultCode, data);
|
||||||
} else {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TwitterButtonFragment twitter_fragment = (TwitterButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnTW);
|
TwitterButtonFragment twitter_fragment = (TwitterButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnTW);
|
||||||
if (twitter_fragment != null) {
|
if (twitter_fragment != null) {
|
||||||
twitter_fragment.onActivityResult(requestCode, resultCode, data);
|
twitter_fragment.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FacebookButtonFragment facebook_fragment = (FacebookButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnFB);
|
||||||
|
if (facebook_fragment != null) {
|
||||||
|
facebook_fragment.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d("Test","GOT ACTIVITY RESULT!!!:"+requestCode+" : "+resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleSocialMediaLogin(final String key, final String providerType, final String username, final String email){
|
public void handleSocialMediaLogin(final String key, final String providerType, final String username, final String email){
|
||||||
@@ -196,7 +203,6 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
String tag_string_req = "sociallogin";
|
String tag_string_req = "sociallogin";
|
||||||
session.removeUser();
|
session.removeUser();
|
||||||
showDialog();
|
showDialog();
|
||||||
|
|
||||||
StringRequest strReq = getStringRequestSocialMediaLogin(key, providerType, username, email);
|
StringRequest strReq = getStringRequestSocialMediaLogin(key, providerType, username, email);
|
||||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||||
}
|
}
|
||||||
@@ -254,8 +260,8 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
session.setLogin(true);
|
session.setLogin(true);
|
||||||
|
|
||||||
String uid = jObj.getString("uid");
|
|
||||||
JSONObject user = jObj.getJSONObject("user");
|
JSONObject user = jObj.getJSONObject("user");
|
||||||
|
String id = user.getString("id");
|
||||||
String username = user.getString("username");
|
String username = user.getString("username");
|
||||||
String name = user.getString("name");
|
String name = user.getString("name");
|
||||||
String surname = user.getString("surname");
|
String surname = user.getString("surname");
|
||||||
@@ -263,10 +269,11 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
String status = user.getString("status");
|
String status = user.getString("status");
|
||||||
String created_at = user.getString("created_at");
|
String created_at = user.getString("created_at");
|
||||||
String updated_at = user.getString("updated_at");
|
String updated_at = user.getString("updated_at");
|
||||||
|
String lastlogin_at = user.getString("lastlogin_at");
|
||||||
String providerType = user.getString("providerType");
|
String providerType = user.getString("providerType");
|
||||||
String token = user.getString("token");
|
String token = user.getString("accesskey");
|
||||||
|
|
||||||
session.addUser(uid, username, name, surname, email, status, providerType, created_at, updated_at, token);
|
session.addUser(id, username, name, surname, email, status, providerType, created_at, updated_at, lastlogin_at, token);
|
||||||
|
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
LoginActivity.this,
|
LoginActivity.this,
|
||||||
@@ -276,6 +283,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
String errorMsg = jObj.getString("error_msg");
|
String errorMsg = jObj.getString("error_msg");
|
||||||
|
Log.e(TAG, "Error at social media login (Server returned error): " + errorMsg);
|
||||||
Toast.makeText(getApplicationContext(),errorMsg, Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(),errorMsg, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
@@ -287,7 +295,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onErrorResponse(VolleyError error) {
|
public void onErrorResponse(VolleyError error) {
|
||||||
Log.e(TAG, "Registration Error: " + error.getMessage());
|
Log.e(TAG, "Social Media Login Error: " + error.getMessage());
|
||||||
Toast.makeText(getApplicationContext(),
|
Toast.makeText(getApplicationContext(),
|
||||||
error.getMessage(), Toast.LENGTH_LONG).show();
|
error.getMessage(), Toast.LENGTH_LONG).show();
|
||||||
hideDialog();
|
hideDialog();
|
||||||
@@ -323,9 +331,8 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
boolean error = jObj.getBoolean("error");
|
boolean error = jObj.getBoolean("error");
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
String uid = jObj.getString("uid");
|
|
||||||
|
|
||||||
JSONObject user = jObj.getJSONObject("user");
|
JSONObject user = jObj.getJSONObject("user");
|
||||||
|
String id = user.getString("id");
|
||||||
String username = user.getString("username");
|
String username = user.getString("username");
|
||||||
String name = user.getString("name");
|
String name = user.getString("name");
|
||||||
String surname = user.getString("surname");
|
String surname = user.getString("surname");
|
||||||
@@ -333,8 +340,9 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
String status = user.getString("status");
|
String status = user.getString("status");
|
||||||
String created_at = user.getString("created_at");
|
String created_at = user.getString("created_at");
|
||||||
String updated_at = user.getString("updated_at");
|
String updated_at = user.getString("updated_at");
|
||||||
|
String lastlogin_at = user.getString("lastlogin_at");
|
||||||
|
String token = user.getString("accesskey");
|
||||||
String providerType = "local";
|
String providerType = "local";
|
||||||
String token = user.getString("token");
|
|
||||||
|
|
||||||
if(status.equals("0")){
|
if(status.equals("0")){
|
||||||
new AlertDialog.Builder(LoginActivity.this)
|
new AlertDialog.Builder(LoginActivity.this)
|
||||||
@@ -357,8 +365,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
.show();
|
.show();
|
||||||
}else {
|
}else {
|
||||||
session.addUser(uid, username, name, surname, email, status, providerType, created_at, updated_at, token);
|
session.addUser(id, username, name, surname, email, status, providerType, created_at, updated_at, lastlogin_at, token);
|
||||||
|
|
||||||
|
|
||||||
session.setLogin(true);
|
session.setLogin(true);
|
||||||
hideDialog();
|
hideDialog();
|
||||||
@@ -369,6 +376,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String errorMsg = jObj.getString("error_msg");
|
String errorMsg = jObj.getString("error_msg");
|
||||||
|
Log.e(TAG, "Error at login (Server returned error): " + errorMsg);
|
||||||
Toast.makeText(getApplicationContext(), errorMsg, Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), errorMsg, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.mikepenz.iconics.IconicsDrawable;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@@ -142,9 +143,10 @@ public class MainActivity extends BaseActivity{
|
|||||||
try {
|
try {
|
||||||
JSONObject jObj = new JSONObject(response);
|
JSONObject jObj = new JSONObject(response);
|
||||||
boolean error = jObj.getBoolean("error");
|
boolean error = jObj.getBoolean("error");
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
TextView count = (TextView) findViewById(R.id.txt_main_incidents);
|
TextView count = (TextView) findViewById(R.id.txt_main_incidents);
|
||||||
count.setText(jObj.getString("msg"));
|
count.setText(jObj.getString("total"));
|
||||||
} else {
|
} else {
|
||||||
String errorMsg = jObj.getString("error_msg");
|
String errorMsg = jObj.getString("error_msg");
|
||||||
Log.e(TAG, "Error getting incident count (server returned error): " + errorMsg);
|
Log.e(TAG, "Error getting incident count (server returned error): " + errorMsg);
|
||||||
@@ -169,9 +171,8 @@ public class MainActivity extends BaseActivity{
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getincidentcount");
|
params.put("tag", "getincidentcount");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import org.deke.risk.riskahead.helper.AppController;
|
|||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||||
import org.deke.risk.riskahead.helper.OwnIconRendered;
|
import org.deke.risk.riskahead.helper.OwnIconRendered;
|
||||||
import org.deke.risk.riskahead.helper.PlaceProvider;
|
import org.deke.risk.riskahead.helper.PlaceProvider;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -154,12 +155,12 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
{
|
{
|
||||||
mHeatMapPositionList.add(item.getPosition());
|
mHeatMapPositionList.add(item.getPosition());
|
||||||
//If the item isn't already being displayed
|
//If the item isn't already being displayed
|
||||||
if(isMarkerShown && !visibleMarkers.containsKey(item.getID()))
|
if(isMarkerShown && !visibleMarkers.containsKey(item.getId()))
|
||||||
{
|
{
|
||||||
mClusterManager.addItem(item);
|
mClusterManager.addItem(item);
|
||||||
mClusterManager.cluster();
|
mClusterManager.cluster();
|
||||||
|
|
||||||
visibleMarkers.put(item.getID(),item);
|
visibleMarkers.put(item.getId(),item);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@@ -238,29 +239,29 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getInfoWindow(Marker marker) {
|
public View getInfoWindow(Marker marker) {
|
||||||
|
LinearLayout layCategoryColor = ((LinearLayout) myContentsView.findViewById(R.id.lay_infowindow_color));
|
||||||
|
|
||||||
TextView tvTitle = ((TextView) myContentsView
|
TextView tvCategory = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_category));
|
||||||
.findViewById(R.id.txt_infowindow_title));
|
TextView tvSubcategory = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_subcategory));
|
||||||
TextView tvSnippet = ((TextView) myContentsView
|
TextView tvVictim = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_victim));
|
||||||
.findViewById(R.id.txt_infowindow_description));
|
TextView tvSuspect = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_subject));
|
||||||
TextView tvCategory = ((TextView) myContentsView
|
TextView tvTime = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_time));
|
||||||
.findViewById(R.id.txt_infowindow_category));
|
|
||||||
LinearLayout layCategory = ((LinearLayout) myContentsView
|
TextView tvUsername = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_fromuser));
|
||||||
.findViewById(R.id.lay_infowindow_color));
|
TextView tvScore = ((TextView) myContentsView.findViewById(R.id.txt_infowindow_points));
|
||||||
TextView tvUsername = ((TextView) myContentsView
|
RatingBar rbScore = ((RatingBar) myContentsView.findViewById(R.id.rb_infowindow_rating));
|
||||||
.findViewById(R.id.txt_infowindow_fromuser));
|
|
||||||
TextView tvPoints = ((TextView) myContentsView
|
|
||||||
.findViewById(R.id.txt_infowindow_points));
|
|
||||||
RatingBar rbScore = ((RatingBar) myContentsView
|
|
||||||
.findViewById(R.id.rb_infowindow_rating));
|
|
||||||
|
|
||||||
if (clickedClusterItem != null) {
|
if (clickedClusterItem != null) {
|
||||||
tvTitle.setText(clickedClusterItem.getTitle());
|
layCategoryColor.setBackgroundColor(clickedClusterItem.getCategoryColor());
|
||||||
tvSnippet.setText(clickedClusterItem.getSnippet());
|
|
||||||
tvCategory.setText(clickedClusterItem.getCategory());
|
tvCategory.setText(clickedClusterItem.getIncidentCategoryName(getApplicationContext()));
|
||||||
layCategory.setBackgroundColor(Color.parseColor("#" + clickedClusterItem.getColor()));
|
tvSubcategory.setText(clickedClusterItem.getIncidentSubCategoryName(getApplicationContext()));
|
||||||
tvUsername.setText(getString(R.string.lbl_mapsinfowindow_author) + ": " + clickedClusterItem.getUsername());
|
tvSuspect.setText(clickedClusterItem.getSuspectString(getApplicationContext()));
|
||||||
tvPoints.setText(getString(R.string.lbl_mapsinfowindow_score) + ": " + clickedClusterItem.getScore());
|
|
||||||
|
tvUsername.setText(getString(R.string.lbl_mapsinfowindow_author) + ": " + clickedClusterItem.getFromUsername());
|
||||||
|
tvScore.setText(getString(R.string.lbl_mapsinfowindow_score) + ": " + clickedClusterItem.getVotedScore());
|
||||||
|
tvVictim.setText(clickedClusterItem.getFidVictimCategory());
|
||||||
|
tvTime.setText(clickedClusterItem.getTimeString(getApplicationContext()));
|
||||||
rbScore.setRating(clickedClusterItem.getScoreStars());
|
rbScore.setRating(clickedClusterItem.getScoreStars());
|
||||||
}
|
}
|
||||||
return myContentsView;
|
return myContentsView;
|
||||||
@@ -278,7 +279,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
mHeatMapPositionList.add(new LatLng(53.252151,10.422109));
|
mHeatMapPositionList.add(new LatLng(53.252151,10.422109));
|
||||||
|
|
||||||
mProvider = new HeatmapTileProvider.Builder()
|
mProvider = new HeatmapTileProvider.Builder()
|
||||||
.radius(40)
|
.radius(50)
|
||||||
.data(mHeatMapPositionList)
|
.data(mHeatMapPositionList)
|
||||||
.opacity(0.7)
|
.opacity(0.7)
|
||||||
.build();
|
.build();
|
||||||
@@ -339,7 +340,6 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
position = new LatLng(Double.parseDouble(c.getString(1)),Double.parseDouble(c.getString(2)));
|
position = new LatLng(Double.parseDouble(c.getString(1)),Double.parseDouble(c.getString(2)));
|
||||||
markerOptions.position(position);
|
markerOptions.position(position);
|
||||||
markerOptions.title(c.getString(0));
|
markerOptions.title(c.getString(0));
|
||||||
//mMarker = mMap.addMarker(markerOptions);
|
|
||||||
}
|
}
|
||||||
if(position!=null){
|
if(position!=null){
|
||||||
CameraUpdate cameraPosition = CameraUpdateFactory.newLatLng(position);
|
CameraUpdate cameraPosition = CameraUpdateFactory.newLatLng(position);
|
||||||
@@ -354,7 +354,6 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoaderReset(Loader<Cursor> arg0) {
|
public void onLoaderReset(Loader<Cursor> arg0) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -426,6 +425,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
JSONArray incidents = jObj.getJSONArray("message");
|
JSONArray incidents = jObj.getJSONArray("message");
|
||||||
|
|
||||||
for(int i=0;i<incidents.length();i++){
|
for(int i=0;i<incidents.length();i++){
|
||||||
JSONObject incident = incidents.getJSONObject(i);
|
JSONObject incident = incidents.getJSONObject(i);
|
||||||
LatLng pos = new LatLng(Double.parseDouble(incident.getString("latitude")),Double.parseDouble(incident.getString("longitude")));
|
LatLng pos = new LatLng(Double.parseDouble(incident.getString("latitude")),Double.parseDouble(incident.getString("longitude")));
|
||||||
@@ -455,9 +455,9 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
@Override
|
@Override
|
||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getincidentswithpositionandscore");
|
params.put("tag", "getincidentswithpositionandscorev2");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
@@ -466,7 +466,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClusterItemInfoWindowClick(IncidentReport incidentReport) {
|
public void onClusterItemInfoWindowClick(IncidentReport incidentReport) {
|
||||||
gotoViewReportActivity(incidentReport.getID());
|
gotoViewReportActivity(incidentReport.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,437 +0,0 @@
|
|||||||
package org.deke.risk.riskahead;
|
|
||||||
|
|
||||||
import android.app.DatePickerDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.app.TimePickerDialog;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.location.Address;
|
|
||||||
import android.location.Geocoder;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.DatePicker;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.TimePicker;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.android.volley.Request;
|
|
||||||
import com.android.volley.Response;
|
|
||||||
import com.android.volley.VolleyError;
|
|
||||||
import com.android.volley.toolbox.StringRequest;
|
|
||||||
|
|
||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
|
||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
|
||||||
import org.deke.risk.riskahead.helper.TextValidator;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ReportActivity extends BaseActivity {
|
|
||||||
|
|
||||||
private final static String mActivityTitle = "Report";
|
|
||||||
private final static String TAG = ReportActivity.class.getSimpleName();
|
|
||||||
private static final int DATE_DIALOG_ID = 999;
|
|
||||||
private static final int TIME_DIALOG_ID = 998;
|
|
||||||
|
|
||||||
private static final String SAVED_TITLE = "801";
|
|
||||||
private static final String SAVED_DESCRIPTION_LONG = "802";
|
|
||||||
private static final String SAVED_CRIME_CATEGORY = "803";
|
|
||||||
private static final String SAVED_DATE_INCIDENT = "804";
|
|
||||||
private static final String SAVED_DATE_TIME = "805";
|
|
||||||
private static final String SAVED_POSITION = "806";
|
|
||||||
private static final String SAVED_POSITION_DETAIL = "807";
|
|
||||||
|
|
||||||
private EditText txtTitle;
|
|
||||||
private EditText txtDescription;
|
|
||||||
private Spinner txtCrimeCategory;
|
|
||||||
private EditText txtPosition;
|
|
||||||
private EditText txtDay;
|
|
||||||
private EditText txtTime;
|
|
||||||
private TextView txtPositionDetail;
|
|
||||||
|
|
||||||
private String latitude, longitude;
|
|
||||||
|
|
||||||
private int year, month, day;
|
|
||||||
private int hour, minute;
|
|
||||||
|
|
||||||
public HashMap<String, String[]> categories;
|
|
||||||
public ArrayList<String> incidentCategoryList;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
userHasToBeLoggedIn();
|
|
||||||
|
|
||||||
Intent intent = getIntent();
|
|
||||||
String pos = intent.getStringExtra(EXTRA_MESSAGE);
|
|
||||||
getCategories();
|
|
||||||
|
|
||||||
final Calendar c = Calendar.getInstance();
|
|
||||||
year = c.get(Calendar.YEAR);
|
|
||||||
month = c.get(Calendar.MONTH);
|
|
||||||
day = c.get(Calendar.DAY_OF_MONTH);
|
|
||||||
hour = c.get(Calendar.HOUR_OF_DAY);
|
|
||||||
minute = c.get(Calendar.MINUTE);
|
|
||||||
|
|
||||||
txtTitle = (EditText) findViewById(R.id.input_report_short);
|
|
||||||
txtDescription = (EditText) findViewById(R.id.input_report_long);
|
|
||||||
txtCrimeCategory = (Spinner) findViewById(R.id.dd_report_category);
|
|
||||||
txtDay = (EditText) findViewById(R.id.input_report_date);
|
|
||||||
txtTime = (EditText) findViewById(R.id.input_report_time);
|
|
||||||
txtPosition = (EditText) findViewById(R.id.input_report_position);
|
|
||||||
txtPositionDetail = (TextView) findViewById(R.id.lbl_report_position_detail);
|
|
||||||
|
|
||||||
if(txtDay.getText().toString().equals("")) {
|
|
||||||
txtDay.setText(new StringBuilder()
|
|
||||||
.append(year).append("-").append(month + 1).append("-")
|
|
||||||
.append(day).append(" "));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(txtTime.getText().toString().equals("")) {
|
|
||||||
txtTime.setText(new StringBuilder().append(hour)
|
|
||||||
.append(":").append(minute).append(" "));
|
|
||||||
}
|
|
||||||
|
|
||||||
findViewById(R.id.btn_report_position).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
gotoMapActivity();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
findViewById(R.id.btn_report_report).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
String tag_string_req = "addincidentwithposition";
|
|
||||||
StringRequest strReq = getStringRequestAddIncidentWithPosition(txtTitle.getText().toString(), txtDescription.getText().toString(), Integer.valueOf(categories.get(txtCrimeCategory.getSelectedItem().toString())[0]), latitude, longitude, 10, 1, txtDay.getText().toString(), txtTime.getText().toString());
|
|
||||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
txtDay.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
showDialog(DATE_DIALOG_ID);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
txtPosition.setEnabled(false);
|
|
||||||
txtTime.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
showDialog(TIME_DIALOG_ID);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
restoreSharedPreferences();
|
|
||||||
|
|
||||||
if(pos != null) {
|
|
||||||
String[] position = pos.split(":");
|
|
||||||
Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());
|
|
||||||
|
|
||||||
try {
|
|
||||||
List<Address> addressList = geocoder.getFromLocation(Double.parseDouble(position[0]), Double.parseDouble(position[1]), 1);
|
|
||||||
|
|
||||||
if (addressList != null && addressList.size() > 0) {
|
|
||||||
Address address = addressList.get(0);
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
for (int i = 0; i < address.getMaxAddressLineIndex(); i++) {
|
|
||||||
|
|
||||||
if(address.getAddressLine(i) != null) sb.append(address.getAddressLine(i)).append("\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//if(address.getLocality() != null) sb.append(address.getLocality()).append("\n");
|
|
||||||
//if(address.getPostalCode() != null) sb.append(address.getPostalCode()).append("\n");
|
|
||||||
if(address.getCountryName() != null) sb.append(address.getCountryName());
|
|
||||||
|
|
||||||
txtPosition.setText(address.getLocality());
|
|
||||||
txtPositionDetail.setText(sb.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
latitude = position[0];
|
|
||||||
longitude = position[1];
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
txtTitle.addTextChangedListener(new TextValidator(txtTitle,getApplicationContext()) {
|
|
||||||
@Override
|
|
||||||
public void validate(TextView textView, String text) {
|
|
||||||
if (text.length() < 5) {
|
|
||||||
textView.setError("Title must be at least\n" +
|
|
||||||
"5 characters in length.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
txtDescription.addTextChangedListener(new TextValidator(txtDescription, getApplicationContext()) {
|
|
||||||
@Override
|
|
||||||
public void validate(TextView textView, String text) {
|
|
||||||
if (text.length() < 5) {
|
|
||||||
textView.setError("Description must be at least\n" +
|
|
||||||
"5 characters in length.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
result.setSelection(reportAvtivityID, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Dialog onCreateDialog(int id) {
|
|
||||||
switch (id) {
|
|
||||||
case DATE_DIALOG_ID:
|
|
||||||
return new DatePickerDialog(this, datePickerListener,
|
|
||||||
year, month,day);
|
|
||||||
case TIME_DIALOG_ID:
|
|
||||||
return new TimePickerDialog(this, timePickerListener,
|
|
||||||
hour,minute,true);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DatePickerDialog.OnDateSetListener datePickerListener
|
|
||||||
= new DatePickerDialog.OnDateSetListener() {
|
|
||||||
|
|
||||||
// when dialog box is closed, below method will be called.
|
|
||||||
public void onDateSet(DatePicker view, int selectedYear,
|
|
||||||
int selectedMonth, int selectedDay) {
|
|
||||||
year = selectedYear;
|
|
||||||
month = selectedMonth;
|
|
||||||
day = selectedDay;
|
|
||||||
|
|
||||||
txtDay.setText(new StringBuilder().append(year)
|
|
||||||
.append("-").append(month + 1).append("-").append(day)
|
|
||||||
.append(" "));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private TimePickerDialog.OnTimeSetListener timePickerListener
|
|
||||||
= new TimePickerDialog.OnTimeSetListener() {
|
|
||||||
|
|
||||||
// when dialog box is closed, below method will be called.
|
|
||||||
public void onTimeSet(TimePicker view, int selectedHour,
|
|
||||||
int selectedMinute) {
|
|
||||||
hour = selectedHour;
|
|
||||||
minute = selectedMinute;
|
|
||||||
|
|
||||||
txtTime.setText(new StringBuilder().append(hour)
|
|
||||||
.append(":").append(minute).append(" "));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
|
|
||||||
SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();
|
|
||||||
editor.putString(SAVED_TITLE, txtTitle.getText().toString());
|
|
||||||
editor.putString(SAVED_DESCRIPTION_LONG, txtDescription.getText().toString());
|
|
||||||
editor.putInt(SAVED_CRIME_CATEGORY, txtCrimeCategory.getSelectedItemPosition());
|
|
||||||
editor.putString(SAVED_DATE_INCIDENT, txtDay.getText().toString());
|
|
||||||
editor.putString(SAVED_DATE_TIME, txtTime.getText().toString());
|
|
||||||
editor.putString(SAVED_POSITION, txtPosition.getText().toString());
|
|
||||||
editor.putString(SAVED_POSITION_DETAIL, txtPositionDetail.getText().toString());
|
|
||||||
editor.putString("latitude", latitude);
|
|
||||||
editor.putString("longitude", longitude);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restoreSharedPreferences() {
|
|
||||||
SharedPreferences prefs = getPreferences(MODE_PRIVATE);
|
|
||||||
|
|
||||||
txtTitle.setText(prefs.getString(SAVED_TITLE, ""));
|
|
||||||
txtDescription.setText(prefs.getString(SAVED_DESCRIPTION_LONG, ""));
|
|
||||||
txtCrimeCategory.setSelection(prefs.getInt(SAVED_CRIME_CATEGORY, 0));
|
|
||||||
txtDay.setText(prefs.getString(SAVED_DATE_INCIDENT, new StringBuilder()
|
|
||||||
.append(year).append("-").append(month + 1).append("-")
|
|
||||||
.append(day).append(" ").toString()));
|
|
||||||
|
|
||||||
txtTime.setText(prefs.getString(SAVED_DATE_TIME, new StringBuilder().append(hour)
|
|
||||||
.append(":").append(minute).append(" ").toString()));
|
|
||||||
|
|
||||||
txtPosition.setText(prefs.getString(SAVED_POSITION, ""));
|
|
||||||
txtPositionDetail.setText(prefs.getString(SAVED_POSITION_DETAIL, ""));
|
|
||||||
latitude = prefs.getString("latitude","0");
|
|
||||||
longitude = prefs.getString("longitude","0");
|
|
||||||
|
|
||||||
findViewById(R.id.btn_report_position).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
gotoMapActivity(latitude + ":" + longitude);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getCategories(){
|
|
||||||
String tag_string_req = "getincidentcategories";
|
|
||||||
StringRequest strReq = getStringRequestGetIncidentCategories();
|
|
||||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
|
||||||
}
|
|
||||||
|
|
||||||
private StringRequest getStringRequestAddIncidentWithPosition(final String textshort, final String textlong, final int crimecategory, final String latitude, final String longitude, final int status, final int radius, final String day, final String time) {
|
|
||||||
showDialog();
|
|
||||||
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
Log.d(TAG, "Report response: " + response);
|
|
||||||
hideDialog();
|
|
||||||
try {
|
|
||||||
JSONObject jObj = new JSONObject(response);
|
|
||||||
boolean error = jObj.getBoolean("error");
|
|
||||||
|
|
||||||
if (!error) {
|
|
||||||
showMessage("Report added!");
|
|
||||||
SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();
|
|
||||||
editor.clear().commit();
|
|
||||||
txtTitle.setText("");
|
|
||||||
txtDescription.setText("");
|
|
||||||
txtCrimeCategory.setSelection(0);
|
|
||||||
txtDay.setText("");
|
|
||||||
txtTime.setText("");
|
|
||||||
txtPosition.setText("");
|
|
||||||
findViewById(R.id.btn_report_position).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
gotoMapActivity();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
showAd();
|
|
||||||
gotoMapActivity(latitude+":"+longitude);
|
|
||||||
} else {
|
|
||||||
String errorMsg = jObj.getString("error_msg");
|
|
||||||
Log.e(TAG, "Error adding incident (Server returned error): " + errorMsg);
|
|
||||||
showMessage(errorMsg);
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
Log.e(TAG, "Error adding incident: " + error.getMessage());
|
|
||||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
|
||||||
hideDialog();
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getParams() {
|
|
||||||
Map<String, String> params = new HashMap<>();
|
|
||||||
params.put("tag", "addincidentwithposition");
|
|
||||||
params.put("uid", user.get("uid"));
|
|
||||||
params.put("token", user.get("token"));
|
|
||||||
params.put("textshort",textshort);
|
|
||||||
params.put("textlong",textlong);
|
|
||||||
params.put("fiduser",user.get("uid"));
|
|
||||||
params.put("fidcategory", Integer.toString(crimecategory));
|
|
||||||
params.put("latitude",latitude);
|
|
||||||
params.put("longitude",longitude);
|
|
||||||
params.put("status",Integer.toString(status));
|
|
||||||
params.put("radius",Integer.toString(radius));
|
|
||||||
params.put("happened_at",year+"-"+month+"-"+day+" "+hour+":"+minute+":00");
|
|
||||||
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private StringRequest getStringRequestGetIncidentCategories() {
|
|
||||||
showDialog();
|
|
||||||
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
Log.d(TAG, "Incident categories response: " + response);
|
|
||||||
hideDialog();
|
|
||||||
try {
|
|
||||||
JSONObject jObj = new JSONObject(response);
|
|
||||||
boolean error = jObj.getBoolean("error");
|
|
||||||
|
|
||||||
if (!error) {
|
|
||||||
JSONArray jsoncategories = jObj.getJSONArray("msg");
|
|
||||||
categories = new HashMap<>();
|
|
||||||
incidentCategoryList = new ArrayList<>();
|
|
||||||
|
|
||||||
for(int i=0;i<jsoncategories.length();i++){
|
|
||||||
JSONObject category = jsoncategories.getJSONObject(i);
|
|
||||||
|
|
||||||
String tmp[] = {category.getString("uid"),category.getString("description")};
|
|
||||||
categories.put(category.getString("name"),tmp);
|
|
||||||
|
|
||||||
incidentCategoryList.add(category.getString("name"));
|
|
||||||
}
|
|
||||||
|
|
||||||
Spinner spinner = (Spinner) findViewById(R.id.dd_report_category);
|
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(ReportActivity.this, android.R.layout.simple_spinner_item,incidentCategoryList);
|
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
spinner.setAdapter(adapter);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
String errorMsg = jObj.getString("error_msg");
|
|
||||||
Log.e(TAG, "Error getting incident categories (Server returned error): " + errorMsg);
|
|
||||||
showMessage(errorMsg);
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
Log.e(TAG, "Error getting incident categories: " + error.getMessage());
|
|
||||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
|
||||||
hideDialog();
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Map<String, String> getParams() {
|
|
||||||
Map<String, String> params = new HashMap<>();
|
|
||||||
params.put("tag", "getincidentcategories");
|
|
||||||
params.put("uid", user.get("uid"));
|
|
||||||
params.put("token", user.get("token"));
|
|
||||||
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutResourceId() {
|
|
||||||
return R.layout.activity_report;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getActivityName() {
|
|
||||||
return mActivityTitle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -27,6 +27,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(address.getCountryName() != null) sb.append(address.getCountryName());
|
if(address.getCountryName() != null) sb.append(address.getCountryName());
|
||||||
incident.setmPosDescription(sb.toString());
|
incident.setIncidentPositionDescription(sb.toString());
|
||||||
}
|
}
|
||||||
incident.setPosition(latlngpos);
|
incident.setPosition(latlngpos);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -267,7 +268,8 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "addincidentwithposition");
|
params.put("tag", "addincidentwithposition");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.android.volley.toolbox.StringRequest;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.deke.risk.riskahead.helper.TextValidator;
|
import org.deke.risk.riskahead.helper.TextValidator;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -131,11 +132,9 @@ public class SettingsActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(user.get("providerType") != null && user.get("providerType").equals("local")){
|
if(user.get("providerType") != null && user.get("providerType").equals("local")){
|
||||||
findViewById(R.id.lbl_settings_password).setVisibility(View.VISIBLE);
|
|
||||||
findViewById(R.id.txt_settings_password).setVisibility(View.VISIBLE);
|
findViewById(R.id.txt_settings_password).setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.btn_settings_req_password).setVisibility(View.VISIBLE);
|
findViewById(R.id.btn_settings_req_password).setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
findViewById(R.id.lbl_settings_password).setVisibility(View.INVISIBLE);
|
|
||||||
findViewById(R.id.txt_settings_password).setVisibility(View.INVISIBLE);
|
findViewById(R.id.txt_settings_password).setVisibility(View.INVISIBLE);
|
||||||
findViewById(R.id.btn_settings_req_password).setVisibility(View.INVISIBLE);
|
findViewById(R.id.btn_settings_req_password).setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
@@ -171,7 +170,7 @@ public class SettingsActivity extends BaseActivity {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
showMessage(jObj.getString("msg"));
|
showMessage(jObj.getString("msg"));
|
||||||
JSONObject tmpuser = jObj.getJSONObject("user");
|
JSONObject tmpuser = jObj.getJSONObject("user");
|
||||||
session.addUser(jObj.getString("uid"), tmpuser.getString("username"), tmpuser.getString("name"), tmpuser.getString("surname"), tmpuser.getString("email"), tmpuser.getString("status"), user.get("providerType"), tmpuser.getString("created_at"), tmpuser.getString("updated_at"), tmpuser.getString("token"));
|
session.addUser(jObj.getString("uid"), tmpuser.getString("username"), tmpuser.getString("name"), tmpuser.getString("surname"), tmpuser.getString("email"), tmpuser.getString("status"), user.get("providerType"), tmpuser.getString("created_at"), tmpuser.getString("updated_at"), tmpuser.getString("lastlogin_at"), tmpuser.getString("token"));
|
||||||
finish();
|
finish();
|
||||||
startActivity(getIntent());
|
startActivity(getIntent());
|
||||||
} else {
|
} else {
|
||||||
@@ -199,8 +198,8 @@ public class SettingsActivity extends BaseActivity {
|
|||||||
// Posting params to register url
|
// Posting params to register url
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "updateuser");
|
params.put("tag", "updateuser");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
params.put("username", txtUsername.getText().toString());
|
params.put("username", txtUsername.getText().toString());
|
||||||
params.put("name", txtName.getText().toString());
|
params.put("name", txtName.getText().toString());
|
||||||
params.put("surname", txtSurname.getText().toString());
|
params.put("surname", txtSurname.getText().toString());
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.beardedhen.androidbootstrap.BootstrapLabel;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@@ -164,8 +165,8 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
// Posting parameters to login url
|
// Posting parameters to login url
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "deactivateincident");
|
params.put("tag", "deactivateincident");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
params.put("incidentid", incidentid.toString());
|
params.put("incidentid", incidentid.toString());
|
||||||
|
|
||||||
|
|
||||||
@@ -260,8 +261,8 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
// Posting parameters to login url
|
// Posting parameters to login url
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getincidentfromid");
|
params.put("tag", "getincidentfromid");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
params.put("incidentid", incidentid.toString());
|
params.put("incidentid", incidentid.toString());
|
||||||
|
|
||||||
|
|
||||||
@@ -315,8 +316,8 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getincidentvotescore");
|
params.put("tag", "getincidentvotescore");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
params.put("incidentid", incidentid.toString());
|
params.put("incidentid", incidentid.toString());
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
@@ -377,8 +378,8 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "addvote");
|
params.put("tag", "addvote");
|
||||||
params.put("uid", user.get("uid"));
|
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", user.get("token"));
|
params.put("token", user.get(SessionManager.TOKEN));
|
||||||
params.put("incidentid", incidentid.toString());
|
params.put("incidentid", incidentid.toString());
|
||||||
params.put("votetype", votetype);
|
params.put("votetype", votetype);
|
||||||
|
|
||||||
|
|||||||
@@ -58,19 +58,17 @@ public class ReportListAdapter extends BaseAdapter {
|
|||||||
LinearLayout ll = (LinearLayout) vi.findViewById(R.id.lay_reportlist_color);
|
LinearLayout ll = (LinearLayout) vi.findViewById(R.id.lay_reportlist_color);
|
||||||
ImageView iv = (ImageView) vi.findViewById(R.id.ic_reportlist_row);
|
ImageView iv = (ImageView) vi.findViewById(R.id.ic_reportlist_row);
|
||||||
|
|
||||||
|
IncidentReport item = new IncidentReport(data.get(position));
|
||||||
|
|
||||||
try {
|
titleText.setText(item.getIncidentCategoryName(vi.getContext()));
|
||||||
titleText.setText(data.get(position).getString("created_at")+" : "+data.get(position).getString("text_short"));
|
itemText.setText(item.getIncidentSubCategoryName(vi.getContext()));
|
||||||
itemText.setText(data.get(position).getString("text_long"));
|
categoryText.setText(item.getTimeString(vi.getContext()));
|
||||||
categoryText.setText(data.get(position).getString("cat_name"));
|
|
||||||
titleText.setTypeface(null, Typeface.BOLD);
|
titleText.setTypeface(null, Typeface.BOLD);
|
||||||
ll.setBackgroundColor(Color.parseColor("#" + data.get(position).getString("color")));
|
ll.setBackgroundColor(item.getCategoryColor());
|
||||||
|
|
||||||
|
iv.setBackground(parent.getContext().getDrawable(item.getIconDrawable()));
|
||||||
|
|
||||||
IncidentReport item = new IncidentReport(data.get(position));
|
|
||||||
iv.setBackground(parent.getContext().getDrawable(item.getIconDrawable()));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return vi;
|
return vi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,32 @@
|
|||||||
package org.deke.risk.riskahead.fragment;
|
package org.deke.risk.riskahead.fragment;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import com.facebook.AccessToken;
|
||||||
import com.facebook.CallbackManager;
|
import com.facebook.CallbackManager;
|
||||||
import com.facebook.FacebookCallback;
|
import com.facebook.FacebookCallback;
|
||||||
import com.facebook.FacebookException;
|
import com.facebook.FacebookException;
|
||||||
import com.facebook.FacebookSdk;
|
import com.facebook.FacebookSdk;
|
||||||
|
import com.facebook.GraphRequest;
|
||||||
|
import com.facebook.GraphResponse;
|
||||||
|
import com.facebook.login.LoginBehavior;
|
||||||
import com.facebook.login.LoginManager;
|
import com.facebook.login.LoginManager;
|
||||||
import com.facebook.login.LoginResult;
|
import com.facebook.login.LoginResult;
|
||||||
|
|
||||||
import org.deke.risk.riskahead.LoginActivity;
|
import org.deke.risk.riskahead.LoginActivity;
|
||||||
import org.deke.risk.riskahead.R;
|
import org.deke.risk.riskahead.R;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@@ -46,7 +53,7 @@ public class FacebookButtonFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
||||||
view = inflater.inflate(R.layout.fragment_facebook_button, container, false);
|
view = inflater.inflate(R.layout.fragment_facebook_button, container, false);
|
||||||
initFacebookButton();
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,20 +64,16 @@ public class FacebookButtonFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onResume() {
|
||||||
super.onAttach(activity);
|
super.onResume();
|
||||||
try {
|
FacebookSdk.sdkInitialize(getContext());
|
||||||
mListener = (OnFragmentInteractionListener) activity;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
throw new ClassCastException(activity.toString()
|
|
||||||
+ " must implement OnFragmentInteractionListener");
|
|
||||||
}
|
|
||||||
|
|
||||||
FacebookSdk.sdkInitialize(activity.getApplicationContext());
|
|
||||||
callbackManager = CallbackManager.Factory.create();
|
callbackManager = CallbackManager.Factory.create();
|
||||||
|
initFacebookButton();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
mListener = null;
|
mListener = null;
|
||||||
@@ -78,6 +81,7 @@ public class FacebookButtonFragment extends Fragment {
|
|||||||
|
|
||||||
public interface OnFragmentInteractionListener {
|
public interface OnFragmentInteractionListener {
|
||||||
void onFragmentInteraction(Uri uri);
|
void onFragmentInteraction(Uri uri);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initFacebookButton() {
|
private void initFacebookButton() {
|
||||||
@@ -86,7 +90,8 @@ public class FacebookButtonFragment extends Fragment {
|
|||||||
btnLoginFB.setOnClickListener(new OnClickListener() {
|
btnLoginFB.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
LoginManager.getInstance().logInWithReadPermissions(getActivity(), Arrays.asList("public_profile", "user_friends"));
|
LoginManager.getInstance().setLoginBehavior(LoginBehavior.WEB_ONLY);
|
||||||
|
LoginManager.getInstance().logInWithReadPermissions(getActivity(), Arrays.asList("public_profile", "email"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -94,18 +99,38 @@ public class FacebookButtonFragment extends Fragment {
|
|||||||
new FacebookCallback<LoginResult>() {
|
new FacebookCallback<LoginResult>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(LoginResult loginResult) {
|
public void onSuccess(LoginResult loginResult) {
|
||||||
((LoginActivity) getActivity()).handleSocialMediaLogin(loginResult.getAccessToken().getToken(),"facebook",loginResult.getAccessToken().getUserId(),"");
|
getUserMailAndLogin(loginResult.getAccessToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCancel() {
|
public void onCancel() {
|
||||||
|
Log.d("FB","OnCancel");
|
||||||
((LoginActivity) getActivity()).showMessage("Facebook LogIn canceled");
|
((LoginActivity) getActivity()).showMessage("Facebook LogIn canceled");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(FacebookException exception) {
|
public void onError(FacebookException exception) {
|
||||||
|
Log.d("FB","OnError");
|
||||||
((LoginActivity) getActivity()).showMessage("Error while SignIn: ErrorMsg: " + exception.toString());
|
((LoginActivity) getActivity()).showMessage("Error while SignIn: ErrorMsg: " + exception.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getUserMailAndLogin(AccessToken accesstoken){
|
||||||
|
GraphRequest request = GraphRequest.newMeRequest(accesstoken, new GraphRequest.GraphJSONObjectCallback() {
|
||||||
|
@Override
|
||||||
|
public void onCompleted(JSONObject objects, GraphResponse response) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
((LoginActivity) getActivity()).handleSocialMediaLogin(objects.getString("id"), "facebook", objects.getString("first_name"), objects.getString("email"));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Bundle parameters = new Bundle();
|
||||||
|
parameters.putString("fields", "id,first_name,last_name,email");
|
||||||
|
request.setParameters(parameters);
|
||||||
|
request.executeAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,14 +72,15 @@ public class GooglePlusButtonFragment extends Fragment implements GoogleApiClien
|
|||||||
performClickAction();
|
performClickAction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateUI(mGoogleApiClient.isConnected());
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void performClickAction() {
|
private void performClickAction() {
|
||||||
if(mGoogleApiClient.isConnected()){
|
if(mGoogleApiClient.isConnected()){
|
||||||
signOutFromGplus();
|
//signOutFromGplus();
|
||||||
|
Person currentPerson = getProfileInformation();
|
||||||
|
((LoginActivity) getActivity()).handleSocialMediaLogin(currentPerson.getId(),"google",currentPerson.getDisplayName(),Plus.AccountApi.getAccountName(mGoogleApiClient));
|
||||||
}else{
|
}else{
|
||||||
signInWithGplus();
|
signInWithGplus();
|
||||||
}
|
}
|
||||||
@@ -143,23 +144,14 @@ public class GooglePlusButtonFragment extends Fragment implements GoogleApiClien
|
|||||||
if(mSignInClicked) ((LoginActivity) getActivity()).handleSocialMediaLogin(currentPerson.getId(),"google",currentPerson.getDisplayName(),Plus.AccountApi.getAccountName(mGoogleApiClient));
|
if(mSignInClicked) ((LoginActivity) getActivity()).handleSocialMediaLogin(currentPerson.getId(),"google",currentPerson.getDisplayName(),Plus.AccountApi.getAccountName(mGoogleApiClient));
|
||||||
|
|
||||||
mSignInClicked = false;
|
mSignInClicked = false;
|
||||||
updateUI(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionSuspended(int arg0) {
|
public void onConnectionSuspended(int arg0) {
|
||||||
mGoogleApiClient.connect();
|
mGoogleApiClient.connect();
|
||||||
updateUI(false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUI(boolean isSignedIn) {
|
|
||||||
if (isSignedIn) {
|
|
||||||
this.btnSignIn.setText("Log out from G+");
|
|
||||||
} else {
|
|
||||||
this.btnSignIn.setText("Google+");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sign-in into google
|
* Sign-in into google
|
||||||
@@ -220,7 +212,14 @@ public class GooglePlusButtonFragment extends Fragment implements GoogleApiClien
|
|||||||
private void signOutFromGplus() {
|
private void signOutFromGplus() {
|
||||||
if (mGoogleApiClient.isConnected()) {
|
if (mGoogleApiClient.isConnected()) {
|
||||||
mGoogleApiClient.clearDefaultAccountAndReconnect();
|
mGoogleApiClient.clearDefaultAccountAndReconnect();
|
||||||
updateUI(false);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void logoutFromGplus() {
|
||||||
|
if (mGoogleApiClient.isConnected()) {
|
||||||
|
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
|
||||||
|
mGoogleApiClient.disconnect();
|
||||||
|
mGoogleApiClient.connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.deke.risk.riskahead.ProfileActivity;
|
|||||||
import org.deke.risk.riskahead.R;
|
import org.deke.risk.riskahead.R;
|
||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@@ -90,8 +91,8 @@ public class ProfileStatisticsFragment extends Fragment {
|
|||||||
// Posting params to register url
|
// Posting params to register url
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getuserstats");
|
params.put("tag", "getuserstats");
|
||||||
params.put("uid", parent.user.get("uid"));
|
params.put("uid", parent.user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", parent.user.get("token"));
|
params.put("token", parent.user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.deke.risk.riskahead.R;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.adapter.ReportListAdapter;
|
import org.deke.risk.riskahead.adapter.ReportListAdapter;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -58,7 +59,7 @@ public class ReportListFragment extends Fragment{
|
|||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parentview, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parentview, View view, int position, long id) {
|
||||||
try {
|
try {
|
||||||
parent.gotoViewReportActivity(resultList.get(position).getInt("uid"));
|
parent.gotoViewReportActivity(resultList.get(position).getInt("id"));
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -120,8 +121,8 @@ public class ReportListFragment extends Fragment{
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "getincidentsfromuserid");
|
params.put("tag", "getincidentsfromuserid");
|
||||||
params.put("uid", parent.user.get("uid"));
|
params.put("uid", parent.user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", parent.user.get("token"));
|
params.put("token", parent.user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class ReportWF_1_Fragment extends Fragment{
|
|||||||
spinner_sub_1.setVisibility(View.VISIBLE);
|
spinner_sub_1.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
incident.setmFidCat1_Main(position);
|
incident.setFidIncidentCategory(position);
|
||||||
isMandatoryCategoryFilled = false;
|
isMandatoryCategoryFilled = false;
|
||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
}
|
}
|
||||||
@@ -188,10 +188,10 @@ public class ReportWF_1_Fragment extends Fragment{
|
|||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((position == 0) && (incident.getmFidCat1_Sub() != 0))
|
if ((position == 0) && (incident.getFidIncidentSubCategory() != 0))
|
||||||
crimeSubCategory.setSelection(incident.getmFidCat1_Sub());
|
crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||||
|
|
||||||
incident.setmFidCat1_Sub(position);
|
incident.setFidIncidentSubCategory(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -224,19 +224,19 @@ public class ReportWF_1_Fragment extends Fragment{
|
|||||||
if(incident != null){
|
if(incident != null){
|
||||||
if(incident.getPosition() != null){
|
if(incident.getPosition() != null){
|
||||||
timeLayout.setVisibility(View.VISIBLE);
|
timeLayout.setVisibility(View.VISIBLE);
|
||||||
txtPositionInformation.setText(incident.getmPosDescription());
|
txtPositionInformation.setText(incident.getIncidentPositionDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(incident.getmFidCat1_Main() != 0){
|
if(incident.getFidIncidentCategory() != 0){
|
||||||
crimeCategory.setSelection(incident.getmFidCat1_Main());
|
crimeCategory.setSelection(incident.getFidIncidentCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(incident.getmFidCat1_Sub() != 0){
|
if(incident.getFidIncidentSubCategory() != 0){
|
||||||
crimeSubCategory.setSelection(incident.getmFidCat1_Sub());
|
crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(incident.getmCat1_Sub_etc() != null){
|
if(incident.getEtcIncidentCategory() != null){
|
||||||
crimeSubOther.setText(incident.getmCat1_Sub_etc());
|
crimeSubOther.setText(incident.getEtcIncidentCategory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,9 +247,9 @@ public class ReportWF_1_Fragment extends Fragment{
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
incident.setmFidCat1_Main(crimeCategory.getSelectedItemPosition());
|
incident.setFidIncidentCategory(crimeCategory.getSelectedItemPosition());
|
||||||
incident.setmFidCat1_Sub(crimeSubCategory.getSelectedItemPosition());
|
incident.setFidIncidentSubCategory(crimeSubCategory.getSelectedItemPosition());
|
||||||
incident.setmCat1_Sub_etc(crimeSubOther.getText().toString());
|
incident.setEtcIncidentCategory(crimeSubOther.getText().toString());
|
||||||
|
|
||||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
incident.setmFidTimeMainCat(position);
|
incident.setFidTimeCategory(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -215,11 +215,11 @@ public class ReportWF_2_Fragment extends Fragment {
|
|||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
isMandatoryCategoryFilled = !((SpinnerHintAdapter) timeSubCategory.getAdapter()).isInInitialState();
|
isMandatoryCategoryFilled = !((SpinnerHintAdapter) timeSubCategory.getAdapter()).isInInitialState();
|
||||||
|
|
||||||
if ((position == 0) && (incident.getmFidTimeSubCat() != 0))
|
if ((position == 0) && (incident.getFidTimeSubCategory() != 0))
|
||||||
timeSubCategory.setSelection(incident.getmFidTimeSubCat());
|
timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||||
|
|
||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
incident.setmFidTimeSubCat(position);
|
incident.setFidTimeSubCategory(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -248,12 +248,12 @@ public class ReportWF_2_Fragment extends Fragment {
|
|||||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
if(incident != null){
|
if(incident != null){
|
||||||
if(incident.getmFidTimeMainCat() != 0){
|
if(incident.getFidTimeCategory() != 0){
|
||||||
timeCategory.setSelection(incident.getmFidTimeMainCat());
|
timeCategory.setSelection(incident.getFidTimeCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(incident.getmFidTimeSubCat() != 0){
|
if(incident.getFidTimeSubCategory() != 0){
|
||||||
timeSubCategory.setSelection(incident.getmFidTimeSubCat());
|
timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(incident.getFromDate() != null && !incident.getFromDate().equals("")){
|
if(incident.getFromDate() != null && !incident.getFromDate().equals("")){
|
||||||
@@ -280,8 +280,8 @@ public class ReportWF_2_Fragment extends Fragment {
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
incident.setmFidTimeMainCat(timeCategory.getSelectedItemPosition());
|
incident.setFidTimeCategory(timeCategory.getSelectedItemPosition());
|
||||||
incident.setmFidTimeSubCat(timeSubCategory.getSelectedItemPosition());
|
incident.setFidTimeSubCategory(timeSubCategory.getSelectedItemPosition());
|
||||||
incident.setFromDate(inputDateFrom.getText().toString());
|
incident.setFromDate(inputDateFrom.getText().toString());
|
||||||
incident.setFromTime(inputTimeFrom.getText().toString());
|
incident.setFromTime(inputTimeFrom.getText().toString());
|
||||||
incident.setToDate(inputDateTo.getText().toString());
|
incident.setToDate(inputDateTo.getText().toString());
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class ReportWF_3_Fragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
incident.setmFidSuspectMainCat(position);
|
incident.setFidSuspectCategory(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -147,11 +147,11 @@ public class ReportWF_3_Fragment extends Fragment {
|
|||||||
|
|
||||||
isMandatoryCategoryFilled = !((SpinnerHintAdapter) suspectOriginCategory.getAdapter()).isInInitialState();
|
isMandatoryCategoryFilled = !((SpinnerHintAdapter) suspectOriginCategory.getAdapter()).isInInitialState();
|
||||||
|
|
||||||
if ((position == 0) && (incident.getmFidTimeSubCat() != 0))
|
if ((position == 0) && (incident.getFidSuspectSubCategory() != 0))
|
||||||
suspectOriginCategory.setSelection(incident.getmFidSuspectOrigin());
|
suspectOriginCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||||
|
|
||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
incident.setmFidTimeSubCat(position);
|
incident.setFidSuspectSubCategory(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -180,9 +180,9 @@ public class ReportWF_3_Fragment extends Fragment {
|
|||||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
if(incident != null){
|
if(incident != null){
|
||||||
if(incident.getmFidSuspectMainCat() != 0) suspectCategory.setSelection(incident.getmFidSuspectMainCat());
|
if(incident.getFidSuspectCategory() != 0) suspectCategory.setSelection(incident.getFidSuspectCategory());
|
||||||
if(incident.getmFidSuspectOrigin() != 0) suspectOriginCategory.setSelection(incident.getmFidSuspectOrigin());
|
if(incident.getFidSuspectSubCategory() != 0) suspectOriginCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||||
if(incident.getmSuspectEtc() != null && !incident.getmSuspectEtc().equals("")) suspectEtcInput.setText(incident.getmSuspectEtc());
|
if(incident.getEtcSuspectCategory() != null && !incident.getEtcSuspectCategory().equals("")) suspectEtcInput.setText(incident.getEtcSuspectCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIfFinished();
|
checkIfFinished();
|
||||||
@@ -192,9 +192,9 @@ public class ReportWF_3_Fragment extends Fragment {
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
incident.setmFidSuspectMainCat(suspectCategory.getSelectedItemPosition());
|
incident.setFidSuspectCategory(suspectCategory.getSelectedItemPosition());
|
||||||
incident.setmFidSuspectOrigin(suspectOriginCategory.getSelectedItemPosition());
|
incident.setFidSuspectSubCategory(suspectOriginCategory.getSelectedItemPosition());
|
||||||
incident.setmSuspectEtc(suspectEtcInput.getText().toString());
|
incident.setEtcSuspectCategory(suspectEtcInput.getText().toString());
|
||||||
|
|
||||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.deke.risk.riskahead.R;
|
|||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
import org.deke.risk.riskahead.adapter.Top10ListAdapter;
|
import org.deke.risk.riskahead.adapter.Top10ListAdapter;
|
||||||
|
import org.deke.risk.riskahead.helper.SessionManager;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -70,9 +71,9 @@ public class Top10Fragment extends Fragment {
|
|||||||
JSONObject jObj = new JSONObject(response);
|
JSONObject jObj = new JSONObject(response);
|
||||||
boolean error = jObj.getBoolean("error");
|
boolean error = jObj.getBoolean("error");
|
||||||
if (!error) {
|
if (!error) {
|
||||||
JSONArray users = jObj.getJSONArray("msg");
|
JSONArray users = jObj.getJSONArray("top10");
|
||||||
resultList = new ArrayList<>();
|
resultList = new ArrayList<>();
|
||||||
Log.d(TAG,"Writing stuff in resultList!");
|
|
||||||
for(int i=0;i<users.length();i++){
|
for(int i=0;i<users.length();i++){
|
||||||
JSONObject user = users.getJSONObject(i);
|
JSONObject user = users.getJSONObject(i);
|
||||||
resultList.add(user);
|
resultList.add(user);
|
||||||
@@ -108,8 +109,8 @@ public class Top10Fragment extends Fragment {
|
|||||||
protected Map<String, String> getParams() {
|
protected Map<String, String> getParams() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("tag", "gettop10");
|
params.put("tag", "gettop10");
|
||||||
params.put("uid", parent.user.get("uid"));
|
params.put("uid", parent.user.get(SessionManager.KEY_UID));
|
||||||
params.put("token", parent.user.get("token"));
|
params.put("token", parent.user.get(SessionManager.TOKEN));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class TwitterButtonFragment extends Fragment {
|
|||||||
String token = authToken.token;
|
String token = authToken.token;
|
||||||
String secret = authToken.secret;
|
String secret = authToken.secret;
|
||||||
|
|
||||||
((LoginActivity) getActivity()).handleSocialMediaLogin((Long.toString(session.getUserId())),"twitter",session.getUserName(),"");
|
((LoginActivity) getActivity()).handleSocialMediaLogin((Long.toString(session.getUserId())), "twitter", session.getUserName(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ import android.widget.Toast;
|
|||||||
import com.google.android.gms.ads.AdListener;
|
import com.google.android.gms.ads.AdListener;
|
||||||
import com.google.android.gms.ads.AdRequest;
|
import com.google.android.gms.ads.AdRequest;
|
||||||
import com.google.android.gms.ads.InterstitialAd;
|
import com.google.android.gms.ads.InterstitialAd;
|
||||||
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.plus.Plus;
|
||||||
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
|
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
|
||||||
import com.mikepenz.iconics.context.IconicsLayoutInflater;
|
import com.mikepenz.iconics.context.IconicsLayoutInflater;
|
||||||
import com.mikepenz.materialdrawer.AccountHeader;
|
import com.mikepenz.materialdrawer.AccountHeader;
|
||||||
@@ -44,6 +47,7 @@ import org.deke.risk.riskahead.ReportWFActivity;
|
|||||||
import org.deke.risk.riskahead.SettingsActivity;
|
import org.deke.risk.riskahead.SettingsActivity;
|
||||||
import org.deke.risk.riskahead.SubscriptionsActivity;
|
import org.deke.risk.riskahead.SubscriptionsActivity;
|
||||||
import org.deke.risk.riskahead.ViewReportActivity;
|
import org.deke.risk.riskahead.ViewReportActivity;
|
||||||
|
import org.deke.risk.riskahead.fragment.GooglePlusButtonFragment;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@@ -64,6 +68,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
public HashMap<String, String> user;
|
public HashMap<String, String> user;
|
||||||
public ProgressDialog pDialog;
|
public ProgressDialog pDialog;
|
||||||
|
|
||||||
|
GoogleApiClient mGoogleApiClient;
|
||||||
private final static int INTERVAL = 1000 * 300; //300 seconds
|
private final static int INTERVAL = 1000 * 300; //300 seconds
|
||||||
InterstitialAd mInterstitialAd;
|
InterstitialAd mInterstitialAd;
|
||||||
|
|
||||||
@@ -218,16 +223,13 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
intent = new Intent(BaseActivity.this, SubscriptionsActivity.class);
|
intent = new Intent(BaseActivity.this, SubscriptionsActivity.class);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
session.removeUser();
|
logoutUser();
|
||||||
session.setLogin(false);
|
|
||||||
intent = new Intent(BaseActivity.this, LoginActivity.class);
|
|
||||||
intent.putExtra(EXTRA_MESSAGE, "login");
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.d("Unknown switch page: ", Integer.toString(position));
|
Log.d("Unknown switch page: ", Integer.toString(position));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
BaseActivity.this.startActivity(intent);
|
if(intent != null) BaseActivity.this.startActivity(intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
@@ -276,9 +278,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
public void logout() {
|
public void logout() {
|
||||||
session.setLogin(false);
|
session.setLogin(false);
|
||||||
|
|
||||||
Intent intent = new Intent(this, LoginActivity.class);
|
Intent intent = new Intent(BaseActivity.this, LoginActivity.class);
|
||||||
intent.putExtra(EXTRA_MESSAGE, "login");
|
intent.putExtra(EXTRA_MESSAGE, "login");
|
||||||
startActivity(intent);
|
BaseActivity.this.startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.deke.risk.riskahead.helper;
|
package org.deke.risk.riskahead.helper;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
|
||||||
import com.google.android.gms.maps.model.BitmapDescriptor;
|
import com.google.android.gms.maps.model.BitmapDescriptor;
|
||||||
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||||
@@ -16,107 +17,124 @@ import org.json.JSONObject;
|
|||||||
*/
|
*/
|
||||||
public class IncidentReport implements ClusterItem {
|
public class IncidentReport implements ClusterItem {
|
||||||
|
|
||||||
private LatLng mPosition;
|
private int id;
|
||||||
private Integer mID;
|
private LatLng incidentPosition;
|
||||||
private String mTitle;
|
private String incidentPositionDescription;
|
||||||
private String mDescription;
|
|
||||||
private String mFidUser;
|
|
||||||
private String mFidCategory;
|
|
||||||
private String mHappenedAt;
|
|
||||||
private String mCreatedAt;
|
|
||||||
private String mUpdatedAt;
|
|
||||||
private String mRadius;
|
|
||||||
private String mCatName;
|
|
||||||
private String mCatDescription;
|
|
||||||
private String mColor;
|
|
||||||
private String mUsername;
|
|
||||||
private int mScore;
|
|
||||||
|
|
||||||
|
private int fidFromUser;
|
||||||
|
private String fromUsername;
|
||||||
|
|
||||||
private int mFidCat1_Main;
|
private int votedScore;
|
||||||
private int mFidCat1_Sub;
|
|
||||||
private String mCat1_Sub_etc;
|
|
||||||
private String mPosDescription;
|
|
||||||
|
|
||||||
private int mFidTimeMainCat;
|
private String createdAt;
|
||||||
private int mFidTimeSubCat;
|
private String updatedAt;
|
||||||
|
|
||||||
|
private int fidIncidentCategory;
|
||||||
|
private int fidIncidentSubCategory;
|
||||||
|
private String etcIncidentCategory;
|
||||||
|
|
||||||
|
private int fidTimeCategory;
|
||||||
|
private int fidTimeSubCategory;
|
||||||
private String fromTime;
|
private String fromTime;
|
||||||
private String fromDate;
|
private String fromDate;
|
||||||
private String toTime;
|
private String toTime;
|
||||||
private String toDate;
|
private String toDate;
|
||||||
|
|
||||||
private int mFidSuspectMainCat;
|
private int fidSuspectCategory;
|
||||||
private int mFidSuspectOrigin;
|
private int fidSuspectSubCategory;
|
||||||
private String mSuspectEtc;
|
private String etcSuspectCategory;
|
||||||
|
|
||||||
|
private int fidSuspectWeaponCategory;
|
||||||
|
private int fidSuspectWeaponSubCategory;
|
||||||
|
private String etcSuspectWeaponCategory;
|
||||||
|
|
||||||
|
private int fidSuspectCountCategory;
|
||||||
|
private String etcSuspectCountCategory;
|
||||||
|
|
||||||
private BitmapDescriptor icon;
|
private int fidVictimCategory;
|
||||||
|
|
||||||
|
private int fidVictimOriginCategory;
|
||||||
|
private String etcVictimOriginCategory;
|
||||||
|
|
||||||
public IncidentReport(JSONObject mIncident, LatLng pos) {
|
private int fidSuspectTransportationCategory;
|
||||||
|
private String etcSuspectTransportationCategory;
|
||||||
|
|
||||||
try {
|
private int fidVictimBelongingCategory;
|
||||||
this.mID = mIncident.getInt("uid");
|
private String etcVictimBelongingCategory;
|
||||||
this.mTitle = mIncident.getString("text_short");
|
|
||||||
this.mDescription = mIncident.getString("text_long");
|
private int fidSuspectCharacteristicsCategory;
|
||||||
this.mFidUser = mIncident.getString("fid_user");
|
private String etcSuspectCharacteristicsCategory;
|
||||||
this.mFidCategory = mIncident.getString("fid_category");
|
|
||||||
this.mHappenedAt = mIncident.getString("happened_at");
|
private int fidOthersCategory;
|
||||||
this.mCreatedAt = mIncident.getString("created_at");
|
private String etcOthersCategory;
|
||||||
this.mUpdatedAt = mIncident.getString("updated_at");
|
|
||||||
this.mRadius = mIncident.getString("radius");
|
public IncidentReport(JSONObject mIncident, LatLng position) {
|
||||||
this.mCatName = mIncident.getString("cat_name");
|
setAllAttributes(mIncident, position);
|
||||||
this.mCatDescription = mIncident.getString("cat_description");
|
|
||||||
this.mColor = mIncident.getString("color");
|
|
||||||
this.mUsername = mIncident.getString("username");
|
|
||||||
this.mScore = mIncident.getInt("votescore");
|
|
||||||
this.mPosition = pos;
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IncidentReport(JSONObject mIncident) {
|
public IncidentReport(JSONObject mIncident) {
|
||||||
|
setAllAttributes(mIncident,null);
|
||||||
try {
|
|
||||||
this.mID = mIncident.getInt("uid");
|
|
||||||
this.mTitle = mIncident.getString("text_short");
|
|
||||||
this.mDescription = mIncident.getString("text_long");
|
|
||||||
this.mFidUser = mIncident.getString("fid_user");
|
|
||||||
this.mFidCategory = mIncident.getString("fid_category");
|
|
||||||
this.mHappenedAt = mIncident.getString("happened_at");
|
|
||||||
this.mCreatedAt = mIncident.getString("created_at");
|
|
||||||
this.mUpdatedAt = mIncident.getString("updated_at");
|
|
||||||
this.mRadius = mIncident.getString("radius");
|
|
||||||
this.mCatName = mIncident.getString("cat_name");
|
|
||||||
this.mCatDescription = mIncident.getString("cat_description");
|
|
||||||
this.mColor = mIncident.getString("color");
|
|
||||||
this.mUsername = mIncident.getString("username");
|
|
||||||
this.mScore = mIncident.getInt("votescore");
|
|
||||||
this.mPosition = new LatLng(mIncident.getDouble("latitude"),mIncident.getDouble("longitude"));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IncidentReport(){
|
public IncidentReport(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void setAllAttributes(JSONObject mIncident, LatLng position) {
|
||||||
public LatLng getPosition() {
|
try {
|
||||||
return mPosition;
|
this.id = mIncident.getInt("id");
|
||||||
|
|
||||||
|
if(position != null) {
|
||||||
|
this.incidentPosition = position;
|
||||||
|
}else{
|
||||||
|
this.incidentPosition = new LatLng(mIncident.getDouble("latitude"),mIncident.getDouble("longitude"));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.votedScore = mIncident.getInt("id");
|
||||||
|
this.createdAt = mIncident.getString("created_at");
|
||||||
|
this.updatedAt = mIncident.getString("updated_at");
|
||||||
|
this.fromUsername = mIncident.getString("username");
|
||||||
|
|
||||||
|
this.fidFromUser = mIncident.getInt("fid_user");
|
||||||
|
this.fidIncidentCategory = mIncident.getInt("fid_incident");
|
||||||
|
this.fidIncidentSubCategory = mIncident.getInt("fid_subincident");
|
||||||
|
this.etcIncidentCategory = mIncident.getString("etc_incident");
|
||||||
|
this.fidTimeCategory = mIncident.getInt("fid_time");
|
||||||
|
this.fidTimeSubCategory = mIncident.getInt("fid_subtime");
|
||||||
|
this.fromTime = mIncident.getString("happened_from_datetime").split(" ")[1];
|
||||||
|
this.fromDate = mIncident.getString("happened_from_datetime").split(" ")[0];
|
||||||
|
this.toTime = mIncident.getString("happened_to_datetime").split(" ")[1];
|
||||||
|
this.toDate = mIncident.getString("happened_to_datetime").split(" ")[0];
|
||||||
|
this.fidSuspectCategory = mIncident.getInt("fid_suspect");
|
||||||
|
this.fidSuspectSubCategory = mIncident.getInt("fid_subsuspect");
|
||||||
|
this.etcSuspectCategory = mIncident.getString("etc_suspect");
|
||||||
|
this.fidSuspectWeaponCategory = mIncident.getInt("fid_weapon");
|
||||||
|
this.fidSuspectWeaponSubCategory = mIncident.getInt("fid_subweapon");
|
||||||
|
this.etcSuspectWeaponCategory = mIncident.getString("etc_weapon");
|
||||||
|
this.fidSuspectCountCategory = mIncident.getInt("fid_suspectcount");
|
||||||
|
this.etcSuspectCountCategory = mIncident.getString("etc_suspectcount");
|
||||||
|
this.fidVictimCategory = mIncident.getInt("fid_victim");
|
||||||
|
this.fidVictimOriginCategory = mIncident.getInt("fid_victimorigin");
|
||||||
|
this.etcVictimOriginCategory = mIncident.getString("etc_victimorigin");
|
||||||
|
this.fidSuspectTransportationCategory = mIncident.getInt("fid_suspecttransportation");
|
||||||
|
this.etcSuspectTransportationCategory = mIncident.getString("etc_suspecttransportation");
|
||||||
|
this.fidVictimBelongingCategory = mIncident.getInt("fid_victimbelonging");
|
||||||
|
this.etcVictimBelongingCategory = mIncident.getString("etc_victimbelonging");
|
||||||
|
this.fidSuspectCharacteristicsCategory = mIncident.getInt("fid_suspectcharacteristics");
|
||||||
|
this.etcSuspectCharacteristicsCategory = mIncident.getString("etc_suspectcharacteristics");
|
||||||
|
this.fidOthersCategory = mIncident.getInt("fid_others");
|
||||||
|
this.etcOthersCategory = mIncident.getString("etc_others");
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPosition(LatLng pos) {
|
|
||||||
mPosition = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BitmapDescriptor getIcon() {
|
public BitmapDescriptor getIcon() {
|
||||||
BitmapDescriptor mIcon;
|
BitmapDescriptor mIcon;
|
||||||
|
|
||||||
switch (Integer.valueOf(this.mFidCategory)) {
|
switch (Integer.valueOf(this.fidIncidentCategory)) {
|
||||||
case 1:
|
case 1:
|
||||||
mIcon = BitmapDescriptorFactory.fromResource(R.drawable.icon_general);
|
mIcon = BitmapDescriptorFactory.fromResource(R.drawable.icon_general);
|
||||||
break;
|
break;
|
||||||
@@ -142,10 +160,11 @@ public class IncidentReport implements ClusterItem {
|
|||||||
|
|
||||||
return mIcon;
|
return mIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIconDrawable() {
|
public int getIconDrawable() {
|
||||||
int mIcon;
|
int mIcon;
|
||||||
|
|
||||||
switch (Integer.valueOf(this.mFidCategory)) {
|
switch (Integer.valueOf(this.fidIncidentCategory)) {
|
||||||
case 1:
|
case 1:
|
||||||
mIcon = R.drawable.icon_general;
|
mIcon = R.drawable.icon_general;
|
||||||
break;
|
break;
|
||||||
@@ -171,104 +190,222 @@ public class IncidentReport implements ClusterItem {
|
|||||||
return mIcon;
|
return mIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSnippet() {
|
|
||||||
return this.mDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return this.mTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCategory(){
|
|
||||||
return this.mCatName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScore() { return this.mScore; }
|
|
||||||
|
|
||||||
public String getUsername() { return this.mUsername; }
|
|
||||||
|
|
||||||
public float getScoreStars() {
|
public float getScoreStars() {
|
||||||
if(mScore > 0){
|
if(this.votedScore > 0){
|
||||||
return 0.5f;
|
return 0.5f;
|
||||||
}else if(mScore > 2){
|
}else if(this.votedScore > 1){
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}else if(mScore > 4){
|
}else if(this.votedScore > 2){
|
||||||
return 1.5f;
|
return 1.5f;
|
||||||
}else if(mScore > 6){
|
}else if(this.votedScore > 3){
|
||||||
return 2.0f;
|
return 2.0f;
|
||||||
}else if(mScore > 8){
|
}else if(this.votedScore > 4){
|
||||||
return 2.5f;
|
return 2.5f;
|
||||||
}else if(mScore > 10){
|
}else if(this.votedScore > 5){
|
||||||
return 3.0f;
|
return 3.0f;
|
||||||
}else if(mScore > 12){
|
}else if(this.votedScore > 6){
|
||||||
return 3.5f;
|
return 3.5f;
|
||||||
}else if(mScore > 14){
|
}else if(this.votedScore > 7){
|
||||||
return 4.0f;
|
return 4.0f;
|
||||||
}else if(mScore > 16){
|
}else if(this.votedScore > 8){
|
||||||
return 4.5f;
|
return 4.5f;
|
||||||
}else if(mScore > 18){
|
}else if(this.votedScore > 9){
|
||||||
return 5.0f;
|
return 5.0f;
|
||||||
}else{
|
}else{
|
||||||
return 0f;
|
return 0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getColor(){
|
public void resetDatetime() {
|
||||||
return this.mColor;
|
toTime = "";
|
||||||
|
toDate = "";
|
||||||
|
fromTime = "";
|
||||||
|
fromDate = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getID() {
|
@Override
|
||||||
return mID;
|
public LatLng getPosition() {
|
||||||
|
return this.incidentPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPosition(LatLng position) {
|
||||||
|
this.incidentPosition = position;
|
||||||
public String getmPosDescription() {
|
|
||||||
return mPosDescription;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmPosDescription(String mLocDetail) {
|
public String getFromUsername() {
|
||||||
this.mPosDescription = mLocDetail;
|
return fromUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidCat1_Main() {
|
public void setFromUsername(String fromUsername) {
|
||||||
return mFidCat1_Main;
|
this.fromUsername = fromUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidCat1_Main(int mFidCat1_Main) {
|
public int getFidIncidentCategory() {
|
||||||
this.mFidCat1_Main = mFidCat1_Main;
|
return fidIncidentCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidCat1_Sub() {
|
public void setFidIncidentCategory(int fidIncidentCategory) {
|
||||||
return mFidCat1_Sub;
|
this.fidIncidentCategory = fidIncidentCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidCat1_Sub(int mFidCat1_Sub) {
|
public int getId() {
|
||||||
this.mFidCat1_Sub = mFidCat1_Sub;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getmCat1_Sub_etc() {
|
public void setId(int id) {
|
||||||
return mCat1_Sub_etc;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmCat1_Sub_etc(String mCat1_Sub_etc) {
|
public String getIncidentCategoryName(Context context){
|
||||||
this.mCat1_Sub_etc = mCat1_Sub_etc;
|
return context.getResources().getStringArray(R.array.cat_situation_main)[this.fidIncidentCategory];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidTimeMainCat() {
|
public String getIncidentSubCategoryName(Context context){
|
||||||
return mFidTimeMainCat;
|
String returnName = "";
|
||||||
|
switch(this.fidIncidentCategory){
|
||||||
|
case 1:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_general)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_verbal)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_force)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_force_serious)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_nature)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
returnName = context.getResources().getStringArray(R.array.cat_situation_sub_infrastructure)[this.fidIncidentSubCategory];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return returnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidTimeMainCat(int mFidTimeMainCat) {
|
public String getTimeString(Context context){
|
||||||
this.mFidTimeMainCat = mFidTimeMainCat;
|
String returnString = "";
|
||||||
|
switch (this.fidTimeCategory){
|
||||||
|
case 1:
|
||||||
|
returnString = context.getResources().getStringArray(R.array.cat_time_main)[this.fidTimeCategory];
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
returnString = context.getResources().getStringArray(R.array.cat_time_sub_periodical)[this.fidTimeSubCategory];
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if((this.fromTime != null) && !(this.fromTime.equals("00:00:00"))){
|
||||||
|
returnString = this.fromDate+" "+this.fromTime;
|
||||||
|
}else{
|
||||||
|
returnString = this.fromDate;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if((this.fromTime != null) && !(this.fromTime.equals("00:00")) && (this.toTime != null) && !(this.toTime.equals("00:00"))){
|
||||||
|
returnString = this.fromDate+" "+this.fromTime+" -> "+this.toDate+" "+this.toTime;
|
||||||
|
}else{
|
||||||
|
returnString = this.fromDate+" -> "+this.toDate;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
returnString = context.getResources().getStringArray(R.array.cat_time_main)[this.fidTimeCategory];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return returnString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidTimeSubCat() {
|
public String getSuspectString(Context context){
|
||||||
return mFidTimeSubCat;
|
return context.getResources().getStringArray(R.array.cat_suspect_main)[this.fidSuspectCategory];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidTimeSubCat(int mFidTimeSubCat) {
|
public int getCategoryColor(){
|
||||||
this.mFidTimeSubCat = mFidTimeSubCat;
|
String color = "FFFFFF";
|
||||||
|
switch (this.fidIncidentCategory) {
|
||||||
|
case 1:
|
||||||
|
color = "3ac1e2";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
color = "3ed78d";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
color = "ed8d53";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
color = "ff3433";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
color = "3f7efd";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
color = "929292";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return Color.parseColor("#" + color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVotedScore(){
|
||||||
|
return this.votedScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVotedScore(int votedScore){
|
||||||
|
this.votedScore = votedScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidFromUser() {
|
||||||
|
return fidFromUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidFromUser(int fidFromUser) {
|
||||||
|
this.fidFromUser = fidFromUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(String createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdatedAt() {
|
||||||
|
return updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedAt(String updatedAt) {
|
||||||
|
this.updatedAt = updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidIncidentSubCategory() {
|
||||||
|
return fidIncidentSubCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidIncidentSubCategory(int fidIncidentSubCategory) {
|
||||||
|
this.fidIncidentSubCategory = fidIncidentSubCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcIncidentCategory() {
|
||||||
|
return etcIncidentCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcIncidentCategory(String etcIncidentCategory) {
|
||||||
|
this.etcIncidentCategory = etcIncidentCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidTimeCategory() {
|
||||||
|
return fidTimeCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidTimeCategory(int fidTimeCategory) {
|
||||||
|
this.fidTimeCategory = fidTimeCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidTimeSubCategory() {
|
||||||
|
return fidTimeSubCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidTimeSubCategory(int fidTimeSubCategory) {
|
||||||
|
this.fidTimeSubCategory = fidTimeSubCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFromTime() {
|
public String getFromTime() {
|
||||||
@@ -300,37 +437,166 @@ public class IncidentReport implements ClusterItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setToDate(String toDate) {
|
public void setToDate(String toDate) {
|
||||||
toDate = toDate;
|
this.toDate = toDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetDatetime() {
|
public int getFidSuspectCategory() {
|
||||||
toTime = "";
|
return fidSuspectCategory;
|
||||||
toDate = "";
|
|
||||||
fromTime = "";
|
|
||||||
fromDate = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidSuspectMainCat() {
|
public void setFidSuspectCategory(int fidSuspectCategory) {
|
||||||
return mFidSuspectMainCat;
|
this.fidSuspectCategory = fidSuspectCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidSuspectMainCat(int mFidSuspectMainCat) {
|
public int getFidSuspectSubCategory() {
|
||||||
this.mFidSuspectMainCat = mFidSuspectMainCat;
|
return fidSuspectSubCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getmFidSuspectOrigin() {
|
public void setFidSuspectSubCategory(int fidSuspectSubCategory) {
|
||||||
return mFidSuspectOrigin;
|
this.fidSuspectSubCategory = fidSuspectSubCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmFidSuspectOrigin(int mFidSuspectOrigin) {
|
public String getEtcSuspectCategory() {
|
||||||
this.mFidSuspectOrigin = mFidSuspectOrigin;
|
return etcSuspectCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getmSuspectEtc() {
|
public void setEtcSuspectCategory(String etcSuspectCategory) {
|
||||||
return mSuspectEtc;
|
this.etcSuspectCategory = etcSuspectCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setmSuspectEtc(String mSuspectEtc) {
|
public int getFidSuspectWeaponCategory() {
|
||||||
this.mSuspectEtc = mSuspectEtc;
|
return fidSuspectWeaponCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidSuspectWeaponCategory(int fidSuspectWeaponCategory) {
|
||||||
|
this.fidSuspectWeaponCategory = fidSuspectWeaponCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidSuspectWeaponSubCategory() {
|
||||||
|
return fidSuspectWeaponSubCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidSuspectWeaponSubCategory(int fidSuspectWeaponSubCategory) {
|
||||||
|
this.fidSuspectWeaponSubCategory = fidSuspectWeaponSubCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcSuspectWeaponCategory() {
|
||||||
|
return etcSuspectWeaponCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcSuspectWeaponCategory(String etcSuspectWeaponCategory) {
|
||||||
|
this.etcSuspectWeaponCategory = etcSuspectWeaponCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidSuspectCountCategory() {
|
||||||
|
return fidSuspectCountCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidSuspectCountCategory(int fidSuspectCountCategory) {
|
||||||
|
this.fidSuspectCountCategory = fidSuspectCountCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcSuspectCountCategory() {
|
||||||
|
return etcSuspectCountCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcSuspectCountCategory(String etcSuspectCountCategory) {
|
||||||
|
this.etcSuspectCountCategory = etcSuspectCountCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidVictimCategory() {
|
||||||
|
return fidVictimCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidVictimCategory(int fidVictimCategory) {
|
||||||
|
this.fidVictimCategory = fidVictimCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidVictimOriginCategory() {
|
||||||
|
return fidVictimOriginCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidVictimOriginCategory(int fidVictimOriginCategory) {
|
||||||
|
this.fidVictimOriginCategory = fidVictimOriginCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcVictimOriginCategory() {
|
||||||
|
return etcVictimOriginCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcVictimOriginCategory(String etcVictimOriginCategory) {
|
||||||
|
this.etcVictimOriginCategory = etcVictimOriginCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidSuspectTransportationCategory() {
|
||||||
|
return fidSuspectTransportationCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidSuspectTransportationCategory(int fidSuspectTransportationCategory) {
|
||||||
|
this.fidSuspectTransportationCategory = fidSuspectTransportationCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcSuspectTransportationCategory() {
|
||||||
|
return etcSuspectTransportationCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcSuspectTransportationCategory(String etcSuspectTransportationCategory) {
|
||||||
|
this.etcSuspectTransportationCategory = etcSuspectTransportationCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidVictimBelongingCategory() {
|
||||||
|
return fidVictimBelongingCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidVictimBelongingCategory(int fidVictimBelongingCategory) {
|
||||||
|
this.fidVictimBelongingCategory = fidVictimBelongingCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcVictimBelongingCategory() {
|
||||||
|
return etcVictimBelongingCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcVictimBelongingCategory(String etcVictimBelongingCategory) {
|
||||||
|
this.etcVictimBelongingCategory = etcVictimBelongingCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidSuspectCharacteristicsCategory() {
|
||||||
|
return fidSuspectCharacteristicsCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidSuspectCharacteristicsCategory(int fidSuspectCharacteristicsCategory) {
|
||||||
|
this.fidSuspectCharacteristicsCategory = fidSuspectCharacteristicsCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcSuspectCharacteristicsCategory() {
|
||||||
|
return etcSuspectCharacteristicsCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcSuspectCharacteristicsCategory(String etcSuspectCharacteristicsCategory) {
|
||||||
|
this.etcSuspectCharacteristicsCategory = etcSuspectCharacteristicsCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFidOthersCategory() {
|
||||||
|
return fidOthersCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFidOthersCategory(int fidOthersCategory) {
|
||||||
|
this.fidOthersCategory = fidOthersCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEtcOthersCategory() {
|
||||||
|
return etcOthersCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtcOthersCategory(String etcOthersCategory) {
|
||||||
|
this.etcOthersCategory = etcOthersCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIncidentPositionDescription() {
|
||||||
|
return incidentPositionDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncidentPositionDescription(String incidentPositionDescription) {
|
||||||
|
this.incidentPositionDescription = incidentPositionDescription;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,18 @@ import com.google.maps.android.clustering.view.DefaultClusterRenderer;
|
|||||||
*/
|
*/
|
||||||
public class OwnIconRendered extends DefaultClusterRenderer<IncidentReport> {
|
public class OwnIconRendered extends DefaultClusterRenderer<IncidentReport> {
|
||||||
|
|
||||||
|
Context context;
|
||||||
|
|
||||||
public OwnIconRendered(Context context, GoogleMap map,ClusterManager<IncidentReport> clusterManager) {
|
public OwnIconRendered(Context context, GoogleMap map,ClusterManager<IncidentReport> clusterManager) {
|
||||||
super(context, map, clusterManager);
|
super(context, map, clusterManager);
|
||||||
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onBeforeClusterItemRendered(IncidentReport item, MarkerOptions markerOptions) {
|
protected void onBeforeClusterItemRendered(IncidentReport item, MarkerOptions markerOptions) {
|
||||||
markerOptions.icon(item.getIcon());
|
markerOptions.icon(item.getIcon());
|
||||||
markerOptions.snippet(item.getSnippet());
|
markerOptions.snippet(item.getIncidentSubCategoryName(context));
|
||||||
markerOptions.title(item.getTitle());
|
markerOptions.title(item.getIncidentCategoryName(context));
|
||||||
super.onBeforeClusterItemRendered(item, markerOptions);
|
super.onBeforeClusterItemRendered(item, markerOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,17 +22,18 @@ public class SessionManager {
|
|||||||
private static final String PREF_NAME = "AndroidLogin";
|
private static final String PREF_NAME = "AndroidLogin";
|
||||||
private static final String USERDATA_NAME = "AndroidLoginUser";
|
private static final String USERDATA_NAME = "AndroidLoginUser";
|
||||||
|
|
||||||
private static final String KEY_UID = "uid";
|
public static final String KEY_UID = "uid";
|
||||||
private static final String KEY_USERNAME = "username";
|
public static final String KEY_USERNAME = "username";
|
||||||
private static final String KEY_NAME = "name";
|
public static final String KEY_NAME = "name";
|
||||||
private static final String KEY_SURNAME = "surname";
|
public static final String KEY_SURNAME = "surname";
|
||||||
private static final String KEY_EMAIL = "email";
|
public static final String KEY_EMAIL = "email";
|
||||||
private static final String KEY_STATUS = "status";
|
public static final String KEY_STATUS = "status";
|
||||||
private static final String PROVIDER_TYPE = "providerType";
|
public static final String PROVIDER_TYPE = "providerType";
|
||||||
private static final String KEY_CREATED_AT = "created_at";
|
public static final String KEY_CREATED_AT = "created_at";
|
||||||
private static final String KEY_UPDATED_AT = "updated_at";
|
public static final String KEY_UPDATED_AT = "updated_at";
|
||||||
private static final String TOKEN = "token";
|
public static final String KEY_LASTLOGIN_AT = "lastlogin_at";
|
||||||
private static final String KEY_IS_LOGGEDIN = "isLoggedIn";
|
public static final String TOKEN = "accesskey";
|
||||||
|
public static final String KEY_IS_LOGGEDIN = "isLoggedIn";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ public class SessionManager {
|
|||||||
return status.getBoolean(KEY_IS_LOGGEDIN, false);
|
return status.getBoolean(KEY_IS_LOGGEDIN, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addUser(String uid, String username, String name, String surname, String email, String status, String provider_type, String created_at, String updated_at, String token) {
|
public void addUser(String uid, String username, String name, String surname, String email, String status, String provider_type, String created_at, String updated_at, String lastlogin_at, String token) {
|
||||||
|
|
||||||
userDataEditor.putString(KEY_UID, uid); //UID
|
userDataEditor.putString(KEY_UID, uid); //UID
|
||||||
userDataEditor.putString(KEY_USERNAME, username); // Username
|
userDataEditor.putString(KEY_USERNAME, username); // Username
|
||||||
@@ -64,6 +65,7 @@ public class SessionManager {
|
|||||||
userDataEditor.putString(PROVIDER_TYPE, provider_type); // ProviderType
|
userDataEditor.putString(PROVIDER_TYPE, provider_type); // ProviderType
|
||||||
userDataEditor.putString(KEY_CREATED_AT, created_at); // Created At
|
userDataEditor.putString(KEY_CREATED_AT, created_at); // Created At
|
||||||
userDataEditor.putString(KEY_UPDATED_AT, updated_at); // Updated At
|
userDataEditor.putString(KEY_UPDATED_AT, updated_at); // Updated At
|
||||||
|
userDataEditor.putString(KEY_LASTLOGIN_AT, lastlogin_at); // Last Login
|
||||||
userDataEditor.putString(TOKEN, token); // TOKEN
|
userDataEditor.putString(TOKEN, token); // TOKEN
|
||||||
|
|
||||||
userDataEditor.apply();
|
userDataEditor.apply();
|
||||||
@@ -86,6 +88,7 @@ public class SessionManager {
|
|||||||
user.put(PROVIDER_TYPE, userdata.getString(PROVIDER_TYPE, null));
|
user.put(PROVIDER_TYPE, userdata.getString(PROVIDER_TYPE, null));
|
||||||
user.put(KEY_CREATED_AT, userdata.getString(KEY_CREATED_AT, null));
|
user.put(KEY_CREATED_AT, userdata.getString(KEY_CREATED_AT, null));
|
||||||
user.put(KEY_UPDATED_AT, userdata.getString(KEY_UPDATED_AT, null));
|
user.put(KEY_UPDATED_AT, userdata.getString(KEY_UPDATED_AT, null));
|
||||||
|
user.put(KEY_LASTLOGIN_AT, userdata.getString(KEY_LASTLOGIN_AT, null));
|
||||||
user.put(TOKEN, userdata.getString(TOKEN, null));
|
user.put(TOKEN, userdata.getString(TOKEN, null));
|
||||||
|
|
||||||
Log.d(TAG, "Fetching user from sharedPrefs: " + user.toString());
|
Log.d(TAG, "Fetching user from sharedPrefs: " + user.toString());
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:layout_marginTop="52dp"
|
android:layout_marginTop="52dp"
|
||||||
android:textColor="#aa4b4b4b"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_main_incidents"
|
android:id="@+id/txt_main_incidents"
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:layout_marginTop="34dp"
|
android:layout_marginTop="34dp"
|
||||||
android:textColor="#aa4b4b4b"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
android:id="@+id/layoutFooter"
|
android:id="@+id/layoutFooter"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#d5ddff"
|
android:background="#7fbfbfbf"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
|||||||
@@ -1,195 +0,0 @@
|
|||||||
<RelativeLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/main_layout"
|
|
||||||
android:background="@drawable/layout_bg_gradient"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".ReportActivity">
|
|
||||||
|
|
||||||
<!-- dummy item for disabling focus -->
|
|
||||||
<LinearLayout
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:layout_width="0px"
|
|
||||||
android:layout_height="0px" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutMain"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/layoutContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:padding="15dp"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_short"
|
|
||||||
android:text="@string/lbl_report_short"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignLeft="@+id/input_report_short"
|
|
||||||
android:layout_alignStart="@+id/input_report_short" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input_report_short"
|
|
||||||
android:hint="@string/input_report_short_hint"
|
|
||||||
android:inputType="text"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="@color/input_login"
|
|
||||||
android:textColorHint="@color/input_login_hint"
|
|
||||||
android:layout_marginTop="20dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_long"
|
|
||||||
android:text="@string/lbl_report_long"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/input_report_short" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input_report_long"
|
|
||||||
android:hint="@string/input_report_long_hint"
|
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="top|left"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="@color/input_login"
|
|
||||||
android:textColorHint="@color/input_login_hint"
|
|
||||||
android:layout_below="@+id/lbl_report_long"
|
|
||||||
android:scrollbars="vertical"
|
|
||||||
android:minLines="1"
|
|
||||||
android:lines="4"
|
|
||||||
android:maxLines="4" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_category"
|
|
||||||
android:text="@string/lbl_report_category"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/input_report_long" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/dd_report_category"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/lbl_report_category" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_date"
|
|
||||||
android:text="@string/lbl_report_date"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/dd_report_category" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_time"
|
|
||||||
android:text="@string/lbl_report_time"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_above="@+id/input_report_time"
|
|
||||||
android:layout_alignLeft="@+id/input_report_time"
|
|
||||||
android:layout_alignStart="@+id/input_report_time" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input_report_date"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="date"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_below="@+id/lbl_report_date"
|
|
||||||
android:layout_alignLeft="@+id/lbl_report_date"
|
|
||||||
android:layout_alignStart="@+id/lbl_report_date"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input_report_time"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="time"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_alignBottom="@+id/input_report_date"
|
|
||||||
android:layout_toRightOf="@+id/input_report_date"
|
|
||||||
android:layout_toEndOf="@+id/input_report_date"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_report_position"
|
|
||||||
android:text="@string/lbl_report_position"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/input_report_date"
|
|
||||||
android:layout_alignLeft="@+id/input_report_date"
|
|
||||||
android:layout_alignStart="@+id/input_report_time" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/input_report_position"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:editable="false"
|
|
||||||
android:layout_below="@+id/lbl_report_position"
|
|
||||||
android:layout_toRightOf="@+id/lbl_report_category"
|
|
||||||
android:layout_toEndOf="@+id/lbl_report_category" />
|
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
|
||||||
android:id="@+id/btn_report_position"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
bootstrap:bootstrapText="@string/btn_report_position"
|
|
||||||
android:layout_below="@+id/lbl_report_position"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
bootstrap:bootstrapBrand="primary"
|
|
||||||
bootstrap:roundedCorners="true"
|
|
||||||
bootstrap:bootstrapSize="lg"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
android:id="@+id/lbl_report_position_detail"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_below="@+id/input_report_position"
|
|
||||||
android:layout_alignLeft="@+id/input_report_position"
|
|
||||||
android:layout_alignStart="@+id/input_report_position" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutFooter"
|
|
||||||
android:gravity="center"
|
|
||||||
android:background="@color/bg_common"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_marginBottom="0dp">
|
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
|
||||||
android:id="@+id/btn_report_report"
|
|
||||||
bootstrap:bootstrapText="@string/btn_main_report"
|
|
||||||
android:minWidth="300dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
bootstrap:bootstrapBrand="danger"
|
|
||||||
bootstrap:roundedCorners="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
@@ -30,128 +30,123 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp">
|
||||||
android:padding="8dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/lbl_settings_username"
|
android:id="@+id/til_settings_username"
|
||||||
android:text="@string/lbl_settings_username"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/txt_settings_username"
|
||||||
|
android:hint="Username"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/til_settings_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp" />
|
android:layout_below="@+id/til_settings_username">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/txt_settings_username"
|
android:id="@+id/txt_settings_name"
|
||||||
android:text="test"
|
android:hint="@string/lbl_settings_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="8"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/til_settings_surname"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/lbl_settings_username"
|
android:layout_toRightOf="@+id/til_settings_name"
|
||||||
|
android:layout_below="@+id/til_settings_username">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/txt_settings_surname"
|
||||||
|
android:hint="@string/lbl_settings_surname"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="8"
|
||||||
|
android:layout_alignBottom="@+id/til_settings_name"
|
||||||
|
android:layout_toRightOf="@+id/til_settings_name"
|
||||||
|
android:layout_toEndOf="@+id/til_settings_name" />
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/til_settings_email"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/til_settings_name">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/txt_settings_email"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/lbl_settings_email"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/til_settings_password"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/til_settings_email">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/txt_settings_password"
|
||||||
|
android:hint="@string/lbl_settings_password"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="8" />
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||||
|
android:id="@+id/btn_settings_req_password"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
bootstrap:bootstrapText="@string/btn_settings_req_password"
|
||||||
|
bootstrap:bootstrapBrand="primary"
|
||||||
|
bootstrap:roundedCorners="true"
|
||||||
|
android:layout_alignBottom="@+id/til_settings_password"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true" />
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_settings_name"
|
|
||||||
android:text="@string/lbl_settings_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/txt_settings_username" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_settings_surname"
|
|
||||||
android:text="@string/lbl_settings_surname"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_above="@+id/txt_settings_surname"
|
|
||||||
android:layout_alignLeft="@+id/txt_settings_surname"
|
|
||||||
android:layout_alignStart="@+id/txt_settings_surname" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/txt_settings_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="8"
|
|
||||||
android:layout_below="@+id/lbl_settings_name"
|
|
||||||
android:layout_alignLeft="@+id/lbl_settings_name"
|
|
||||||
android:layout_alignStart="@+id/lbl_settings_name" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/txt_settings_surname"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="8"
|
|
||||||
android:layout_alignBottom="@+id/txt_settings_name"
|
|
||||||
android:layout_toRightOf="@+id/txt_settings_name"
|
|
||||||
android:layout_toEndOf="@+id/txt_settings_name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_settings_email"
|
|
||||||
android:text="@string/lbl_settings_email"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/txt_settings_name" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/txt_settings_email"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/lbl_settings_email"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lbl_settings_password"
|
|
||||||
android:text="@string/lbl_settings_password"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_below="@+id/txt_settings_email"
|
|
||||||
android:layout_alignLeft="@+id/txt_settings_email"
|
|
||||||
android:layout_alignStart="@+id/txt_settings_email" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/txt_settings_password"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="8"
|
|
||||||
android:layout_below="@+id/lbl_settings_password"
|
|
||||||
android:layout_alignLeft="@+id/lbl_settings_password"
|
|
||||||
android:layout_alignStart="@+id/lbl_settings_password" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layoutFooter"
|
android:id="@+id/layoutFooter"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@color/bg_common"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:background="#7fbfbfbf"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginBottom="0dp">
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true">
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
<Button
|
||||||
android:id="@+id/btn_settings_req_password"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
bootstrap:bootstrapText="@string/btn_settings_req_password"
|
|
||||||
bootstrap:bootstrapBrand="primary"
|
|
||||||
bootstrap:roundedCorners="true"/>
|
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
|
||||||
android:id="@+id/btn_settings_change"
|
android:id="@+id/btn_settings_change"
|
||||||
bootstrap:bootstrapText="@string/btn_settings_change"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="#651a1111"
|
||||||
|
android:layout_marginRight="1dp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
bootstrap:bootstrapBrand="primary"
|
style="?android:attr/borderlessButtonStyle"
|
||||||
bootstrap:roundedCorners="true"/>
|
android:text="@string/btn_settings_change" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textColor="#aa999999"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_profile_points"
|
android:id="@+id/txt_profile_points"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@id/txt_profile_points"
|
android:layout_below="@id/txt_profile_points"
|
||||||
android:textColor="#aa999999"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_profile_numberposts"
|
android:id="@+id/txt_profile_numberposts"
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@id/txt_profile_numberposts"
|
android:layout_below="@id/txt_profile_numberposts"
|
||||||
android:textColor="#aa999999"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_profile_ranking"
|
android:id="@+id/txt_profile_ranking"
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
android:layout_above="@+id/txt_profile_membersince"
|
android:layout_above="@+id/txt_profile_membersince"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:textColor="#aa999999"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_profile_membersince"
|
android:id="@+id/txt_profile_membersince"
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:textColor="#aa999999"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,17 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp"
|
android:paddingRight="5dp"
|
||||||
android:weightSum="1">
|
android:weightSum="1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:id="@+id/lay_reportlist_color"
|
||||||
|
android:background="#e45151"
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -13,16 +21,9 @@
|
|||||||
android:id="@+id/ic_reportlist_row"/>
|
android:id="@+id/ic_reportlist_row"/>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:id="@+id/lay_reportlist_color"
|
|
||||||
android:background="#e45151"
|
|
||||||
android:layout_width="5dp"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#a6000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:id="@+id/txt_reportlist_lvrow_title"
|
android:id="@+id/txt_reportlist_lvrow_title"
|
||||||
android:text="Header"
|
android:text="Header"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:text="Long Text"
|
android:text="Long Text"
|
||||||
android:id="@+id/txt_reportlist_lvrow_text"
|
android:id="@+id/txt_reportlist_lvrow_text"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
@@ -49,7 +50,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:text="Category"
|
android:text="Category"
|
||||||
android:id="@+id/txt_reportlist_lvrow_category"
|
android:id="@+id/txt_reportlist_lvrow_category"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_top10_rank"
|
android:id="@+id/txt_top10_rank"
|
||||||
android:text="#0"
|
android:text="#0"
|
||||||
android:textColor="@color/md_black_1000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#a6000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:id="@+id/txt_top10_name"
|
android:id="@+id/txt_top10_name"
|
||||||
android:text="Member name"
|
android:text="Member name"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:text="Reported Incidents"
|
android:text="Reported Incidents"
|
||||||
android:id="@+id/txt_top10_numberOfIncidents"
|
android:id="@+id/txt_top10_numberOfIncidents"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:text="Member since"
|
android:text="Member since"
|
||||||
android:id="@+id/txt_top10_membersince"
|
android:id="@+id/txt_top10_membersince"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txt_top10_points"
|
android:id="@+id/txt_top10_points"
|
||||||
android:text="0"
|
android:text="0"
|
||||||
android:textColor="@color/md_black_1000"
|
android:textColor="@color/text_light_grey"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="250dp"
|
android:layout_width="250dp"
|
||||||
android:minWidth="200dp"
|
android:minWidth="250dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#a6000000"
|
android:textColor="#a6000000"
|
||||||
android:id="@+id/txt_infowindow_title"
|
android:id="@+id/txt_infowindow_category"
|
||||||
android:text="Header"
|
android:text="Header"
|
||||||
android:textSize="18dp"
|
android:textSize="18dp"
|
||||||
android:paddingLeft="30dp"
|
android:paddingLeft="30dp"
|
||||||
@@ -44,10 +44,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:typeface="serif"
|
android:typeface="serif"
|
||||||
android:textColor="#b9000000"
|
android:textColor="#b9000000"
|
||||||
android:text="Textabfdfdgregreger"
|
android:text="subcategory"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:id="@+id/txt_infowindow_description"
|
android:id="@+id/txt_infowindow_subcategory"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:marqueeRepeatLimit="marquee_forever" />
|
android:marqueeRepeatLimit="marquee_forever" />
|
||||||
@@ -56,10 +56,28 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="#b9000000"
|
||||||
android:text="Category"
|
android:text="subject"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:id="@+id/txt_infowindow_subject"
|
||||||
|
android:typeface="serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#b9000000"
|
||||||
|
android:text="victim"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:id="@+id/txt_infowindow_victim"
|
||||||
|
android:typeface="serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#b9000000"
|
||||||
|
android:text="time"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:id="@+id/txt_infowindow_category"
|
android:id="@+id/txt_infowindow_time"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -74,7 +92,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="#b9000000"
|
||||||
android:text="Username"
|
android:text="username"
|
||||||
android:id="@+id/txt_infowindow_fromuser"
|
android:id="@+id/txt_infowindow_fromuser"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
|
|
||||||
@@ -82,7 +100,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="#b9000000"
|
||||||
android:text="Points:"
|
android:text="points:"
|
||||||
android:id="@+id/txt_infowindow_points"
|
android:id="@+id/txt_infowindow_points"
|
||||||
android:typeface="serif" />
|
android:typeface="serif" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">RiskAhead</string>
|
<string name="app_name">RiskAhead</string>
|
||||||
<string name="facebook_app_id">658657714234846</string>
|
|
||||||
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
|
|
||||||
|
|
||||||
<string name="btn_start_login">Login</string>
|
<string name="btn_start_login">Login</string>
|
||||||
<string name="btn_start_register">Register</string>
|
<string name="btn_start_register">Register</string>
|
||||||
@@ -22,8 +20,6 @@
|
|||||||
<string name="title_activity_start">RiskAhead</string>
|
<string name="title_activity_start">RiskAhead</string>
|
||||||
<string name="title_activity_entrance">RiskAhead</string>
|
<string name="title_activity_entrance">RiskAhead</string>
|
||||||
|
|
||||||
<string name="btn_settings_change">{fa_pencil} Confirm changes</string>
|
|
||||||
|
|
||||||
<string name="drawer_open">Open navigation drawer</string>
|
<string name="drawer_open">Open navigation drawer</string>
|
||||||
<string name="drawer_close">Close navigation drawer</string>
|
<string name="drawer_close">Close navigation drawer</string>
|
||||||
|
|
||||||
@@ -50,7 +46,7 @@
|
|||||||
<string name="lbl_main_txt1">We have currently ...</string>
|
<string name="lbl_main_txt1">We have currently ...</string>
|
||||||
<string name="lbl_main_txt2">... reported incidents</string>
|
<string name="lbl_main_txt2">... reported incidents</string>
|
||||||
<string name="btn_main_report">{fa_map_marker} Report</string>
|
<string name="btn_main_report">{fa_map_marker} Report</string>
|
||||||
<string name="btn_main_viewmap">{fa_info} View Map</string>
|
<string name="btn_main_viewmap">{fa_map} View Map</string>
|
||||||
|
|
||||||
<string name="input_report_short_hint">Short Description</string>
|
<string name="input_report_short_hint">Short Description</string>
|
||||||
<string name="input_report_long_hint">Long Descpription</string>
|
<string name="input_report_long_hint">Long Descpription</string>
|
||||||
@@ -68,6 +64,10 @@
|
|||||||
<string name="lbl_settings_surname">Surname</string>
|
<string name="lbl_settings_surname">Surname</string>
|
||||||
<string name="lbl_settings_email">E-Mail</string>
|
<string name="lbl_settings_email">E-Mail</string>
|
||||||
<string name="lbl_settings_username">Username</string>
|
<string name="lbl_settings_username">Username</string>
|
||||||
|
<string name="lbl_settings_password">Confirm Password</string>
|
||||||
|
<string name="btn_settings_req_password">{fa_envelope} Reset Password</string>
|
||||||
|
<string name="lbl_settings_retype_password">Retype Password</string>
|
||||||
|
<string name="btn_settings_change">Confirm changes</string>
|
||||||
|
|
||||||
<string name="lbl_profile_stats">Profile Stats</string>
|
<string name="lbl_profile_stats">Profile Stats</string>
|
||||||
<string name="lbl_profile_member_since">Member Since</string>
|
<string name="lbl_profile_member_since">Member Since</string>
|
||||||
@@ -77,9 +77,6 @@
|
|||||||
<string name="btn_profile_viewposts">{fa_search} View Posts</string>
|
<string name="btn_profile_viewposts">{fa_search} View Posts</string>
|
||||||
<string name="lbl_profile_top10">Top 10</string>
|
<string name="lbl_profile_top10">Top 10</string>
|
||||||
|
|
||||||
<string name="lbl_settings_password">Confirm Password</string>
|
|
||||||
<string name="btn_settings_req_password">{fa_envelope} Reset Password</string>
|
|
||||||
<string name="lbl_settings_retype_password">Retype Password</string>
|
|
||||||
|
|
||||||
<string name="btn_maps_confirm_position">{fa_paint_brush} Report this position!</string>
|
<string name="btn_maps_confirm_position">{fa_paint_brush} Report this position!</string>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<color name="common_text">#333333</color>
|
<color name="common_text">#333333</color>
|
||||||
<color name="actionbar_text">#fdfdfd</color>
|
<color name="actionbar_text">#fdfdfd</color>
|
||||||
|
|
||||||
|
<color name="text_light_grey">#aa4b4b4b</color>
|
||||||
|
|
||||||
<color name="white">#ffffff</color>
|
<color name="white">#ffffff</color>
|
||||||
<color name="title">#ffffff</color>
|
<color name="title">#ffffff</color>
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
<string name="title_activity_start">RiskAhead</string>
|
<string name="title_activity_start">RiskAhead</string>
|
||||||
<string name="title_activity_entrance">RiskAhead</string>
|
<string name="title_activity_entrance">RiskAhead</string>
|
||||||
|
|
||||||
<string name="btn_settings_change">{fa_pencil} Confirm changes</string>
|
|
||||||
|
|
||||||
<string name="drawer_open">Open navigation drawer</string>
|
<string name="drawer_open">Open navigation drawer</string>
|
||||||
<string name="drawer_close">Close navigation drawer</string>
|
<string name="drawer_close">Close navigation drawer</string>
|
||||||
|
|
||||||
@@ -68,6 +66,10 @@
|
|||||||
<string name="lbl_settings_surname">Surname</string>
|
<string name="lbl_settings_surname">Surname</string>
|
||||||
<string name="lbl_settings_email">E-Mail</string>
|
<string name="lbl_settings_email">E-Mail</string>
|
||||||
<string name="lbl_settings_username">Username</string>
|
<string name="lbl_settings_username">Username</string>
|
||||||
|
<string name="lbl_settings_password">Confirm Password</string>
|
||||||
|
<string name="btn_settings_req_password">{fa_envelope} Reset Password</string>
|
||||||
|
<string name="lbl_settings_retype_password">Retype Password</string>
|
||||||
|
<string name="btn_settings_change">Confirm changes</string>
|
||||||
|
|
||||||
<string name="lbl_profile_stats">Profile Stats</string>
|
<string name="lbl_profile_stats">Profile Stats</string>
|
||||||
<string name="lbl_profile_member_since">Member Since</string>
|
<string name="lbl_profile_member_since">Member Since</string>
|
||||||
@@ -77,9 +79,6 @@
|
|||||||
<string name="btn_profile_viewposts">{fa_search} View Posts</string>
|
<string name="btn_profile_viewposts">{fa_search} View Posts</string>
|
||||||
<string name="lbl_profile_top10">Top 10</string>
|
<string name="lbl_profile_top10">Top 10</string>
|
||||||
|
|
||||||
<string name="lbl_settings_password">Confirm Password</string>
|
|
||||||
<string name="btn_settings_req_password">{fa_envelope} Reset Password</string>
|
|
||||||
<string name="lbl_settings_retype_password">Retype Password</string>
|
|
||||||
|
|
||||||
<string name="btn_maps_confirm_position">{fa_paint_brush} Report this position!</string>
|
<string name="btn_maps_confirm_position">{fa_paint_brush} Report this position!</string>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user