@06.02.15 Dennis Thießen: Release 1.9
This commit is contained in:
@@ -18,9 +18,9 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "org.deke.risk.riskahead"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 22
|
||||
versionCode 22
|
||||
versionName "1.8.7"
|
||||
targetSdkVersion 20
|
||||
versionCode 23
|
||||
versionName "1.9"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Request;
|
||||
@@ -32,7 +33,7 @@ public class MainActivity extends BaseActivity{
|
||||
private final static String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private Handler handler;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -45,6 +46,13 @@ public class MainActivity extends BaseActivity{
|
||||
}
|
||||
|
||||
private void initButtons() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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
|
||||
@@ -53,12 +61,13 @@ public class MainActivity extends BaseActivity{
|
||||
}
|
||||
});
|
||||
|
||||
Drawable reportIcon = new IconicsDrawable(this)
|
||||
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);
|
||||
|
||||
@@ -69,12 +78,16 @@ public class MainActivity extends BaseActivity{
|
||||
}
|
||||
});
|
||||
|
||||
Drawable mapIcon = new IconicsDrawable(this)
|
||||
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));
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Runnable mHandlerTask = new Runnable()
|
||||
|
||||
@@ -101,18 +101,13 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
super.onCreate(savedInstanceState);
|
||||
userHasToBeLoggedIn();
|
||||
|
||||
navDrawer.setSelection(mapAvtivityID, false);
|
||||
|
||||
if(session.getSubsPremium()){
|
||||
MIN_ZOOM_LEVEL = 7;
|
||||
}else{
|
||||
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);
|
||||
|
||||
findViewById(R.id.fab_reportwf_map).setVisibility(View.INVISIBLE);
|
||||
@@ -197,6 +192,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Log.d(TAG, "MARKED LOCATION: " + markedLocation.latitude + " " + markedLocation.longitude);
|
||||
showAdd = false;
|
||||
gotoReportActivity(markedLocation.latitude + ":" + markedLocation.longitude);
|
||||
}
|
||||
});
|
||||
@@ -314,6 +310,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
}
|
||||
|
||||
private void addIncidentMarkersOnMap(JSONArray incidents){
|
||||
|
||||
mClusterManager.clearItems();
|
||||
|
||||
for(int i = 0; i < incidents.length();i++){
|
||||
@@ -752,6 +749,13 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
pbCounter++;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
navDrawer.setSelection(mapAvtivityID, false);
|
||||
showAdd = true;
|
||||
}
|
||||
|
||||
private void hideProgress(){
|
||||
pbCounter--;
|
||||
if(pbCounter == 0){
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
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.gson.Gson;
|
||||
|
||||
@@ -153,7 +156,6 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
transaction.commit();
|
||||
|
||||
if(state > 0){
|
||||
btnReportNow.setVisibility(View.VISIBLE);
|
||||
btnMap.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -232,20 +234,25 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
@Override
|
||||
public void onInputFinished(boolean finished) {
|
||||
if(finished) {
|
||||
if(currentState < fragList.size()-1) btnContinue.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
||||
btnContinue.setBootstrapBrand(DefaultBootstrapBrand.SUCCESS);
|
||||
|
||||
}else{
|
||||
btnContinue.setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
||||
btnContinue.setBootstrapBrand(DefaultBootstrapBrand.REGULAR);
|
||||
}
|
||||
|
||||
if(finished && (currentState == 1)){
|
||||
btnReportNow.setVisibility(View.VISIBLE);
|
||||
} else if (currentState > 1) {
|
||||
if((currentState == 1 && finished) || (currentState > 1)){
|
||||
btnReportNow.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
btnReportNow.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if(finished || currentState > 1){
|
||||
btnContinue.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
btnContinue.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
@@ -47,15 +48,33 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
Bundle querySkus;
|
||||
|
||||
HashMap<String,JSONObject> purchaseMap = new HashMap<>();
|
||||
ArrayList<String> skuList = new ArrayList<>();
|
||||
|
||||
HashMap<String,String> dbItems = new HashMap<>();
|
||||
ArrayList<String> ownedSkus = new ArrayList<>();
|
||||
|
||||
Handler handler;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
userHasToBeLoggedIn();
|
||||
|
||||
skuList.add("no_ads_01");
|
||||
skuList.add("no_ads_02");
|
||||
skuList.add("extra_functions_01");
|
||||
skuList.add("extra_functions_02");
|
||||
|
||||
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
|
||||
@@ -79,15 +98,14 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
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_02");
|
||||
skuList.add("extra_functions_01");
|
||||
skuList.add("extra_functions_02");
|
||||
querySkus = new Bundle();
|
||||
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
thread.start();
|
||||
}
|
||||
|
||||
private void getAlreadyPurchasedItems() {
|
||||
try {
|
||||
@@ -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;
|
||||
|
||||
if(dbItems != null && dbItems.containsKey(sub)){
|
||||
|
||||
@@ -377,6 +377,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
sendBroadcast(broadcastIntent);
|
||||
|
||||
stopService(new Intent(BaseActivity.this, NotificationService.class));
|
||||
showAd();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ public class NotificationService extends Service {
|
||||
}
|
||||
NotificationCompat.Builder mBuilder =
|
||||
new NotificationCompat.Builder(getApplicationContext())
|
||||
.setSmallIcon(R.drawable.logo_riskahead)
|
||||
.setSmallIcon(R.drawable.logo_380)
|
||||
.setAutoCancel(true)
|
||||
.setContentTitle(title)
|
||||
.setContentText(context);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<include
|
||||
@@ -18,8 +19,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:contentDescription="@null"
|
||||
android:id="@+id/imageView"
|
||||
android:src="@drawable/bg_withlogo_2"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<RelativeLayout
|
||||
@@ -107,7 +108,6 @@
|
||||
<Button
|
||||
android:id="@+id/btn_main_report"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/activity_main_button"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginRight="1dp"
|
||||
android:paddingLeft="10dp"
|
||||
@@ -122,7 +122,6 @@
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/activity_main_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="80dp"
|
||||
android:text="@string/btn_main_showmap" />
|
||||
|
||||
@@ -125,7 +125,8 @@
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_marginTop="50dp"
|
||||
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"/>
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user