From 4fccde671687a84c2cb93311689b9522458b91a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Wed, 27 Mar 2019 21:41:46 +0300 Subject: [PATCH] Created MapsFragment --- .../java/gq/yigit/mycity/MainActivity.java | 4 +- .../yigit/mycity/navigation/MapsFragment.java | 109 ++++++++++++++++++ .../VoteFragment.java | 2 +- .../app/src/main/res/layout/fragment_maps.xml | 14 +++ .../app/src/main/res/layout/fragment_vote.xml | 8 +- .../__pycache__/rating_system.cpython-37.pyc | Bin 3121 -> 3227 bytes .../__pycache__/user_info.cpython-37.pyc | Bin 2512 -> 2565 bytes .../__pycache__/voting_system.cpython-37.pyc | Bin 3492 -> 3530 bytes .../api/modules/databases/ratings.json | 6 + .../api/modules/databases/votings.json | 2 +- 10 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java rename MyCity/app/src/main/java/gq/yigit/mycity/{voteFragment => votesFragment}/VoteFragment.java (99%) create mode 100644 MyCity/app/src/main/res/layout/fragment_maps.xml diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java b/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java index 6ead66f..cd84487 100644 --- a/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java +++ b/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java @@ -25,7 +25,7 @@ import android.widget.TextView; import android.widget.Toast; import gq.yigit.mycity.tools.*; import gq.yigit.mycity.tools.WebRequest.responseListener; -import gq.yigit.mycity.voteFragment.VoteFragment; +import gq.yigit.mycity.votesFragment.VoteFragment; import gq.yigit.mycity.votesFragment.VotesContent; import gq.yigit.mycity.votesFragment.VotesFragment; import gq.yigit.mycity.votesFragment.VotesFragment.OnListFragmentInteractionListener; @@ -35,7 +35,7 @@ import org.json.JSONObject; import java.util.HashMap; import static gq.yigit.mycity.tools.ImageDownload.*; -import static gq.yigit.mycity.voteFragment.VoteFragment.*; +import static gq.yigit.mycity.votesFragment.VoteFragment.*; public class MainActivity extends AppCompatActivity implements diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java b/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java new file mode 100644 index 0000000..51e1a30 --- /dev/null +++ b/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java @@ -0,0 +1,109 @@ +package gq.yigit.mycity.navigation; + +import android.content.Context; +import android.net.Uri; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import gq.yigit.mycity.R; + +/** + * A simple {@link Fragment} subclass. + * Activities that contain this fragment must implement the + * {@link MapsFragment.OnFragmentInteractionListener} interface + * to handle interaction events. + * Use the {@link MapsFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class MapsFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + private OnFragmentInteractionListener mListener; + + public MapsFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment MapsFragment. + */ + // TODO: Rename and change types and number of parameters + public static MapsFragment newInstance(String param1, String param2) { + MapsFragment fragment = new MapsFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_maps, container, false); + } + + // TODO: Rename method, update argument and hook method into UI event + public void onButtonPressed(Uri uri) { + if (mListener != null) { + mListener.onFragmentInteraction(uri); + } + } + + @Override + public void onAttach(Context context) { + super.onAttach(context); + if (context instanceof OnFragmentInteractionListener) { + mListener = (OnFragmentInteractionListener) context; + } else { + throw new RuntimeException(context.toString() + + " must implement OnFragmentInteractionListener"); + } + } + + @Override + public void onDetach() { + super.onDetach(); + mListener = null; + } + + /** + * This interface must be implemented by activities that contain this + * fragment to allow an interaction in this fragment to be communicated + * to the activity and potentially other fragments contained in that + * activity. + *

