info icon at toolbar + clean up

This commit is contained in:
Domagalski 2018-12-16 00:13:49 +01:00
parent 672a6bee06
commit dee33a2ec3
6 changed files with 1 additions and 28 deletions

View File

@ -323,7 +323,6 @@ public abstract class BaseActivity
}
if (item.getItemId()==R.id.action_info){
int layoutID;
switch (activeFragment){
case SHARED_PREFERENCES:
@ -344,19 +343,11 @@ public abstract class BaseActivity
popupWindow.setFocusable(true);
// If you need the PopupWindow to dismiss when when touched outside
popupWindow.setBackgroundDrawable(new ColorDrawable());
int location[] = new int[2];
// Get the View's(the one that was clicked in the Fragment) location
View anchorView= getWindow().getDecorView().findViewById(android.R.id.content);
anchorView.getLocationOnScreen(location);
// Using location, the PopupWindow will be displayed right under anchorView
// popupWindow.showAsDropDown(anchorView,6,170,Gravity.RIGHT|Gravity.CENTER);
popupWindow.showAtLocation(anchorView,Gravity.TOP|Gravity.RIGHT, 0, 0);
// popupWindow.showAtLocation(anchorView, Gravity.NO_GRAVITY,
// location[0] + anchorView.getWidth() / 2, location[1] + anchorView.getHeight());
popupWindow.showAtLocation(anchorView,Gravity.TOP|Gravity.END, 0, 0);
}
return super.onOptionsItemSelected(item);
}

View File

@ -131,8 +131,6 @@ public class MapActivity extends BaseActivity
};
findViewById(R.id.mapInfoImageButton).setOnClickListener(v-> InfoHelperUtils.infoPopUp(v, R.layout.info_popup_map));
selectLocationButton = findViewById(R.id.select_location_button);
removeLocationButton = findViewById(R.id.remove_location_button);
mapView = findViewById(R.id.mapView);

View File

@ -84,7 +84,6 @@ public class UsersListFragment extends Fragment {
public void onViewCreated(View view, Bundle savedInstanceState) {
ButterKnife.bind(this, view);
view.findViewById(R.id.userListInfoImageButton).setOnClickListener(v -> InfoHelperUtils.infoPopUp(v,R.layout.info_popup_userlist));
userService = ApiClient.getClient(getApplicationContext())
.create(UserService.class);

View File

@ -20,12 +20,6 @@
</com.mapbox.mapboxsdk.maps.MapView>
<ImageButton
android:id="@+id/mapInfoImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
mapbox:srcCompat="@drawable/outline_info_24"/>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"

View File

@ -6,8 +6,6 @@
android:fontFamily="@font/lato_regular"
android:layout_height="match_parent">
<com.uam.wmi.findmytutor.utils.SharingInfoPopupButtonPreference/>
<PreferenceCategory
android:title="@string/settings_category_location"
android:key="category_sharing">

View File

@ -10,13 +10,6 @@
<include layout="@layout/users_list_main" />
<ImageButton
android:id="@+id/userListInfoImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
mapbox:srcCompat="@drawable/outline_info_24"/>
</android.support.design.widget.CoordinatorLayout>