@03.02.15 Dennis Thießen: Release 1.8.7
This commit is contained in:
@@ -13,14 +13,14 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.1"
|
||||
buildToolsVersion "23.0.2"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "org.deke.risk.riskahead"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 22
|
||||
versionCode 21
|
||||
versionName "1.8.6"
|
||||
versionCode 22
|
||||
versionName "1.8.7"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.deke.risk.riskahead;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -33,8 +32,6 @@ public class MainActivity extends BaseActivity{
|
||||
private final static String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
private Handler mHandler = new Handler();
|
||||
private TextView notificationStatus;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@@ -86,7 +83,7 @@ public class MainActivity extends BaseActivity{
|
||||
public void run() {
|
||||
requestNumberOfIncidents();
|
||||
|
||||
notificationStatus = (TextView) findViewById(R.id.lbl_main_notifystatus_status);
|
||||
TextView notificationStatus = (TextView) findViewById(R.id.lbl_main_notifystatus_status);
|
||||
if(session.getNotificationEnabled()){
|
||||
if(session.getNotificationServiceReady()){
|
||||
notificationStatus.setText(getString(R.string.txt_notifystatus_activated));
|
||||
@@ -142,6 +139,7 @@ public class MainActivity extends BaseActivity{
|
||||
Log.e(TAG, "Error getting incident count: " + error.getMessage());
|
||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
||||
stopRepeatingTask();
|
||||
hideDialog();
|
||||
}
|
||||
}) {
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import android.view.Menu;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RatingBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -749,14 +748,14 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
}
|
||||
|
||||
private void showProgress(){
|
||||
((ProgressBar) findViewById(R.id.pb_map_progress)).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.pb_map_progress).setVisibility(View.VISIBLE);
|
||||
pbCounter++;
|
||||
}
|
||||
|
||||
private void hideProgress(){
|
||||
pbCounter--;
|
||||
if(pbCounter == 0){
|
||||
((ProgressBar) findViewById(R.id.pb_map_progress)).setVisibility(View.GONE);
|
||||
findViewById(R.id.pb_map_progress).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ProfileActivity extends BaseActivity{
|
||||
Log.d(TAG,"ProfileActivity created");
|
||||
}
|
||||
|
||||
private void initProfileFromUserID(String msg_intent) {
|
||||
private void initProfileFromUserID(String userId) {
|
||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
|
||||
|
||||
tabLayout.addTab(tabLayout.newTab().setText(getResources().getString(R.string.lbl_profile_stats)));
|
||||
@@ -41,25 +41,7 @@ public class ProfileActivity extends BaseActivity{
|
||||
|
||||
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
|
||||
|
||||
final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
|
||||
final PagerAdapter adapter = new ProfilePagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(), msg_intent);
|
||||
|
||||
viewPager.setAdapter(adapter);
|
||||
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
viewPager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
}
|
||||
});
|
||||
initViewPager(tabLayout, userId);
|
||||
}
|
||||
|
||||
private void initOwnProfileView() {
|
||||
@@ -71,8 +53,12 @@ public class ProfileActivity extends BaseActivity{
|
||||
|
||||
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
|
||||
|
||||
initViewPager(tabLayout, user.get(SessionManager.KEY_UID));
|
||||
}
|
||||
|
||||
private void initViewPager(TabLayout tabLayout, String userId) {
|
||||
final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
|
||||
final PagerAdapter adapter = new ProfilePagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(), user.get(SessionManager.KEY_UID));
|
||||
final PagerAdapter adapter = new ProfilePagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount(), userId);
|
||||
|
||||
viewPager.setAdapter(adapter);
|
||||
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
@@ -84,12 +70,10 @@ public class ProfileActivity extends BaseActivity{
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,8 +67,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
userHasToBeLoggedIn();
|
||||
|
||||
showDialog();
|
||||
|
||||
txtIncidentCategory = (EditText) findViewById(R.id.txt_viewreport_incidentcategory);
|
||||
txtIncidentSubCategory = (EditText) findViewById(R.id.txt_viewreport_incidentsubcategory);
|
||||
txtPosition = (EditText) findViewById(R.id.txt_viewreport_position);
|
||||
@@ -151,19 +149,21 @@ public class ViewReportActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
public void getIncident(Integer uid) {
|
||||
showDialog();
|
||||
String tag_string_req = "getincidentwithpositionfromid";
|
||||
StringRequest strReq = getStringRequestGetIncidentWithPositionFromID(uid);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
|
||||
public void deleteIncident(Integer uid) {
|
||||
showDialog();
|
||||
|
||||
String tag_string_req = "deactivateIncident";
|
||||
StringRequest strReq = getStringRequestDeleteIncident(uid);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestDeleteIncident(final Integer incidentid) {
|
||||
showDialog();
|
||||
return new StringRequest(Request.Method.POST, AppConfig.URL_DEFAULT, new Response.Listener<String>() {
|
||||
|
||||
@Override
|
||||
@@ -212,7 +212,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestGetIncidentWithPositionFromID(final Integer incidentid) {
|
||||
showDialog();
|
||||
return new StringRequest(Request.Method.POST, AppConfig.URL_DEFAULT, new Response.Listener<String>() {
|
||||
|
||||
@Override
|
||||
@@ -362,8 +361,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
private void initReport(IncidentReport incident) {
|
||||
Context tmpContext = getApplicationContext();
|
||||
|
||||
hideDialog();
|
||||
|
||||
scorelabel.setText(Integer.toString(incident.getVotedScore()));
|
||||
txtIncidentCategory.setText(incident.getIncidentCategoryName(tmpContext));
|
||||
txtIncidentSubCategory.setText(checkIfTextEmptyAndReturnString(incident.getIncidentSubCategoryName(tmpContext)));
|
||||
@@ -451,7 +448,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
Log.d(TAG, "MadeVote: " + response);
|
||||
hideDialog();
|
||||
|
||||
try {
|
||||
JSONObject jObj = new JSONObject(response);
|
||||
@@ -478,7 +474,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
Log.e(TAG, "Error voting incident: " + error.getMessage());
|
||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
||||
hideDialog();
|
||||
}
|
||||
}) {
|
||||
|
||||
@@ -500,7 +495,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
String tag_string_req = "deletevote";
|
||||
StringRequest strReq = getStringRequestDeleteVote(incidentid);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestDeleteVote(final Integer incidentid) {
|
||||
@@ -509,7 +503,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
Log.d(TAG, "Delete Vote: " + response);
|
||||
hideDialog();
|
||||
|
||||
try {
|
||||
JSONObject jObj = new JSONObject(response);
|
||||
@@ -534,7 +527,6 @@ public class ViewReportActivity extends BaseActivity {
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
Log.e(TAG, "Error deleting voting incident: " + error.getMessage());
|
||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
||||
hideDialog();
|
||||
}
|
||||
}) {
|
||||
|
||||
|
||||
@@ -85,13 +85,21 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String newStringValue = newValue.toString();
|
||||
session.setNotificationRadius(Integer.valueOf(newStringValue));
|
||||
((ListPreference) preference).setValue(newValue.toString());
|
||||
preference.setSummary(prefRadius.getEntry());
|
||||
return true;
|
||||
|
||||
if(session.getSubsPremium() || Integer.valueOf(newStringValue) < 25){
|
||||
session.setNotificationRadius(Integer.valueOf(newStringValue));
|
||||
((ListPreference) preference).setValue(newValue.toString());
|
||||
preference.setSummary(prefRadius.getEntry());
|
||||
return true;
|
||||
}else{
|
||||
((SettingsActivity) getActivity()).showMessage(getString(R.string.txt_premium_only));
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
prefFrequency.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
|
||||
@@ -409,6 +409,10 @@
|
||||
<item>5 كم</item>
|
||||
<item>10 كم</item>
|
||||
<item>15 كم</item>
|
||||
<item>25 كم</item>
|
||||
<item>50 كم</item>
|
||||
<item>100 كم</item>
|
||||
<item>250 كم</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -416,6 +420,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -403,6 +403,10 @@
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -410,6 +414,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -409,6 +409,10 @@
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -416,6 +420,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -408,6 +408,10 @@
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -415,6 +419,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -425,6 +425,10 @@ Não foi possível recuperar as configurações do perfil
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -432,6 +436,10 @@ Não foi possível recuperar as configurações do perfil
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -407,6 +407,10 @@
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -414,6 +418,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
@@ -411,6 +411,10 @@
|
||||
<item>5 km</item>
|
||||
<item>10 km</item>
|
||||
<item>15 km</item>
|
||||
<item>25 km</item>
|
||||
<item>50 km</item>
|
||||
<item>100 km</item>
|
||||
<item>250 km</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_radius_entry">
|
||||
@@ -418,6 +422,10 @@
|
||||
<item>5</item>
|
||||
<item>10</item>
|
||||
<item>15</item>
|
||||
<item>25</item>
|
||||
<item>50</item>
|
||||
<item>100</item>
|
||||
<item>250</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="notification_freq">
|
||||
|
||||
Reference in New Issue
Block a user