DT @12.09.2015: Refactored, report activity extended

This commit is contained in:
Dennis Thießen
2015-09-12 19:42:18 +02:00
parent 788793d61c
commit 7667064583
23 changed files with 441 additions and 316 deletions

View File

@@ -2,22 +2,23 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.deke.risk.riskahead" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="org.deke.risk.riskahead.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".helper.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="org.deke.risk.riskahead.permission.MAPS_RECEIVE" />
<!-- Allows the Google Maps Android API V2 to cache map tile data in the device's external storage area -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Google Maps Android API V2 requires OpenGL ES version 2 -->
<uses-feature
android:glEsVersion="0x00020000"
@@ -40,6 +41,7 @@
<activity
android:name=".StartActivity"
android:configChanges="orientation"
android:label="@string/title_activity_start" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -49,6 +51,7 @@
</activity>
<activity
android:name=".LoginActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName=".StartActivity" >
>
@@ -62,11 +65,13 @@
</activity>
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:label="@string/title_activity_entrance"
android:parentActivityName=".LoginActivity" >
</activity>
<activity
android:name=".MapsActivity"
android:configChanges="orientation"
android:label="@string/title_activity_maps"
android:parentActivityName=".MainActivity" >
<intent-filter>
@@ -90,19 +95,23 @@
<activity
android:name=".ProfileActivity"
android:configChanges="orientation"
android:label="@string/title_activity_user_config"
android:parentActivityName=".MainActivity" >
</activity>
<activity
android:name=".ReportActivity"
android:configChanges="orientation"
android:label="@string/title_activity_report" >
</activity>
<activity
android:name=".SettingsActivity"
android:configChanges="orientation"
android:label="@string/title_activity_settings" >
</activity>
<activity
android:name=".SubscriptionsActivity"
android:configChanges="orientation"
android:label="@string/title_activity_subscriptions" >
</activity>
</application>

View File

