use of com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager in project SmartTubeNext by yuliskov.
the class SearchFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBackgroundManager = ((LeanbackActivity) getActivity()).getBackgroundManager();
mSearchPresenter = SearchPresenter.instance(getContext());
mSearchPresenter.setView(this);
mCardPresenter = new VideoCardPresenter();
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mProgressBarManager = new ProgressBarManager();
setSearchResultProvider(this);
setupEventListeners();
// TODO: move permission acquirement to presenter
Log.d(TAG, "User is initiating a search. Do we have RECORD_AUDIO permission? " + hasPermission(Manifest.permission.RECORD_AUDIO));
if (!hasPermission(Manifest.permission.RECORD_AUDIO)) {
Log.d(TAG, "Does not have RECORD_AUDIO, using SpeechRecognitionCallback");
// SpeechRecognitionCallback is not required and if not provided recognition will be
// handled using internal speech recognizer, in which case you must have RECORD_AUDIO
// permission
setSpeechRecognitionCallback(new SpeechRecognitionCallback() {
@Override
public void recognizeSpeech() {
if (isAdded()) {
try {
startActivityForResult(getRecognizerIntent(), REQUEST_SPEECH);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "Cannot find activity for speech recognizer", e);
}
} else {
Log.e(TAG, "Can't perform search. Fragment is detached.");
}
}
});
} else {
Log.d(TAG, "We DO have RECORD_AUDIO");
}
}
use of com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager in project SmartTubeNext by yuliskov.
the class SearchTagsFragmentBase method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mProgressBarManager = new ProgressBarManager();
mResultsPresenter = new CustomListRowPresenter();
mResultsAdapter = new ArrayObjectAdapter(mResultsPresenter);
mSearchTagsAdapter = new TagAdapter(getActivity(), "");
setSearchResultProvider(this);
setupListeners();
}
use of com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager in project SmartTubeNext by yuliskov.
the class BrowseFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
mRestoredHeaderIndex = savedInstanceState != null ? savedInstanceState.getInt(SELECTED_HEADER_INDEX, -1) : -1;
mRestoredItemIndex = savedInstanceState != null ? savedInstanceState.getInt(SELECTED_ITEM_INDEX, -1) : -1;
mIsFragmentCreated = true;
mSections = new LinkedHashMap<>();
mHandler = new Handler();
mBrowsePresenter = BrowsePresenter.instance(getContext());
mBrowsePresenter.setView(this);
mProgressBarManager = new ProgressBarManager();
setupAdapter();
setupFragmentFactory();
setupUi();
enableMainFragmentScaling(false);
}
use of com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager in project SmartTubeNext by yuliskov.
the class ChannelFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
// Real restore takes place in the presenter
super.onCreate(null);
mRestoredItemIndex = savedInstanceState != null ? savedInstanceState.getInt(SELECTED_ITEM_INDEX, -1) : -1;
mIsFragmentCreated = true;
mChannelPresenter = ChannelPresenter.instance(getContext());
mChannelPresenter.setView(this);
mProgressBarManager = new ProgressBarManager();
}
use of com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager in project SmartTubeNext by yuliskov.
the class ChannelUploadsFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
// Real restore takes place in the presenter
super.onCreate(null);
mRestoredItemIndex = savedInstanceState != null ? savedInstanceState.getInt(SELECTED_ITEM_INDEX, -1) : -1;
mIsFragmentCreated = true;
mChannelUploadsPresenter = ChannelUploadsPresenter.instance(getContext());
mChannelUploadsPresenter.setView(this);
mProgressBarManager = new ProgressBarManager();
}
Aggregations