Skip to content

Commit

Permalink
Merge pull request #580 from karsai1993/master
Browse files Browse the repository at this point in the history
Handling EditText hint text and items in option menu
  • Loading branch information
therajanmaurya authored Mar 14, 2017
2 parents 8c97510 + ea75872 commit a01ee17
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,31 +103,30 @@ public void onBackStackChanged() {
setMenuCreateCentre(false);
setMenuCreateGroup(true);
}

}
});

}

private void setMenuCreateGroup(boolean visibility) {
private void setMenuCreateGroup(boolean isEnabled) {
if (menu != null) {
//position of mItem_create_new_group is 2
menu.getItem(2).setVisible(visibility);
menu.getItem(2).setEnabled(isEnabled);
}

}

private void setMenuCreateCentre(boolean visibility) {
private void setMenuCreateCentre(boolean isEnabled) {
if (menu != null) {
//position of mItem_create_new_centre is 1
menu.getItem(1).setVisible(visibility);
menu.getItem(1).setEnabled(isEnabled);
}
}

private void setMenuCreateClient(boolean visibility) {
private void setMenuCreateClient(boolean isEnabled) {
if (menu != null) {
//position of mItem_create_new_client is 0
menu.getItem(0).setVisible(visibility);
menu.getItem(0).setEnabled(isEnabled);
}
}

Expand Down Expand Up @@ -273,6 +272,9 @@ public void onBackPressed() {
if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(Gravity.LEFT);
} else {
setMenuCreateClient(true);
setMenuCreateCentre(true);
setMenuCreateGroup(true);
super.onBackPressed();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void showUserInterface() {
searchOptionsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp_search.setAdapter(searchOptionsAdapter);
sp_search.setOnItemSelectedListener(this);

et_search.requestFocus();
layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
rv_search.setLayoutManager(layoutManager);
Expand Down
19 changes: 19 additions & 0 deletions studio_android-client.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="studio_android-client" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

0 comments on commit a01ee17

Please sign in to comment.