Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Bug 1022100 - Display 'Search History' card to initial activity launch. #24

Merged
merged 1 commit into from
Jul 22, 2014

Conversation

EricEdens
Copy link
Contributor

No description provided.

@EricEdens
Copy link
Contributor Author

Margaret --

Here are some notes on the major components. Most are scaffolding that shouldn't have to change moving forward. The important configurable parts are:

  • CardFactory.java
  • StreamAgentManager.java

Configurable

CardFactory.java
Responsible for resolving which card belongs to which model. In the future, when adding new cards, they'll need to be registered here.

StreamAgentManager.java
Binds data sources (agents) to the StreamAdapter. Adding new cards will require work here.

Scaffolding

PreSearchFragment.java
Binds the StreamAdapter to the AgentManager and holds the card stream's ListView.

StreamAdapter.java
The adapter that holds card models. The corresponding ListView is PreSearchFragment

Changes

MainActivity.java
Added a BroadcastReceiver to decouple search queries. This is important, because search queries can be initiated from the PreSearchFragment (from a card) or from the search bar itself.

Temp

Temporary code that can be removed when we cut over to MC:

  • app/src/main/java/org/mozilla/search/stream/MockHistoryProvider.java
  • app/src/main/java/org/mozilla/gecko/AppConstants.java
  • app/src/main/java/org/mozilla/gecko/db/BrowserContract.java

import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;

import org.mozilla.gecko.db.BrowserContract;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of importing all of BrowserContract, you can just import BrowserContract.SearchHistory.

}
});
// Hide the default dividers.
listView.setDivider(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I belive you can set this in the XML.

EricEdens added a commit that referenced this pull request Jul 22, 2014
Bug 1022100 - Display 'Search History' card to initial activity launch.
@EricEdens EricEdens merged commit 07142a3 into master Jul 22, 2014
@EricEdens EricEdens deleted the history_card branch July 25, 2014 00:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants