use of com.zype.android.ui.main.fragments.videos.VideosCursorAdapter in project zype-android by zype.
the class SearchActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (getIntent() != null) {
searchString = getIntent().getStringExtra(BundleConstants.SEARCH_STRING);
} else {
throw new IllegalStateException("VideoId can not be empty");
}
searchProgress = (ProgressBar) findViewById(R.id.search_progress);
tvSearchField = (TextView) findViewById(R.id.search_field);
tvSearchField.setText(searchString);
viewSearch = (SearchView) findViewById(R.id.viewSearch);
viewSearch.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
startSearch();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
viewSearch.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
return false;
}
});
viewSearch.setQuery(searchString, false);
viewSearch.setIconified(false);
viewSearch.setFocusable(false);
viewSearch.clearFocus();
// tvSearchField.setOnKeyListener(new View.OnKeyListener() {
//
// @Override
// public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (event.getAction() == KeyEvent.ACTION_DOWN
// && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
// startSearch();
// return true;
// }
//
// return false;
// }
// });
// tvSearchField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
// @Override
// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// if (actionId == EditorInfo.IME_ACTION_SEARCH) {
// startSearch();
// return true;
// }
// return false;
// }
// });
mAdapter = new VideosCursorAdapter(this, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, this, this);
ListView mListView = (ListView) findViewById(R.id.list_search);
mListView.setEmptyView(findViewById(R.id.empty));
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(this);
tabHost = (TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();
TabHost.TabSpec tabSpec = tabHost.newTabSpec("tagAll");
tabSpec.setIndicator(getString(R.string.title_tab_search_all));
tabSpec.setContent(R.id.list_search);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tagGuests");
tabSpec.setIndicator(getString(R.string.title_tab_search_guests));
tabSpec.setContent(R.id.list_search);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tagTags");
tabSpec.setIndicator(getString(R.string.title_tab_search_tags));
tabSpec.setContent(R.id.list_search);
tabHost.addTab(tabSpec);
tabHost.setCurrentTabByTag("tagAll");
setTabColors(tabHost);
tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String arg0) {
setTabColors(tabHost);
}
});
TabWidget tabs = (TabWidget) findViewById(android.R.id.tabs);
tabs.setVisibility(GONE);
requestSearchResult(1, searchString);
if (ZypeConfiguration.isNativeSubscriptionEnabled(this)) {
new BillingManager(this, this);
}
}
use of com.zype.android.ui.main.fragments.videos.VideosCursorAdapter in project zype-android by zype.
the class MyLibraryFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
adapter = new VideosCursorAdapter(getActivity(), CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, onVideoItemActionListener, onLoginListener);
View view = inflater.inflate(R.layout.fragment_my_library, null);
listMyLibrary = (ListView) view.findViewById(R.id.listMyLibrary);
listMyLibrary.setEmptyView(textEmpty);
listMyLibrary.setOnItemClickListener(this);
listMyLibrary.setAdapter(adapter);
progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
layoutSignIn = (RelativeLayout) view.findViewById(R.id.layoutSignIn);
Button buttonSignIn = (Button) view.findViewById(R.id.buttonSighIn);
buttonSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onLoginListener.onRequestLogin();
}
});
textEmpty = (TextView) view.findViewById(R.id.empty);
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
prefListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
updateViews();
updateTextEmpty();
}
};
prefs.registerOnSharedPreferenceChangeListener(prefListener);
updateViews();
return view;
}
use of com.zype.android.ui.main.fragments.videos.VideosCursorAdapter in project zype-android by zype.
the class AbstractTabFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mAdapter = new VideosCursorAdapter(getActivity(), CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, mOnVideoItemActionListener, mOnLoginListener);
View view = inflater.inflate(R.layout.fragment_base_tab_list, null);
mListView = (ListView) view.findViewById(R.id.list_tab);
mEmpty = (TextView) view.findViewById(R.id.empty);
mListView.setEmptyView(mEmpty);
mListView.setOnItemClickListener(this);
mListView.setAdapter(mAdapter);
tabHost = (TabHost) view.findViewById(android.R.id.tabhost);
tabHost.setup();
TabHost.TabSpec tabSpec = tabHost.newTabSpec("tag1");
tabSpec.setIndicator(getString(R.string.title_tab_search_all));
tabSpec.setContent(R.id.list_tab);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tag2");
tabSpec.setIndicator(getString(R.string.title_tab_search_audio));
tabSpec.setContent(R.id.list_tab);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tag3");
tabSpec.setIndicator(getString(R.string.title_tab_search_video));
tabSpec.setContent(R.id.list_tab);
tabHost.addTab(tabSpec);
tabHost.setCurrentTabByTag("tag1");
setTabColors(tabHost);
tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String arg0) {
setTabColors(tabHost);
startLoadCursors(selectedTab);
}
});
return view;
}
use of com.zype.android.ui.main.fragments.videos.VideosCursorAdapter in project zype-android by zype.
the class FavoritesFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
adapter = new VideosCursorAdapter(getActivity(), CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, onVideoItemActionListener, onLoginListener);
View view = inflater.inflate(R.layout.fragment_favorites, null);
listFavorites = (ListView) view.findViewById(R.id.listFavorites);
textEmpty = (TextView) view.findViewById(R.id.empty);
listFavorites.setEmptyView(textEmpty);
listFavorites.setOnItemClickListener(this);
listFavorites.setAdapter(adapter);
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
prefListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
updateTextEmpty();
}
};
prefs.registerOnSharedPreferenceChangeListener(prefListener);
return view;
}
Aggregations