DT @13.12.2015: TabbedWorkflow in Profile eingebaut und ReportListActivity daher gestrichen. Rearranged and Reformated Code of all XML-Files

This commit is contained in:
Dennis Thießen
2015-12-13 14:38:05 +01:00
parent 14e1b1640c
commit c47e302d28
31 changed files with 1157 additions and 992 deletions

View File

@@ -72,6 +72,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/22.2.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.beardedhen/androidbootstrap/2.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.beardedhen/androidbootstrap/2.0.1/jars" />
@@ -116,6 +117,7 @@
</content> </content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="design-22.2.0" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" /> <orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" /> <orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-fitness-8.3.0" level="project" /> <orderEntry type="library" exported="" name="play-services-fitness-8.3.0" level="project" />

View File

@@ -45,6 +45,7 @@ dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.1.0' compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.beardedhen:androidbootstrap:2.0.1' compile 'com.beardedhen:androidbootstrap:2.0.1'
compile 'com.mcxiaoke.volley:library:1.0.+' compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.android.support:design:22.2.0'
compile 'com.google.code.gson:gson:2.4' compile 'com.google.code.gson:gson:2.4'
compile 'com.google.maps.android:android-maps-utils:0.3.+' compile 'com.google.maps.android:android-maps-utils:0.3.+'
compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:support-v4:22.2.1'

View File

@@ -116,15 +116,6 @@
android:name=".SubscriptionsActivity" android:name=".SubscriptionsActivity"
android:label="@string/title_activity_subscriptions" android:label="@string/title_activity_subscriptions"
android:screenOrientation="portrait"></activity> android:screenOrientation="portrait"></activity>
<activity
android:name=".ReportlistActivity"
android:label="@string/title_activity_reportlist"
android:parentActivityName=".ProfileActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ProfileActivity" />
</activity>
<activity <activity
android:name=".ViewReportActivity" android:name=".ViewReportActivity"
android:label="@string/title_activity_view_report" android:label="@string/title_activity_view_report"

View File

@@ -1,9 +1,17 @@
package org.deke.risk.riskahead; package org.deke.risk.riskahead;
import android.app.LocalActivityManager;
import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.TabHost;
import android.widget.TableLayout; import android.widget.TableLayout;
import android.widget.TableRow; import android.widget.TableRow;
import android.widget.TextView; import android.widget.TextView;
@@ -14,8 +22,8 @@ import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.StringRequest;
import org.deke.risk.riskahead.helper.AppConfig; import org.deke.risk.riskahead.helper.AppConfig;
import org.deke.risk.riskahead.helper.AppController;
import org.deke.risk.riskahead.helper.BaseActivity; import org.deke.risk.riskahead.helper.BaseActivity;
import org.deke.risk.riskahead.helper.ProfilePagerAdapter;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@@ -28,28 +36,40 @@ public class ProfileActivity extends BaseActivity {
private final static String mActivityTitle = "User Statistics"; private final static String mActivityTitle = "User Statistics";
private final static String TAG = ProfileActivity.class.getSimpleName(); private final static String TAG = ProfileActivity.class.getSimpleName();
private TextView txtMemberSince; private TabHost tabs=null;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
userHasToBeLoggedIn(); userHasToBeLoggedIn();
txtMemberSince = (TextView) findViewById(R.id.txt_profile_membersince); TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
txtMemberSince.setText(user.get("created_at"));
StringRequest strReq = getStringRequestProfileStats(); tabLayout.addTab(tabLayout.newTab().setText("Statistics"));
String tag_string_req = "req_profilestats"; tabLayout.addTab(tabLayout.newTab().setText("Top 10"));
AppController.getInstance().addToRequestQueue(strReq, tag_string_req); tabLayout.addTab(tabLayout.newTab().setText("Reports"));
StringRequest strReq2 = getStringRequestTop10(); tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
String tag_string_req2 = "req_top10";
AppController.getInstance().addToRequestQueue(strReq2, tag_string_req2);
findViewById(R.id.btn_profile_viewposts).setOnClickListener(new View.OnClickListener() { final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
final PagerAdapter adapter = new ProfilePagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
viewPager.setAdapter(adapter);
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onClick(View v) { public void onTabSelected(TabLayout.Tab tab) {
gotoReportlistActivity(); viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
} }
}); });
} }
@@ -64,124 +84,6 @@ public class ProfileActivity extends BaseActivity {
return mActivityTitle; return mActivityTitle;
} }
private StringRequest getStringRequestProfileStats() {
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d(TAG, "User stats: " + response);
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
TextView points = (TextView) findViewById(R.id.txt_profile_points);
TextView ranking = (TextView) findViewById(R.id.txt_profile_ranking);
TextView posts = (TextView) findViewById(R.id.txt_profile_numberposts);
points.setText(jObj.getString("points"));
ranking.setText(jObj.getString("rank"));
posts.setText(jObj.getString("posts"));
} else {
String errorMsg = jObj.getString("error_msg");
Log.e(TAG, "Error getting user stats (server returned error): " + errorMsg);
showMessage(errorMsg);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error getting user stats: " + error.getMessage());
showMessage(getString(R.string.errormsg_couldnotretrieve));
}
}) {
@Override
protected Map<String, String> getParams() {
// Posting params to register url
Map<String, String> params = new HashMap<>();
params.put("tag", "getuserstats");
params.put("uid", user.get("uid"));
params.put("token", user.get("token"));
return params;
}
};
}
private StringRequest getStringRequestTop10() {
showDialog();
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d(TAG, "Top 10 stats: " + response);
hideDialog();
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
TableLayout tbltop10 = (TableLayout) findViewById(R.id.tableTop10);
JSONArray listitems = jObj.getJSONArray("msg");
for(int i=0;i<listitems.length();i++){
JSONObject listitem = listitems.getJSONObject(i);
TableRow row = new TableRow(getApplication());
TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
lp.setMargins(3,3,3,3);
row.setLayoutParams(lp);
TextView rank = new TextView(getApplication());
rank.setText(listitem.getString("rank"));
rank.setTextColor(Color.BLACK);
TextView username = new TextView(getApplication());
username.setText(listitem.getString("username"));
username.setTextColor(Color.BLACK);
TextView points = new TextView(getApplication());
points.setText(listitem.getString("points"));
points.setTextColor(Color.BLACK);
row.addView(rank);
row.addView(username);
row.addView(points);
tbltop10.addView(row,i+1);
}
} else {
String errorMsg = jObj.getString("error_msg");
Log.e(TAG, "Error getting top 10 stats (Server returned error): " + errorMsg);
showMessage(errorMsg);
}
} catch (JSONException e) {
e.printStackTrace();
}
} }
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error getting top 10 stats: " + error.getMessage());
showMessage(getString(R.string.errormsg_couldnotretrieve));
hideDialog();
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("tag", "gettop10");
params.put("uid", user.get("uid"));
params.put("token", user.get("token"));
return params;
}
};
}
}