@@ -17,8 +17,6 @@ import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.CallbackManager;
import org.deke.risk.riskahead.fragments.FacebookButtonFragment;
import org.deke.risk.riskahead.fragments.GooglePlusButtonFragment;
import org.deke.risk.riskahead.fragments.TwitterButtonFragment;
@@ -39,82 +37,72 @@ import java.util.Map;
public class LoginActivity extends AppCompatActivity implements FacebookButtonFragment.OnFragmentInteractionListener, GooglePlusButtonFragment.OnFragmentInteractionListener, TwitterButtonFragment.OnFragmentInteractionListener{
private static final String TAG = LoginActivity.class.getSimpleName();
private CallbackManager callbackManager;
private final static String TAG = LoginActivity.class.getSimpleName();
private final static String EXTRA_MESSAGE = "org.deke.risk.riskahead.MESSAGE";
private String msg_intent;
private Button btnSignUpMY;
private String inputMsg;
private Button btn_login;
private TextView input_email;
private TextView input_full_name;
private TextView input_password;
private ProgressDialog pDialog;
private SessionManager session;
public final static String EXTRA_MESSAGE = "com.mycompany.myfirstapp.MESSAGE";
private SQLiteHandler db;
private SessionManager session;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
inputMsg = intent.getStringExtra(StartActivity.EXTRA_MESSAGE);
callbackManager = CallbackManager.Factory.create();
msg_intent = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE);
session = new SessionManager(getApplicationContext());
// Progress dialog
pDialog = new ProgressDialog(this);
pDialog.setCancelable(false);
// SQLite database handler
db = new SQLiteHandler(getApplicationContext());
session = new SessionManager(getApplicationContext());
// Check if user is already logged in or not
if (session.isLoggedIn()) {
// User is already logged in. Take him to main activity
intent = new Intent(LoginActivity.this,MainActivity.class);
startActivity(intent);
finish();
}
if(inputMsg.equals("login")){
if(msg_intent.equals("login")){
setContentView(R.layout.activity_login);
}else if(inputMsg.equals("register")){
input_email = (TextView) findViewById(R.id.input_register_email);
input_password = (TextView) findViewById(R.id.input_register_password);
}else if(msg_intent.equals("register")){
setContentView(R.layout.activity_register);
input_full_name = (TextView) findViewById(R.id.input_full_name);
input_full_name = (TextView) findViewById(R.id.input_register_name);
input_email = (TextView) findViewById(R.id.input_register_email);
input_password = (TextView) findViewById(R.id.input_register_password);
}
input_email = (TextView) findViewById(R.id.input_email);
input_password = (TextView) findViewById(R.id.input_password);
FragmentManager fragmentManager = getSupportFragmentManager();
FacebookButtonFragment fragmentFB = new FacebookButtonFragment();
GooglePlusButtonFragment fragmentGP = new GooglePlusButtonFragment();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.add(R.id.fragment_btn_gp, fragmentGP);
transaction.add(R.id.frag_login_btnGP, fragmentGP);
transaction.commit();
initMySigninButton();
}
private void initMySigninButton() {
btnSignUpMY = (Button) findViewById(R.id.btnSignUp);
btnSignUpMY.setOnClickListener(new View.OnClickListener() {
btn_login = (Button) findViewById(R.id.btn_register);
btn_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (v.getId() == R.id.btnSignUp) {
if (v.getId() == R.id.btn_register) {
String email = input_email.getText().toString();
String password = input_password.getText().toString();
if (inputMsg.equals("login")) {
if (msg_intent.equals("login")) {
if (isEmpty(input_email) || isEmpty(input_password)) {
showMessage("Please enter all fields before logging in");
} else {
checkLogin(email, password);
}
} else if (inputMsg.equals("register")) {
} else if (msg_intent.equals("register")) {
String name = input_full_name.getText().toString();
if (isEmpty(input_email) || isEmpty(input_password) || isEmpty(input_full_name)) {
showMessage("Please enter all fields before registration");
@@ -147,13 +135,13 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == GooglePlusButtonFragment.RC_SIGN_IN) {
GooglePlusButtonFragment fragment = (GooglePlusButtonFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_btn_gp);
GooglePlusButtonFragment fragment = (GooglePlusButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnGP);
fragment.onActivityResult(requestCode, resultCode, data);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
TwitterButtonFragment twitter_fragment = (TwitterButtonFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_btn_tw);
TwitterButtonFragment twitter_fragment = (TwitterButtonFragment) getSupportFragmentManager().findFragmentById(R.id.frag_login_btnTW);
if (twitter_fragment != null) {
twitter_fragment.onActivityResult(requestCode, resultCode, data);
}
@@ -169,41 +157,23 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
finish();
}
// Tag used to cancel the request
String tag_string_req = "sociallogin";
db.deleteUsers();
pDialog.setMessage("Social Media Login ...");
showDialog();
StringRequest strReq = getStringRequestSocialMediaLogin(key, providerType, username, email);
// Adding request to request queue
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
}
private void checkLogin(final String email, final String password) {
// Tag used to cancel the request
String tag_string_req = "req_login";
db.deleteUsers();
pDialog.setMessage("Logging in ...");
showDialog();
StringRequest strReq = getStringRequestLogin(email, password);
// Adding request to request queue
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
}
private void registerUser(final String username, final String email,final String password) {
// Tag used to cancel the request
String tag_string_req = "req_register";
db.deleteUsers();
pDialog.setMessage("Registering ...");
showDialog();
StringRequest strReq = getStringRequestRegisterUser(username, email, password);
// Adding request to request queue
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
}
@@ -219,11 +189,9 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String tag_string_req = "requestpwreset";
StringRequest strReq = getStringRequestResetPW(input_email.getText().toString());
// Adding request to request queue
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
showMessage("E-Mail was sent to your address");
}
})
@@ -242,7 +210,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
public void onResponse(String response) {
Log.d(TAG, "Social Media Login Response: " + response.toString());
Log.d(TAG, "Social Media Login Response: " + response);
hideDialog();
try {
@@ -256,7 +224,6 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
// User successfully stored in MySQL
// Now store the user in sqlite
String uid = jObj.getString("uid");
JSONObject user = jObj.getJSONObject("user");
String username = user.getString("username");
String name = user.getString("name");
@@ -277,9 +244,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
startActivity(intent);
finish();
} else {
// Error occurred in registration. Get the error
// message
// Error occurred in registration. Get the error message
String errorMsg = jObj.getString("error_msg");
Toast.makeText(getApplicationContext(),
errorMsg, Toast.LENGTH_LONG).show();
@@ -321,7 +286,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
public void onResponse(String response) {
Log.d(TAG, "Login Response: " + response.toString());
Log.d(TAG, "Login Response: " + response);
hideDialog();
try {
@@ -419,7 +384,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
public void onResponse(String response) {
Log.d(TAG, "Register Response: " + response.toString());
Log.d(TAG, "Register Response: " + response);
hideDialog();
try {
@@ -487,7 +452,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
public void onResponse(String response) {
Log.d(TAG, "Resend E-Mail Response: " + response.toString());
Log.d(TAG, "Resend E-Mail Response: " + response);
hideDialog();
try {
@@ -536,7 +501,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
@Override
public void onResponse(String response) {
Log.d(TAG, "Resend E-Mail Response: " + response.toString());
Log.d(TAG, "Resend E-Mail Response: " + response);
hideDialog();
try {

View File

@@ -6,7 +6,6 @@ import android.os.Handler;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -14,7 +13,6 @@ import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.beardedhen.androidbootstrap.BootstrapButton;
import org.deke.risk.riskahead.helper.AppConfig;
import org.deke.risk.riskahead.helper.AppController;
@@ -28,13 +26,16 @@ import java.util.Map;
public class MainActivity extends BaseActivity{
public String inputMsg;
private final static String mActivityTitle = "RiskAhead";
private final static String TAG = MainActivity.class.getSimpleName();
private final static String EXTRA_MESSAGE = "org.deke.risk.riskahead.MESSAGE";
public String msg_input;
public static FragmentManager fragmentManager;
private static final String TAG = MainActivity.class.getSimpleName();
Handler mHandler = new Handler();
private SQLiteHandler db;
private String mActivityTitle = "RiskAhead";
private final static int INTERVAL = 1000 * 10; //10 seconds
private TextView incidentCount;
@@ -43,24 +44,21 @@ public class MainActivity extends BaseActivity{
super.onCreate(savedInstanceState);
Intent intent = getIntent();
inputMsg = intent.getStringExtra(StartActivity.EXTRA_MESSAGE);
fragmentManager = getSupportFragmentManager();
incidentCount = (TextView) findViewById(R.id.txt_incidents);
msg_input = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
fragmentManager = getSupportFragmentManager();
db = new SQLiteHandler(getApplicationContext());
StringRequest strReq = getStringRequestIncidentCount(db.getUserDetails().get("email"));
String tag_string_req = "req_incidents";
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
incidentCount = (TextView) findViewById(R.id.txt_main_incidents);
findViewById(R.id.btn_report).setOnClickListener(new View.OnClickListener() {
findViewById(R.id.btn_main_report).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gotoReportActivity();
}
});
findViewById(R.id.btn_view_map).setOnClickListener(new View.OnClickListener() {
findViewById(R.id.btn_main_viewmap).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gotoMapActivity();
@@ -70,11 +68,13 @@ public class MainActivity extends BaseActivity{
@Override
protected void onPause(){
super.onPause();
stopRepeatingTask();
}
@Override
protected void onResume(){
super.onResume();
startRepeatingTask();
}
@@ -114,13 +114,13 @@ public class MainActivity extends BaseActivity{
@Override
public void onResponse(String response) {
Log.d(TAG, "Incident count: " + response.toString());
Log.d(TAG, "Incident count: " + response);
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
TextView count = (TextView) findViewById(R.id.txt_incidents);
TextView count = (TextView) findViewById(R.id.txt_main_incidents);
count.setText(jObj.getString("msg"));
} else {
String errorMsg = jObj.getString("error_msg");

View File

@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.SyncStateContract;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
@@ -25,8 +24,11 @@ import org.deke.risk.riskahead.helper.PlaceProvider;
public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCallbacks<Cursor> {
private final static String mActivityTitle = "RiskMap";
private static final String TAG = MapsActivity.class.getSimpleName();
private static GoogleMap mMap;
private String mActivityTitle = "RiskMap";
private LatLng myLocation;
private void handleIntent(Intent intent){
@@ -106,14 +108,8 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_maps);
// Passing harcoded values for latitude & longitude. Please change as per your need. This is just used to drop a Marker on the Map
//latitude = 53.33;
// longitude = 10.02;
// setUpMapIfNeeded(); // For setting up the MapFragment
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.frag_maps_map)).getMap();
mMap.setMyLocationEnabled(true);
mMap.getUiSettings().setZoomControlsEnabled(true);
handleIntent(getIntent());
@@ -121,10 +117,8 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_maps, menu);
// Get the SearchView and set the searchable configuration
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.location_search).getActionView();
SearchableInfo searchInfo = searchManager.getSearchableInfo(getComponentName());
@@ -133,26 +127,6 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
return true;
}
/***** Sets up the map if it is possible to do so *****/
public void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
//mMap = ((SupportMapFragment) MainActivity.fragmentManager.findFragmentById(R.id.location_map)).getMap();
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
// Check if we were successful in obtaining the map.
if (mMap != null)
setUpMap();
}
}
/**
* This is where we can add markers or lines, add listeners or move the
* camera.
* <p>
* This should only be called once and when we are sure that {@link #mMap}
* is not null.
*/
private void setUpMap() {
// For showing a move to my loction button
mMap.setMyLocationEnabled(true);
@@ -163,14 +137,11 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 12.0f));
}
/**** The mapfragment's id must be removed from the FragmentManager
**** or else if the same it is passed on the next time then
**** app will crash ****/
@Override
public void onDestroy() {
super.onDestroy();
if (mMap != null) {
getSupportFragmentManager().beginTransaction().remove(getSupportFragmentManager().findFragmentById(R.id.map)).commitAllowingStateLoss();
getSupportFragmentManager().beginTransaction().remove(getSupportFragmentManager().findFragmentById(R.id.frag_maps_map)).commitAllowingStateLoss();
mMap = null;
}
}

View File

@@ -9,34 +9,30 @@ import android.widget.TextView;
import org.deke.risk.riskahead.helper.BaseActivity;
import org.deke.risk.riskahead.helper.SQLiteHandler;
import org.deke.risk.riskahead.helper.SessionManager;
import java.util.HashMap;
public class ProfileActivity extends BaseActivity {
private final static String mActivityTitle = "User Profile";
private final static String TAG = ProfileActivity.class.getSimpleName();
private TextView txtName;
private TextView txtEmail;
private TextView txtTest;
private Button btnLogout;
private SQLiteHandler db;
public HashMap<String, String> user;
private SessionManager session;
private String mActivityTitle = "User Profile";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_profile);
session = new SessionManager(getApplicationContext());
txtName = (TextView) findViewById(R.id.txt_profile_name);
txtEmail = (TextView) findViewById(R.id.txt_profile_email);
btnLogout = (Button) findViewById(R.id.btn_profile_logout);
txtTest = (TextView) findViewById(R.id.test);
txtName = (TextView) findViewById(R.id.name);
txtEmail = (TextView) findViewById(R.id.email);
btnLogout = (Button) findViewById(R.id.btnLogout);
// Logout button click event
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -44,10 +40,9 @@ public class ProfileActivity extends BaseActivity {
}
});
// SqLite database handler
db = new SQLiteHandler(getApplicationContext());
// Fetching user details from sqlite
user = db.getUserDetails();
txtName.setText(user.get("username"));
txtEmail.setText(user.get("email"));
}

View File

@@ -1,23 +1,121 @@
package org.deke.risk.riskahead;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TimePicker;
import org.deke.risk.riskahead.helper.BaseActivity;
import org.deke.risk.riskahead.helper.SQLiteHandler;
import java.util.Calendar;
public class ReportActivity extends BaseActivity {
private String mActivityTitle = "Report";
private static final String TAG = ReportActivity.class.getSimpleName();
private SQLiteHandler db;
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 EditText txtDay;
private EditText txtTime;
private int year, month, day;
private int hour, minute;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_report);
db = new SQLiteHandler(getApplicationContext());
Spinner spinner = (Spinner) findViewById(R.id.dd_report_category);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.incident_categories, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
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);
txtDay = (EditText) findViewById(R.id.txt_report_date);
txtTime = (EditText) findViewById(R.id.txt_report_time);
txtDay.setText(new StringBuilder()
.append(day).append("-").append(month + 1).append("-")
.append(year).append(" "));
txtTime.setText(new StringBuilder().append(hour)
.append(":").append(minute).append(" "));
txtDay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDialog(DATE_DIALOG_ID);
}
});
txtTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDialog(TIME_DIALOG_ID);
}
});
}
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_DIALOG_ID:
// set date picker as current date
return new DatePickerDialog(this, datePickerListener,
year, month,day);
case TIME_DIALOG_ID:
// set date picker as current date
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;
// set selected date into textview
txtDay.setText(new StringBuilder().append(day)
.append("-").append(month + 1).append("-").append(year)
.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;
// set selected date into textview
txtTime.setText(new StringBuilder().append(hour)
.append(":").append(minute).append(" "));
}
};
@Override
protected int getLayoutResourceId() {
return R.layout.activity_report;

View File

@@ -1,19 +1,18 @@
package org.deke.risk.riskahead;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import org.deke.risk.riskahead.helper.BaseActivity;
public class SettingsActivity extends BaseActivity {
private String mActivityTitle = "Settings";
private final static String mActivityTitle = "Settings";
private final static String TAG = SettingsActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_settings);
}
@Override

