@06.02.15 Dennis Thießen: Release 1.9
This commit is contained in:
@@ -18,9 +18,9 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.deke.risk.riskahead"
|
applicationId "org.deke.risk.riskahead"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 22
|
targetSdkVersion 20
|
||||||
versionCode 22
|
versionCode 23
|
||||||
versionName "1.8.7"
|
versionName "1.9"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.support.v4.content.ContextCompat;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.volley.Request;
|
import com.android.volley.Request;
|
||||||
@@ -32,7 +33,7 @@ public class MainActivity extends BaseActivity{
|
|||||||
private final static String TAG = MainActivity.class.getSimpleName();
|
private final static String TAG = MainActivity.class.getSimpleName();
|
||||||
|
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
|
private Handler handler;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -45,36 +46,48 @@ public class MainActivity extends BaseActivity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initButtons() {
|
private void initButtons() {
|
||||||
Button report = (Button) findViewById(R.id.btn_main_report);
|
runOnUiThread(new Runnable() {
|
||||||
report.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void run() {
|
||||||
gotoReportActivity();
|
ImageView bg = (ImageView) findViewById(R.id.imageView);
|
||||||
|
bg.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.bg_withlogo_2));
|
||||||
|
|
||||||
|
|
||||||
|
Button report = (Button) findViewById(R.id.btn_main_report);
|
||||||
|
report.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
gotoReportActivity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Drawable reportIcon = new IconicsDrawable(getApplicationContext())
|
||||||
|
.icon(GoogleMaterial.Icon.gmd_room)
|
||||||
|
.color(ContextCompat.getColor(getApplicationContext(), R.color.white))
|
||||||
|
.sizeDp(24);
|
||||||
|
|
||||||
|
report.setCompoundDrawables(reportIcon, null, null, null);
|
||||||
|
report.setBackgroundDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.activity_main_button));
|
||||||
|
|
||||||
|
Button map = (Button) findViewById(R.id.btn_main_viewmap);
|
||||||
|
|
||||||
|
map.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
gotoMapActivity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Drawable mapIcon = new IconicsDrawable(getApplicationContext())
|
||||||
|
.icon(GoogleMaterial.Icon.gmd_map)
|
||||||
|
.color(ContextCompat.getColor(getApplicationContext(), R.color.white))
|
||||||
|
.sizeDp(24);
|
||||||
|
|
||||||
|
map.setCompoundDrawables(null, null, mapIcon, null);
|
||||||
|
map.setBackgroundDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.activity_main_button));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Drawable reportIcon = new IconicsDrawable(this)
|
|
||||||
.icon(GoogleMaterial.Icon.gmd_room)
|
|
||||||
.color(ContextCompat.getColor(getApplicationContext(),R.color.white))
|
|
||||||
.sizeDp(24);
|
|
||||||
|
|
||||||
report.setCompoundDrawables(reportIcon, null, null, null);
|
|
||||||
|
|
||||||
Button map = (Button) findViewById(R.id.btn_main_viewmap);
|
|
||||||
|
|
||||||
map.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
gotoMapActivity();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Drawable mapIcon = new IconicsDrawable(this)
|
|
||||||
.icon(GoogleMaterial.Icon.gmd_map)
|
|
||||||
.color(ContextCompat.getColor(getApplicationContext(), R.color.white))
|
|
||||||
.sizeDp(24);
|
|
||||||
|
|
||||||
map.setCompoundDrawables(null, null, mapIcon, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Runnable mHandlerTask = new Runnable()
|
Runnable mHandlerTask = new Runnable()
|
||||||
|
|||||||
@@ -101,18 +101,13 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
userHasToBeLoggedIn();
|
userHasToBeLoggedIn();
|
||||||
|
|
||||||
navDrawer.setSelection(mapAvtivityID, false);
|
|
||||||
|
|
||||||
if(session.getSubsPremium()){
|
if(session.getSubsPremium()){
|
||||||
MIN_ZOOM_LEVEL = 7;
|
MIN_ZOOM_LEVEL = 7;
|
||||||
}else{
|
}else{
|
||||||
MIN_ZOOM_LEVEL = 9;
|
MIN_ZOOM_LEVEL = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
showAdd = true;
|
MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.frag_maps_map);
|
||||||
|
|
||||||
MapFragment mapFragment = (MapFragment) getFragmentManager()
|
|
||||||
.findFragmentById(R.id.frag_maps_map);
|
|
||||||
mapFragment.getMapAsync(this);
|
mapFragment.getMapAsync(this);
|
||||||
|
|
||||||
findViewById(R.id.fab_reportwf_map).setVisibility(View.INVISIBLE);
|
findViewById(R.id.fab_reportwf_map).setVisibility(View.INVISIBLE);
|
||||||
@@ -197,6 +192,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Log.d(TAG, "MARKED LOCATION: " + markedLocation.latitude + " " + markedLocation.longitude);
|
Log.d(TAG, "MARKED LOCATION: " + markedLocation.latitude + " " + markedLocation.longitude);
|
||||||
|
showAdd = false;
|
||||||
gotoReportActivity(markedLocation.latitude + ":" + markedLocation.longitude);
|
gotoReportActivity(markedLocation.latitude + ":" + markedLocation.longitude);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -314,6 +310,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addIncidentMarkersOnMap(JSONArray incidents){
|
private void addIncidentMarkersOnMap(JSONArray incidents){
|
||||||
|
|
||||||
mClusterManager.clearItems();
|
mClusterManager.clearItems();
|
||||||
|
|
||||||
for(int i = 0; i < incidents.length();i++){
|
for(int i = 0; i < incidents.length();i++){
|
||||||
@@ -752,6 +749,13 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
pbCounter++;
|
pbCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume(){
|
||||||
|
super.onResume();
|
||||||
|
navDrawer.setSelection(mapAvtivityID, false);
|
||||||
|
showAdd = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void hideProgress(){
|
private void hideProgress(){
|
||||||
pbCounter--;
|
pbCounter--;
|
||||||
if(pbCounter == 0){
|
if(pbCounter == 0){
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ import com.android.volley.Response;
|
|||||||
import com.android.volley.VolleyError;
|
import com.android.volley.VolleyError;
|
||||||
import com.android.volley.toolbox.StringRequest;
|
import com.android.volley.toolbox.StringRequest;
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import com.beardedhen.androidbootstrap.api.attributes.BootstrapBrand;
|
||||||
|
import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand;
|
||||||
|
import com.beardedhen.androidbootstrap.api.view.BootstrapBrandView;
|
||||||
import com.google.android.gms.maps.model.LatLng;
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
@@ -153,7 +156,6 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
transaction.commit();
|
transaction.commit();
|
||||||
|
|
||||||
if(state > 0){
|
if(state > 0){
|
||||||
btnReportNow.setVisibility(View.VISIBLE);
|
|
||||||
btnMap.setVisibility(View.GONE);
|
btnMap.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,20 +234,25 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
@Override
|
@Override
|
||||||
public void onInputFinished(boolean finished) {
|
public void onInputFinished(boolean finished) {
|
||||||
if(finished) {
|
if(finished) {
|
||||||
if(currentState < fragList.size()-1) btnContinue.setVisibility(View.VISIBLE);
|
|
||||||
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
||||||
|
btnContinue.setBootstrapBrand(DefaultBootstrapBrand.SUCCESS);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
btnContinue.setVisibility(View.INVISIBLE);
|
|
||||||
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
||||||
|
btnContinue.setBootstrapBrand(DefaultBootstrapBrand.REGULAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(finished && (currentState == 1)){
|
if((currentState == 1 && finished) || (currentState > 1)){
|
||||||
btnReportNow.setVisibility(View.VISIBLE);
|
btnReportNow.setVisibility(View.VISIBLE);
|
||||||
} else if (currentState > 1) {
|
}else{
|
||||||
btnReportNow.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
btnReportNow.setVisibility(View.INVISIBLE);
|
btnReportNow.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(finished || currentState > 1){
|
||||||
|
btnContinue.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
btnContinue.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
@@ -47,46 +48,63 @@ public class SubscriptionsActivity extends BaseActivity{
|
|||||||
Bundle querySkus;
|
Bundle querySkus;
|
||||||
|
|
||||||
HashMap<String,JSONObject> purchaseMap = new HashMap<>();
|
HashMap<String,JSONObject> purchaseMap = new HashMap<>();
|
||||||
|
ArrayList<String> skuList = new ArrayList<>();
|
||||||
|
|
||||||
HashMap<String,String> dbItems = new HashMap<>();
|
HashMap<String,String> dbItems = new HashMap<>();
|
||||||
ArrayList<String> ownedSkus = new ArrayList<>();
|
ArrayList<String> ownedSkus = new ArrayList<>();
|
||||||
|
|
||||||
|
Handler handler;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
userHasToBeLoggedIn();
|
userHasToBeLoggedIn();
|
||||||
|
|
||||||
tblBillings = (TableLayout) findViewById(R.id.tbl_billing);
|
|
||||||
|
|
||||||
ServiceConnection mServiceConn = new ServiceConnection() {
|
|
||||||
@Override
|
|
||||||
public void onServiceDisconnected(ComponentName name) {
|
|
||||||
mService = null;
|
|
||||||
Log.d(TAG,"Disconnected from InApp Billing Service");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onServiceConnected(ComponentName name,
|
|
||||||
IBinder service) {
|
|
||||||
mService = IInAppBillingService.Stub.asInterface(service);
|
|
||||||
Log.d(TAG,"Connected to InApp Billing Service");
|
|
||||||
|
|
||||||
initBillingOptions();
|
|
||||||
getAlreadyPurchasedItems();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
|
|
||||||
serviceIntent.setPackage("com.android.vending");
|
|
||||||
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
|
|
||||||
|
|
||||||
ArrayList<String> skuList = new ArrayList<>();
|
|
||||||
skuList.add("no_ads_01");
|
skuList.add("no_ads_01");
|
||||||
skuList.add("no_ads_02");
|
skuList.add("no_ads_02");
|
||||||
skuList.add("extra_functions_01");
|
skuList.add("extra_functions_01");
|
||||||
skuList.add("extra_functions_02");
|
skuList.add("extra_functions_02");
|
||||||
querySkus = new Bundle();
|
|
||||||
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
|
|
||||||
|
|
||||||
|
initBillingService();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBillingService() {
|
||||||
|
tblBillings = (TableLayout) findViewById(R.id.tbl_billing);
|
||||||
|
handler = new Handler();
|
||||||
|
|
||||||
|
Thread thread = new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
ServiceConnection mServiceConn = new ServiceConnection() {
|
||||||
|
@Override
|
||||||
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
|
mService = null;
|
||||||
|
Log.d(TAG, "Disconnected from InApp Billing Service");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceConnected(ComponentName name,
|
||||||
|
IBinder service) {
|
||||||
|
mService = IInAppBillingService.Stub.asInterface(service);
|
||||||
|
Log.d(TAG,"Connected to InApp Billing Service");
|
||||||
|
|
||||||
|
initBillingOptions();
|
||||||
|
getAlreadyPurchasedItems();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
|
||||||
|
serviceIntent.setPackage("com.android.vending");
|
||||||
|
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
|
||||||
|
|
||||||
|
querySkus = new Bundle();
|
||||||
|
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getAlreadyPurchasedItems() {
|
private void getAlreadyPurchasedItems() {
|
||||||
@@ -126,13 +144,9 @@ public class SubscriptionsActivity extends BaseActivity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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){
|
|
||||||
|
for(String sub : skuList){
|
||||||
boolean itemFound = false;
|
boolean itemFound = false;
|
||||||
|
|
||||||
if(dbItems != null && dbItems.containsKey(sub)){
|
if(dbItems != null && dbItems.containsKey(sub)){
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
sendBroadcast(broadcastIntent);
|
sendBroadcast(broadcastIntent);
|
||||||
|
|
||||||
stopService(new Intent(BaseActivity.this, NotificationService.class));
|
stopService(new Intent(BaseActivity.this, NotificationService.class));
|
||||||
|
showAd();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public class NotificationService extends Service {
|
|||||||
}
|
}
|
||||||
NotificationCompat.Builder mBuilder =
|
NotificationCompat.Builder mBuilder =
|
||||||
new NotificationCompat.Builder(getApplicationContext())
|
new NotificationCompat.Builder(getApplicationContext())
|
||||||
.setSmallIcon(R.drawable.logo_riskahead)
|
.setSmallIcon(R.drawable.logo_380)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(context);
|
.setContentText(context);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
android:id="@+id/main_layout"
|
android:id="@+id/main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/black"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
@@ -18,8 +19,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/toolbar"
|
android:layout_below="@id/toolbar"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:src="@drawable/bg_withlogo_2"
|
|
||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -107,7 +108,6 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_main_report"
|
android:id="@+id/btn_main_report"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/activity_main_button"
|
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:layout_marginRight="1dp"
|
android:layout_marginRight="1dp"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
@@ -122,7 +122,6 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/activity_main_button"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:text="@string/btn_main_showmap" />
|
android:text="@string/btn_main_showmap" />
|
||||||
|
|||||||
@@ -125,7 +125,8 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
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_centerInParent="true"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:textColor="@color/text_light_grey"/>
|
android:textColor="@color/text_light_grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
Reference in New Issue
Block a user