+ * See the Android Training lesson Communicating with Other Fragments for more information. + */ + public interface OnFragmentInteractionListener { + // TODO: Update argument type and name + void onFragmentInteraction(Uri uri); + } +} diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/voteFragment/VoteFragment.java b/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java similarity index 99% rename from MyCity/app/src/main/java/gq/yigit/mycity/voteFragment/VoteFragment.java rename to MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java index b515d80..11bb0c1 100644 --- a/MyCity/app/src/main/java/gq/yigit/mycity/voteFragment/VoteFragment.java +++ b/MyCity/app/src/main/java/gq/yigit/mycity/votesFragment/VoteFragment.java @@ -1,4 +1,4 @@ -package gq.yigit.mycity.voteFragment; +package gq.yigit.mycity.votesFragment; import android.content.Context; import android.graphics.Bitmap; diff --git a/MyCity/app/src/main/res/layout/fragment_maps.xml b/MyCity/app/src/main/res/layout/fragment_maps.xml new file mode 100644 index 0000000..3fedce4 --- /dev/null +++ b/MyCity/app/src/main/res/layout/fragment_maps.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/MyCity/app/src/main/res/layout/fragment_vote.xml b/MyCity/app/src/main/res/layout/fragment_vote.xml index 6c79ff9..c1e6ef8 100644 --- a/MyCity/app/src/main/res/layout/fragment_vote.xml +++ b/MyCity/app/src/main/res/layout/fragment_vote.xml @@ -1,9 +1,9 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".votesFragment.VoteFragment" android:orientation="vertical"> #1lcDVe>X0OD5rcHWzvySbTpUwK^(FX!_fqvzen*UR_( zS7BwR0gNF-XtC(vga|UuBTgr88ErE%LHmrB)wUzMor`iAH(O5Ijoh{ud2K)PfeBj# z1Bmj%6L~sA!J1>kg2*?EXrVnaqVa!}94R{!Vp5EwGvF@^QAzM&S(HW)P2HoE?y$RT ziIIQeKY!(q|2jh#y%!8U;SP+bO5DeQc#!cL@jQma!;DXh0LLElJ&+3`93Gh$RV-j} zWKi}*MGePs;*d?_B$hIkZ_eyrgUj{+9C+pFTAtbyH2o+Xk zBiQDBj{G9)^F;>PN(?m69GZO?0b08p*nQUFOH|lJHfP_GQ`8n&AyCil*`k%2>)qbd z)IlM7+EQ=rv*87D#{mHY4&&;(eFe^|dhWr_Pm&U*Qy3Z}mY7WofzsgeM`9x%0I(#N zsYaCzU>is^|5B|?<)qqL#ay48%wUf#`4An#R);2_<0XzR^?*{Rn|>BgUmCi&6VM+U zBvRYS=}{d*T?ZVivZ0>@|0)CWP8}xM=Y0bUZ_JU7%qJlhX%@=cW-`_+P@Jh7vP}3mK>OlhxLih^477AJLbrp4{vt>Z^OHeeeeD zIiVpugrc@i5?rMn&k``V3=V|9cLhAM0@?-8ItPyjP~#4N=H6XR#6qtdC%5KId5R*X zj+b+4WX%-oWL}{i>wF!Mb@kR8ct=y-jpb>Q)MC^^pAuS})#v(_he&7k`A{!FM*IbccCno@d^7KAv}v8lU2DtyuIKeVYeIkAL{@ z!gzlX7(<58VPZ0Z0OGvEyM{18YevWHTEgnu!p^zbak{Q>yPoj6zVLxbOBO~T0_n+s z#-e2Ha9ol>J3ibG08PRTO5qkaB15>*M~X<5xc)E>}Pw%9h?VH8lIfV1oM z|Lb=ddg#Al=u3BGh?sZ*1L8r>8^ntk5)X4eBMVsC<%f`5mBsNn8DoUy%(zUq*R+8Z zoXY6EIh(;MPUkFWpFiG!6M(v!G6YN?_l%zam(+dhB~;Zn>-p9I5MtI~Lq6chR~ez9 zvBe;7DWHkgm=7QWv=2D2hpfkU$k-NJa5j=Ul_QA>gq=K1Wztu#?RhZN7yD*(i{ySt zz<@&lw)$nS!-`sU9_@c8F=b;&d1|yxga*raa*|p(;|(@~A^c@V&N!L_ZZd=ITFDw( zgquARSkF&ww9y&S#dPl2K{tb;k-GFSPd^O(1{-^+e@1E10qE896n*%B4-71PG&7)W z3Tc1=RjxKP(_%ZML{rz|fb6CEl_vGo{=a}0)5hy@p{hQ(pMzwU9(HQ=pY0`5J@IbL zn!P=8<)2FnW}^RKVdZ8e*J++CsjuD|l+I*SvykTjK37+Dui`CebW uFC0e8BqyGRMGZ~09IRZM&tqL4@Cd5hrM)Xqp}nhlkLDsjy5Q&Mhx`xEFt(`x diff --git a/server_side/api/modules/__pycache__/user_info.cpython-37.pyc b/server_side/api/modules/__pycache__/user_info.cpython-37.pyc index 435c58ca7ff0be6d3d37bddc84339fe2465a9305..179a53ef19664096430364dd1631ad9ec2b66ec3 100644 GIT binary patch delta 666 zcmX|-ziSjx5Xaxl?!JAyce~m9k-J=sMnS|TB3g*bDF_m%>rcr%}wdEYn8VdHf(yb%OGGw0ybyVXnH zK{&Vn#}F}sn8|-0B$SL2jmOv;+R}!iX2s5sOFnd^Te2OCp(nkeFa2RfR)8t4suPfb z@>O7bsMzLA9;slnMh@|*CF`o8>f}!FZ6uot^I5guoPuoKGXvaVciDZm%t(;;ijk+h zi6z^HeX1C)lssp+N`c{^_-z&-FLBE;g8%(tR&J3tR>e`nI*$k!|V^;&D&KYAsC$YlC#$+ZpvYl-{y_ z@w(aF=%jvRcMw7E+7F(+w{cUq|L*fDq{xzX=!g zDqn?l{gt0T;p9BEGwiS_?Ae)3Cdw?cCt1W@?YSR4K}v0}ZEcVB7x%c61V&2#bUX9c z3gu>@>~atgq5y#*RDtV;xLR8>g>KPO%qSpP(mnCQUpT_8QF6|t^bc_WOZu62`RwVk Zqj+A$2%3cu)Uj%!=u}jRT1LDu{0nK?k5>Qy delta 605 zcmX|-&x;c=6vy*2nM|hhW2f!(*NSUdL=bvdFQV*+4XIZg& z5sIuiuE-2{^XQ-9#j^*`DxMU*31&tx58lfsFZsUr@;v_73@-;kjhJ<9eKh_l4#V!j zZ$n5BrbPaWAi*%5(!`P$lxNnICAPE^E_ual>Lfyn#FcJRlQkg9R^AGvuUzGu7$`Cc z^9|)sBD9egmaMCWs-v@_FC*DhkjJW7fNb3)cmUVQ4RVVN2?}(d5pD9r;t&k7f41&1S(rHw2(6#a|FQSNGo^B5903Zx9`Y-& zqt|>4_w+Zu(`Om&k=!oGKFb)IeP)?~#~I5x(gHxAbKWs)KAY?B&T&t=^Sf!9KA0^~ z_jzmUq>A8PuN*sTvtVz<0PjT5jK=(TukANxdSscyK3Fwk$^ c^QX3}q$@l{m6@YMzu8h7niGlF#rGn diff --git a/server_side/api/modules/__pycache__/voting_system.cpython-37.pyc b/server_side/api/modules/__pycache__/voting_system.cpython-37.pyc index dde0ccb827b566adac7c6c409c171f87475133b7..318b0634f6687d2e17f406a64c61eb23cae76643 100644 GIT binary patch delta 797 zcmZXR&ubGw6vyA2Np?4zY_j>CO{$<+4^@g5q^Y)uB2`2S)Eq(VqrrM z(Tf*b<|6dq20VF^_U6HpC;x=}DPHvLRx08S`+e{8zK8kF%%|3mmUGo{Y@l!V%ihEN zUB}y=LjVa9yC4oL3QU*@MwNAWFC|hKd%TDj{WWknW287enI z;V4@0} zKwUBWSk-UM$4~k+*}4@#gaHdtVgo!F<3QFF)-IY@_GVx8t5 zy~Pr|IK2ks@Fmi_fXNCBnUd+q)XUaN&6=dvH~U)?ODffmJHJfZ>d0EItWYy>NdOs^ zu!c=E^iS&w-qwqm2l!Qg$V}gij4^~bX8wMNff-UHnet%6^gjnIKB`Q|A&2~rXLt}; zAy48NX*!VP^T1&d0#kGQ1eyoa_8b-_#;d2@muirN@h|B0?5X($3gXYiaxs=OvE+}W z7A|}w zIhY5=kRf!KI-5ZOG4JrMPy%vKbgZte?5?Anf~}6*^_183mER3i08HCD9DtJA*OKN) zvvz4Xre!-u8=a9*<#UcpPDNLB8NI;)e;ccshT*ubjX+JTQ7ezwW46wyph5-b^Y#Dv zdklRH4jBg88wk}P4p9=zf)nBhOT?vuCv}KpTl@&pIUNnBbOU27kHkglKF0(rSRK)M z3!20lju#}`&EpmL4Nx~#pi)+>)UEuK-vCU!8G@R3LhPXGGU+b8eb$6j=-n-9V zq{MqG8S4W=gC%STBeu_9FJwFueU3a~0~o*^_N=)tkexZ1)fWhL$|Up#OYGGw9XQX4 zCDJDhijmo9p*?iWs<$HDv`QPDSerY$d*-KixAu^*7n3mH5W@sC!7~+q86KEbe*=D) zZ~mpZK8$$!wGWxor$*39*p{1qrq)>7MLTb8Uu2Fs^{2rx)4>cl$IHQWki}-{6n~fk(?#xTHA$<5n!=dH|(-@PA|pk`Dj? diff --git a/server_side/api/modules/databases/ratings.json b/server_side/api/modules/databases/ratings.json index 1231874..fdeafe3 100644 --- a/server_side/api/modules/databases/ratings.json +++ b/server_side/api/modules/databases/ratings.json @@ -27,6 +27,12 @@ "rater": "9vard12ty0ad2yvwp3q53rsf3h43r2vq", "score": 5, "note": null + }, + { + "id": 4, + "rater": "9vard12ty0ad2yvwp3q53rsf3h43r2vq", + "score": 3, + "note": "Not bad boiii" } ] } diff --git a/server_side/api/modules/databases/votings.json b/server_side/api/modules/databases/votings.json index 665ae40..2628a57 100644 --- a/server_side/api/modules/databases/votings.json +++ b/server_side/api/modules/databases/votings.json @@ -11,7 +11,7 @@ "1": { "name": "Sample Vote 1", "desc": "Sample description", - "votes": 1 + "votes": 3 }, "2": { "name": "Sample Vote 2",