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
0445d2fb
Commit
0445d2fb
authored
Jul 31, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Explore and Map search consistent
parent
4b9d4563
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
131 deletions
+11
-131
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+0
-56
app/src/main/res/layout/fragment_map.xml
app/src/main/res/layout/fragment_map.xml
+11
-75
No files found.
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
0445d2fb
...
...
@@ -123,9 +123,6 @@ public class MapFragment extends Fragment implements TextWatcher,
private
List
<
com
.
mrane
.
data
.
Marker
>
markerlist
;
public
FragmentTransaction
transaction
;
public
CampusMapView
campusMapView
;
public
ImageButton
removeIcon
;
public
ImageButton
indexIcon
;
public
ImageButton
mapIcon
;
public
ImageButton
addMarkerIcon
;
private
DrawerLayout
mDrawerLayout
;
private
ActionBarDrawerToggle
mDrawerToggle
;
...
...
@@ -320,27 +317,6 @@ public class MapFragment extends Fragment implements TextWatcher,
campusMapView
.
setSettingsManager
(
settingsManager
);
campusMapView
.
setData
(
data
);
removeIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
remove_icon
);
removeIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
removeClick
(
v
);
}
});
indexIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
index_icon
);
indexIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
indexClick
(
v
);
}
});
mapIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
map_icon
);
mapIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
mapClick
(
v
);
}
});
addMarkerIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
add_marker_icon
);
fragmentManager
=
getChildFragmentManager
();
...
...
@@ -372,12 +348,10 @@ public class MapFragment extends Fragment implements TextWatcher,
R
.
string
.
drawer_open
,
R
.
string
.
drawer_close
)
{
TextView
settingsTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
settings_title
);
/** Called when a drawer has settled in a completely closed state. */
public
void
onDrawerClosed
(
View
view
)
{
super
.
onDrawerClosed
(
view
);
settingsTitle
.
setVisibility
(
View
.
GONE
);
editText
.
setVisibility
(
View
.
VISIBLE
);
setCorrectIcons
();
...
...
@@ -387,10 +361,6 @@ public class MapFragment extends Fragment implements TextWatcher,
public
void
onDrawerOpened
(
View
drawerView
)
{
super
.
onDrawerOpened
(
drawerView
);
editText
.
setVisibility
(
View
.
GONE
);
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
removeIcon
.
setVisibility
(
View
.
GONE
);
settingsTitle
.
setVisibility
(
View
.
VISIBLE
);
}
};
mDrawerLayout
.
setDrawerListener
(
mDrawerToggle
);
...
...
@@ -454,15 +424,6 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
placeSubHeadTextView
!=
null
)
{
placeSubHeadTextView
.
setTypeface
(
regular
);
}
if
(
editText
!=
null
)
{
editText
.
setTypeface
(
regular
);
}
TextView
settingsTitle
=
(
TextView
)
getActivity
()
.
findViewById
(
R
.
id
.
settings_title
);
if
(
settingsTitle
!=
null
)
{
settingsTitle
.
setTypeface
(
regular
);
}
}
private
Runnable
setAnchor
()
{
...
...
@@ -1009,45 +970,28 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
noFragments
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
else
{
this
.
setVisibleButton
(
indexIcon
);
}
}
else
{
if
(
fragment
instanceof
ListFragment
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
else
{
this
.
setVisibleButton
(
indexIcon
);
}
}
else
if
(
fragment
instanceof
IndexFragment
)
{
this
.
setVisibleButton
(
mapIcon
);
}
}
}
private
void
noIndexButton
()
{
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
}
private
boolean
handleRemoveIcon
()
{
String
text
=
editText
.
getText
().
toString
();
if
(
text
.
isEmpty
()
||
text
.
equals
(
null
))
{
removeIcon
.
setVisibility
(
View
.
GONE
);
return
false
;
}
else
{
removeIcon
.
setVisibility
(
View
.
VISIBLE
);
return
true
;
}
}
private
void
setVisibleButton
(
ImageButton
icon
)
{
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
icon
.
setVisibility
(
View
.
VISIBLE
);
}
@Override
public
void
onFocusChange
(
View
v
,
boolean
focus
)
{
this
.
editTextFocused
=
focus
;
...
...
app/src/main/res/layout/fragment_map.xml
View file @
0445d2fb
...
...
@@ -10,82 +10,18 @@
android:focusable=
"true"
android:focusableInTouchMode=
"true"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/toolbar"
<EditText
android:id=
"@+id/search"
android:background=
"@color/colorPrimary"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:background=
"@color/colorPrimary"
>
<EditText
android:id=
"@+id/search"
android:layout_width=
"fill_parent"
android:layout_height=
"48dp"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:background=
"@null"
android:dropDownHeight=
"0dp"
android:fontFamily=
"sans-serif"
android:hint=
"Search"
android:imeOptions=
"actionSearch"
android:inputType=
"textNoSuggestions"
android:paddingBottom=
"8dp"
android:paddingLeft=
"8dp"
android:paddingRight=
"50dp"
android:paddingTop=
"8dp"
android:selectAllOnFocus=
"true"
android:singleLine=
"true"
android:textColor=
"@color/primaryTextColor"
android:textColorHint=
"@color/primaryTextColor"
/>
<TextView
android:id=
"@+id/settings_title"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:fontFamily=
"sans-serif-light"
android:paddingLeft=
"8dp"
android:paddingRight=
"76dp"
android:text=
"Settings"
android:visibility=
"gone"
/>
<ImageButton
android:id=
"@+id/index_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"index"
android:cropToPadding=
"true"
android:padding=
"12dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/dept_menu"
/>
<ImageButton
android:id=
"@+id/map_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"map"
android:cropToPadding=
"true"
android:padding=
"12dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/dept_menu_off"
android:visibility=
"gone"
/>
<ImageButton
android:id=
"@+id/remove_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"remove"
android:padding=
"8dp"
android:src=
"@drawable/ic_action_remove"
android:visibility=
"gone"
/>
</android.support.v7.widget.Toolbar>
android:layout_height=
"wrap_content"
android:paddingLeft=
"18dp"
android:paddingRight=
"6dp"
android:paddingTop=
"3dp"
android:paddingBottom=
"15dp"
android:hint=
"Search"
android:textColor=
"@color/primaryTextColor"
android:textColorHint=
"@color/primaryTextColor"
/>
<android.support.v4.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/drawer_layout"
...
...
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