View File

@@ -7,35 +7,27 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import org.deke.risk.riskahead.helper.SessionManager;
public class StartActivity extends AppCompatActivity {
public final static String EXTRA_MESSAGE = "com.mycompany.myfirstapp.MESSAGE";
private final static String EXTRA_MESSAGE = "org.deke.risk.riskahead.MESSAGE";
private final static String TAG = StartActivity.class.getSimpleName();
Button btnLogin;
Button btnRegister;
private SessionManager session;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
btnLogin = (Button) findViewById(R.id.btn_start_login);
btnRegister = (Button) findViewById(R.id.btn_start_register);
// Session manager
session = new SessionManager(getApplicationContext());
// Check if user is already logged in or not
SessionManager session = new SessionManager(getApplicationContext());
if (session.isLoggedIn()) {
// User is already logged in. Take him to main activity
Intent intent = new Intent(StartActivity.this, MainActivity.class);
startActivity(intent);
finish();
@@ -70,12 +62,4 @@ public class StartActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item);
}
private boolean isEmpty(TextView etText) {
return etText.getText().toString().trim().length() == 0;
}
public void showMessage(String statusText){
Toast.makeText(this, statusText, Toast.LENGTH_LONG).show();
}
}

View File

@@ -1,20 +1,18 @@
package org.deke.risk.riskahead;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import org.deke.risk.riskahead.helper.BaseActivity;
public class SubscriptionsActivity extends BaseActivity {
private String mActivityTitle = "Subscriptions";
private final static String mActivityTitle = "Subscriptions";
private final static String TAG = StartActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_subscriptions);
}
@Override

