DT @12.01.2016: Bugfixes und release 1.5

This commit is contained in:
Dennis Thießen
2016-01-12 21:10:20 +01:00
parent 009d7bfa71
commit bf58f08bd0
13 changed files with 66 additions and 58 deletions

Binary file not shown.

View File

@@ -19,8 +19,8 @@ android {
applicationId "org.deke.risk.riskahead"
minSdkVersion 15
targetSdkVersion 22
versionCode 5
versionName "1.4"
versionCode 6
versionName "1.5"
}
buildTypes {
release {

View File

@@ -119,6 +119,7 @@
android:screenOrientation="portrait" />
<activity
android:name=".ReportWFActivity"
android:windowSoftInputMode="adjustPan"
android:label="@string/title_activity_report_wf" />
<service android:name=".helper.NotificationService"

View File

@@ -277,7 +277,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
String providerType = user.getString("providerType");
String token = user.getString("accesskey");
JSONArray jSubs = jObj.getJSONArray("subs");
JSONArray jSubs = user.getJSONArray("subs");
boolean isPremium = false;
boolean isAdFree = false;

View File

@@ -68,6 +68,8 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
private static final int THRESHOLD_ZOOM_LEVEL = 10;
private int MIN_ZOOM_LEVEL = 9;
private float current_zoom_level;
private GoogleMap mMap;
private ClusterManager<IncidentReport> mClusterManager;
@@ -135,7 +137,12 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
}
markedLocation = point;
mMarker = mMap.addMarker(new MarkerOptions().position(point));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(point, DEFAULT_ZOOM_LEVEL));
if(current_zoom_level > DEFAULT_ZOOM_LEVEL){
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(point, current_zoom_level));
}else{
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(point, DEFAULT_ZOOM_LEVEL));
}
findViewById(R.id.fab_reportwf_map).setVisibility(View.VISIBLE);
if(session.getNotificationPositionRequest()){
@@ -174,6 +181,8 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
return;
}
current_zoom_level = position.zoom;
if(position.zoom > 13) {
PRELOAD_PERCENTAGE = 0.7;
}else{

View File

@@ -123,46 +123,28 @@ public class SubscriptionsActivity extends BaseActivity{
}
private void syncWithDatabase(ArrayList<String> ownedSkus) {
boolean itemFound = false;
if(dbItems.containsKey("extra_functions_01")){
for(String sku : ownedSkus){
itemFound = itemFound || sku.equals("extra_functions_01");
}
Log.d(TAG, "sync subs with database...");
if(itemFound == false){
deactivateSubscriptions(dbItems.get("extra_functions_01"));
ArrayList<String> subs = new ArrayList<>();
subs.add("extra_functions_01");
subs.add("extra_functions_02");
subs.add("no_ads_01");
subs.add("no_ads_02");
for(String sub : subs){
boolean itemFound = false;
if(dbItems.containsKey("extra_functions_01")){
for(String sku : ownedSkus){
itemFound = itemFound || sku.equals(sub);
}
if(itemFound == false){
Log.d(TAG, "found sub in database which is active but sub already expired: "+sub);
deactivateSubscriptions(dbItems.get(sub));
}
}
}
if(dbItems.containsKey("extra_functions_02")){
for(String sku : ownedSkus){
itemFound = itemFound || sku.equals("extra_functions_02");
}
if(itemFound == false){
deactivateSubscriptions(dbItems.get("extra_functions_02"));
}
}
if(dbItems.containsKey("no_ads_01")){
for(String sku : ownedSkus){
itemFound = itemFound || sku.equals("no_ads_01");
}
if(itemFound == false){
deactivateSubscriptions(dbItems.get("no_ads_01"));
}
}
if(dbItems.containsKey("no_ads_02")){
for(String sku : ownedSkus){
itemFound = itemFound || sku.equals("no_ads_02");
}
if(itemFound == false){
deactivateSubscriptions(dbItems.get("no_ads_02"));
}
}
}
@@ -180,7 +162,6 @@ public class SubscriptionsActivity extends BaseActivity{
initPurchaseTable(responseList);
}
} catch (RemoteException e) {
e.printStackTrace();
} catch (JSONException e) {

View File

@@ -64,7 +64,7 @@ public class ViewReportActivity extends BaseActivity {
super.onCreate(savedInstanceState);
userHasToBeLoggedIn();
registerBroadcastReceiver();
txtIncidentCategory = (EditText) findViewById(R.id.txt_viewreport_incidentcategory);
txtIncidentSubCategory = (EditText) findViewById(R.id.txt_viewreport_incidentsubcategory);
txtPosition = (EditText) findViewById(R.id.txt_viewreport_position);

View File

@@ -27,8 +27,9 @@ public class ReportWF_3_Fragment extends Fragment {
private final static int PARAMILITARY = 4;
private final static int MILITARY = 5;
private final static int TERRORIST = 6;
private final static int ETC = 7;
private final static int DONTKNOW = 8;
private final static int DONTKNOW = 7;
private final static int ETC = 8;
private View viewFragment;
@@ -125,7 +126,7 @@ public class ReportWF_3_Fragment extends Fragment {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if ((position < 1) && (incident.getFidSuspectSubCategory() != 0))
suspectSubCategory.setSelection(incident.getFidTimeSubCategory());
suspectSubCategory.setSelection(incident.getFidSuspectSubCategory());
incident.setFidSuspectSubCategory(position);
checkIfFinished();

View File

@@ -25,8 +25,8 @@ public class ReportWF_4_Fragment extends Fragment {
private final static int FIREARM = 2;
private final static int EXPLOSIONS = 3;
private final static int MIL= 4;
private final static int ETC = 5;
private final static int DONTKNOW = 6;
private final static int ETC = 6;
private final static int DONTKNOW = 5;
private View viewFragment;

View File

@@ -159,7 +159,7 @@ public class IncidentReport implements ClusterItem {
switch (this.fidIncidentCategory) {
case 1:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_general_w_f;
}else{
@@ -174,7 +174,7 @@ public class IncidentReport implements ClusterItem {
}
break;
case 2:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_verbal_w_f;
}else{
@@ -189,7 +189,7 @@ public class IncidentReport implements ClusterItem {
}
break;
case 3:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_middle_violance_w_f;
}else{
@@ -204,7 +204,7 @@ public class IncidentReport implements ClusterItem {
}
break;
case 4:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_high_violance_w_f;
}else{
@@ -219,7 +219,7 @@ public class IncidentReport implements ClusterItem {
}
break;
case 5:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_nature_w_f;
}else{
@@ -234,7 +234,7 @@ public class IncidentReport implements ClusterItem {
}
break;
case 6:
if(tmpFromDate != null && tmpFromDate.after(today)){
if((this.fidTimeCategory == 2) || (tmpFromDate != null && tmpFromDate.after(today))){
if(fidVictimCategory == 1){
mIcon = R.drawable.icon_infra_v2_w_f;
}else{
@@ -403,10 +403,14 @@ public class IncidentReport implements ClusterItem {
returnValue = "";
}
if(stringArray != null && (stringArray.length == this.fidIncidentSubCategory)){
if(stringArray != null && (stringArray.length == this.fidSuspectCategory)){
returnValue = getEtcSuspectCategory();
}else if(stringArray != null){
returnValue = stringArray[this.fidIncidentSubCategory-1];
returnValue = stringArray[this.fidSuspectCategory-1];
}
if(this.fidSuspectCategory == 4 || this.fidSuspectCategory == 5 || this.fidSuspectCategory == 6) {
returnValue += " ("+context.getResources().getStringArray(R.array.cat_suspect_sub_location)[this.fidSuspectSubCategory]+")";
}
return returnValue;
@@ -470,6 +474,10 @@ public class IncidentReport implements ClusterItem {
returnValue = stringArray[this.fidSuspectWeaponCategory-1];
}
if(this.fidSuspectWeaponCategory < 5 && this.etcSuspectWeaponCategory.length() > 0) {
returnValue += " ( "+this.etcSuspectWeaponCategory+" )";
}
return returnValue;
}

View File

@@ -49,8 +49,8 @@
android:layout_height="40dp"
android:layout_weight="1"
android:paddingRight="1dp"
bootstrap:bootstrapBrand="danger"
bootstrap:bootstrapText="Report NOW!" />
bootstrap:bootstrapBrand="warning"
bootstrap:bootstrapText="@string/btn_reportwf_reportnow" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btn_reportwf_next"
@@ -58,7 +58,7 @@
android:layout_height="40dp"
android:layout_weight="1"
bootstrap:bootstrapBrand="success"
bootstrap:bootstrapText="Continue" />
bootstrap:bootstrapText="@string/btn_reportwf_next" />
</LinearLayout>

View File

@@ -141,6 +141,10 @@
<string name="txt_notification_context"> neuer Vorfall. Pass auf!</string>
<string name="txt_notification_context_multi"> neue Vorfälle. Pass auf!</string>
<string name="btn_reportwf_reportnow">Jetzt melden!</string>
<string name="btn_reportwf_next">Weiter</string>
<string name="menu_send_feedback">Feedback senden</string>
<string-array name="cat_situation_main">
<item>Allgemeiner Vorfall/Situation</item>
<item>Mündliche Gewalt</item>

View File

@@ -145,6 +145,10 @@
<string name="txt_notification_context"> new incident near your last location. Watch out!</string>
<string name="txt_notification_context_multi"> new incidents near your last location. Watch out!</string>
<string name="btn_reportwf_reportnow">Report NOW!</string>
<string name="btn_reportwf_next">Next</string>
<string name="menu_send_feedback">Send Feedback</string>
<string-array name="cat_situation_main">
<item>Allgemeiner Vorfall/Situation</item>
<item>Mündliche Gewalt</item>