Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting this error while making Simple Flat Dialog #11

Open
Aspirers opened this issue Aug 11, 2021 · 1 comment
Open

I am getting this error while making Simple Flat Dialog #11

Aspirers opened this issue Aug 11, 2021 · 1 comment

Comments

@Aspirers
Copy link

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setVisibility(int)' on a null object reference
       at com.example.flatdialoglibrary.dialog.FlatDialog.setLargeTextFieldBorderColor(FlatDialog.java:230)
       at com.example.flatdialoglibrary.dialog.FlatDialog.initDefaultCase(FlatDialog.java:68)
       at com.example.flatdialoglibrary.dialog.FlatDialog.<init>(FlatDialog.java:60)
       at com.zee.whats.scan.web.whatscan.qr.scanner.last_seen.di.AppModule.provideFlatDialog(AppModule.kt:38)
       at

Code

    @Singleton
    @Provides
    fun provideFlatDialog(@ApplicationContext application: Context) = FlatDialog(application).apply {
        setIcon(R.drawable.ic_keyboard_lock)
        setTitle(application.getString(R.string.keyboard_info))
        setTitleColor(Color.parseColor(application.getString(R.string.first_button_text_color)))
        setSubtitle(application.getString(R.string.keyboard_locked_default))
        setSubtitleColor(Color.parseColor(application.getString(R.string.first_button_text_color)))
        setBackgroundColor(Color.parseColor(application.getString(R.string.dialog_background_color)))

//        setFirstTextFieldHint(application.getString(R.string.fine))
        setFirstButtonColor(Color.parseColor(application.getString(R.string.first_button_color)))
        setFirstButtonTextColor(Color.parseColor(application.getString(R.string.first_button_text_color)))
        setFirstButtonText(application.getString(R.string.keep_lock))

//        setSecondTextFieldHint(application.getString(R.string.unlock))
        setSecondButtonColor(Color.parseColor(application.getString(R.string.second_button_color)))
        setSecondButtonTextColor(Color.parseColor(application.getString(R.string.second_button_text_color)))
        setSecondButtonText(application.getString(R.string.unlock))
    }

        flatDialog_.withFirstButtonListner {
            Hawk.put("lock_keyboard", true)
            binding.lockKeyboardIv.visible()
            binding.unlockKeyboardIv.invisible()
            flatDialog.dismiss()
        }
        flatDialog_.withSecondButtonListner {
            Hawk.put("lock_keyboard", false)
            binding.lockKeyboardIv.invisible()
            binding.unlockKeyboardIv.visible()
            flatDialog.dismiss()

        }
        flatDialog_.show()
@sufyan5008
Copy link

having same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants