Search in sources :

Example 16 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xLog by elvishew.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    tagView = (TextView) findViewById(R.id.tag);
    tagView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            showChangeTagDialog();
        }
    });
    levelView = (Spinner) findViewById(R.id.level);
    threadInfo = (CheckedTextView) findViewById(R.id.thread_info);
    threadInfo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            threadInfo.toggle();
        }
    });
    stackTraceInfo = (CheckedTextView) findViewById(R.id.stack_trace_info);
    stackTraceInfo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            stackTraceInfo.toggle();
            setEnabledStateOnViews(stackTraceDepthContainer, stackTraceInfo.isChecked());
        }
    });
    stackTraceDepthContainer = findViewById(R.id.stack_trace_depth_container);
    setEnabledStateOnViews(stackTraceDepthContainer, false);
    stackTraceDepth = (Spinner) stackTraceDepthContainer.findViewById(R.id.stack_trace_depth);
    border = (CheckedTextView) findViewById(R.id.border);
    border.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            border.toggle();
        }
    });
    // Setup print button.
    findViewById(R.id.print).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            printLog();
        }
    });
    // Setup view printer.
    RecyclerView logContainer = (RecyclerView) findViewById(R.id.log_container);
    viewPrinter = new RecyclerViewPrinter(logContainer);
    // Print welcome message.
    XLog.printers(viewPrinter).i("XLog is ready.\nPrint your log now!");
    // Check permission.
    hasPermission = hasPermission();
    if (!hasPermission) {
        if (shouldShowRequestPermissionRationale()) {
            showPermissionRequestDialog(false);
        } else {
            requestPermission();
        }
    }
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) CheckedTextView(android.widget.CheckedTextView) Toolbar(androidx.appcompat.widget.Toolbar)

Example 17 with Toolbar

use of androidx.appcompat.widget.Toolbar in project DiscreteScrollView by yarolegovich.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    root = findViewById(R.id.screen);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    findViewById(R.id.preview_shop).setOnClickListener(this);
    findViewById(R.id.preview_weather).setOnClickListener(this);
    findViewById(R.id.preview_vertical).setOnClickListener(this);
    findViewById(R.id.credit_city_icons).setOnClickListener(this);
    findViewById(R.id.credit_shop_photos).setOnClickListener(this);
    findViewById(R.id.credit_taya).setOnClickListener(this);
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar)

Example 18 with Toolbar

use of androidx.appcompat.widget.Toolbar in project uCrop by Yalantis.

the class UCropActivity method setupAppBar.

/**
 * Configures and styles both status bar and toolbar.
 */
private void setupAppBar() {
    setStatusBarColor(mStatusBarColor);
    final Toolbar toolbar = findViewById(R.id.toolbar);
    // Set all of the Toolbar coloring
    toolbar.setBackgroundColor(mToolbarColor);
    toolbar.setTitleTextColor(mToolbarWidgetColor);
    final TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
    toolbarTitle.setTextColor(mToolbarWidgetColor);
    toolbarTitle.setText(mToolbarTitle);
    // Color buttons inside the Toolbar
    Drawable stateButtonDrawable = ContextCompat.getDrawable(this, mToolbarCancelDrawable).mutate();
    stateButtonDrawable.setColorFilter(mToolbarWidgetColor, PorterDuff.Mode.SRC_ATOP);
    toolbar.setNavigationIcon(stateButtonDrawable);
    setSupportActionBar(toolbar);
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowTitleEnabled(false);
    }
}
Also used : Drawable(android.graphics.drawable.Drawable) SelectedStateListDrawable(com.yalantis.ucrop.util.SelectedStateListDrawable) AspectRatioTextView(com.yalantis.ucrop.view.widget.AspectRatioTextView) TextView(android.widget.TextView) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 19 with Toolbar

use of androidx.appcompat.widget.Toolbar in project PagerBottomTabStrip by tyzlmjj.

the class HideActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_hide);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    PageNavigationView pageBottomTabLayout = findViewById(tab);
    mNavigationController = pageBottomTabLayout.material().addItem(R.drawable.ic_restore_teal_24dp, "Recents").addItem(R.drawable.ic_favorite_teal_24dp, "Favorites").addItem(R.drawable.ic_nearby_teal_24dp, "Nearby").build();
    ViewPager viewPager = findViewById(R.id.viewPager);
    viewPager.setAdapter(new TestViewPagerAdapter(getSupportFragmentManager()));
    mNavigationController.setupWithViewPager(viewPager);
}
Also used : PageNavigationView(me.majiajie.pagerbottomtabstrip.PageNavigationView) ViewPager(androidx.viewpager.widget.ViewPager) Toolbar(androidx.appcompat.widget.Toolbar)

Example 20 with Toolbar

use of androidx.appcompat.widget.Toolbar in project ETSMobile-Android2 by ApplETS.

the class TodayWidgetConfigureActivity method setUpActionBar.

private void setUpActionBar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.widget_config_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(getString(R.string.widget_configure));
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

Toolbar (androidx.appcompat.widget.Toolbar)271 View (android.view.View)110 TextView (android.widget.TextView)55 RecyclerView (androidx.recyclerview.widget.RecyclerView)44 Bundle (android.os.Bundle)42 NonNull (androidx.annotation.NonNull)36 Intent (android.content.Intent)34 Fragment (androidx.fragment.app.Fragment)32 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 ViewGroup (android.view.ViewGroup)25 Context (android.content.Context)24 EditText (android.widget.EditText)22 MenuItem (android.view.MenuItem)21 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)20 Navigation (androidx.navigation.Navigation)20 Drawable (android.graphics.drawable.Drawable)18