View File

@@ -0,0 +1,101 @@
package org.deke.risk.riskahead.fragments;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import org.deke.risk.riskahead.ProfileActivity;
import org.deke.risk.riskahead.R;
import org.deke.risk.riskahead.helper.AppConfig;
import org.deke.risk.riskahead.helper.AppController;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Dennis on 13.12.2015.
*/
public class ProfileStatisticsFragment extends Fragment {
private final static String mActivityTitle = "User Statistics";
private final static String TAG = ProfileStatisticsFragment.class.getSimpleName();
private View view;
private ProfileActivity parent;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.activity_profile_stats, container, false);
parent = (ProfileActivity)getActivity();
StringRequest strReq = getStringRequestProfileStats();
String tag_string_req = "req_profilestats";
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
return view;
}
private StringRequest getStringRequestProfileStats() {
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d(TAG, "User stats: " + response);
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
TextView points = (TextView) view.findViewById(R.id.txt_profile_points);
TextView ranking = (TextView) view.findViewById(R.id.txt_profile_ranking);
TextView posts = (TextView) view.findViewById(R.id.txt_profile_numberposts);
TextView txtMemberSince = (TextView) view.findViewById(R.id.txt_profile_membersince);
points.setText(jObj.getString("points"));
ranking.setText(jObj.getString("rank"));
posts.setText(jObj.getString("posts"));
txtMemberSince.setText(parent.user.get("created_at"));
} else {
String errorMsg = jObj.getString("error_msg");
Log.e(TAG, "Error getting user stats (server returned error): " + errorMsg);
parent.showMessage(errorMsg);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error getting user stats: " + error.getMessage());
parent.showMessage(getString(R.string.errormsg_couldnotretrieve));
}
}) {
@Override
protected Map<String, String> getParams() {
// Posting params to register url
Map<String, String> params = new HashMap<>();
params.put("tag", "getuserstats");
params.put("uid", parent.user.get("uid"));
params.put("token", parent.user.get("token"));
return params;
}
};
}
}

View File

