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; ...@@ -3,6 +3,7 @@ package app.insti.fragment;
import android.Manifest; import android.Manifest;
import android.app.Activity; import android.app.Activity;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender; import android.content.IntentSender;
...@@ -33,10 +34,12 @@ import android.text.TextWatcher; ...@@ -33,10 +34,12 @@ import android.text.TextWatcher;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
...@@ -83,6 +86,7 @@ import app.insti.api.request.ComplaintCreateRequest; ...@@ -83,6 +86,7 @@ import app.insti.api.request.ComplaintCreateRequest;
import app.insti.api.request.ImageUploadRequest; import app.insti.api.request.ImageUploadRequest;
import app.insti.api.response.ComplaintCreateResponse; import app.insti.api.response.ComplaintCreateResponse;
import app.insti.api.response.ImageUploadResponse; import app.insti.api.response.ImageUploadResponse;
import app.insti.utils.CustomScrollView;
import app.insti.utils.TagCategories; import app.insti.utils.TagCategories;
import me.relex.circleindicator.CircleIndicator; import me.relex.circleindicator.CircleIndicator;
import retrofit2.Call; import retrofit2.Call;
...@@ -129,6 +133,12 @@ public class FileComplaintFragment extends Fragment { ...@@ -129,6 +133,12 @@ public class FileComplaintFragment extends Fragment {
private boolean GPSIsSetup = false; private boolean GPSIsSetup = false;
FusedLocationProviderClient mFusedLocationClient; FusedLocationProviderClient mFusedLocationClient;
ProgressDialog progressDialog; 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() { public FileComplaintFragment() {
// Required empty public constructor // Required empty public constructor
...@@ -175,6 +185,8 @@ public class FileComplaintFragment extends Fragment { ...@@ -175,6 +185,8 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = getArguments(); Bundle bundle = getArguments();
userId = bundle.getString(Constants.USER_ID); userId = bundle.getString(Constants.USER_ID);
/*mapLinearLayout = (LinearLayout) view.findViewById(R.id.mapLinearLayout);*/
prepareTags(); prepareTags();
progressDialog = new ProgressDialog(getContext()); progressDialog = new ProgressDialog(getContext());
...@@ -185,11 +197,15 @@ public class FileComplaintFragment extends Fragment { ...@@ -185,11 +197,15 @@ public class FileComplaintFragment extends Fragment {
getResources().getDisplayMetrics().heightPixels / 2 getResources().getDisplayMetrics().heightPixels / 2
); );
collapsing_toolbar = view.findViewById(R.id.collapsing_toolbar);
collapsing_toolbar.setVisibility(View.GONE);
imageViewHolder.setLayoutParams(layoutParams); imageViewHolder.setLayoutParams(layoutParams);
Toolbar toolbar = getActivity().findViewById(R.id.toolbar); Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
toolbar.setTitle("Add Complaint"); toolbar.setTitle("Add Complaint");
nestedScrollView = view.findViewById(R.id.nested_scrollview); nestedScrollView = view.findViewById(R.id.nested_scrollview);
layout_buttons = view.findViewById(R.id.layout_buttons); layout_buttons = view.findViewById(R.id.layout_buttons);
layout_buttons.setVisibility(View.GONE); layout_buttons.setVisibility(View.GONE);
...@@ -370,6 +386,8 @@ public class FileComplaintFragment extends Fragment { ...@@ -370,6 +386,8 @@ public class FileComplaintFragment extends Fragment {
} }
public void getMapReady() { public void getMapReady() {
/*mapLinearLayout.requestDisallowInterceptTouchEvent(true);*/
Log.i(TAG, "in getMapReady"); Log.i(TAG, "in getMapReady");
mMapView.getMapAsync(new OnMapReadyCallback() { mMapView.getMapAsync(new OnMapReadyCallback() {
@Override @Override
...@@ -400,6 +418,29 @@ public class FileComplaintFragment extends Fragment { ...@@ -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 { ...@@ -675,6 +716,7 @@ public class FileComplaintFragment extends Fragment {
Bundle bundle = data.getExtras(); Bundle bundle = data.getExtras();
Bitmap bitmap = (Bitmap) bundle.get("data"); Bitmap bitmap = (Bitmap) bundle.get("data");
base64Image = convertImageToString(bitmap); base64Image = convertImageToString(bitmap);
collapsing_toolbar.setVisibility(View.VISIBLE);
sendImage(); sendImage();
} else if (resultCode == Activity.RESULT_OK && requestCode == Constants.RESULT_LOAD_IMAGE && data != null) { } else if (resultCode == Activity.RESULT_OK && requestCode == Constants.RESULT_LOAD_IMAGE && data != null) {
...@@ -689,6 +731,7 @@ public class FileComplaintFragment extends Fragment { ...@@ -689,6 +731,7 @@ public class FileComplaintFragment extends Fragment {
String picturePath = cursor.getString(columnIndex); String picturePath = cursor.getString(columnIndex);
cursor.close(); cursor.close();
base64Image = convertImageToString(getScaledBitmap(picturePath, 800, 800)); base64Image = convertImageToString(getScaledBitmap(picturePath, 800, 800));
collapsing_toolbar.setVisibility(View.VISIBLE);
sendImage(); sendImage();
} }
} }
......
...@@ -39,22 +39,6 @@ ...@@ -39,22 +39,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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 <LinearLayout
android:id="@+id/linearLayoutAddImage" android:id="@+id/linearLayoutAddImage"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -66,7 +50,7 @@ ...@@ -66,7 +50,7 @@
android:id="@+id/imageViewAddImage" android:id="@+id/imageViewAddImage"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="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> </LinearLayout>
...@@ -91,7 +75,7 @@ ...@@ -91,7 +75,7 @@
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView <app.insti.utils.CustomScrollView
android:id="@+id/nested_scrollview" android:id="@+id/nested_scrollview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -187,10 +171,18 @@ ...@@ -187,10 +171,18 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:id="@+id/google_map" android:id="@+id/mapLinearLayout"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="200dp" /> 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 <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -204,13 +196,19 @@ ...@@ -204,13 +196,19 @@
android:background="#ccc" android:background="#ccc"
android:padding="10dp"> android:padding="10dp">
<TextView <RelativeLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
android:text="TAGS"
android:textColor="#4A4A4A" <TextView
android:textSize="16sp" android:layout_width="wrap_content"
android:textStyle="bold" /> android:layout_height="wrap_content"
android:text="TAGS"
android:textColor="#4A4A4A"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
...@@ -288,10 +286,27 @@ ...@@ -288,10 +286,27 @@
</LinearLayout> </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> </android.support.design.widget.CoordinatorLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_buttons" android:id="@+id/layout_buttons"
android:layout_width="match_parent" 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