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

View file

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

View file

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

View file

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