Skip to content

Commit

Permalink
Merge pull request #228 from dimagi/title-crash-fix-3
Browse files Browse the repository at this point in the history
another fix for  spannables in case list
  • Loading branch information
ctsims committed Apr 15, 2015
2 parents ffde700 + 10d773c commit 8eb2fe0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/src/org/commcare/dalvik/activities/EntitySelectActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.commcare.suite.model.Action;
import org.commcare.suite.model.Detail;
import org.commcare.suite.model.DetailField;
import org.commcare.suite.model.Entry;
import org.commcare.suite.model.SessionDatum;
import org.commcare.util.CommCareSession;
import org.commcare.util.SessionFrame;
Expand All @@ -65,7 +64,6 @@
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Vector;

/**
*
Expand Down Expand Up @@ -171,7 +169,8 @@ public void onCreate(Bundle savedInstanceState) {
rightFrame = (FrameLayout)findViewById(R.id.screen_compound_select_right_pane);

TextView message = (TextView)findViewById(R.id.screen_compound_select_prompt);
message.setText(localize("select.placeholder.message", new String[]{Localization.get("cchq.case")}));
//use the old method here because some Android versions don't like Spannables for titles
message.setText(Localization.get("select.placeholder.message", new String[]{Localization.get("cchq.case")}));
} else {
setContentView(R.layout.entity_select_layout);
//So we're not in landscape mode anymore, but were before. If we had something selected, we
Expand Down Expand Up @@ -203,6 +202,7 @@ public void onCreate(Bundle savedInstanceState) {


TextView searchLabel = (TextView)findViewById(R.id.screen_entity_select_search_label);
//use the old method here because some Android versions don't like Spannables for titles
searchLabel.setText(Localization.get("select.search.label"));
searchLabel.setOnClickListener(new OnClickListener(){
@Override
Expand Down Expand Up @@ -412,7 +412,7 @@ public void onStop() {
*
* @param contextRef reference to the selected element for which to display
* detailed view
* @param i intent to attach extra data to. If null, create a fresh
* @param detailIntent intent to attach extra data to. If null, create a fresh
* EntityDetailActivity intent
* @return The intent argument, or a newly created one, with element
* selection information attached.
Expand Down Expand Up @@ -585,10 +585,11 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0, MENU_SORT, MENU_SORT, localize("select.menu.sort")).setIcon(
//use the old method here because some Android versions don't like Spannables for titles
menu.add(0, MENU_SORT, MENU_SORT, Localization.get("select.menu.sort")).setIcon(
android.R.drawable.ic_menu_sort_alphabetically);
if(mMappingEnabled) {
menu.add(0, MENU_MAP, MENU_MAP, localize("select.menu.map")).setIcon(
menu.add(0, MENU_MAP, MENU_MAP, Localization.get("select.menu.map")).setIcon(
android.R.drawable.ic_menu_mapmode);
}
Action action = shortSelect.getCustomAction();
Expand Down Expand Up @@ -840,6 +841,7 @@ public void displayReferenceAwesome(final TreeReference selection, int detailInd
findViewById(R.id.screen_compound_select_prompt).setVisibility(View.GONE);
View.inflate(this, R.layout.entity_detail, rightFrame);
Button next = (Button)findViewById(R.id.entity_select_button);
//use the old method here because some Android versions don't like Spannables for titles
next.setText(Localization.get("select.detail.confirm"));
next.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Expand Down

0 comments on commit 8eb2fe0

Please sign in to comment.