Search in sources :

Example 81 with Toolbar

use of androidx.appcompat.widget.Toolbar in project IITB-App by wncc.

the class QuickLinksFragment method onStart.

public void onStart() {
    super.onStart();
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("Quick Links");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_qlinks);
    TextView CMS = getActivity().findViewById(R.id.button_CMS);
    TextView CMSMaint = getActivity().findViewById(R.id.button_CMSMaint);
    TextView CMSNet = getActivity().findViewById(R.id.button_CMSNet);
    TextView Eateries = getActivity().findViewById(R.id.button_Eateries);
    TextView ASC = getActivity().findViewById(R.id.button_ASC);
    TextView ASCExt = getActivity().findViewById(R.id.button_ASCExt);
    TextView Moodle = getActivity().findViewById(R.id.button_Moodle);
    TextView Intern = getActivity().findViewById(R.id.button_Internship);
    TextView Placement = getActivity().findViewById(R.id.button_Placement);
    TextView Library = getActivity().findViewById(R.id.button_Library);
    TextView AcadCal = getActivity().findViewById(R.id.button_Acad_calendar);
    TextView AcadTime = getActivity().findViewById(R.id.button_Acad_timetable);
    TextView Holidays = getActivity().findViewById(R.id.button_Holidays);
    TextView Circulars = getActivity().findViewById(R.id.button_Circulars);
    TextView Courses = getActivity().findViewById(R.id.button_Courselist);
    TextView WebMail = getActivity().findViewById(R.id.button_WebMail);
    TextView GPO = getActivity().findViewById(R.id.button_GPO);
    TextView CAMP = getActivity().findViewById(R.id.button_CAMP);
    TextView MSStore = getActivity().findViewById(R.id.button_MSStore);
    TextView BigHome = getActivity().findViewById(R.id.button_BigHomeCloud);
    // TextView FTP = getActivity().findViewById(R.id.button_FTP);
    TextView Intercom = getActivity().findViewById(R.id.button_Intercom);
    TextView Hospital = getActivity().findViewById(R.id.button_Hospital);
    TextView VPN = getActivity().findViewById(R.id.button_VPN);
    CMS.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://gymkhana.iitb.ac.in/cms_new/");
        }
    });
    CMSMaint.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://support.iitb.ac.in");
        }
    });
    CMSNet.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://help-cc.iitb.ac.in/");
        }
    });
    Eateries.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://gymkhana.iitb.ac.in/feedback/eateries/");
        }
    });
    ASC.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://asc.iitb.ac.in");
        }
    });
    ASCExt.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://portal.iitb.ac.in/asc");
        }
    });
    Moodle.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://moodle.iitb.ac.in");
        }
    });
    Intern.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://placements.iitb.ac.in/internship/login.jsp");
        }
    });
    Placement.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://placements.iitb.ac.in/placements/login.jsp");
        }
    });
    Library.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.library.iitb.ac.in/");
        }
    });
    AcadCal.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.iitb.ac.in/newacadhome/toacadcalender.jsp");
        }
    });
    AcadTime.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.iitb.ac.in/newacadhome/timetable.jsp");
        }
    });
    Holidays.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.iitb.ac.in/en/about-iit-bombay/iit-bombay-holidays-list");
        }
    });
    Circulars.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.iitb.ac.in/newacadhome/circular.jsp");
        }
    });
    Courses.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://portal.iitb.ac.in/asc/Courses");
        }
    });
    WebMail.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://webmail.iitb.ac.in");
        }
    });
    GPO.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://gpo.iitb.ac.in");
        }
    });
    CAMP.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://camp.iitb.ac.in/");
        }
    });
    MSStore.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://msstore.iitb.ac.in/");
        }
    });
    BigHome.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://home.iitb.ac.in/");
        }
    });
    // FTP.setOnClickListener(new View.OnClickListener() {  public void onClick(View v) {  goToUrl("ftp://ftp.iitb.ac.in/");  } });
    Intercom.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://portal.iitb.ac.in/TelephoneDirectory/");
        }
    });
    Hospital.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("http://www.iitb.ac.in/hospital/");
        }
    });
    VPN.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            goToUrl("https://www.cc.iitb.ac.in/engservices/engaccessingiitffromoutside/19-vpn");
        }
    });
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar)

Example 82 with Toolbar

use of androidx.appcompat.widget.Toolbar in project IITB-App by wncc.

the class TrainingBlogFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("Internship Blog");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_training_blog);
    setHasOptionsMenu(true);
    updateData();
    postType = TrainingBlogPost.class;
    adapterType = TrainingBlogAdapter.class;
    recyclerView = getActivity().findViewById(R.id.training_feed_recycler_view);
    swipeRefreshLayout = getActivity().findViewById(R.id.training_feed_swipe_refresh_layout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

        @Override
        public void onRefresh() {
            updateData();
        }
    });
}
Also used : SwipeRefreshLayout(androidx.swiperefreshlayout.widget.SwipeRefreshLayout) Toolbar(androidx.appcompat.widget.Toolbar)

