Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS123-CanteeneoAndroid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Willard Torres
CS123-CanteeneoAndroid
Commits
50530e0f
Commit
50530e0f
authored
Dec 06, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add double seek bar for price range filtering
parent
e8a07c2a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
6 deletions
+22
-6
build.gradle
app/build.gradle
+1
-0
NavDrawerActivity.java
app/src/main/java/com/testapp/NavDrawerActivity.java
+4
-1
activity_nav_drawer.xml
app/src/main/res/layout/activity_nav_drawer.xml
+6
-5
attrs.xml
app/src/main/res/values/attrs.xml
+9
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/build.gradle
View file @
50530e0f
...
...
@@ -32,4 +32,5 @@ dependencies {
compile
'com.squareup.retrofit2:converter-gson:2.1.0'
compile
files
(
'libs/picasso-2.5.2.jar'
)
compile
'com.android.support:support-v4:23.2.1'
compile
'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
}
app/src/main/java/com/testapp/NavDrawerActivity.java
View file @
50530e0f
...
...
@@ -32,6 +32,8 @@ import android.widget.Toast;
import
com.testapp.entities.Dish
;
import
com.testapp.entities.Filter
;
import
org.florescu.android.rangeseekbar.RangeSeekBar
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -257,7 +259,8 @@ public class NavDrawerActivity extends AppCompatActivity implements NavigationVi
}
public
void
refreshDishes
()
{
adapter
.
filter
(
query
,
getChecked
(
R
.
id
.
type_checkboxes
),
getChecked
(
R
.
id
.
cuisine_checkboxes
),
getChecked
(
R
.
id
.
location_checkboxes
),
0
,
1000
);
RangeSeekBar
priceRangeBar
=
(
RangeSeekBar
)
findViewById
(
R
.
id
.
price_range_bar
);
adapter
.
filter
(
query
,
getChecked
(
R
.
id
.
type_checkboxes
),
getChecked
(
R
.
id
.
cuisine_checkboxes
),
getChecked
(
R
.
id
.
location_checkboxes
),
priceRangeBar
.
getSelectedMinValue
().
doubleValue
(),
priceRangeBar
.
getSelectedMaxValue
().
doubleValue
());
adapter
.
notifyDataSetChanged
();
System
.
out
.
println
(
adapter
.
filteredDishes
.
size
());
}
...
...
app/src/main/res/layout/activity_nav_drawer.xml
View file @
50530e0f
...
...
@@ -2,6 +2,7 @@
<android.support.v4.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:rsb=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -140,13 +141,13 @@
android:paddingTop=
"5dp"
android:paddingBottom=
"5dp"
/>
<SeekBar
<org.florescu.android.rangeseekbar.RangeSeekBar
android:id=
"@+id/price_range_bar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingLeft=
"20dip"
android:paddingRight=
"20dip"
android:max=
"150"
android:progress=
"1"
/>
rsb:textAboveThumbsColor=
"#000000"
rsb:absoluteMaxValue=
"300"
rsb:absoluteMinValue=
"0"
/>
<TextView
android:typeface=
"monospace"
...
...
app/src/main/res/values/attrs.xml
0 → 100644
View file @
50530e0f
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"RangeSeekBar"
>
<attr
name=
"absoluteMinValue"
format=
"integer|float"
/>
<attr
name=
"absoluteMaxValue"
format=
"integer|float"
/>
<attr
name=
"singleThumb"
format=
"boolean"
/>
</declare-styleable>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
50530e0f
...
...
@@ -21,6 +21,8 @@
<string
name=
"drawer_4"
>
Price Range
</string>
<string
name=
"drawer_5"
>
Locations
</string>
<string
name=
"apply_filter"
>
Apply Filters
</string>
<string
name=
"min_price"
>
Minimum
</string>
<string
name=
"max_price"
>
Maximum
</string>
<string
name=
"navigation_drawer_open"
>
Open navigation drawer
</string>
<string
name=
"navigation_drawer_close"
>
Close navigation drawer
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment