Commit 09b0c46d authored by Preetam Ozarde's avatar Preetam Ozarde

Toolbar visibility and FAB Button changes

parent 241cf8e3
......@@ -3,6 +3,7 @@ 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;
......@@ -33,10 +34,12 @@ 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.ScrollView;
......@@ -83,6 +86,7 @@ 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;
......@@ -129,6 +133,12 @@ public class FileComplaintFragment extends Fragment {
private boolean GPSIsSetup = false;
FusedLocationProviderClient mFusedLocationClient;
ProgressDialog progressDialog;
int GLOBAL_TOUCH_POSITION_X = 0;
int GLOBAL_TOUCH_CURRENT_POSITION_X = 0;
boolean isMaptouched = true;
boolean isBlockedScrollView = false;
LinearLayout mapLinearLayout;
CollapsingToolbarLayout collapsing_toolbar;
public FileComplaintFragment() {
// Required empty public constructor
......@@ -175,6 +185,8 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = getArguments();
userId = bundle.getString(Constants.USER_ID);
/*mapLinearLayout = (LinearLayout) view.findViewById(R.id.mapLinearLayout);*/
prepareTags();
progressDialog = new ProgressDialog(getContext());
......@@ -185,11 +197,15 @@ 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);
layout_buttons = view.findViewById(R.id.layout_buttons);
layout_buttons.setVisibility(View.GONE);
......@@ -370,6 +386,8 @@ public class FileComplaintFragment extends Fragment {
}
public void getMapReady() {
/*mapLinearLayout.requestDisallowInterceptTouchEvent(true);*/
Log.i(TAG, "in getMapReady");
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
......@@ -400,6 +418,29 @@ public class FileComplaintFragment extends Fragment {
}
});
}
/*googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
@Override
public void onCameraIdle() {
Log.e(TAG,"==camera idle=="+ googleMap.getCameraPosition().target);
}
});
googleMap.setOnCameraMoveStartedListener(new GoogleMap.OnCameraMoveStartedListener() {
@Override
public void onCameraMoveStarted(int reason) {
if (reason ==REASON_GESTURE) {
isMaptouched = true;
Toast.makeText(getActivity(), "The user gestured on the map.",
Toast.LENGTH_SHORT).show();
} else if (reason ==REASON_API_ANIMATION) {
Toast.makeText(getActivity(), "The user tapped something on the map.",
Toast.LENGTH_SHORT).show();
} else if (reason ==REASON_DEVELOPER_ANIMATION) {
Toast.makeText(getActivity(), "The app moved the camera.",
Toast.LENGTH_SHORT).show();
}
}
});*/
}
});
}
......@@ -675,6 +716,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) {
......@@ -689,6 +731,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();
}
}
......
......@@ -39,22 +39,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"
......@@ -66,7 +50,7 @@
android:id="@+id/imageViewAddImage"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/baseline_photo_size_select_actual_black_48"/>
android:src="@drawable/baseline_photo_size_select_actual_black_48" />
</LinearLayout>
......@@ -91,7 +75,7 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
<app.insti.utils.CustomScrollView
android:id="@+id/nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -187,10 +171,18 @@
android:layout_height="wrap_content"
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" />
<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>
<LinearLayout
android:layout_width="match_parent"
......@@ -204,13 +196,19 @@
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" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TAGS"
android:textColor="#4A4A4A"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
......@@ -288,10 +286,27 @@
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</app.insti.utils.CustomScrollView>
<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_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:padding="100dp"/>
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:id="@+id/layout_buttons"
android:layout_width="match_parent"
......
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