Search in sources :

Example 31 with RxPermissions

use of com.tbruyelle.rxpermissions3.RxPermissions in project RxEasyHttp by zhou-you.

the class LoginActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    mEmailView = (EditText) findViewById(R.id.email);
    mPasswordView = (EditText) findViewById(R.id.password);
    mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
            if (id == R.id.login || id == EditorInfo.IME_NULL) {
                attemptLogin();
                return true;
            }
            return false;
        }
    });
    Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
    mEmailSignInButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            attemptLogin();
        }
    });
    mEmailView.setText("18688994275");
    mPasswordView.setText("123456");
    rxPermissions = new RxPermissions(this);
    autoLogin();
}
Also used : KeyEvent(android.view.KeyEvent) RxPermissions(com.tbruyelle.rxpermissions2.RxPermissions) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView)

Example 32 with RxPermissions

use of com.tbruyelle.rxpermissions3.RxPermissions in project music-player by Anrimian.

the class StartFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    rxPermissions = new RxPermissions(this);
    viewBinding.progressStateView.onTryAgainClick(this::onTryAgainButtonClicked);
}
Also used : RxPermissions(com.tbruyelle.rxpermissions3.RxPermissions)

Example 33 with RxPermissions

use of com.tbruyelle.rxpermissions3.RxPermissions in project music-player by Anrimian.

the class HeadsetSettingsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.settings);
    toolbar.setSubtitle(R.string.headset);
    toolbar.setTitleClickListener(null);
    rxPermissions = new RxPermissions(requireActivity());
    SlidrPanel.simpleSwipeBack(viewBinding.clContainer, this, toolbar::onStackFragmentSlided);
    onCheckChanged(viewBinding.cbPlayOnConnect, this::onPlayOnConnectChecked);
    setChecked(viewBinding.cbPlayOnConnect, BluetoothConnectionReceiver.isEnabled(requireContext()));
}
Also used : RxPermissions(com.tbruyelle.rxpermissions3.RxPermissions) AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar)

Example 34 with RxPermissions

use of com.tbruyelle.rxpermissions3.RxPermissions in project cuddly-octo-fortnight by prpr894.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    // getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryGray));
    setContentView(R.layout.activity_main);
    initView();
    // 此处用来检查权限,判断运行系统SDK版本是否大于等于23(android6.0)
    rxPermissions = new RxPermissions(this);
    initReasionDialog();
    initPermissionSettingDialog();
    if (Build.VERSION.SDK_INT >= 23) {
        checkPermissionNow();
    }
}
Also used : RxPermissions(com.tbruyelle.rxpermissions2.RxPermissions)

Aggregations

RxPermissions (com.tbruyelle.rxpermissions2.RxPermissions)31 Intent (android.content.Intent)8 SuppressLint (android.annotation.SuppressLint)6 Permission (com.tbruyelle.rxpermissions2.Permission)4 View (android.view.View)3 GifSizeFilter (com.connxun.ltcx.utils.GifSizeFilter)3 RxPermissions (com.tbruyelle.rxpermissions3.RxPermissions)3 Manifest (android.Manifest)2 Uri (android.net.Uri)2 Button (android.widget.Button)2 OnClick (butterknife.OnClick)2 GlideEngine (com.zhihu.matisse.engine.impl.GlideEngine)2 CaptureStrategy (com.zhihu.matisse.internal.entity.CaptureStrategy)2 Consumer (io.reactivex.functions.Consumer)2 IOException (java.io.IOException)2 Activity (android.app.Activity)1 Context (android.content.Context)1 ActivityInfo (android.content.pm.ActivityInfo)1 Cursor (android.database.Cursor)1 Bundle (android.os.Bundle)1