Search in sources :

Example 76 with Toolbar

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

the class MapFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    /* Set title */
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("InstiMap");
    /* Set selected menu item */
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_map);
    /* Initialize */
    editText = (EditText) getView().findViewById(R.id.search);
    if (markerlist == null) {
        setFonts();
        getAPILocations();
    } else if (creatingView) {
        setFonts();
        if (venues != null)
            setupWithData(venues);
        else
            getAPILocations();
    }
    creatingView = false;
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar)

Example 77 with Toolbar

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

the class ComplaintsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_complaints, container, false);
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("Complaints/Suggestions");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_complaint);
    Bundle bundle = getArguments();
    userID = bundle.getString(Constants.USER_ID);
    userProfileUrl = bundle.getString(Constants.CURRENT_USER_PROFILE_PICTURE);
    CollapsingToolbarLayout collapsingToolbarLayout = view.findViewById(R.id.collapsing_toolbar);
    collapsingToolbarLayout.setTitleEnabled(false);
    ViewPager viewPager = view.findViewById(R.id.tab_viewpager);
    slidingTabLayout = view.findViewById(R.id.sliding_tab_layout);
    Button buttonVentIssues = view.findViewById(R.id.buttonVentIssues);
    buttonVentIssues.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            FileComplaintFragment fileComplaintFragment = new FileComplaintFragment();
            fileComplaintFragment.setArguments(getArguments());
            FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
            fragmentTransaction.replace(R.id.framelayout_for_fragment, fileComplaintFragment, Utils.getTag(fileComplaintFragment));
            fragmentTransaction.addToBackStack("Complaint Fragment").commit();
        }
    });
    slidingTabLayout = view.findViewById(R.id.sliding_tab_layout);
    if (viewPager != null) {
        setupViewPager(viewPager);
    }
    return view;
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Button(android.widget.Button) Bundle(android.os.Bundle) CollapsingToolbarLayout(com.google.android.material.appbar.CollapsingToolbarLayout) View(android.view.View) ViewPager(androidx.viewpager.widget.ViewPager) Toolbar(androidx.appcompat.widget.Toolbar)

Example 78 with Toolbar

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

the class NewsFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("News");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_news);
    setHasOptionsMenu(true);
    updateData();
    postType = NewsArticle.class;
    adapterType = NewsAdapter.class;
    recyclerView = getActivity().findViewById(R.id.news_recycler_view);
    swipeRefreshLayout = getActivity().findViewById(R.id.news_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 79 with Toolbar

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

the class PlacementBlogFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("Placement Blog");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_placement_blog);
    setHasOptionsMenu(true);
    updateData();
    postType = PlacementBlogPost.class;
    adapterType = PlacementBlogAdapter.class;
    recyclerView = getActivity().findViewById(R.id.placement_feed_recycler_view);
    swipeRefreshLayout = getActivity().findViewById(R.id.placement_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 80 with Toolbar

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

the class SettingsFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    // Set toolbar title
    Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
    toolbar.setTitle("Settings");
    Utils.setSelectedMenuItem(getActivity(), R.id.nav_settings);
    if (Utils.currentUserCache == null) {
        // Get the user id
        Bundle bundle = getArguments();
        String userID = bundle.getString(Constants.USER_ID);
        // Fill in the user
        RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
        retrofitInterface.getUser(Utils.getSessionIDHeader(), userID).enqueue(new EmptyCallback<User>() {

            @Override
            public void onResponse(Call<User> call, Response<User> response) {
                if (response.isSuccessful()) {
                    if (getActivity() == null || getView() == null)
                        return;
                    User user = response.body();
                    showContactPref.setChecked(user.getShowContactNumber());
                    showContactPref.setEnabled(true);
                    Utils.currentUserCache = user;
                }
            }
        });
    } else {
        showContactPref.setChecked(Utils.currentUserCache.getShowContactNumber());
        showContactPref.setEnabled(true);
    }
}
Also used : User(app.insti.api.model.User) Bundle(android.os.Bundle) Toolbar(androidx.appcompat.widget.Toolbar) RetrofitInterface(app.insti.api.RetrofitInterface)

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