updated filters view on all screens

This commit is contained in:
Aran Zaiger 2016-07-10 14:02:13 +03:00
parent 9c10a0dc26
commit 2462975975
4 changed files with 42 additions and 50 deletions

View file

@ -50,14 +50,14 @@ public class ExploreFragment extends Fragment {
private ImageButton dateFilter;
private ImageButton locationFilter;
private ImageButton userFilter;
// private ImageButton userFilter;
private Button map_small_filter;
private Button map_medium_filter;
private Button map_large_filter;
private LinearLayout exploreFilters;
private boolean dateFilterIsVisible = false;
private boolean locationFilterIsVisible = false;
private boolean userFilterIsVisible = false;
// private boolean userFilterIsVisible = false;
private final String day = "24 hours";
private final String week = "Week";
@ -65,9 +65,9 @@ public class ExploreFragment extends Fragment {
private final String hundredMeters = "100 meters";
private final String kilometer = "1 Km";
private final String threeKilometer = "3 Km";
private final String mine = "Mine";
private final String others = "Others";
private final String all = "All";
// private final String mine = "Mine";
// private final String others = "Others";
// private final String all = "All";
public ExploreFragment() {
// Required empty public constructor
@ -91,7 +91,6 @@ public class ExploreFragment extends Fragment {
dateFilter = (ImageButton) view.findViewById(R.id.explore_date_filter);
locationFilter = (ImageButton) view.findViewById(R.id.explore_location_filter);
userFilter = (ImageButton) view.findViewById(R.id.explore_user_filter);
map_small_filter = (Button) view.findViewById(R.id.explore_small_filter);
map_medium_filter = (Button) view.findViewById(R.id.explore_medium_filter);
@ -109,7 +108,7 @@ public class ExploreFragment extends Fragment {
exploreFilters.setVisibility(View.VISIBLE);
dateFilterIsVisible = true;
locationFilterIsVisible = false;
userFilterIsVisible = false;
// userFilterIsVisible = false;
// set text button in the right filter string
map_small_filter.setText(day);
@ -129,7 +128,7 @@ public class ExploreFragment extends Fragment {
exploreFilters.setVisibility(View.VISIBLE);
locationFilterIsVisible = true;
dateFilterIsVisible = false;
userFilterIsVisible = false;
// userFilterIsVisible = false;
// set text button in the right filter string
map_small_filter.setText(hundredMeters);
@ -139,25 +138,25 @@ public class ExploreFragment extends Fragment {
}
});
userFilter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (userFilterIsVisible) {
userFilterIsVisible = false;
exploreFilters.setVisibility(View.GONE);
} else {
exploreFilters.setVisibility(View.VISIBLE);
userFilterIsVisible = true;
dateFilterIsVisible = false;
locationFilterIsVisible = false;
// set text button in the right filter string
map_small_filter.setText(mine);
map_medium_filter.setText(others);
map_large_filter.setText(all);
}
}
});
// userFilter.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (userFilterIsVisible) {
// userFilterIsVisible = false;
// exploreFilters.setVisibility(View.GONE);
// } else {
// exploreFilters.setVisibility(View.VISIBLE);
// userFilterIsVisible = true;
// dateFilterIsVisible = false;
// locationFilterIsVisible = false;
//
// // set text button in the right filter string
// map_small_filter.setText(mine);
// map_medium_filter.setText(others);
// map_large_filter.setText(all);
// }
// }
// });
// TODO: choose a default filter for openning explore mode

View file

@ -26,7 +26,7 @@
android:contextClickable="false" >
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/explore_date_filter"
android:layout_weight="1"
@ -34,7 +34,7 @@
android:scaleType="fitCenter" />
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/explore_location_filter"
android:layout_gravity="center_horizontal"
@ -42,13 +42,6 @@
android:scaleType="fitCenter"
android:src="@drawable/location_filter" />
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/explore_user_filter"
android:layout_weight="1"
android:scaleType="fitCenter"
android:src="@drawable/users_filter" />
</LinearLayout>
<LinearLayout
@ -61,21 +54,21 @@
android:id="@+id/explore_filter_options" >
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 1"
android:id="@+id/explore_small_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 2"
android:id="@+id/explore_medium_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 3"
android:id="@+id/explore_large_filter"

View file

@ -27,7 +27,7 @@
android:contextClickable="false">
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/map_date_filter"
android:layout_weight="1"
@ -35,7 +35,7 @@
android:scaleType="fitCenter" />
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/map_location_filter"
android:layout_gravity="center_horizontal"
@ -44,7 +44,7 @@
android:src="@drawable/location_filter" />
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/map_user_filter"
android:layout_weight="1"
@ -62,21 +62,21 @@
android:id="@+id/map_filter_options">
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 1"
android:id="@+id/map_small_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 2"
android:id="@+id/map_medium_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 3"
android:id="@+id/map_large_filter"

View file

@ -29,7 +29,7 @@
android:contextClickable="false" >
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/personalSpace_date_filter"
android:layout_weight="1"
@ -38,7 +38,7 @@
android:focusable="false" />
<ImageButton
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:id="@+id/personalSpace_premission_filter"
android:layout_weight="1"
@ -60,21 +60,21 @@
android:focusableInTouchMode="false">
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 1"
android:id="@+id/personalSpace_small_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 2"
android:id="@+id/personalSpace_medium_filter"
android:layout_weight="1" />
<Button
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="50dp"
android:text="filter 3"
android:id="@+id/personalSpace_large_filter"