Search in sources :

Example 1 with ActionBar

use of androidx.appcompat.app.ActionBar in project WordPress-Login-Flow-Android by wordpress-mobile.

the class LoginMagicLinkRequestFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.log_in);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState == null) {
        mAnalyticsListener.trackMagicLinkRequestFormViewed();
    }
    if (mForceRequestAtStart && !mInProgress) {
        dispatchMagicLinkRequest();
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 2 with ActionBar

use of androidx.appcompat.app.ActionBar in project WordPress-Login-Flow-Android by wordpress-mobile.

the class LoginMagicLinkSentFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.log_in);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState == null) {
        mAnalyticsListener.trackLoginMagicLinkOpenEmailClientViewed();
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 3 with ActionBar

use of androidx.appcompat.app.ActionBar in project CloudReader by youlookwhat.

the class BaseActivity method setToolBar.

/**
 * 设置titlebar
 */
protected void setToolBar(Toolbar toolbar) {
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // 去除默认Title显示
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
    }
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            supportFinishAfterTransition();
        }
    });
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) ActionBar(androidx.appcompat.app.ActionBar)

Example 4 with ActionBar

use of androidx.appcompat.app.ActionBar in project CloudReader by youlookwhat.

the class ToolbarHelper method initFullBar.

/**
 * 将Toolbar高度填充到状态栏
 */
public static void initFullBar(Toolbar toolbar, AppCompatActivity activity) {
    ViewGroup.LayoutParams params = toolbar.getLayoutParams();
    params.height = DensityUtil.getStatusHeight(activity) + getSystemActionBarSize(activity);
    toolbar.setLayoutParams(params);
    toolbar.setPadding(toolbar.getLeft(), toolbar.getTop() + DensityUtil.getStatusHeight(activity), toolbar.getRight(), toolbar.getBottom());
    activity.setSupportActionBar(toolbar);
    ActionBar actionBar = activity.getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
}
Also used : ViewGroup(android.view.ViewGroup) ActionBar(androidx.appcompat.app.ActionBar)

Example 5 with ActionBar

use of androidx.appcompat.app.ActionBar in project CloudReader by youlookwhat.

the class MainActivity method initView.

private void initView() {
    setNoTitle();
    setSupportActionBar(bindingView.include.toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // 去除默认Title显示
        actionBar.setDisplayShowTitleEnabled(false);
    }
    vpContent = bindingView.include.vpContent;
    ivTitleOne = bindingView.include.ivTitleOne;
    ivTitleTwo = bindingView.include.ivTitleTwo;
    ivTitleThree = bindingView.include.ivTitleThree;
    bindingView.include.llTitleMenu.setOnClickListener(this);
    bindingView.include.ivTitleOne.setOnClickListener(this);
    bindingView.include.ivTitleTwo.setOnClickListener(this);
    bindingView.include.ivTitleThree.setOnClickListener(this);
    getClipContent();
    UpdateUtil.check(this, false);
}
Also used : ActionBar(androidx.appcompat.app.ActionBar)

Aggregations

ActionBar (androidx.appcompat.app.ActionBar)113 Toolbar (androidx.appcompat.widget.Toolbar)28 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)24 View (android.view.View)21 TextView (android.widget.TextView)13 Bundle (android.os.Bundle)9 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)8 Intent (android.content.Intent)7 SuppressLint (android.annotation.SuppressLint)6 Uri (android.net.Uri)6 DefaultItemDecoration (com.yanzhenjie.recyclerview.widget.DefaultItemDecoration)6 ImageView (android.widget.ImageView)5 SwipeRecyclerView (com.yanzhenjie.recyclerview.SwipeRecyclerView)5 File (java.io.File)5 SharedPreferences (android.content.SharedPreferences)4 MenuItem (android.view.MenuItem)4 FragmentTransaction (androidx.fragment.app.FragmentTransaction)4 OCFile (com.owncloud.android.datamodel.OCFile)4 Context (android.content.Context)3 Menu (android.view.Menu)3