Example 83 with Toolbar

use of androidx.appcompat.widget.Toolbar 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 = 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 = findViewById(R.id.search_progress);
    tvSearchField = findViewById(R.id.search_field);
    tvSearchField.setText(searchString);
    viewSearch = findViewById(R.id.viewSearch);
    viewSearch.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            updateUI();
            if (!TextUtils.isEmpty(query)) {
                startSearch();
            }
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
    viewSearch.setOnCloseListener(new SearchView.OnCloseListener() {

        @Override
        public boolean onClose() {
            return false;
        }
    });
    textErrorEmptyQuery = findViewById(R.id.textErrorEmptyQuery);
    // 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;
    // }
    // });
    textEmpty = findViewById(R.id.empty);
    mAdapter = new VideosCursorAdapter(this, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, this, this);
    listVideos = findViewById(R.id.list_search);
    listVideos.setEmptyView(findViewById(R.id.empty));
    listVideos.setAdapter(mAdapter);
    listVideos.setOnItemClickListener(this);
    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 = findViewById(android.R.id.tabs);
    tabs.setVisibility(GONE);
    viewSearch.setQuery(searchString, false);
    viewSearch.setIconified(false);
    viewSearch.setFocusable(false);
    viewSearch.clearFocus();
    requestSearchResult(1, searchString);
    if (ZypeConfiguration.isNativeSubscriptionEnabled(this)) {
        new BillingManager(this, this);
    }
    updateUI();
}
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) SearchView(androidx.appcompat.widget.SearchView) Toolbar(androidx.appcompat.widget.Toolbar)

Example 84 with Toolbar

use of androidx.appcompat.widget.Toolbar 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_v2);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    listVideos = findViewById(R.id.listVideos);
    adapter = new VideosAdapter(null);
    listVideos.setAdapter(adapter);
    progressBar = findViewById(R.id.progress);
    viewSearch = findViewById(R.id.viewSearch);
    viewSearch.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            if (!TextUtils.isEmpty(query)) {
                model.search(query, ZypeConfiguration.getRootPlaylistId(SearchActivity.this));
            }
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
    viewSearch.setOnCloseListener(new SearchView.OnCloseListener() {

        @Override
        public boolean onClose() {
            hideProgress();
            model.clearSearchResults();
            showEmptyQuery(true);
            return false;
        }
    });
    textEmptyResult = findViewById(R.id.textEmptyResult);
    textErrorEmptyQuery = findViewById(R.id.textErrorEmptyQuery);
    viewSearch.setQuery("", false);
    viewSearch.setIconified(false);
    viewSearch.setFocusable(false);
    viewSearch.clearFocus();
    model = ViewModelProviders.of(this).get(SearchViewModel.class);
    model.getVideos().observe(this, createVideosObserver());
    model.getSelectedVideo().observe(this, video -> {
        if (video != null) {
            NavigationHelper navigationHelper = NavigationHelper.getInstance(this);
            navigationHelper.handleVideoClick(this, video, null, false);
            model.onSelectedVideoProcessed();
        }
    });
    adapter.setVideoListener((video) -> {
        model.onVideoClicked(video);
    });
    adapter.setPopupMenuListener((action, video) -> {
        model.handleVideoAction(action, video, success -> {
            if (success) {
                model.refresh();
            } else {
                NavigationHelper.getInstance(SearchActivity.this).switchToLoginScreen(SearchActivity.this);
            }
        });
    });
}
Also used : SearchView(androidx.appcompat.widget.SearchView) NavigationHelper(com.zype.android.ui.NavigationHelper) Toolbar(androidx.appcompat.widget.Toolbar) VideosAdapter(com.zype.android.ui.v2.videos.VideosAdapter)

Example 85 with Toolbar

use of androidx.appcompat.widget.Toolbar 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);
    mTvEmpty.setText("");
    if (ZypeConfiguration.isNativeSubscriptionEnabled(this) || ZypeConfiguration.isNativeToUniversalSubscriptionEnabled(this)) {
        new BillingManager(this, this);
    }
    startLoadCursors();
}
Also used : BillingManager(com.zype.android.Billing.BillingManager) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

Toolbar (androidx.appcompat.widget.Toolbar)284 View (android.view.View)116 TextView (android.widget.TextView)58 RecyclerView (androidx.recyclerview.widget.RecyclerView)44 Bundle (android.os.Bundle)43 Intent (android.content.Intent)39 NonNull (androidx.annotation.NonNull)36 Fragment (androidx.fragment.app.Fragment)33 ActionBar (androidx.appcompat.app.ActionBar)29 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)29 Nullable (androidx.annotation.Nullable)28 BarPainter (com.xabber.android.ui.color.BarPainter)26 R (org.thoughtcrime.securesms.R)26 Context (android.content.Context)25 ViewGroup (android.view.ViewGroup)25 EditText (android.widget.EditText)23 MenuItem (android.view.MenuItem)21 ImageView (android.widget.ImageView)20 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)20 Navigation (androidx.navigation.Navigation)20