|
|
|
@ -257,12 +257,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
|
|
|
|
|
|
|
|
private WebServicesView webServices = null;
|
|
|
|
private WebServicesView webServices = null;
|
|
|
|
|
|
|
|
|
|
|
|
public static final int TAB_STYLE_NONE = 0;
|
|
|
|
private int tabStyle = 0;
|
|
|
|
public static final int TAB_STYLE_ACTIVITY = 1;
|
|
|
|
|
|
|
|
public static final int TAB_STYLE_ACTIVITY_WEB = 2;
|
|
|
|
|
|
|
|
public static final int TAB_STYLE_WEB = 3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int tabStyle = TAB_STYLE_NONE;
|
|
|
|
private boolean moreSectionHasControls;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* ======================================================================
|
|
|
|
* ======================================================================
|
|
|
|
@ -372,9 +369,12 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
boolean hasTitle = !TextUtils.isEmpty(model.getValue(Task.TITLE));
|
|
|
|
boolean hasTitle = !TextUtils.isEmpty(model.getValue(Task.TITLE));
|
|
|
|
|
|
|
|
|
|
|
|
if(hasTitle && Preferences.getBoolean(R.string.p_ideas_tab_enabled, false) && Constants.MARKET_STRATEGY.allowIdeasTab())
|
|
|
|
if(hasTitle && Preferences.getBoolean(R.string.p_ideas_tab_enabled, false) && Constants.MARKET_STRATEGY.allowIdeasTab())
|
|
|
|
tabStyle = TAB_STYLE_ACTIVITY_WEB;
|
|
|
|
tabStyle = (TaskEditViewPager.TAB_SHOW_ACTIVITY | TaskEditViewPager.TAB_SHOW_WEB);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
tabStyle = TAB_STYLE_ACTIVITY;
|
|
|
|
tabStyle = TaskEditViewPager.TAB_SHOW_ACTIVITY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (moreSectionHasControls)
|
|
|
|
|
|
|
|
tabStyle |= TaskEditViewPager.TAB_SHOW_MORE;
|
|
|
|
|
|
|
|
|
|
|
|
if (editNotes == null) {
|
|
|
|
if (editNotes == null) {
|
|
|
|
instantiateEditNotes();
|
|
|
|
instantiateEditNotes();
|
|
|
|
@ -590,12 +590,17 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
String[] itemOrder = controlOrder.toArray(new String[controlOrder.size()]);
|
|
|
|
String[] itemOrder = controlOrder.toArray(new String[controlOrder.size()]);
|
|
|
|
|
|
|
|
|
|
|
|
String moreSectionTrigger = getString(R.string.TEA_ctrl_more_pref);
|
|
|
|
String moreSectionTrigger = getString(R.string.TEA_ctrl_more_pref);
|
|
|
|
|
|
|
|
String hideAlwaysTrigger = getString(R.string.TEA_ctrl_hide_section_pref);
|
|
|
|
String shareViewDescriptor = getString(R.string.TEA_ctrl_share_pref);
|
|
|
|
String shareViewDescriptor = getString(R.string.TEA_ctrl_share_pref);
|
|
|
|
LinearLayout section = basicControls;
|
|
|
|
LinearLayout section = basicControls;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
moreSectionHasControls = false;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < itemOrder.length; i++) {
|
|
|
|
for (int i = 0; i < itemOrder.length; i++) {
|
|
|
|
String item = itemOrder[i];
|
|
|
|
String item = itemOrder[i];
|
|
|
|
if (item.equals(moreSectionTrigger)) {
|
|
|
|
if (item.equals(hideAlwaysTrigger)) {
|
|
|
|
|
|
|
|
break; // As soon as we hit the hide section, we're done
|
|
|
|
|
|
|
|
} else if (item.equals(moreSectionTrigger)) {
|
|
|
|
section = moreControls;
|
|
|
|
section = moreControls;
|
|
|
|
if (taskRabbitControl != null) {
|
|
|
|
if (taskRabbitControl != null) {
|
|
|
|
taskRabbitControl.getDisplayView().setVisibility(View.GONE);
|
|
|
|
taskRabbitControl.getDisplayView().setVisibility(View.GONE);
|
|
|
|
@ -603,19 +608,21 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
View control_set = null;
|
|
|
|
View controlSet = null;
|
|
|
|
TaskEditControlSet curr = controlSetMap.get(item);
|
|
|
|
TaskEditControlSet curr = controlSetMap.get(item);
|
|
|
|
|
|
|
|
|
|
|
|
if (item.equals(shareViewDescriptor))
|
|
|
|
if (item.equals(shareViewDescriptor))
|
|
|
|
control_set = peopleControlSet.getSharedWithRow();
|
|
|
|
controlSet = peopleControlSet.getSharedWithRow();
|
|
|
|
else if (curr != null)
|
|
|
|
else if (curr != null)
|
|
|
|
control_set = (LinearLayout) curr.getDisplayView();
|
|
|
|
controlSet = (LinearLayout) curr.getDisplayView();
|
|
|
|
|
|
|
|
|
|
|
|
if (control_set != null) {
|
|
|
|
if (controlSet != null) {
|
|
|
|
if ((i + 1 >= itemOrder.length || itemOrder[i + 1].equals(moreSectionTrigger))) {
|
|
|
|
if ((i + 1 >= itemOrder.length || itemOrder[i + 1].equals(moreSectionTrigger))) {
|
|
|
|
removeTeaSeparator(control_set);
|
|
|
|
removeTeaSeparator(controlSet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
section.addView(control_set);
|
|
|
|
section.addView(controlSet);
|
|
|
|
|
|
|
|
if (section == moreControls)
|
|
|
|
|
|
|
|
moreSectionHasControls = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1250,15 +1257,13 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
public int getTabForPosition(int position) {
|
|
|
|
public int getTabForPosition(int position) {
|
|
|
|
if ((tabStyle == TAB_STYLE_WEB && position == 0) ||
|
|
|
|
Activity activity = getActivity();
|
|
|
|
(tabStyle != TAB_STYLE_WEB && position == 1))
|
|
|
|
String pageTitle = mAdapter.getTitle(position);
|
|
|
|
return TAB_VIEW_MORE;
|
|
|
|
if (pageTitle.equals(activity.getString(R.string.TEA_tab_activity)))
|
|
|
|
|
|
|
|
|
|
|
|
else if (tabStyle != TAB_STYLE_WEB && position == 0)
|
|
|
|
|
|
|
|
return TAB_VIEW_UPDATES;
|
|
|
|
return TAB_VIEW_UPDATES;
|
|
|
|
|
|
|
|
else if (pageTitle.equals(activity.getString(R.string.TEA_tab_more)))
|
|
|
|
else if((tabStyle == TAB_STYLE_WEB && position == 1) ||
|
|
|
|
return TAB_VIEW_MORE;
|
|
|
|
(tabStyle == TAB_STYLE_ACTIVITY_WEB && position == 2))
|
|
|
|
else if (pageTitle.equals(activity.getString(R.string.TEA_tab_web)))
|
|
|
|
return TAB_VIEW_WEB_SERVICES;
|
|
|
|
return TAB_VIEW_WEB_SERVICES;
|
|
|
|
|
|
|
|
|
|
|
|
// error experienced
|
|
|
|
// error experienced
|
|
|
|
@ -1352,10 +1357,8 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
|
|
|
|
setPagerHeightForPosition(position);
|
|
|
|
setPagerHeightForPosition(position);
|
|
|
|
|
|
|
|
|
|
|
|
NestableScrollView scrollView = (NestableScrollView)getView().findViewById(R.id.edit_scroll);
|
|
|
|
NestableScrollView scrollView = (NestableScrollView)getView().findViewById(R.id.edit_scroll);
|
|
|
|
if((tabStyle == TAB_STYLE_WEB && position == 1) ||
|
|
|
|
if(getTabForPosition(position) == TAB_VIEW_WEB_SERVICES)
|
|
|
|
(tabStyle == TAB_STYLE_ACTIVITY_WEB && position == 2))
|
|
|
|
scrollView.setScrollabelViews(webServices.getScrollableViews());
|
|
|
|
scrollView.
|
|
|
|
|
|
|
|
setScrollabelViews(webServices.getScrollableViews());
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
scrollView.setScrollabelViews(null);
|
|
|
|
scrollView.setScrollabelViews(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|