Skip to content

Commit

Permalink
Versions view how show's project name as title.
Browse files Browse the repository at this point in the history
  • Loading branch information
bknatterud committed Apr 30, 2015
1 parent 88863f2 commit 38c0c7a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.unfoldingword.mobile.R;

import fragments.VersionSelectionFragment;
import model.datasource.ProjectDataSource;
import model.modelClasses.mainData.ProjectModel;

/**
* Created by Fechner on 2/27/15.
Expand All @@ -19,6 +21,9 @@ public class VersionSelectionActivity extends ActionBarActivity implements Versi

private ActionBar mActionBar = null;

private TextView actionbarTextView;
private ProjectModel chosenProject;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -31,13 +36,16 @@ protected void onCreate(Bundle savedInstanceState) {
if (extras != null) {

String chosenProjectId = extras.getString(GeneralSelectionActivity.CHOSEN_ID);
chosenProject = new ProjectDataSource(getApplicationContext()).getModel(chosenProjectId);
actionbarTextView.setText(chosenProject.getTitle());
getSupportFragmentManager().beginTransaction()
.add(R.id.versions_frame, VersionSelectionFragment.newInstance(chosenProjectId, false))
.commit();
}
}
}


private void setUI() {

View view = getLayoutInflater().inflate(R.layout.actionbar_base, null);
Expand All @@ -48,13 +56,12 @@ private void setUI() {
private void setupActionBar(View view){

mActionBar = getSupportActionBar();
TextView actionbarTextView = (TextView) view.findViewById(R.id.actionbar_text_view);
actionbarTextView = (TextView) view.findViewById(R.id.actionbar_text_view);
mActionBar.setCustomView(view);
mActionBar.setDisplayShowCustomEnabled(true);
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setHomeButtonEnabled(false);
mActionBar.setDisplayHomeAsUpEnabled(false);
actionbarTextView.setText("Select Version");
}

private void setupCloseButton(View view){
Expand Down
4 changes: 4 additions & 0 deletions app/app/src/main/java/fragments/VersionSelectionFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ private void setupViews(View view, LayoutInflater inflater){
titleTextView.setVisibility(View.GONE);
}
else{
if (chosenProject == null) {
addProject();
}
titleTextView.setText(chosenProject.getTitle());
titleTextView.setVisibility(View.VISIBLE);
}
prepareListView(view, inflater);
Expand Down
2 changes: 1 addition & 1 deletion app/app/src/main/java/utils/USFMParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class USFMParser {
private static final Pattern FOOTNOTE_TEXT_REGEX = Pattern.compile("(\\\\f.)(\\s)*(\\+)(\\s)(\\\\ft)*\\s*(.)*\\n(\\\\fqa)");
private static final Pattern FOOTNOTE_VERSE_REGEX = Pattern.compile("\\\\fqa.*\\\\f[*]");

private static final String TAB = "      ";
private static final String TAB = "    ";

private static USFMParser instance = null;

Expand Down

0 comments on commit 38c0c7a

Please sign in to comment.