Commit feeda2e0 authored by sshivam95's avatar sshivam95

Venter: Change the style of the app with relative to InstiAPP theme. Change...

Venter: Change the style of the app with relative to InstiAPP theme. Change comment and up vote buttons.
parent 8385ec05
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();
}
......
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");
......
......@@ -3,7 +3,6 @@ package app.insti.fragment;
import android.Manifest;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
......@@ -11,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;
......@@ -19,8 +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.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
......@@ -35,14 +31,13 @@ import android.text.TextWatcher;
import android.util.Base64;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.Toast;
......@@ -87,7 +82,6 @@ import app.insti.api.request.ComplaintCreateRequest;
import app.insti.api.request.ImageUploadRequest;
import app.insti.api.response.ComplaintCreateResponse;
import app.insti.api.response.ImageUploadResponse;
import app.insti.utils.CustomScrollView;
import app.insti.utils.TagCategories;
import me.relex.circleindicator.CircleIndicator;
import retrofit2.Call;
......@@ -103,7 +97,7 @@ 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;
......@@ -127,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;
......@@ -136,7 +130,7 @@ public class FileComplaintFragment extends Fragment {
FusedLocationProviderClient mFusedLocationClient;
ProgressDialog progressDialog;
CollapsingToolbarLayout collapsing_toolbar;
LinearLayout linear_layout_file_complaint;
LinearLayout linearLayoutAnalyse;
public FileComplaintFragment() {
// Required empty public constructor
......@@ -156,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;
......@@ -183,7 +171,7 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = getArguments();
userId = bundle.getString(Constants.USER_ID);
/*mapLinearLayout = (LinearLayout) view.findViewById(R.id.mapLinearLayout);*/
Toast.makeText(getContext(), getString(R.string.initial_message_file_complaint), Toast.LENGTH_LONG).show();
prepareTags();
......@@ -204,6 +192,7 @@ public class FileComplaintFragment extends Fragment {
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);
......@@ -219,12 +208,9 @@ 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);
linear_layout_file_complaint = view.findViewById(R.id.linear_layout_file_complaint);
floatingActionButton = view.findViewById(R.id.fabButton);
floatingActionButton.show();
floatingActionButton.setOnClickListener(new View.OnClickListener() {
imageActionButton = view.findViewById(R.id.fabButton);
imageActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
giveOptionsToAddImage();
......@@ -240,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 {
......@@ -339,7 +329,6 @@ public class FileComplaintFragment extends Fragment {
// ends here
tagView = view.findViewById(R.id.tag_view);
tagView.setOnTagDeleteListener(new TagView.OnTagDeleteListener() {
......@@ -421,6 +410,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();
}
});
}
}
});
......@@ -551,16 +561,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) {
......@@ -605,9 +619,9 @@ public class FileComplaintFragment extends Fragment {
}
private void addComplaint() {
String complaint = "Complaint: " + autoCompleteTextView.getText().toString();
String suggestion = null;
String locationDetails = 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();
......@@ -620,31 +634,73 @@ public class FileComplaintFragment extends Fragment {
locationDetails = "";
}
if (Location == null) {
Location = new LatLng(19.1208, 72.9014);
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.commit();
}
// 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.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 + 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.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();
}
});
@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();
}
});
}
}
private void updateMap(LatLng Location, String Name, String Address, int cursor) {
......
<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,21 +38,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<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"
......@@ -92,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
......@@ -114,6 +101,7 @@
android:textColor="@android:color/black"
android:textColorHint="#4a4a4a"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
<ProgressBar
......@@ -121,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"
......@@ -140,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"
......@@ -150,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"
......@@ -168,47 +193,19 @@
<LinearLayout
android:id="@+id/layoutAnalyse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/mapLinearLayout"
android:layout_width="wrap_content"
android:layout_height="300dp"
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="300dp" />
</LinearLayout>
<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="300dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical">
<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:imeOptions="flagNoExtractUi|actionSearch"
android:inputType="textMultiLine"
android:minLines="3"
android:textColor="@android:color/black"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
<com.cunoraz.tagview.TagView
android:id="@+id/tag_view"
android:layout_width="match_parent"
......@@ -221,6 +218,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="5dp"
android:weightSum="100">
<android.support.design.widget.TextInputLayout
......@@ -244,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>
......@@ -263,9 +262,7 @@
android:id="@+id/tag_populate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:focusable="true"
android:focusableInTouchMode="true"/>
android:layout_margin="10dp" />
</ScrollView>
......@@ -279,49 +276,36 @@
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabButton"
android:layout_width="wrap_content"
<RelativeLayout
android:id="@+id/layout_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
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" />
</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">
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" />
<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" />
</RelativeLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
\ No newline at end of file
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