@@ -1,22 +1,24 @@
package org.deke.risk.riskahead; package org.deke.risk.riskahead.fragments;
import android.support.v4.app.Fragment;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ListAdapter; import android.widget.ListAdapter;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast;
import com.android.volley.Request; import com.android.volley.Request;
import com.android.volley.Response; 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 org.deke.risk.riskahead.ProfileActivity;
import org.deke.risk.riskahead.R;
import org.deke.risk.riskahead.helper.AppConfig; import org.deke.risk.riskahead.helper.AppConfig;
import org.deke.risk.riskahead.helper.AppController; import org.deke.risk.riskahead.helper.AppController;
import org.deke.risk.riskahead.helper.BaseActivity;
import org.deke.risk.riskahead.helper.ReportListAdapter; import org.deke.risk.riskahead.helper.ReportListAdapter;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
@@ -27,21 +29,26 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class ReportlistActivity extends BaseActivity { /**
* Created by Dennis on 13.12.2015.
*/
public class ReportListFragment extends Fragment{
private final static String mActivityTitle = "ReportList";
private final static String TAG = ReportListFragment.class.getSimpleName();
private final static String mActivityTitle = "Reports"; private View view;
private final static String TAG = ReportlistActivity.class.getSimpleName(); private ProfileActivity parent;
ListView myListView; ListView myListView;
ListAdapter myListAdapter; ListAdapter myListAdapter;
List<JSONObject> resultList; List<JSONObject> resultList;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState); view = inflater.inflate(R.layout.activity_reportlist, container, false);
userHasToBeLoggedIn(); parent = (ProfileActivity)getActivity();
myListView = (ListView)findViewById(R.id.lv_reportlist_list); myListView = (ListView) view.findViewById(R.id.lv_reportlist_list);
//setContentView(R.layout.activity_reportlist); //setContentView(R.layout.activity_reportlist);
String tag_string_req = "getincidentswithpositionfromid"; String tag_string_req = "getincidentswithpositionfromid";
@@ -50,39 +57,26 @@ public class ReportlistActivity extends BaseActivity {
myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parentview, View view, int position, long id) {
try { try {
gotoViewReportActivity(resultList.get(position).getInt("uid")); parent.gotoViewReportActivity(resultList.get(position).getInt("uid"));
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}); });
return view;
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return true;
}
@Override
protected int getLayoutResourceId() {
return R.layout.activity_reportlist;
}
@Override
protected String getActivityName() {
return mActivityTitle;
}
private StringRequest getStringRequestGetIncidentsWithPositionFromUserID() { private StringRequest getStringRequestGetIncidentsWithPositionFromUserID() {
showDialog(); parent.showDialog();
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() { return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
@Override @Override
public void onResponse(String response) { public void onResponse(String response) {
Log.d(TAG, "Map positions response with ID: " + response); Log.d(TAG, "Map positions response with ID: " + response);
hideDialog(); parent.hideDialog();
try { try {
JSONObject jObj = new JSONObject(response); JSONObject jObj = new JSONObject(response);
@@ -98,7 +92,7 @@ public class ReportlistActivity extends BaseActivity {
} }
myListAdapter = new ReportListAdapter( myListAdapter = new ReportListAdapter(
getApplicationContext(), parent.getApplicationContext(),
resultList); resultList);
myListView.setAdapter(myListAdapter); myListView.setAdapter(myListAdapter);
@@ -106,7 +100,7 @@ public class ReportlistActivity extends BaseActivity {
} else { } else {
String errorMsg = jObj.getString("error_msg"); String errorMsg = jObj.getString("error_msg");
Log.e(TAG, "Error getting incident list (Server returned error): " + errorMsg); Log.e(TAG, "Error getting incident list (Server returned error): " + errorMsg);
showMessage(errorMsg); parent.showMessage(errorMsg);
} }
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
@@ -118,8 +112,8 @@ public class ReportlistActivity extends BaseActivity {
@Override @Override
public void onErrorResponse(VolleyError error) { public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error getting incident list: " + error.getMessage()); Log.e(TAG, "Error getting incident list: " + error.getMessage());
showMessage(getString(R.string.errormsg_couldnotretrieve)); parent.showMessage(getString(R.string.errormsg_couldnotretrieve));
hideDialog(); parent.hideDialog();
} }
}) { }) {
@@ -127,11 +121,12 @@ public class ReportlistActivity extends BaseActivity {
protected Map<String, String> getParams() { protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("tag", "getincidentsfromuserid"); params.put("tag", "getincidentsfromuserid");
params.put("uid", user.get("uid")); params.put("uid", parent.user.get("uid"));
params.put("token", user.get("token")); params.put("token", parent.user.get("token"));
return params; return params;
} }
}; };
} }
} }

View File

