Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
e02df0a9
Commit
e02df0a9
authored
Jul 15, 2017
by
Sajal Narang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/unstablebrainiac/IITB-App
parents
73569367
a014c432
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
279 additions
and
2 deletions
+279
-2
.idea/misc.xml
.idea/misc.xml
+1
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
...c/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
+6
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/PeopleSuggestionAdapter.java
.../in/ac/iitb/gymkhana/iitbapp/PeopleSuggestionAdapter.java
+102
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/PeopleFragment.java
.../in/ac/iitb/gymkhana/iitbapp/fragment/PeopleFragment.java
+113
-0
app/src/main/res/layout/content_main.xml
app/src/main/res/layout/content_main.xml
+2
-1
app/src/main/res/layout/fragment_people.xml
app/src/main/res/layout/fragment_people.xml
+26
-0
app/src/main/res/layout/ppl_search_suggestion_item_view.xml
app/src/main/res/layout/ppl_search_suggestion_item_view.xml
+15
-0
app/src/main/res/menu/activity_main_drawer.xml
app/src/main/res/menu/activity_main_drawer.xml
+3
-0
app/src/main/res/menu/search_view_menu.xml
app/src/main/res/menu/search_view_menu.xml
+11
-0
No files found.
.idea/misc.xml
View file @
e02df0a9
...
...
@@ -24,7 +24,7 @@
</value>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
default=
"true"
project-jdk-name=
"1.8
(1)
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
View file @
e02df0a9
...
...
@@ -38,6 +38,7 @@ import in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment;
import
in.ac.iitb.gymkhana.iitbapp.fragment.MyEventsFragment
;
import
in.ac.iitb.gymkhana.iitbapp.fragment.NotificationsFragment
;
import
in.ac.iitb.gymkhana.iitbapp.fragment.PTCellFragment
;
import
in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment
;
import
in.ac.iitb.gymkhana.iitbapp.fragment.TimetableFragment
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
...
...
@@ -190,6 +191,11 @@ public class MainActivity extends AppCompatActivity
AboutFragment
aboutFragment
=
new
AboutFragment
();
updateFragment
(
aboutFragment
);
break
;
case
R
.
id
.
nav_people
:
PeopleFragment
peopleFragment
=
new
PeopleFragment
();
updateFragment
(
peopleFragment
);
break
;
}
DrawerLayout
drawer
=
(
DrawerLayout
)
findViewById
(
R
.
id
.
drawer_layout
);
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/PeopleSuggestionAdapter.java
0 → 100644
View file @
e02df0a9
package
in.ac.iitb.gymkhana.iitbapp
;
import
android.content.Context
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.Filter
;
import
android.widget.Filterable
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
/**
* Created by mrunz on 6/7/17.
*/
public
class
PeopleSuggestionAdapter
extends
BaseAdapter
implements
Filterable
{
List
mData
;
List
mStringFilterList
;
ValueFilter
valueFilter
;
private
LayoutInflater
inflater
;
public
PeopleSuggestionAdapter
(
List
cancel_type
)
{
mData
=
cancel_type
;
mStringFilterList
=
cancel_type
;
}
@Override
public
int
getCount
()
{
return
mData
.
size
();
}
@Override
public
Object
getItem
(
int
position
)
{
return
mData
.
get
(
position
);
}
@Override
public
long
getItemId
(
int
position
)
{
return
position
;
}
@Override
public
View
getView
(
int
position
,
View
convertView
,
final
ViewGroup
parent
)
{
if
(
inflater
==
null
)
{
inflater
=
(
LayoutInflater
)
parent
.
getContext
()
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
}
View
view
=
inflater
.
inflate
(
R
.
layout
.
ppl_search_suggestion_item_view
,
parent
,
false
);
TextView
tv_suggestion
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
suggestion_item
);
tv_suggestion
.
setText
(
mData
.
get
(
position
).
toString
());
return
view
;
}
@Override
public
Filter
getFilter
()
{
if
(
valueFilter
==
null
)
{
valueFilter
=
new
ValueFilter
();
}
return
valueFilter
;
}
private
class
ValueFilter
extends
Filter
{
@Override
protected
FilterResults
performFiltering
(
CharSequence
constraint
)
{
FilterResults
results
=
new
FilterResults
();
if
(
constraint
!=
null
&&
constraint
.
length
()
>
0
)
{
List
filterList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
mStringFilterList
.
size
();
i
++)
{
if
((
mStringFilterList
.
get
(
i
).
toString
().
toUpperCase
()).
contains
(
constraint
.
toString
().
toUpperCase
()))
{
filterList
.
add
(
mStringFilterList
.
get
(
i
));
}
}
results
.
count
=
filterList
.
size
();
results
.
values
=
filterList
;
}
else
{
results
.
count
=
mStringFilterList
.
size
();
results
.
values
=
mStringFilterList
;
}
return
results
;
}
@Override
protected
void
publishResults
(
CharSequence
constraint
,
FilterResults
results
)
{
mData
=
(
List
)
results
.
values
;
notifyDataSetChanged
();
}
}
}
\ No newline at end of file
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/PeopleFragment.java
0 → 100644
View file @
e02df0a9
package
in.ac.iitb.gymkhana.iitbapp.fragment
;
import
android.app.SearchManager
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.view.MenuItemCompat
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ListView
;
import
android.support.v7.widget.SearchView
;
import
java.util.ArrayList
;
import
in.ac.iitb.gymkhana.iitbapp.PeopleSuggestionAdapter
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
public
class
PeopleFragment
extends
Fragment
{
View
view
;
SearchView
searchView
;
PeopleSuggestionAdapter
adapter
;
ArrayList
<
String
>
suggestionList
=
new
ArrayList
<
String
>();
ListView
listView
;
public
PeopleFragment
()
{
// Required empty public constructor
}
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_people
,
container
,
false
);
setHasOptionsMenu
(
true
);
suggestionList
.
add
(
"Web and Coding Club"
);
suggestionList
.
add
(
"Electronics and Robotics Club"
);
suggestionList
.
add
(
"Krittika"
);
suggestionList
.
add
(
"Maths and Physics Club"
);
suggestionList
.
add
(
"Aeromodelling Club"
);
suggestionList
.
add
(
"Literati"
);
suggestionList
.
add
(
"Roots"
);
suggestionList
.
add
(
"Staccato"
);
suggestionList
.
add
(
"Saaz"
);
suggestionList
.
add
(
"InSync"
);
suggestionList
.
add
(
"Pixels"
);
suggestionList
.
add
(
"Rang"
);
suggestionList
.
add
(
"FourthWall"
);
suggestionList
.
add
(
"WeSpeak and Vaani"
);
suggestionList
.
add
(
"SilverScreen"
);
suggestionList
.
add
(
"IIT-BBC"
);
suggestionList
.
add
(
"Design Club"
);
suggestionList
.
add
(
"LifeStyleClub"
);
suggestionList
.
add
(
"MoodIndigo"
);
suggestionList
.
add
(
"Techfest"
);
suggestionList
.
add
(
"SARC"
);
suggestionList
.
add
(
"Academic Council"
);
listView
=
(
ListView
)
view
.
findViewById
(
R
.
id
.
list_view
);
listView
.
setVisibility
(
View
.
GONE
);
adapter
=
new
PeopleSuggestionAdapter
(
suggestionList
);
listView
.
setAdapter
(
adapter
);
//TODO SuggestionClickListener
return
view
;
}
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
super
.
onCreateOptionsMenu
(
menu
,
inflater
);
menu
.
clear
();
inflater
.
inflate
(
R
.
menu
.
search_view_menu
,
menu
);
MenuItem
searchItem
=
menu
.
findItem
(
R
.
id
.
action_search
);
final
SearchManager
searchManager
=
(
SearchManager
)
getContext
().
getSystemService
(
Context
.
SEARCH_SERVICE
);
searchView
=
(
SearchView
)
MenuItemCompat
.
getActionView
(
searchItem
);
searchView
.
setSearchableInfo
(
searchManager
.
getSearchableInfo
(
getActivity
().
getComponentName
()));
searchView
.
setOnQueryTextListener
(
new
SearchView
.
OnQueryTextListener
()
{
@Override
public
boolean
onQueryTextSubmit
(
String
query
)
{
searchView
.
clearFocus
();
listView
.
setVisibility
(
View
.
GONE
);
return
false
;
}
@Override
public
boolean
onQueryTextChange
(
String
newText
)
{
listView
.
setVisibility
(
View
.
VISIBLE
);
adapter
.
getFilter
().
filter
(
newText
);
return
false
;
}
});
}
}
app/src/main/res/layout/content_main.xml
View file @
e02df0a9
...
...
@@ -7,4 +7,5 @@
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
tools:context=
"in.ac.iitb.gymkhana.iitbapp.MainActivity"
tools:showIn=
"@layout/app_bar_main"
/>
tools:showIn=
"@layout/app_bar_main"
android:orientation=
"vertical"
/>
app/src/main/res/layout/fragment_people.xml
0 → 100644
View file @
e02df0a9
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
tools:context=
"in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment"
>
<!-- TODO: Update blank fragment layout -->
<!--<android.support.v7.widget.SearchView-->
<!--android:id="@+id/search"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:defaultQueryHint="Search"-->
<!--android:clickable="true"/>-->
<ListView
android:id=
"@+id/list_view"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:visibility=
"gone"
android:layout_alignParentStart=
"true"
android:layout_below=
"@+id/search"
/>
</RelativeLayout>
app/src/main/res/layout/ppl_search_suggestion_item_view.xml
0 → 100644
View file @
e02df0a9
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"suggestion"
android:padding=
"8dp"
android:textSize=
"20sp"
android:id=
"@+id/suggestion_item"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/menu/activity_main_drawer.xml
View file @
e02df0a9
...
...
@@ -42,6 +42,9 @@
android:id=
"@+id/nav_map"
android:icon=
"@drawable/ic_map"
android:title=
"Map"
/>
<item
android:id=
"@+id/nav_people"
android:title=
"People"
/>
</group>
<item
android:title=
"Communicate"
>
...
...
app/src/main/res/menu/search_view_menu.xml
0 → 100644
View file @
e02df0a9
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<item
android:id=
"@+id/action_search"
app:actionViewClass=
"android.support.v7.widget.SearchView"
app:showAsAction=
"always|collapseActionView"
android:icon=
"@android:drawable/ic_menu_search"
android:title=
"Search"
/>
</menu>
\ No newline at end of file
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