Skip to content
Util class to use Settings.Panel easily.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.idea
app
easysettingspanel Add doc Jun 22, 2019
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle Kotlin 1.3.40 Jun 22, 2019
gradle.properties CreateProject Jun 17, 2019
gradlew
gradlew.bat CreateProject Jun 17, 2019
settings.gradle

README.md

EasySettingsPanel

Util class to use Settings.Panel easily.

Screen

Gradle

Step1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Step2. Add the dependency

dependencies {
    implementation 'com.github.koji-1009:EasySettingsPanel:Tag'
}

How to use

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setSupportActionBar(toolbar)

        button_internet_connectivity.setOnClickListener {
            EasySettingsPanel.openInternetConnectivityPanelBackportWifi(this@MainActivity)
        }
        button_nfc.setOnClickListener {
            if (NfcAdapter.getDefaultAdapter(this@MainActivity)?.isEnabled == true) {
                EasySettingsPanel.openNfcPanel(this@MainActivity)
            } else {
                Snackbar.make(layout_top, "Sorry. This phone can not use NFC.", Snackbar.LENGTH_INDEFINITE).show()
            }
        }
        button_volume.setOnClickListener {
            EasySettingsPanel.openVolumePanel(this@MainActivity)
        }
        button_wifi.setOnClickListener {
            EasySettingsPanel.openWifiPanel(this@MainActivity)
        }
    }
}

License

Apache License 2.0

Copyright (C) 2019 Koji Wakamiya

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.