@@ -0,0 +1,126 @@
package org.deke.risk.riskahead.fragments;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import org.deke.risk.riskahead.ProfileActivity;
import org.deke.risk.riskahead.R;
import org.deke.risk.riskahead.helper.AppConfig;
import org.deke.risk.riskahead.helper.AppController;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Dennis on 13.12.2015.
*/
public class Top10Fragment extends Fragment {
private final static String mActivityTitle = "Top10";
private final static String TAG = ProfileStatisticsFragment.class.getSimpleName();
private View view;
private ProfileActivity parent;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.activity_profile_top10, container, false);
parent = (ProfileActivity)getActivity();
StringRequest strReq2 = getStringRequestTop10();
String tag_string_req2 = "req_top10";
AppController.getInstance().addToRequestQueue(strReq2, tag_string_req2);
return view;
}
private StringRequest getStringRequestTop10() {
parent.showDialog();
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d(TAG, "Top 10 stats: " + response);
parent.hideDialog();
try {
JSONObject jObj = new JSONObject(response);
boolean error = jObj.getBoolean("error");
if (!error) {
TableLayout tbltop10 = (TableLayout) view.findViewById(R.id.tableTop10);
JSONArray listitems = jObj.getJSONArray("msg");
for(int i=0;i<listitems.length();i++){
JSONObject listitem = listitems.getJSONObject(i);
TableRow row = new TableRow(view.getContext());
TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
lp.setMargins(3,3,3,3);
row.setLayoutParams(lp);
TextView rank = new TextView(view.getContext());
rank.setText(listitem.getString("rank"));
rank.setTextColor(Color.BLACK);
TextView username = new TextView(view.getContext());
username.setText(listitem.getString("username"));
username.setTextColor(Color.BLACK);
TextView points = new TextView(view.getContext());
points.setText(listitem.getString("points"));
points.setTextColor(Color.BLACK);
row.addView(rank);
row.addView(username);
row.addView(points);
tbltop10.addView(row,i+1);
}
} else {
String errorMsg = jObj.getString("error_msg");
Log.e(TAG, "Error getting top 10 stats (Server returned error): " + errorMsg);
parent.showMessage(errorMsg);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error getting top 10 stats: " + error.getMessage());
parent.showMessage(getString(R.string.errormsg_couldnotretrieve));
parent.hideDialog();
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("tag", "gettop10");
params.put("uid", parent.user.get("uid"));
params.put("token", parent.user.get("token"));
return params;
}
};
}
}

View File

