From fa0b30ff01420b6157878ec7f1b9e12a9a7016a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Thu, 28 Mar 2019 11:05:11 +0300 Subject: [PATCH] Ratings page in progress --- MyCity/app/src/main/AndroidManifest.xml | 1 + .../java/gq/yigit/mycity/MainActivity.java | 22 ++- .../java/gq/yigit/mycity/RateFragment.java | 146 ++++++++++++++++++ .../mycity/votesFragment/VoteFragment.java | 1 - .../app/src/main/res/layout/fragment_rate.xml | 50 ++++++ .../app/src/main/res/layout/fragment_vote.xml | 3 +- .../__pycache__/rating_system.cpython-37.pyc | Bin 3227 -> 2894 bytes .../api/modules/databases/ratings.json | 6 + server_side/api/modules/rating_system.py | 29 +--- 9 files changed, 225 insertions(+), 33 deletions(-) create mode 100644 MyCity/app/src/main/java/gq/yigit/mycity/RateFragment.java create mode 100644 MyCity/app/src/main/res/layout/fragment_rate.xml diff --git a/MyCity/app/src/main/AndroidManifest.xml b/MyCity/app/src/main/AndroidManifest.xml index cd1f147..49ce08d 100644 --- a/MyCity/app/src/main/AndroidManifest.xml +++ b/MyCity/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ + request = new HashMap<>(); + request.put("longitude",longitude); + request.put("latitude","latitude"); + WebRequest web_manager = new WebRequest(url + "/ratings",false,request); + web_manager.addListener(this); + web_manager.execute(); + } + + @Override + public void onProviderDisabled(String provider) {} + + @Override + public void onProviderEnabled(String provider) { + Log.i("[INFO]",provider); + } + + @Override + public void onStatusChanged(String provider, int status, Bundle extras) {} +} + + diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java b/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java index 11bb0c1..94a9308 100644 --- a/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java +++ b/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java @@ -45,7 +45,6 @@ public class VoteFragment extends Fragment implements responseListener, imageLis // Required empty public constructor } - // TODO: Rename and change types and number of parameters public static VoteFragment newInstance(String voteid) { VoteFragment fragment = new VoteFragment(); Bundle args = new Bundle(); diff --git a/MyCity/app/src/main/res/layout/fragment_rate.xml b/MyCity/app/src/main/res/layout/fragment_rate.xml new file mode 100644 index 0000000..7523181 --- /dev/null +++ b/MyCity/app/src/main/res/layout/fragment_rate.xml @@ -0,0 +1,50 @@ + + + + + + + + + +