Search in sources :

Example 1 with BillingManager

use of com.zype.android.Billing.BillingManager in project zype-android by zype.

the class VideosActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_videos);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    addListeners();
    if (getIntent() != null) {
        playlistId = getIntent().getStringExtra(BundleConstants.PARENT_ID);
    } else {
        throw new IllegalStateException("Playlist Id can not be empty");
    }
    updateTitle();
    mListView = (ListView) findViewById(R.id.list_latest);
    mListView.setOnItemClickListener(this);
    mListView.setEmptyView(findViewById(R.id.empty));
    mAdapter = new VideosCursorAdapter(this, VideosCursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, mOnVideoItemActionListener, mOnLoginListener);
    mListView.setAdapter(mAdapter);
    mTvEmpty = (TextView) findViewById(R.id.empty);
    if (ZypeConfiguration.isNativeSubscriptionEnabled(this)) {
        new BillingManager(this, this);
    }
    startLoadCursors();
}
Also used : BillingManager(com.zype.android.Billing.BillingManager) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with BillingManager

use of com.zype.android.Billing.BillingManager 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);
    }
}
Also used : TabHost(android.widget.TabHost) VideosCursorAdapter(com.zype.android.ui.main.fragments.videos.VideosCursorAdapter) BillingManager(com.zype.android.Billing.BillingManager) TabWidget(android.widget.TabWidget) ListView(android.widget.ListView) SearchView(android.support.v7.widget.SearchView) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with BillingManager

use of com.zype.android.Billing.BillingManager in project zype-android by zype.

the class SubscriptionActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_subscription);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    setTitle(R.string.subscription_title);
    initParameters(savedInstanceState);
    listSubscriptions = (RecyclerView) findViewById(R.id.listSubscriptions);
    adapter = new SubscriptionsAdapter();
    listSubscriptions.setAdapter(adapter);
    billingManager = new BillingManager(this, this);
    hideProgress();
    bindViews();
}
Also used : BillingManager(com.zype.android.Billing.BillingManager)

Example 4 with BillingManager

use of com.zype.android.Billing.BillingManager in project zype-android by zype.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
    ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(mViewPager);
    for (int i = 0; i < tabLayout.getTabCount(); i++) {
        TabLayout.Tab tab = tabLayout.getTabAt(i);
        tab.setCustomView(mSectionsPagerAdapter.getTabView(i));
    }
    SettingsParamsBuilder settingsParamsBuilder = new SettingsParamsBuilder();
    getApi().executeRequest(WebApiManager.Request.GET_SETTINGS, settingsParamsBuilder.build());
    if (ZypeConfiguration.isNativeSubscriptionEnabled(this)) {
        new BillingManager(this, this);
    }
}
Also used : SettingsParamsBuilder(com.zype.android.webapi.builder.SettingsParamsBuilder) TabLayout(android.support.design.widget.TabLayout) BillingManager(com.zype.android.Billing.BillingManager) ViewPager(android.support.v4.view.ViewPager)

Aggregations

BillingManager (com.zype.android.Billing.BillingManager)4 Toolbar (android.support.v7.widget.Toolbar)2 TabLayout (android.support.design.widget.TabLayout)1 ViewPager (android.support.v4.view.ViewPager)1 SearchView (android.support.v7.widget.SearchView)1 ListView (android.widget.ListView)1 TabHost (android.widget.TabHost)1 TabWidget (android.widget.TabWidget)1 VideosCursorAdapter (com.zype.android.ui.main.fragments.videos.VideosCursorAdapter)1 SettingsParamsBuilder (com.zype.android.webapi.builder.SettingsParamsBuilder)1