View File

@@ -10,8 +10,6 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;
import io.fabric.sdk.android.Fabric;
@@ -83,7 +81,7 @@ public class TwitterButtonFragment extends Fragment {
@Override
public void failure(TwitterException exception) {
Log.e("Debug", "onFailure wird ausgeführt");
showMessage("Twitter Login failed with exception " + exception.getMessage().toString());
showMessage("Twitter Login failed with exception " + exception.getMessage());
}
});
}

View File

@@ -29,16 +29,19 @@ import java.util.HashMap;
public abstract class BaseActivity extends AppCompatActivity {
private final static String EXTRA_MESSAGE = "org.deke.risk.riskahead.MESSAGE";
private final static String TAG = BaseActivity.class.getSimpleName();
private ActionBarDrawerToggle mDrawerToggle;
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private ArrayAdapter<String> mAdapter;
private ShareActionProvider mShareActionProvider;
private SQLiteHandler db;
private SessionManager session;
public HashMap<String, String> user;
public final static String EXTRA_MESSAGE = "com.mycompany.myfirstapp.MESSAGE";
public HashMap<String, String> user;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -55,9 +58,7 @@ public abstract class BaseActivity extends AppCompatActivity {
logoutUser();
}
// Fetching user details from sqlite
user = db.getUserDetails();
// Get the SearchView and set the searchable configuration
mDrawerList = (ListView)findViewById(R.id.navList);
mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
@@ -98,8 +99,6 @@ public abstract class BaseActivity extends AppCompatActivity {
setShareIntent();
getMenuInflater().inflate(R.menu.menu_login, menu);
return true;
}

View File

@@ -92,7 +92,7 @@ public class PlaceProvider extends ContentProvider {
// Finding latitude and longitude for each places using Google Places Details API
for(int i=0;i<list.size();i++){
HashMap<String, String> hMap = (HashMap<String, String>) list.get(i);
HashMap<String, String> hMap = list.get(i);
detailsParser =new PlaceJSONParserDetail();
@@ -135,7 +135,7 @@ public class PlaceProvider extends ContentProvider {
// Creating cursor object with places
for(int i=0;i<list.size();i++){
HashMap<String, String> hMap = (HashMap<String, String>) list.get(i);
HashMap<String, String> hMap = list.get(i);
// Adding place details to cursor
mCursor.addRow(new String[] { Integer.toString(i), hMap.get("description"), hMap.get("reference") });

View File

@@ -6,19 +6,15 @@ import android.content.SharedPreferences.Editor;
import android.util.Log;
public class SessionManager {
// LogCat tag
private static String TAG = SessionManager.class.getSimpleName();
// Shared Preferences
SharedPreferences pref;
Editor editor;
Context _context;
// Shared pref mode
int PRIVATE_MODE = 0;
// Shared preferences file name
private static final String PREF_NAME = "AndroidHiveLogin";
private static final String KEY_IS_LOGGEDIN = "isLoggedIn";
@@ -30,12 +26,8 @@ public class SessionManager {
}
public void setLogin(boolean isLoggedIn) {
editor.putBoolean(KEY_IS_LOGGEDIN, isLoggedIn);
// commit changes
editor.commit();
Log.d(TAG, "User login session modified!");
}

View File

@@ -8,20 +8,21 @@
android:orientation="vertical"
tools:context=".LoginActivity">
<TextView android:text="@string/txt_welcome_login"
<TextView
android:id="@+id/lbl_login_title"
android:text="@string/lbl_login_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="20sp"
android:typeface="sans"
android:textStyle="bold"
android:id="@+id/hello" />
android:textStyle="bold" />
<EditText
android:id="@+id/input_email"
android:hint="@string/hint_email"
android:id="@+id/input_register_email"
android:hint="@string/input_register_email_hint"
android:inputType="textEmailAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -31,11 +32,11 @@
android:textColor="@color/input_login"
android:textColorHint="@color/input_login_hint"
android:layout_marginTop="20dp"
android:layout_below="@+id/hello" />
android:layout_below="@+id/lbl_login_title" />
<EditText
android:id="@+id/input_password"
android:hint="@string/hint_password"
android:id="@+id/input_register_password"
android:hint="@string/input_register_password_hint"
android:inputType="textPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -44,73 +45,70 @@
android:singleLine="true"
android:textColor="@color/input_login"
android:textColorHint="@color/input_login_hint"
android:layout_below="@+id/input_email"
android:layout_below="@+id/input_register_email"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp" />
<!-- Login Button -->
<Button
android:id="@+id/btn_register"
android:text="@string/btn_start_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:layout_marginTop="20dip"
android:id="@+id/btnSignUp"
android:background="@color/btn_login_bg"
android:text="@string/btn_login"
android:textColor="@color/btn_login"
android:minWidth="120dp"
android:layout_below="@+id/input_password"
android:layout_below="@+id/input_register_password"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="@+id/lbl_login_policy"
android:text="@string/lbl_login_policy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="end"
android:id="@+id/txt_policy"
android:text="@string/txt_policy"
android:layout_alignTop="@+id/txt_resend_password"
android:layout_alignTop="@+id/lbl_login_resendPW"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:text="@string/txt_useFBorGP"
android:id="@+id/lbl_login_usesocialnet"
android:text="@string/lbl_login_usesocialnet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_above="@+id/fragment_btn_gp"
android:layout_above="@+id/frag_login_btnGP"
android:layout_centerHorizontal="true" />
<fragment
android:id="@+id/frag_login_btnGP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
android:id="@+id/fragment_btn_gp"
tools:layout="@layout/fragment_googleplus_button"
android:layout_above="@+id/fragment_btn_tw"
android:layout_above="@+id/frag_login_btnTW"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/>
<fragment
android:id="@+id/frag_login_btnTW"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
android:id="@+id/fragment_btn_tw"
tools:layout="@layout/fragment_twitter_button"
android:layout_above="@+id/fragment_btn_fb"
android:layout_above="@+id/frag_login_btnFB"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
/>
android:layout_marginTop="5dp"/>
<fragment
android:id="@+id/frag_login_btnFB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
android:id="@+id/fragment_btn_fb"
tools:layout="@layout/fragment_facebook_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
@@ -118,14 +116,14 @@
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/lbl_login_resendPW"
android:text="@string/lbl_login_resendPW"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:clickable="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/txt_resend_password"
android:id="@+id/txt_resend_password"
android:layout_below="@+id/btnSignUp"
android:layout_below="@+id/btn_register"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

View File

@@ -9,54 +9,54 @@
tools:context=".MainActivity">
<RelativeLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:id="@+id/lbl_main_txt1"
android:text="@string/lbl_main_txt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="We have currently ..."
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="52dp"
android:textColor="@color/white"/>
<TextView
android:id="@+id/txt_incidents"
android:id="@+id/txt_main_incidents"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="0"
android:layout_marginTop="38dp"
android:layout_below="@+id/textView1"
android:layout_below="@+id/lbl_main_txt1"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/textView2"
android:id="@+id/lbl_main_txt2"
android:text="@string/lbl_main_txt2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="... reported incidents"
android:layout_marginTop="34dp"
android:textColor="@color/white"
android:layout_below="@+id/txt_incidents"
android:layout_below="@+id/txt_main_incidents"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/textView3"
android:id="@+id/lbl_main_share"
android:text="@string/lbl_main_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Contribute and share your information"
android:layout_above="@+id/LinearLayout02"
android:layout_above="@+id/ll_01"
android:layout_centerHorizontal="true"
android:layout_marginBottom="26dp" />
<LinearLayout
android:id="@+id/LinearLayout02"
android:id="@+id/ll_01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
@@ -67,23 +67,24 @@
android:layout_marginBottom="43dp">
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btn_report"
android:id="@+id/btn_main_report"
android:text="@string/btn_main_report"
android:layout_weight="1"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Report" android:layout_weight="1"
bootstrap:bb_icon_left="fa-map-marker"
bootstrap:bb_type="danger"
bootstrap:bb_roundedCorners="true" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btn_view_map"
android:id="@+id/btn_main_viewmap"
android:text="@string/btn_main_viewmap"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:text="View Map"
bootstrap:bb_icon_left="fa-info"
bootstrap:bb_type="primary"
bootstrap:bb_roundedCorners="true"/>

View File

@@ -7,7 +7,7 @@
tools:context="org.deke.risk.riskahead.MapsActivity">
<RelativeLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@@ -15,7 +15,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
android:id="@+id/frag_maps_map"
tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>

View File

@@ -8,53 +8,47 @@
tools:context="org.deke.risk.riskahead.ProfileActivity">
<LinearLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:text="@string/lbl_profile_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/welcome"
android:textSize="20dp" />
android:textSize="20dp"
android:layout_gravity="center_horizontal" />
<TextView
android:id="@+id/name"
android:id="@+id/txt_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@color/lbl_name"
android:textSize="24dp" />
android:textSize="24dp"
android:layout_gravity="center_horizontal" />
<TextView
android:id="@+id/email"
android:layout_width="wrap_content"
android:id="@+id/txt_profile_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="13dp" />
<Button
android:id="@+id/btnLogout"
android:id="@+id/btn_profile_logout"
android:text="@string/btn_profile_logout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dip"
android:background="@color/btn_logut_bg"
android:text="@string/btn_logout"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="15dp" />
<TextView
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@color/lbl_name"
android:textSize="24dp" />
</LinearLayout>

View File

@@ -9,8 +9,8 @@
tools:context=".LoginActivity">
<TextView
android:id="@+id/hello"
android:text="@string/txt_welcome_register"
android:id="@+id/lbl_register_title"
android:text="@string/lbl_register_title"
android:textColor="@color/input_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -21,109 +21,108 @@
android:layout_centerHorizontal="true" />
<EditText
android:id="@+id/input_full_name"
android:id="@+id/input_register_name"
android:hint="@string/input_register_name_hint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/input_register_bg"
android:hint="@string/hint_name"
android:padding="10dp"
android:singleLine="true"
android:inputType="textCapWords"
android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint"
android:layout_marginTop="20dp"
android:layout_below="@+id/hello" />
android:layout_below="@+id/lbl_register_title" />
<EditText
android:id="@+id/input_email"
android:id="@+id/input_register_email"
android:hint="@string/input_register_email_hint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/input_register_bg"
android:hint="@string/hint_email"
android:inputType="textEmailAddress"
android:padding="10dp"
android:singleLine="true"
android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint"
android:layout_below="@+id/input_full_name"/>
android:layout_below="@+id/input_register_name"/>
<EditText
android:id="@+id/input_password"
android:id="@+id/input_register_password"
android:hint="@string/input_register_password_hint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@color/input_register_bg"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:padding="10dp"
android:singleLine="true"
android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint"
android:layout_below="@+id/input_email" />
android:layout_below="@+id/input_register_email" />
<Button
android:id="@+id/btn_register"
android:text="@string/btn_start_register"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:minWidth="120dp"
android:id="@+id/btnSignUp"
android:background="#ffea7f8a"
android:text="@string/btn_register"
android:textColor="@color/white"
android:layout_below="@+id/input_password"
android:layout_below="@+id/input_register_password"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="@+id/lbl_login_policy"
android:text="@string/lbl_login_policy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/input_register"
android:id="@+id/txt_policy"
android:text="@string/txt_policy"
android:layout_alignTop="@+id/btnSignUp"
android:layout_alignTop="@+id/btn_register"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:text="@string/txt_useFBorGP"
android:id="@+id/lbl_login_usesocialnet"
android:text="@string/lbl_login_usesocialnet"
android:textColor="@color/input_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_above="@+id/fragment_btn_gp"
android:layout_above="@+id/frag_login_btnGP"
android:layout_centerHorizontal="true" />
<fragment
android:id="@+id/frag_login_btnGP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
android:id="@+id/fragment_btn_gp"
tools:layout="@layout/fragment_googleplus_button"
android:layout_above="@+id/fragment_btn_tw"
android:layout_above="@+id/frag_login_btnTW"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/>
<fragment
android:id="@+id/frag_login_btnTW"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
android:id="@+id/fragment_btn_tw"
tools:layout="@layout/fragment_twitter_button"
android:layout_above="@+id/fragment_btn_fb"
android:layout_above="@+id/frag_login_btnFB"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
/>
android:layout_marginTop="5dp"/>
<fragment
android:id="@+id/frag_login_btnFB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
android:id="@+id/fragment_btn_fb"
tools:layout="@layout/fragment_facebook_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"

View File

@@ -9,12 +9,109 @@
tools:context=".ReportActivity">
<RelativeLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent"
android:padding="20dp"
android:orientation="vertical">
<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="5"/>
<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/txt_report_time"
android:layout_alignLeft="@+id/txt_report_time"
android:layout_alignStart="@+id/txt_report_time"/>
<EditText
android:id="@+id/txt_report_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="date"
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/txt_report_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="time"
android:ems="10"
android:layout_alignBottom="@+id/txt_report_date"
android:layout_toRightOf="@+id/txt_report_date"
android:layout_toEndOf="@+id/txt_report_date"
android:focusable="false"/>
<TextView android:text="Report Activity!" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>

View File

@@ -9,7 +9,7 @@
tools:context=".SettingsActivity">
<RelativeLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

View File

@@ -8,9 +8,9 @@
android:background="#ffffff">
<ImageView
android:id="@+id/image_start_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/logo_riskahead"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
@@ -18,24 +18,24 @@
android:background="#00ffffff" />
<LinearLayout
android:id="@+id/LinearLayout02"
android:id="@+id/ll_01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/btn_start_login"
android:text="@string/btn_start_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_login"
android:id="@+id/btn_start_login"
android:layout_weight="1"
android:onClick="gotoLogin"/>
<Button
android:id="@+id/btn_start_register"
android:text="@string/btn_start_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_register"
android:id="@+id/btn_start_register"
android:layout_weight="1"
android:onClick="gotoRegister"/>

View File

@@ -9,7 +9,7 @@
tools:context=".SubscriptionsActivity">
<RelativeLayout
android:id="@+id/content"
android:id="@+id/rl_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

View File

@@ -1,34 +1,42 @@
<resources>
<string name="app_name">RiskAhead</string>
<string name="facebook_app_id">658657714234846</string>
<string name="txt_welcome_register">Register to RiskAhead</string>
<string name="txt_welcome_login">Log-in to RiskAhead</string>
<string name="txt_resend_password">Forgot your password?\nClick here</string>
<string name="btn_start_login">Login</string>
<string name="btn_start_register">Register</string>
<string name="lbl_login_title">Log-in to RiskAhead</string>
<string name="lbl_login_resendPW">Forgot your password?\nClick here</string>
<string name="lbl_login_policy"><a href="test.com">Terms of Service</a> and\n<a href="test.com">Privacy Policy</a></string>
<string name="lbl_login_usesocialnet">Or use following social networks to sign in</string>
<string name="lbl_register_title">Register to RiskAhead</string>
<string name="input_register_name_hint">Full Name</string>
<string name="input_register_email_hint">E-Mail</string>
<string name="input_register_password_hint">Password</string>
<string name="action_about">About</string>
<string name="txt_policy"><a href="test.com">Terms of Service</a> and\n<a href="test.com">Privacy Policy</a></string>
<string name="hint_full_name">Full Name</string>
<string name="hint_email">E-Mail</string>
<string name="hint_password">Password</string>
<string name="status_signing_in">Signing in...</string>
<string name="status_signing_out">Signing out...</string>
<string name="login_with_gp">Log in with Google+</string>
<string name="logout_with_gp">Log out from Google+</string>
<string name="login_with_fb">Log in with Facebook</string>
<string name="logout_with_fb">Log out from Facebook</string>
<string name="txt_welcome_signin">In order to use our service please create an account or login with your Facebook or G+ Account</string>
<string name="txt_useFBorGP">Or use following social networks to sign in</string>
<string name="title_activity_start">RiskAhead</string>
<string name="btn_login">Login</string>
<string name="btn_register">Register</string>
<string name="title_activity_entrance">Risk Ahead</string>
<string name="hint_name">Full Name</string>
<string name="btn_logout">Logout</string>
<string name="welcome">Welcome</string>
<string name="btn_profile_logout">Logout</string>
<string name="lbl_profile_title">Welcome</string>
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<string name="settings_user">Account</string>
<string name="settings_logout">Logout</string>
<string name="find">Find</string>
<string name="hint">Enter Place</string>
@@ -43,9 +51,29 @@
<string name="app_label">Label</string>
<string name="search_hint">Location</string>
<string name="search_settings">search settings</string>
<string name="title_activity_report">ReportActivity</string>
<string name="hello_world">Hello world!</string>
<string name="title_activity_settings">SettingsActivity</string>
<string name="title_activity_subscriptions">SubscriptionsActivity</string>
<string name="lbl_main_txt1">We have currently ...</string>
<string name="lbl_main_txt2">... reported incidents</string>
<string name="lbl_main_share">Contribute and share your information</string>
<string name="btn_main_report">Report</string>
<string name="btn_main_viewmap">View Map</string>
<string name="title_activity_report">ReportActivity</string>
<string name="input_report_short_hint">short description</string>
<string name="input_report_long_hint">long descpription</string>
<string name="lbl_report_short">Title</string>
<string name="lbl_report_long">Description</string>
<string name="lbl_report_category">Crime Category</string>
<string name="lbl_report_time">Time (hh:mm)</string>
<string name="lbl_report_date">Date (dd-mm-yyyy) of incident</string>
<string-array name="incident_categories">
<item>Personal</item>
<item>Property</item>
<item>Political</item>
</string-array>
</resources>