Merge branch 'master' of github.com:jonatkins/ingress-intel-total-conversion
This commit is contained in:
commit
89d99fa70a
@ -92,6 +92,11 @@ public class IntentGenerator {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void cleanup(final Intent intent) {
|
||||
intent.removeExtra(EXTRA_FLAG_IS_DEFAULT);
|
||||
intent.removeExtra(EXTRA_FLAG_TITLE);
|
||||
}
|
||||
|
||||
public ArrayList<Intent> getBrowserIntents(final String title, final String url) {
|
||||
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
|
@ -15,10 +15,10 @@ import android.widget.ListView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class IntentListFragment extends Fragment implements OnScrollListener, OnItemClickListener {
|
||||
private ArrayList<Intent> mIntents;
|
||||
private IntentAdapter mAdapter;
|
||||
private int mScrollIndex, mScrollTop;
|
||||
private ArrayList<Intent> mIntents;
|
||||
private ListView mListView;
|
||||
private int mScrollIndex, mScrollTop;
|
||||
|
||||
public int getIcon() {
|
||||
return getArguments().getInt("icon");
|
||||
@ -38,6 +38,7 @@ public class IntentListFragment extends Fragment implements OnScrollListener, On
|
||||
mAdapter.setIntents(mIntents);
|
||||
|
||||
mListView = new ListView(getActivity());
|
||||
mListView.setAdapter(mAdapter);
|
||||
if (mScrollIndex != -1 && mScrollTop != -1) {
|
||||
mListView.setSelectionFromTop(mScrollIndex, mScrollTop);
|
||||
}
|
||||
@ -49,11 +50,7 @@ public class IntentListFragment extends Fragment implements OnScrollListener, On
|
||||
|
||||
@Override
|
||||
public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) {
|
||||
final Intent intent = mAdapter.getItem(position);
|
||||
((ShareActivity) getActivity()).getIntentComparator().trackIntentSelection(intent);
|
||||
|
||||
startActivity(intent);
|
||||
getActivity().finish();
|
||||
((ShareActivity) getActivity()).launch(mAdapter.getItem(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,6 +140,13 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
return mComparator;
|
||||
}
|
||||
|
||||
public void launch(final Intent intent) {
|
||||
mComparator.trackIntentSelection(intent);
|
||||
mGenerator.cleanup(intent);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user