Commit a75556eb authored by Preetam Ozarde's avatar Preetam Ozarde

Merge remote-tracking branch 'origin/nss' into nss

# Conflicts:
#	app/src/main/java/app/insti/fragment/ComplaintFragment.java
#	app/src/main/java/app/insti/fragment/FileComplaintFragment.java
#	app/src/main/res/values/strings.xml
parents e64a590e ca4fe5b6
package app.insti.adapter;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
......@@ -14,7 +15,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -23,10 +26,15 @@ import java.util.List;
import java.util.TimeZone;
import app.insti.R;
import app.insti.Utils;
import app.insti.api.RetrofitInterface;
import app.insti.api.model.Venter;
import app.insti.fragment.ComplaintDetailsFragment;
import app.insti.utils.DateTimeUtil;
import app.insti.utils.GsonProvider;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Created by Shivam Sharma on 15-08-2018.
......@@ -45,14 +53,17 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
private CardView cardView;
private TextView textViewDescription;
private Button buttonComments;
private Button buttonVotes;
private ImageButton buttonComments;
private ImageButton buttonVotes;
private TextView textViewComments;
private TextView textViewVotes;
private TextView textViewLocation;
private TextView textViewUserName;
private TextView textViewReportDate;
private TextView textViewStatus;
private int pos;
private int voteCount = 0;
public ComplaintsViewHolder(View currentView) {
super(currentView);
......@@ -64,9 +75,11 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
textViewDescription = currentView.findViewById(R.id.textViewDescription);
buttonComments = currentView.findViewById(R.id.buttonComments);
buttonVotes = currentView.findViewById(R.id.buttonVotes);
textViewComments = currentView.findViewById(R.id.text_comments);
textViewVotes = currentView.findViewById(R.id.text_votes);
}
public void bindHolder(int position) {
public void bindHolder(final int position) {
this.pos = position;
Log.i(TAG, "json = " + GsonProvider.getGsonOutput().toJson(complaintList.get(pos)));
cardView.setOnClickListener(new View.OnClickListener() {
......@@ -90,20 +103,61 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
textViewUserName.setText(complaint.getComplaintCreatedBy().getUserName());
textViewStatus.setText(complaint.getStatus().toUpperCase());
if (complaint.getStatus().equalsIgnoreCase("Reported")) {
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorRed));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.colorRed)));
textViewStatus.setTextColor(context.getResources().getColor(R.color.primaryTextColor));
} else if (complaint.getStatus().equalsIgnoreCase("In Progress")) {
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorSecondary));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.colorSecondary)));
textViewStatus.setTextColor(context.getResources().getColor(R.color.secondaryTextColor));
} else if (complaint.getStatus().equalsIgnoreCase("Resolved")) {
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorGreen));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.colorGreen)));
textViewStatus.setTextColor(context.getResources().getColor(R.color.secondaryTextColor));
}
String time = DateTimeUtil.getDate(complaint.getComplaintReportDate().toString());
String time = DateTimeUtil.getDate(complaint.getComplaintReportDate());
Log.i(TAG, "time: " + time);
textViewReportDate.setText(time);
buttonComments.setText("COMMENTS(" + complaint.getComment().size() + ")");
buttonVotes.setText("UP VOTES(" + complaint.getUsersUpVoted().size() + ")");
textViewComments.setText(String.valueOf(complaint.getComment().size()));
textViewVotes.setText(String.valueOf(complaint.getUsersUpVoted().size()));
buttonComments.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("id", complaintList.get(pos).getComplaintID());
bundle.putString("sessionId", sessionID);
bundle.putString("userId", userID);
ComplaintDetailsFragment complaintDetailsFragment = new ComplaintDetailsFragment();
complaintDetailsFragment.setArguments(bundle);
AppCompatActivity activity = (AppCompatActivity) context;
activity.getSupportFragmentManager().beginTransaction().replace(R.id.framelayout_for_fragment, complaintDetailsFragment).addToBackStack(TAG).commit();
}
});
buttonVotes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (voteCount == 0) {
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.upVote("sessionid=" + sessionID, complaintList.get(pos).getComplaintID()).enqueue(new Callback<Venter.Complaint>() {
@Override
public void onResponse(Call<Venter.Complaint> call, Response<Venter.Complaint> response) {
if (response.isSuccessful()) {
Venter.Complaint complaint = response.body();
if (complaint != null) {
textViewVotes.setText(String.valueOf(complaint.getUsersUpVoted().size()));
}
Toast.makeText(context, "You have Up Voted this complaint", Toast.LENGTH_SHORT).show();
voteCount++;
}
}
@Override
public void onFailure(Call<Venter.Complaint> call, Throwable t) {
Log.i(TAG, "failure in up vote: " + t.toString());
}
});
} else {
Toast.makeText(context, "You have already UpVoted this complaint", Toast.LENGTH_SHORT).show();
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -39,7 +39,6 @@ public class ComplaintFragment extends BaseFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_complaint, container, false);
Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
......@@ -64,7 +63,7 @@ public class ComplaintFragment extends BaseFragment {
fileComplaintFragment.setArguments(getArguments());
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.framelayout_for_fragment, fileComplaintFragment, fileComplaintFragment.getTag());
fragmentTransaction.addToBackStack("ComplaintFragment").commit();
fragmentTransaction.addToBackStack("Complaint Fragment").commit();
}
});
......
package app.insti.fragment;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
......@@ -182,14 +183,14 @@ public class DetailedComplaintFragment extends Fragment {
textViewDescription.setText(detailedComplaint.getDescription());
textViewStatus.setText(detailedComplaint.getStatus().toUpperCase());
if (detailedComplaint.getStatus().equalsIgnoreCase("Reported")) {
textViewStatus.setBackgroundColor(Color.parseColor("#FF0000"));
textViewStatus.setTextColor(getResources().getColor(R.color.primaryTextColor));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(getContext().getResources().getColor(R.color.colorRed)));
textViewStatus.setTextColor(getContext().getResources().getColor(R.color.primaryTextColor));
} else if (detailedComplaint.getStatus().equalsIgnoreCase("In Progress")) {
textViewStatus.setBackgroundColor(getResources().getColor(R.color.colorSecondary));
textViewStatus.setTextColor(getResources().getColor(R.color.secondaryTextColor));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(getContext().getResources().getColor(R.color.colorSecondary)));
textViewStatus.setTextColor(getContext().getResources().getColor(R.color.secondaryTextColor));
} else if (detailedComplaint.getStatus().equalsIgnoreCase("Resolved")) {
textViewStatus.setBackgroundColor(Color.parseColor("#00FF00"));
textViewStatus.setTextColor(getResources().getColor(R.color.secondaryTextColor));
textViewStatus.setBackgroundTintList(ColorStateList.valueOf(getContext().getResources().getColor(R.color.colorGreen)));
textViewStatus.setTextColor(getContext().getResources().getColor(R.color.secondaryTextColor));
}
textViewCommentLabel.setText("COMMENTS");
textViewVoteUpLabel.setText("UP VOTES");
......
......@@ -10,7 +10,6 @@ import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
......@@ -18,7 +17,6 @@ import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
......@@ -39,6 +37,7 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.Toast;
......@@ -98,10 +97,11 @@ public class FileComplaintFragment extends Fragment {
private static final String TAG = FileComplaintFragment.class.getSimpleName();
private static FileComplaintFragment mainactivity;
private Button buttonSubmit;
private FloatingActionButton floatingActionButton;
private ImageButton imageActionButton;
private CustomAutoCompleteTextView autoCompleteTextView;
private EditText editTextSuggestions;
private EditText editTextTags;
private EditText editTextLocationDetails;
private MapView mMapView;
GoogleMap googleMap;
private TagView tagView;
......@@ -121,7 +121,7 @@ public class FileComplaintFragment extends Fragment {
private ViewPager viewPager;
private CircleIndicator indicator;
private Button buttonAnalysis;
private LinearLayout layout_buttons;
private RelativeLayout layout_buttons;
String userId;
View view;
NestedScrollView nestedScrollView;
......@@ -129,6 +129,8 @@ public class FileComplaintFragment extends Fragment {
private boolean GPSIsSetup = false;
FusedLocationProviderClient mFusedLocationClient;
ProgressDialog progressDialog;
CollapsingToolbarLayout collapsing_toolbar;
LinearLayout linearLayoutAnalyse;
public FileComplaintFragment() {
// Required empty public constructor
......@@ -148,12 +150,6 @@ public class FileComplaintFragment extends Fragment {
ft.commit();
}
@Override
public void onStart() {
super.onStart();
Toast.makeText(getContext(), getString(R.string.initial_message_file_complaint), Toast.LENGTH_SHORT).show();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
mainactivity = this;
......@@ -175,6 +171,8 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = getArguments();
userId = bundle.getString(Constants.USER_ID);
Toast.makeText(getContext(), getString(R.string.initial_message_file_complaint), Toast.LENGTH_LONG).show();
prepareTags();
progressDialog = new ProgressDialog(getContext());
......@@ -185,11 +183,16 @@ public class FileComplaintFragment extends Fragment {
getResources().getDisplayMetrics().heightPixels / 2
);
collapsing_toolbar = view.findViewById(R.id.collapsing_toolbar);
collapsing_toolbar.setVisibility(View.GONE);
imageViewHolder.setLayoutParams(layoutParams);
Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
toolbar.setTitle("Add Complaint");
nestedScrollView = view.findViewById(R.id.nested_scrollview);
linearLayoutAnalyse = view.findViewById(R.id.layoutAnalyse);
layout_buttons = view.findViewById(R.id.layout_buttons);
layout_buttons.setVisibility(View.GONE);
......@@ -205,15 +208,15 @@ public class FileComplaintFragment extends Fragment {
viewPager = view.findViewById(R.id.complaint_image_view_pager);
indicator = view.findViewById(R.id.indicator);
linearLayoutAddImage = view.findViewById(R.id.linearLayoutAddImage);
floatingActionButton = view.findViewById(R.id.fabButton);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
imageActionButton = view.findViewById(R.id.fabButton);
imageActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
giveOptionsToAddImage();
}
});
ImageButton imageButtonAddTags = (ImageButton) view.findViewById(R.id.imageButtonAddTags);
autoCompleteTextView = (CustomAutoCompleteTextView) view.findViewById(R.id.dynamicAutoCompleteTextView);
......@@ -223,6 +226,10 @@ public class FileComplaintFragment extends Fragment {
if (!hasFocus) {
if (!(autoCompleteTextView.getText().toString().trim().isEmpty())) {
int paddingDp = 60;
float density = getContext().getResources().getDisplayMetrics().density;
int paddingPixel = (int) (paddingDp * density);
linearLayoutAnalyse.setPadding(0, 0, 0, paddingPixel);
layout_buttons.setVisibility(View.VISIBLE);
buttonSubmit.setVisibility(View.VISIBLE);
} else {
......@@ -238,6 +245,8 @@ public class FileComplaintFragment extends Fragment {
editTextSuggestions = view.findViewById(R.id.editTextSuggestions);
editTextLocationDetails = view.findViewById(R.id.editTextLocationDetails);
editTextTags = view.findViewById(R.id.editTextTags);
editTextTags.addTextChangedListener(new TextWatcher() {
......@@ -370,6 +379,7 @@ public class FileComplaintFragment extends Fragment {
}
public void getMapReady() {
Log.i(TAG, "in getMapReady");
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
......@@ -399,6 +409,27 @@ public class FileComplaintFragment extends Fragment {
return false;
}
});
mFusedLocationClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
// Got last known location. In some rare situations this can be null.
if (location != null) {
// Logic to handle location object
Log.i(TAG, "lat = " + location.getLatitude() + " lon = " + location.getLongitude());
Location = new LatLng(location.getLatitude(), location.getLongitude());
updateMap(Location, "Current Location", location.getLatitude() + ", " + location.getLongitude(), cursor);
} else {
Toast.makeText(getContext(), getString(R.string.getting_current_location), Toast.LENGTH_SHORT).show();
}
}
});
mFusedLocationClient.getLastLocation().addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
e.printStackTrace();
}
});
}
}
});
......@@ -529,16 +560,20 @@ public class FileComplaintFragment extends Fragment {
}
private void populateTags(String cs) {
tagList2.add(new TagClass(cs));
ArrayList<Tag> tags = new ArrayList<>();
Tag tag;
for (int i = 0; i < tagList2.size(); i++) {
tag = new Tag(tagList2.get(i).getName());
tag.radius = 10f;
tag.isDeletable = true;
tags.add(tag);
if (!(cs.isEmpty())) {
tagList2.add(new TagClass(cs));
ArrayList<Tag> tags = new ArrayList<>();
Tag tag;
for (int i = 0; i < tagList2.size(); i++) {
tag = new Tag(tagList2.get(i).getName());
tag.radius = 10f;
tag.isDeletable = true;
tags.add(tag);
}
tagView.addTags(tags);
} else {
Toast.makeText(getContext(), "Please enter some tags", Toast.LENGTH_SHORT).show();
}
tagView.addTags(tags);
}
private void setTags(CharSequence cs) {
......@@ -581,18 +616,68 @@ public class FileComplaintFragment extends Fragment {
}
private void addComplaint() {
String complaint = "Complaint: " + autoCompleteTextView.getText().toString();
String suggestion = null;
final String complaint = "Complaint: " + autoCompleteTextView.getText().toString();
final String suggestion;
final String locationDetails;
Log.i(TAG, "Suggestion: " + editTextSuggestions.getText().toString());
if (!(editTextSuggestions.getText().toString().isEmpty())) {
suggestion = "\nSuggestion: " + editTextSuggestions.getText().toString();
} else {
suggestion = "";
}
if (!(editTextLocationDetails.getText().toString().isEmpty())) {
locationDetails = "\nLocation Details: " + editTextLocationDetails.getText().toString();
} else {
locationDetails = "";
}
if (Location == null) {
Toast.makeText(getContext(), "Please specify the location", Toast.LENGTH_LONG).show();
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response!
new AlertDialog.Builder(getContext())
.setTitle("Location Needed")
.setMessage("You have not specified your location. The app will by default make \"IIT Area\" as your location.")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Location = new LatLng(19.133810, 72.913257);
Address = "IIT Area";
ComplaintCreateRequest complaintCreateRequest = new ComplaintCreateRequest(complaint + suggestion + locationDetails, Address, (float) Location.latitude, (float) Location.longitude, Tags, uploadedImagesUrl);
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.postComplaint("sessionid=" + getArguments().getString(Constants.SESSION_ID), complaintCreateRequest).enqueue(new Callback<ComplaintCreateResponse>() {
@Override
public void onResponse(Call<ComplaintCreateResponse> call, Response<ComplaintCreateResponse> response) {
Toast.makeText(getContext(), "Complaint successfully posted", Toast.LENGTH_LONG).show();
Bundle bundle = getArguments();
bundle.putString(Constants.USER_ID, userId);
ComplaintFragment complaintFragment = new ComplaintFragment();
complaintFragment.setArguments(bundle);
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.replace(R.id.framelayout_for_fragment, complaintFragment, complaintFragment.getTag());
transaction.addToBackStack(complaintFragment.getTag());
manager.popBackStackImmediate("Complaint Fragment", FragmentManager.POP_BACK_STACK_INCLUSIVE);
transaction.commit();
}
@Override
public void onFailure(Call<ComplaintCreateResponse> call, Throwable t) {
Log.i(TAG, "failure in addComplaint: " + t.toString());
Toast.makeText(getContext(), "Complaint Creation Failed", Toast.LENGTH_SHORT).show();
}
});
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getContext(), "Submission aborted", Toast.LENGTH_SHORT).show();
dialog.cancel();
}
})
.create()
.show();
} else {
ComplaintCreateRequest complaintCreateRequest = new ComplaintCreateRequest(complaint + suggestion, Address, (float) Location.latitude, (float) Location.longitude, Tags, uploadedImagesUrl);
ComplaintCreateRequest complaintCreateRequest = new ComplaintCreateRequest(complaint + suggestion + locationDetails, Address, (float) Location.latitude, (float) Location.longitude, Tags, uploadedImagesUrl);
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.postComplaint("sessionid=" + getArguments().getString(Constants.SESSION_ID), complaintCreateRequest).enqueue(new Callback<ComplaintCreateResponse>() {
@Override
......@@ -606,7 +691,7 @@ public class FileComplaintFragment extends Fragment {
FragmentTransaction transaction = manager.beginTransaction();
transaction.replace(R.id.framelayout_for_fragment, complaintFragment, complaintFragment.getTag());
transaction.addToBackStack(complaintFragment.getTag());
manager.popBackStackImmediate("ComplaintFragment", FragmentManager.POP_BACK_STACK_INCLUSIVE);
manager.popBackStackImmediate("Complaint Fragment", FragmentManager.POP_BACK_STACK_INCLUSIVE);
transaction.commit();
}
......@@ -677,6 +762,7 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = data.getExtras();
Bitmap bitmap = (Bitmap) bundle.get("data");
base64Image = convertImageToString(bitmap);
collapsing_toolbar.setVisibility(View.VISIBLE);
sendImage();
} else if (resultCode == Activity.RESULT_OK && requestCode == Constants.RESULT_LOAD_IMAGE && data != null) {
......@@ -691,6 +777,7 @@ public class FileComplaintFragment extends Fragment {
String picturePath = cursor.getString(columnIndex);
cursor.close();
base64Image = convertImageToString(getScaledBitmap(picturePath, 800, 800));
collapsing_toolbar.setVisibility(View.VISIBLE);
sendImage();
}
}
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M21.99,4c0,-1.1 -0.89,-2 -1.99,-2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4 -0.01,-18zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/>
</vector>
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="20dp"/>
<!--<padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>-->
<stroke android:width="1dp" android:color="@color/colorPrimary"/>
</shape>
\ No newline at end of file
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -17,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
android:padding="15dp">
<LinearLayout
android:layout_width="match_parent"
......@@ -43,7 +42,8 @@
android:text="status"
android:textColor="@android:color/black"
android:textSize="16sp"
android:textStyle="bold" />
android:textStyle="bold"
android:background="@drawable/customborder" />
</LinearLayout>
......@@ -51,6 +51,7 @@
android:id="@+id/textViewReportDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="report date"
android:textColor="@color/colorGray"
android:textSize="14sp" />
......@@ -58,6 +59,7 @@
android:id="@+id/textViewLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="location"
android:textColor="@color/colorGray"
android:textSize="14sp" />
......@@ -69,31 +71,69 @@
android:id="@+id/textViewDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="location"
android:textColor="@android:color/black"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:weightSum="2">
android:layout_gravity="center_horizontal"
android:paddingStart="50dp"
android:paddingEnd="20dp"
android:weightSum="2"
android:background="@drawable/customborder">
<Button
android:id="@+id/buttonComments"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#12C1D6"
android:textColor="@color/colorWhite" />
android:weightSum="2">
<ImageButton
android:id="@+id/buttonComments"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="10dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/baseline_comment_24" />
<TextView
android:id="@+id/text_comments"
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="@color/secondaryTextColor"
android:layout_weight="1"
android:text="12"/>
</LinearLayout>
<Button
android:id="@+id/buttonVotes"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/black"
android:textColor="@color/colorWhite" />
android:weightSum="2">
<ImageButton
android:id="@+id/buttonVotes"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="10dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/baseline_arrow_upward_24" />
<TextView
android:id="@+id/text_votes"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="23"
android:textColor="@color/secondaryTextColor"/>
</LinearLayout>
</LinearLayout>
......
......@@ -71,23 +71,25 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="2"
android:layout_gravity="bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="@+id/buttonVoteUp"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:textColor="@color/secondaryTextColor"
android:background="@color/colorSecondary"
android:text="Upvote"
android:layout_weight="2"/>
</LinearLayout>
<Button
android:id="@+id/buttonVoteUp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:textColor="@color/secondaryTextColor"
android:background="@color/colorSecondary"
android:text="Upvote"
android:layout_weight="2"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
......@@ -9,7 +9,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="60dp">
<LinearLayout
android:layout_width="match_parent"
......@@ -43,7 +45,8 @@
android:paddingHorizontal="10dp"
android:text="STATUS"
android:textSize="16sp"
android:textStyle="bold" />
android:textStyle="bold"
android:background="@drawable/customborder"/>
</LinearLayout>
</LinearLayout>
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linear_layout_file_complaint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
......@@ -39,37 +38,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|end"
android:layout_marginEnd="20dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_add_a_photo_black_24dp"
app:backgroundTint="@color/colorSecondary"
app:borderWidth="0dp"
app:fabSize="normal"
app:layout_anchorGravity="bottom|end" />
<LinearLayout
android:id="@+id/linearLayoutAddImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/imageViewAddImage"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/baseline_photo_size_select_actual_black_48"/>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/complaint_image_view_pager"
android:layout_width="match_parent"
......@@ -108,14 +76,17 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:paddingHorizontal="5dp"
android:weightSum="10">
<android.support.design.widget.TextInputLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/editTextIncCreditScoreLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="8"
app:hintTextAppearance="@style/edit_text_hint_apperarance">
<app.insti.CustomAutoCompleteTextView
......@@ -130,6 +101,7 @@
android:textColor="@android:color/black"
android:textColorHint="#4a4a4a"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
<ProgressBar
......@@ -137,13 +109,24 @@
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_gravity="right|center_vertical"
android:visibility="gone" />
</FrameLayout>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/fabButton"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_weight="1"
style="@style/Widget.AppCompat.Button.Borderless"
android:src="@drawable/ic_add_a_photo_black_24dp" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:paddingHorizontal="5dp">
<android.support.design.widget.TextInputLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
......@@ -156,7 +139,6 @@
android:layout_height="wrap_content"
android:gravity="top"
android:hint="@string/enter_suggestions_if_any"
android:imeOptions="flagNoExtractUi|actionSearch"
android:inputType="textMultiLine"
android:minLines="3"
android:textColor="@android:color/black"
......@@ -166,10 +148,37 @@
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="5dp">
<android.support.design.widget.TextInputLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/edit_text_hint_apperarance">
<EditText
android:id="@+id/editTextLocationDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:hint="@string/enter_location_details"
android:inputType="textMultiLine"
android:minLines="3"
android:textColor="@android:color/black"
android:textColorHint="#4a4a4a"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
</FrameLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5sp">
android:layout_margin="5sp"
android:paddingHorizontal="5dp">
<fragment
android:id="@+id/place_autocomplete_fragment"
......@@ -184,56 +193,32 @@
<LinearLayout
android:id="@+id/layoutAnalyse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/google_map"
android:layout_width="match_parent"
android:layout_height="200dp" />
android:layout_height="300dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ccc"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TAGS"
android:textColor="#4A4A4A"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="7dp" />
<com.cunoraz.tagview.TagView
android:id="@+id/tag_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp" />
<View
android:layout_width="match_parent"
android:layout_height="7dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="5dp"
android:weightSum="100">
<android.support.design.widget.TextInputLayout
......@@ -247,7 +232,7 @@
android:id="@+id/editTextTags"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Add more Tags"
android:hint="Add Tags"
android:inputType="text"
android:textColor="@android:color/black"
android:textColorHint="#66000000"
......@@ -257,10 +242,11 @@
<ImageButton
android:id="@+id/imageButtonAddTags"
android:layout_width="wrap_content"
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_weight="10"
app:srcCompat="@android:drawable/ic_input_add" />
style="@style/Widget.AppCompat.Button.Borderless"
app:srcCompat="@drawable/ic_add_black_24dp" />
</LinearLayout>
......@@ -290,33 +276,36 @@
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:id="@+id/layout_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="@+id/button_analysis"
<RelativeLayout
android:id="@+id/layout_buttons"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="ANALYSIS"
android:textColor="@color/colorWhite" />
<Button
android:id="@+id/buttonSubmit"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorSecondary"
android:text="SUBMIT"
android:textColor="@color/secondaryTextColor" />
android:layout_height="wrap_content"
android:backgroundTintMode="screen"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="2"
android:layout_gravity="bottom">
<Button
android:id="@+id/button_analysis"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="ANALYSIS"
android:textColor="@color/colorWhite" />
<Button
android:id="@+id/buttonSubmit"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorSecondary"
android:text="SUBMIT"
android:textColor="@color/secondaryTextColor" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
\ No newline at end of file
......@@ -49,4 +49,5 @@
<string name="GPS_not_enables">GPS is not enabled!</string>
<string name="no_permission">No permission!</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="enter_location_details">Enter Location Details</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment