com.blankj.utilcode.util.PermissionUtils Java Examples

The following examples show how to use com.blankj.utilcode.util.PermissionUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AllNodeActivity.java    From V2EX with GNU General Public License v3.0 6 votes vote down vote up
@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_all_node);
        ButterKnife.bind(this);

        mRecyclerView.setNestedScrollingEnabled(false);
//        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
//        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
//        layoutManager.setSmoothScrollbarEnabled(false);

        mRecyclerView.setLayoutManager(new LabelLayoutManager());
        mNodeAdapter = new NodeAdapter(new ArrayList<>());
        mRecyclerView.setAdapter(mNodeAdapter);
        mSwipeRefreshLayout.setOnRefreshListener(this::onRefresh);

        PermissionUtils.permission(Manifest.permission.BLUETOOTH, Manifest.permission.LOCATION_HARDWARE).request();
    }
 
Example #2
Source File: SysInfoItemAdapter.java    From DoraemonKit with Apache License 2.0 5 votes vote down vote up
@Override
public void bind(final SysInfoItem sysInfoItem) {
    mLabelText.setLabel(sysInfoItem.name);
    mLabelText.setText(sysInfoItem.value);
    mLabelText.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (sysInfoItem.isPermission) {
                PermissionUtils.launchAppDetailsSettings();
            }
        }
    });
}