@@ -23,7 +23,6 @@ import android.widget.AdapterView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import com.android.volley.toolbox.StringRequest;
import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd; import com.google.android.gms.ads.InterstitialAd;
@@ -32,10 +31,8 @@ import org.deke.risk.riskahead.LoginActivity;
import org.deke.risk.riskahead.MainActivity; import org.deke.risk.riskahead.MainActivity;
import org.deke.risk.riskahead.MapsActivity; import org.deke.risk.riskahead.MapsActivity;
import org.deke.risk.riskahead.R; import org.deke.risk.riskahead.R;
import org.deke.risk.riskahead.ReportActivity;
import org.deke.risk.riskahead.ProfileActivity; import org.deke.risk.riskahead.ProfileActivity;
import org.deke.risk.riskahead.ReportWFActivity; import org.deke.risk.riskahead.ReportWFActivity;
import org.deke.risk.riskahead.ReportlistActivity;
import org.deke.risk.riskahead.SettingsActivity; import org.deke.risk.riskahead.SettingsActivity;
import org.deke.risk.riskahead.SubscriptionsActivity; import org.deke.risk.riskahead.SubscriptionsActivity;
import org.deke.risk.riskahead.ViewReportActivity; import org.deke.risk.riskahead.ViewReportActivity;
@@ -68,7 +65,9 @@ public abstract class BaseActivity extends AppCompatActivity {
isNetworkAvailable(); isNetworkAvailable();
} }
public HashMap<String, String> getUser(){
return user;
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -265,11 +264,6 @@ public abstract class BaseActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} }
public void gotoReportlistActivity(){
Intent intent;
intent = new Intent(getApplicationContext(), ReportlistActivity.class);
startActivity(intent);
}
public void gotoMapActivity(){ public void gotoMapActivity(){
Intent intent; Intent intent;

View File

@@ -0,0 +1,41 @@
package org.deke.risk.riskahead.helper;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import org.deke.risk.riskahead.fragments.ProfileStatisticsFragment;
import org.deke.risk.riskahead.fragments.ReportListFragment;
import org.deke.risk.riskahead.fragments.Top10Fragment;
public class ProfilePagerAdapter extends FragmentStatePagerAdapter {
int mNumOfTabs;
public ProfilePagerAdapter(FragmentManager fm, int NumOfTabs) {
super(fm);
this.mNumOfTabs = NumOfTabs;
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
ProfileStatisticsFragment tab1 = new ProfileStatisticsFragment();
return tab1;
case 1:
Top10Fragment tab2 = new Top10Fragment();
return tab2;
case 2:
ReportListFragment tab3 = new ReportListFragment();
return tab3;
default:
return null;
}
}
@Override
public int getCount() {
return mNumOfTabs;
}
}

View File

@@ -1,132 +1,132 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto" xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto" xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:background="@color/bg_login" android:background="@color/bg_login"
android:padding="20dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:padding="20dp"
tools:context=".LoginActivity"> tools:context=".LoginActivity">
<TextView <TextView
android:id="@+id/lbl_login_title" android:id="@+id/lbl_login_title"
android:text="@string/lbl_login_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:text="@string/lbl_login_title"
android:textSize="20sp" android:textSize="20sp"
android:typeface="sans" android:textStyle="bold"
android:textStyle="bold" /> android:typeface="sans" />
<EditText <EditText
android:id="@+id/input_register_email" android:id="@+id/input_register_email"
android:hint="@string/input_register_email_hint"
android:inputType="textEmailAddress"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/lbl_login_title"
android:layout_marginTop="20dp"
android:background="@color/white" android:background="@color/white"
android:hint="@string/input_register_email_hint"
android:inputType="textEmailAddress"
android:padding="10dp" android:padding="10dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/input_login" android:textColor="@color/input_login"
android:textColorHint="@color/input_login_hint" android:textColorHint="@color/input_login_hint" />
android:layout_marginTop="20dp"
android:layout_below="@+id/lbl_login_title" />
<EditText <EditText
android:id="@+id/input_register_password" android:id="@+id/input_register_password"
android:hint="@string/input_register_password_hint"
android:inputType="textPassword"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/input_register_email"
android:layout_marginTop="5dp"
android:background="@color/white" android:background="@color/white"
android:hint="@string/input_register_password_hint"
android:inputType="textPassword"
android:padding="10dp" android:padding="10dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/input_login" android:textColor="@color/input_login"
android:textColorHint="@color/input_login_hint" android:textColorHint="@color/input_login_hint" />
android:layout_below="@+id/input_register_email"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp" />
<Button <Button
android:id="@+id/btn_register" android:id="@+id/btn_register"
android:text="@string/btn_start_login"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/input_register_password"
android:layout_marginBottom="10dip" android:layout_marginBottom="10dip"
android:layout_marginTop="20dip" android:layout_marginTop="20dip"
android:background="@color/btn_login_bg" android:background="@color/btn_login_bg"
android:textColor="@color/btn_login"
android:minWidth="120dp" android:minWidth="120dp"
android:layout_below="@+id/input_register_password" android:text="@string/btn_start_login"
android:layout_alignParentLeft="true" android:textColor="@color/btn_login" />
android:layout_alignParentStart="true" />
<TextView <TextView
android:id="@+id/lbl_login_policy" android:id="@+id/lbl_login_policy"
android:text="@string/lbl_login_policy"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_alignTop="@+id/lbl_login_resendPW"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" /> android:layout_alignTop="@+id/lbl_login_resendPW"
android:gravity="end"
android:text="@string/lbl_login_policy"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
android:id="@+id/lbl_login_usesocialnet" android:id="@+id/lbl_login_usesocialnet"
android:text="@string/lbl_login_usesocialnet"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/frag_login_btnGP" android:layout_above="@+id/frag_login_btnGP"
android:layout_centerHorizontal="true" /> android:layout_centerHorizontal="true"
android:text="@string/lbl_login_usesocialnet" />
<fragment <fragment
android:id="@+id/frag_login_btnGP" android:id="@+id/frag_login_btnGP"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
tools:layout="@layout/fragment_googleplus_button"
android:layout_above="@+id/frag_login_btnTW" android:layout_above="@+id/frag_login_btnTW"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_googleplus_button" />
<fragment <fragment
android:id="@+id/frag_login_btnTW" android:id="@+id/frag_login_btnTW"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
tools:layout="@layout/fragment_twitter_button"
android:layout_above="@+id/frag_login_btnFB" android:layout_above="@+id/frag_login_btnFB"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_twitter_button" />
<fragment <fragment
android:id="@+id/frag_login_btnFB" android:id="@+id/frag_login_btnFB"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
tools:layout="@layout/fragment_facebook_button"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_facebook_button" />
<TextView <TextView
android:id="@+id/lbl_login_resendPW" android:id="@+id/lbl_login_resendPW"
android:text="@string/lbl_login_resendPW"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="onClick"
android:clickable="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_below="@+id/btn_register"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" /> android:layout_alignParentStart="true"
android:layout_below="@+id/btn_register"
android:clickable="true"
android:onClick="onClick"
android:text="@string/lbl_login_resendPW"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout> </RelativeLayout>

View File

@@ -1,7 +1,6 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -14,23 +13,22 @@
<fragment xmlns:android="http://schemas.android.com/apk/res/android" <fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frag_maps_map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/frag_maps_map" tools:context=".MapsActivity" />
tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment"
/>
<com.beardedhen.androidbootstrap.BootstrapButton <com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btn_maps_confirm_position" android:id="@+id/btn_maps_confirm_position"
bootstrap:bootstrapText="@string/btn_maps_confirm_position"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
bootstrap:bootstrapBrand="danger"
bootstrap:roundedCorners="true"
android:layout_marginBottom="20dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" /> android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
bootstrap:bootstrapBrand="danger"
bootstrap:bootstrapText="@string/btn_maps_confirm_position"
bootstrap:roundedCorners="true" />
</RelativeLayout> </RelativeLayout>
<ListView <ListView

View File

@@ -1,203 +1,46 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/bg_common_2" android:background="@drawable/layout_bg_gradient"
tools:context=".ProfileActivity"> tools:context=".ProfileActivity">
<LinearLayout <LinearLayout
android:id="@+id/layoutMain" android:id="@+id/layoutMain"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout
android:id="@+id/layoutContent"
android:layout_width="match_parent"
android:background="@drawable/layout_bg"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:layout_marginBottom="10dp"
android:padding="8dp"
android:orientation="vertical" >
<TextView
android:id="@+id/lbl_profile_stats"
android:text="@string/lbl_profile_stats"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#000000"/>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/lbl_profile_stats"
android:stretchColumns="1"
android:id="@+id/tableLayout">
<TableRow>
<TextView
android:id="@+id/lbl_profile_membersince"
android:text="@string/lbl_profile_member_since"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_profile_membersince"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:textColor="#007197"/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_points"
android:text="@string/lbl_profile_points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_profile_points"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_ranking"
android:text="@string/lbl_profile_ranking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_profile_ranking"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_numberposts"
android:text="@string/lbl_profile_numberposts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_profile_numberposts"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:textColor="#007197"/>
</TableRow>
</TableLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_main_content_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:layout_marginBottom="20dp"
android:padding="8dp"
android:background="@drawable/layout_bg"
android:orientation="vertical" >
<TextView
android:id="@+id/lbl_profile_top10"
android:textStyle="bold"
android:text="@string/lbl_profile_top10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#000000"/>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/lbl_profile_top10"
android:stretchColumns="1"
android:id="@+id/tableTop10">
<TableRow>
<TextView
android:id="@+id/lbl_ranking"
android:text="Ranking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_name"
android:text="Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:textColor="#007197"/>
<TextView
android:id="@+id/txt_points"
android:text="Points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:textColor="#007197"/>
</TableRow>
</TableLayout>
</RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/layoutFooter" android:id="@+id/layoutHeader"
android:gravity="center"
android:background="@color/bg_common"
android:layout_height="50dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="0dp">
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btn_profile_viewposts"
bootstrap:bootstrapText="@string/btn_profile_viewposts"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
bootstrap:bootstrapBrand="primary" android:layout_marginBottom="0dp"
bootstrap:roundedCorners="true" /> android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:background="?attr/colorPrimary"
android:elevation="6dp"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tab_layout" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ListView <ListView

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/layout_bg"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/lbl_profile_stats"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/lbl_profile_stats"
android:textColor="#000000"
android:textStyle="bold" />
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/lbl_profile_stats"
android:stretchColumns="1">
<TableRow>
<TextView
android:id="@+id/lbl_profile_membersince"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:text="@string/lbl_profile_member_since"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_profile_membersince"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:text="0"
android:textColor="#007197" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="@string/lbl_profile_points"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_profile_points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="0"
android:textColor="#007197" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_ranking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="@string/lbl_profile_ranking"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_profile_ranking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="0"
android:textColor="#007197" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/lbl_profile_numberposts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="@string/lbl_profile_numberposts"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_profile_numberposts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text="0"
android:textColor="#007197" />
</TableRow>
</TableLayout>
</RelativeLayout>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_main_content_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:layout_marginBottom="20dp"
android:layout_weight="1"
android:background="@drawable/layout_bg"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/lbl_profile_top10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/lbl_profile_top10"
android:textColor="#000000"
android:textStyle="bold" />
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableTop10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/lbl_profile_top10"
android:stretchColumns="1">
<TableRow>
<TextView
android:id="@+id/lbl_ranking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:text="Ranking"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:text="Name"
android:textColor="#007197" />
<TextView
android:id="@+id/txt_points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="3dip"
android:text="Points"
android:textColor="#007197" />
</TableRow>
</TableLayout>
</RelativeLayout>

View File

@@ -3,130 +3,130 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:background="@color/bg_register" android:background="@color/bg_register"
android:padding="20dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:padding="20dp"
tools:context=".LoginActivity"> tools:context=".LoginActivity">
<TextView <TextView
android:id="@+id/lbl_register_title" android:id="@+id/lbl_register_title"
android:text="@string/lbl_register_title"
android:textColor="@color/input_register"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/lbl_register_title"
android:textColor="@color/input_register"
android:textSize="20sp" android:textSize="20sp"
android:typeface="sans"
android:textStyle="bold" android:textStyle="bold"
android:layout_centerHorizontal="true" /> android:typeface="sans" />
<EditText <EditText
android:id="@+id/input_register_name" android:id="@+id/input_register_name"
android:hint="@string/input_register_name_hint"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/lbl_register_title"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
android:background="@color/input_register_bg" android:background="@color/input_register_bg"
android:hint="@string/input_register_name_hint"
android:inputType="textCapWords"
android:padding="10dp" android:padding="10dp"
android:singleLine="true" android:singleLine="true"
android:inputType="textCapWords"
android:textColor="@color/input_register" android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint" android:textColorHint="@color/input_register_hint" />
android:layout_marginTop="20dp"
android:layout_below="@+id/lbl_register_title" />
<EditText <EditText
android:id="@+id/input_register_email" android:id="@+id/input_register_email"
android:hint="@string/input_register_email_hint"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/input_register_name"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@color/input_register_bg" android:background="@color/input_register_bg"
android:hint="@string/input_register_email_hint"
android:inputType="textEmailAddress" android:inputType="textEmailAddress"
android:padding="10dp" android:padding="10dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/input_register" android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint" android:textColorHint="@color/input_register_hint" />
android:layout_below="@+id/input_register_name"/>
<EditText <EditText
android:id="@+id/input_register_password" android:id="@+id/input_register_password"
android:hint="@string/input_register_password_hint"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/input_register_email"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@color/input_register_bg" android:background="@color/input_register_bg"
android:hint="@string/input_register_password_hint"
android:inputType="textPassword" android:inputType="textPassword"
android:padding="10dp" android:padding="10dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/input_register" android:textColor="@color/input_register"
android:textColorHint="@color/input_register_hint" android:textColorHint="@color/input_register_hint" />
android:layout_below="@+id/input_register_email" />
<Button <Button
android:id="@+id/btn_register" android:id="@+id/btn_register"
android:text="@string/btn_start_register"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:minWidth="120dp"
android:background="#ffea7f8a"
android:textColor="@color/white"
android:layout_below="@+id/input_register_password"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" /> android:layout_alignParentStart="true"
android:layout_below="@+id/input_register_password"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#ffea7f8a"
android:minWidth="120dp"
android:text="@string/btn_start_register"
android:textColor="@color/white" />
<TextView <TextView
android:id="@+id/lbl_login_policy" android:id="@+id/lbl_login_policy"
android:text="@string/lbl_login_policy"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right" android:layout_alignParentEnd="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/input_register"
android:layout_alignTop="@+id/btn_register"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" /> android:layout_alignTop="@+id/btn_register"
android:gravity="right"
android:text="@string/lbl_login_policy"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/input_register" />
<TextView <TextView
android:id="@+id/lbl_login_usesocialnet" android:id="@+id/lbl_login_usesocialnet"
android:text="@string/lbl_login_usesocialnet"
android:textColor="@color/input_register"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/frag_login_btnGP" android:layout_above="@+id/frag_login_btnGP"
android:layout_centerHorizontal="true" /> android:layout_centerHorizontal="true"
android:text="@string/lbl_login_usesocialnet"
android:textColor="@color/input_register" />
<fragment <fragment
android:id="@+id/frag_login_btnGP" android:id="@+id/frag_login_btnGP"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"
tools:layout="@layout/fragment_googleplus_button"
android:layout_above="@+id/frag_login_btnTW" android:layout_above="@+id/frag_login_btnTW"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_googleplus_button" />
<fragment <fragment
android:id="@+id/frag_login_btnTW" android:id="@+id/frag_login_btnTW"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.TwitterButtonFragment"
tools:layout="@layout/fragment_twitter_button"
android:layout_above="@+id/frag_login_btnFB" android:layout_above="@+id/frag_login_btnFB"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_twitter_button" />
<fragment <fragment
android:id="@+id/frag_login_btnFB" android:id="@+id/frag_login_btnFB"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="org.deke.risk.riskahead.fragments.FacebookButtonFragment"
tools:layout="@layout/fragment_facebook_button"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"/> android:layout_marginTop="5dp"
tools:layout="@layout/fragment_facebook_button" />
</RelativeLayout> </RelativeLayout>

View File

@@ -1,5 +1,4 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
@@ -10,8 +9,10 @@
<!-- dummy item for disabling focus --> <!-- dummy item for disabling focus -->
<LinearLayout <LinearLayout
android:focusable="true" android:focusableInTouchMode="true" android:focusable="true"
android:layout_width="0px" android:layout_height="0px"/> android:focusableInTouchMode="true"
android:layout_width="0px"
android:layout_height="0px" />
<LinearLayout <LinearLayout
android:id="@+id/layoutMain" android:id="@+id/layoutMain"

View File

@@ -1,5 +1,4 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
@@ -77,6 +76,7 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ListView <ListView
android:id="@+id/navList" android:id="@+id/navList"
android:layout_width="200dp" android:layout_width="200dp"

View File

@@ -1,11 +1,9 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:background="#8ae6e6e6" android:background="#8ae6e6e6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:context=".ReportlistActivity">
<RelativeLayout <RelativeLayout
android:id="@+id/layoutContent" android:id="@+id/layoutContent"

View File

@@ -50,6 +50,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -1,5 +1,4 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"

View File

@@ -1,6 +1,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"

View File

@@ -1,5 +1,4 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:background="#8ae6e6e6" android:background="#8ae6e6e6"
@@ -43,6 +42,7 @@
android:id="@+id/tableLayout2"> android:id="@+id/tableLayout2">
<TableRow android:padding="1dp"> <TableRow android:padding="1dp">
<TextView <TextView
android:id="@+id/lbl_subscription_1_title" android:id="@+id/lbl_subscription_1_title"
android:text="No Ads" android:text="No Ads"
@@ -51,7 +51,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/lbl_subscription_1_desription" android:id="@+id/lbl_subscription_1_desription"
android:text="You can subscripe this option to have no more ads. This is a recuring subscriptions for $5 a month" android:text="You can subscripe this option to have no more ads. This is a recuring subscriptions for $5 a month"
@@ -59,7 +61,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<Button <Button
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -69,6 +73,7 @@
</TableRow> </TableRow>
<TableRow android:padding="1dp"> <TableRow android:padding="1dp">
<TextView <TextView
android:id="@+id/lbl_subscription_2_title" android:id="@+id/lbl_subscription_2_title"
android:text="Unlimited Access" android:text="Unlimited Access"
@@ -77,7 +82,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/lbl_subscription_2_description" android:id="@+id/lbl_subscription_2_description"
android:text="You can get unlimimited access to the report map with this reccuring subscription for $10 a month" android:text="You can get unlimimited access to the report map with this reccuring subscription for $10 a month"
@@ -85,7 +92,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<Button <Button
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -98,12 +107,9 @@
</TableLayout> </TableLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<ListView <ListView

View File

@@ -1,5 +1,4 @@
<android.support.v4.widget.DrawerLayout <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
@@ -137,7 +136,6 @@
android:layout_alignStart="@+id/input_viewreport_time" /> android:layout_alignStart="@+id/input_viewreport_time" />
<EditText <EditText
android:id="@+id/input_viewreport_position" android:id="@+id/input_viewreport_position"
android:enabled="false" android:enabled="false"
@@ -186,8 +184,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
bootstrap:bootstrapBrand="success" bootstrap:bootstrapBrand="success"
bootstrap:fontAwesomeIcon="fa_angle_up" bootstrap:fontAwesomeIcon="fa_angle_up" />
/>
<com.beardedhen.androidbootstrap.BootstrapLabel <com.beardedhen.androidbootstrap.BootstrapLabel
android:id="@+id/txt_viewreport_points" android:id="@+id/txt_viewreport_points"
@@ -198,8 +195,7 @@
bootstrap:bootstrapBrand="primary" bootstrap:bootstrapBrand="primary"
bootstrap:bootstrapHeading="h4" bootstrap:bootstrapHeading="h4"
bootstrap:roundedCorners="true" bootstrap:roundedCorners="true"
android:text="0" android:text="0" />
/>
<com.beardedhen.androidbootstrap.AwesomeTextView <com.beardedhen.androidbootstrap.AwesomeTextView
android:id="@+id/btn_viewreport_downvote" android:id="@+id/btn_viewreport_downvote"
@@ -208,8 +204,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
bootstrap:bootstrapBrand="danger" bootstrap:bootstrapBrand="danger"
android:layout_below="@+id/txt_viewreport_points" android:layout_below="@+id/txt_viewreport_points"
bootstrap:fontAwesomeIcon="fa_angle_down" bootstrap:fontAwesomeIcon="fa_angle_down" />
/>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@@ -1,5 +1,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:fb="http://schemas.android.com/apk/res-auto" xmlns:fb="http://schemas.android.com/apk/res-auto"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -12,7 +13,6 @@
bootstrap:bootstrapText="{fa_facebook_f} Facebook" bootstrap:bootstrapText="{fa_facebook_f} Facebook"
android:layout_above="@+id/btn_login_fb" android:layout_above="@+id/btn_login_fb"
bootstrap:bootstrapBrand="primary" bootstrap:bootstrapBrand="primary"
bootstrap:roundedCorners="true" bootstrap:roundedCorners="true" />
/>
</FrameLayout> </FrameLayout>

View File

@@ -1,5 +1,8 @@
<FrameLayout android:id="@+id/gp_frame_layout" xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:id="@+id/gp_frame_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment"> tools:context="org.deke.risk.riskahead.fragments.GooglePlusButtonFragment">
@@ -11,8 +14,7 @@
bootstrap:bootstrapText="{fa_google} Google+" bootstrap:bootstrapText="{fa_google} Google+"
android:layout_above="@+id/btn_login_gp" android:layout_above="@+id/btn_login_gp"
bootstrap:bootstrapBrand="danger" bootstrap:bootstrapBrand="danger"
bootstrap:roundedCorners="true" bootstrap:roundedCorners="true" />
/>
</FrameLayout> </FrameLayout>

View File

@@ -1,5 +1,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto" xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="org.deke.risk.riskahead.fragments.TwitterButtonFragment"> tools:context="org.deke.risk.riskahead.fragments.TwitterButtonFragment">
@@ -11,8 +12,7 @@
bootstrap:bootstrapText="{fa_twitter} Twitter" bootstrap:bootstrapText="{fa_twitter} Twitter"
android:layout_above="@+id/btn_login_gp" android:layout_above="@+id/btn_login_gp"
bootstrap:bootstrapBrand="info" bootstrap:bootstrapBrand="info"
bootstrap:roundedCorners="true" bootstrap:roundedCorners="true" />
/>
</FrameLayout> </FrameLayout>

View File

@@ -31,8 +31,7 @@
android:id="@+id/lay_infowindow_color" android:id="@+id/lay_infowindow_color"
android:background="#e45151" android:background="#e45151"
android:layout_width="5dp" android:layout_width="5dp"
android:layout_height="match_parent"> android:layout_height="match_parent"></LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"